From owner-svn-src-all@freebsd.org Sun Feb 4 03:15:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99410EE234A; Sun, 4 Feb 2018 03:15:07 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CBEF269B59; Sun, 4 Feb 2018 03:15:06 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C6CAA1460A; Sun, 4 Feb 2018 03:15:06 +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 w143F6p0014125; Sun, 4 Feb 2018 03:15:06 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w143F645014124; Sun, 4 Feb 2018 03:15:06 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201802040315.w143F645014124@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 4 Feb 2018 03:15:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328837 - stable/11/lib/libpmc X-SVN-Group: stable-11 X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: stable/11/lib/libpmc X-SVN-Commit-Revision: 328837 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Feb 2018 03:15:07 -0000 Author: jhibbits Date: Sun Feb 4 03:15:06 2018 New Revision: 328837 URL: https://svnweb.freebsd.org/changeset/base/328837 Log: MFC r327911: Replace the PMC class struct copy with an explicit memcpy() Modified: stable/11/lib/libpmc/libpmc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libpmc/libpmc.c ============================================================================== --- stable/11/lib/libpmc/libpmc.c Sun Feb 4 02:58:12 2018 (r328836) +++ stable/11/lib/libpmc/libpmc.c Sun Feb 4 03:15:06 2018 (r328837) @@ -3268,7 +3268,8 @@ pmc_init(void) cpu_info.pm_npmc = op_cpu_info.pm_npmc; cpu_info.pm_nclass = op_cpu_info.pm_nclass; for (n = 0; n < cpu_info.pm_nclass; n++) - cpu_info.pm_classes[n] = op_cpu_info.pm_classes[n]; + memcpy(&cpu_info.pm_classes[n], &op_cpu_info.pm_classes[n], + sizeof(cpu_info.pm_classes[n])); pmc_class_table = malloc(PMC_CLASS_TABLE_SIZE * sizeof(struct pmc_class_descr *)); From owner-svn-src-all@freebsd.org Sun Feb 4 02:58:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E053AEE10BB; Sun, 4 Feb 2018 02:58:12 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 86BBA689A6; Sun, 4 Feb 2018 02:58:12 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C051141E8; Sun, 4 Feb 2018 02:58:12 +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 w142wCNL003126; Sun, 4 Feb 2018 02:58:12 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w142wCfi003125; Sun, 4 Feb 2018 02:58:12 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201802040258.w142wCfi003125@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 4 Feb 2018 02:58:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328836 - stable/11/sys/boot/efi/fdt X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/sys/boot/efi/fdt X-SVN-Commit-Revision: 328836 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Feb 2018 02:58:13 -0000 Author: emaste Date: Sun Feb 4 02:58:12 2018 New Revision: 328836 URL: https://svnweb.freebsd.org/changeset/base/328836 Log: Remove now-unused variable after r328809 Modified: stable/11/sys/boot/efi/fdt/efi_fdt.c Modified: stable/11/sys/boot/efi/fdt/efi_fdt.c ============================================================================== --- stable/11/sys/boot/efi/fdt/efi_fdt.c Sat Feb 3 23:49:21 2018 (r328835) +++ stable/11/sys/boot/efi/fdt/efi_fdt.c Sun Feb 4 02:58:12 2018 (r328836) @@ -44,7 +44,6 @@ int fdt_platform_load_dtb(void) { struct fdt_header *hdr; - const char *s; hdr = efi_get_table(&fdtdtb); if (hdr == NULL) From owner-svn-src-all@freebsd.org Sun Feb 4 08:22:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08B9EEEF380; Sun, 4 Feb 2018 08:22:12 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF6EB7325B; Sun, 4 Feb 2018 08:22: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A8E6117AF4; Sun, 4 Feb 2018 08:22: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 w148MBg7067009; Sun, 4 Feb 2018 08:22:11 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w148MBdg067007; Sun, 4 Feb 2018 08:22:11 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201802040822.w148MBdg067007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 4 Feb 2018 08:22:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328838 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/etherswitch/arswitch X-SVN-Commit-Revision: 328838 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Feb 2018 08:22:12 -0000 Author: adrian Date: Sun Feb 4 08:22:11 2018 New Revision: 328838 URL: https://svnweb.freebsd.org/changeset/base/328838 Log: [arswitch] fix up issues on the AR8327. This correctly dumps the ethernet bridge contents on an AR8327 switch. Tested: * AP135 - QCA9550 + AR8327 ethernet switch: # etherswitchcfg atu dump [0] c0:3f:d5:7e:6f:45: portmask 0x00000004 [1] f6:b6:03:96:1e:ba: portmask 0x00000004 [2] 00:03:7f:11:38:4f: portmask 0x00000040 # arp -na ? (192.168.3.170) at 00:03:7f:11:38:4f on arge0 permanent [ethernet] ? (192.168.3.12) at c0:3f:d5:7e:6f:45 on arge0 expires in 1188 seconds [ethernet] ? (192.168.3.1) at f6:b6:03:96:1e:ba on arge0 expires in 1186 seconds [ethernet] Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c head/sys/dev/etherswitch/arswitch/arswitchreg.h Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_8327.c Sun Feb 4 03:15:06 2018 (r328837) +++ head/sys/dev/etherswitch/arswitch/arswitch_8327.c Sun Feb 4 08:22:11 2018 (r328838) @@ -1151,12 +1151,12 @@ ar8327_atu_fetch_table(struct arswitch_softc *sc, ethe return (-1); /* MAC address */ - e->es_macaddr[5] = MS(ret1, AR8327_ATU_DATA1_MAC_ADDR5); - e->es_macaddr[4] = MS(ret1, AR8327_ATU_DATA1_MAC_ADDR4); - e->es_macaddr[3] = MS(ret0, AR8327_ATU_DATA0_MAC_ADDR3); - e->es_macaddr[2] = MS(ret0, AR8327_ATU_DATA0_MAC_ADDR2); - e->es_macaddr[1] = MS(ret0, AR8327_ATU_DATA0_MAC_ADDR1); - e->es_macaddr[0] = MS(ret0, AR8327_ATU_DATA0_MAC_ADDR0); + e->es_macaddr[5] = MS(ret0, AR8327_ATU_DATA0_MAC_ADDR3); + e->es_macaddr[4] = MS(ret0, AR8327_ATU_DATA0_MAC_ADDR2); + e->es_macaddr[3] = MS(ret0, AR8327_ATU_DATA0_MAC_ADDR1); + e->es_macaddr[2] = MS(ret0, AR8327_ATU_DATA0_MAC_ADDR0); + e->es_macaddr[0] = MS(ret1, AR8327_ATU_DATA1_MAC_ADDR5); + e->es_macaddr[1] = MS(ret1, AR8327_ATU_DATA1_MAC_ADDR4); /* Bitmask of ports this entry is for */ e->es_portmask = MS(ret1, AR8327_ATU_DATA1_DEST_PORT); Modified: head/sys/dev/etherswitch/arswitch/arswitchreg.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitchreg.h Sun Feb 4 03:15:06 2018 (r328837) +++ head/sys/dev/etherswitch/arswitch/arswitchreg.h Sun Feb 4 08:22:11 2018 (r328838) @@ -498,7 +498,7 @@ #define AR8327_ATU_DATA1_MAC_ADDR4 BITS(0, 8) #define AR8327_ATU_DATA1_MAC_ADDR4_S 0 #define AR8327_ATU_DATA1_MAC_ADDR5 BITS(8, 8) -#define AR8327_ATU_DATA1_MAC_ADDR5_S 0 +#define AR8327_ATU_DATA1_MAC_ADDR5_S 8 #define AR8327_ATU_DATA1_DEST_PORT BITS(16, 7) #define AR8327_ATU_DATA1_DEST_PORT_S 16 #define AR8327_ATU_DATA1_CROSS_PORT_STATE_EN BIT(23) From owner-svn-src-all@freebsd.org Sun Feb 4 12:16:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6905FECE244; Sun, 4 Feb 2018 12:16:37 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 081617CC1A; Sun, 4 Feb 2018 12:16:37 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E8C1E19FF7; Sun, 4 Feb 2018 12:16:36 +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 w14CGaNH086714; Sun, 4 Feb 2018 12:16:36 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14CGaDG086713; Sun, 4 Feb 2018 12:16:36 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201802041216.w14CGaDG086713@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sun, 4 Feb 2018 12:16:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328839 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: head/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 328839 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Feb 2018 12:16:37 -0000 Author: allanjude Date: Sun Feb 4 12:16:36 2018 New Revision: 328839 URL: https://svnweb.freebsd.org/changeset/base/328839 Log: Add the ThinkPad X1 (sandybridge) to the bsdinstall blacklist MFC after: 2 weeks Sponsored by: FOSDEM IllumOS Table Modified: head/usr.sbin/bsdinstall/scripts/auto Modified: head/usr.sbin/bsdinstall/scripts/auto ============================================================================== --- head/usr.sbin/bsdinstall/scripts/auto Sun Feb 4 08:22:11 2018 (r328838) +++ head/usr.sbin/bsdinstall/scripts/auto Sun Feb 4 12:16:36 2018 (r328839) @@ -182,7 +182,7 @@ if f_interactive; then case "$sys_maker" in "LENOVO") case "$sys_version" in - "ThinkPad X220"|"ThinkPad T420"|"ThinkPad T520"|"ThinkPad W520") + "ThinkPad X220"|"ThinkPad T420"|"ThinkPad T520"|"ThinkPad W520"|"ThinkPad X1") dialog_workaround "$msg_lenovo_fix" retval=$? f_dprintf "lenovofix_prompt=[%s]" "$retval" From owner-svn-src-all@freebsd.org Sun Feb 4 10:33:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2410EC95E2; Sun, 4 Feb 2018 10:33:43 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13C0A78FFE; Sun, 4 Feb 2018 10:33:42 +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 w14AXZY2081526 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 4 Feb 2018 12:33:38 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w14AXZY2081526 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w14AXYdu081525; Sun, 4 Feb 2018 12:33:34 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 4 Feb 2018 12:33:34 +0200 From: Konstantin Belousov To: Bruce Evans Cc: Conrad Meyer , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327495 - head/usr.sbin/rpcbind Message-ID: <20180204103334.GC9536@kib.kiev.ua> References: <201801021725.w02HPDaj068477@repo.freebsd.org> <20180203232725.U1389@besplex.bde.org> <20180204150751.V909@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180204150751.V909@besplex.bde.org> User-Agent: Mutt/1.9.3 (2018-01-21) 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.25 Precedence: list List-Id: "SVN commit messages 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, 04 Feb 2018 10:33:43 -0000 On Sun, Feb 04, 2018 at 04:15:16PM +1100, Bruce Evans wrote: > sig_atomic_t is no better than plain int. This behaviour now makes complete > sense. It is just like the undefined behaviour with the ctype functions, > except since we own terminate_wfd we can guarantee that it doesn't change > while the handler is active (and is valid when the handler is entered). > We could also use atomic ops. However, the C standard doesn't require > anything that we do to work (except maybe in C11, atomic ops might be > explicitly or implicitly specifed to work for things like this). Atomics are atomic WRT the signal handlers as well, the usual guarantees of no torn writes and no out of air values on read hold. Since FreeBSD memory model, as documented in atomic(9), claims that naturally aligned machine-native integer types are atomic without special declarations on access, all guarantees for the handler accesses are already provided. C11 also has a tool to ensure weaker than usual consistency guarantee, only between the thread and a signal handler executing in the context of the thread. I do not see it useful in the discussed case. From owner-svn-src-all@freebsd.org Sun Feb 4 05:15:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5835EEE7C24; Sun, 4 Feb 2018 05:15:23 +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 9F09F6DBA0; Sun, 4 Feb 2018 05:15:21 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id E80D6D4E645; Sun, 4 Feb 2018 16:15:16 +1100 (AEDT) Date: Sun, 4 Feb 2018 16:15:16 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Conrad Meyer cc: Bruce Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327495 - head/usr.sbin/rpcbind In-Reply-To: Message-ID: <20180204150751.V909@besplex.bde.org> References: <201801021725.w02HPDaj068477@repo.freebsd.org> <20180203232725.U1389@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.2 cv=YbvN30Zf c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=6COIcUhGSTRIru9ACGAA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Feb 2018 05:15:23 -0000 On Sat, 3 Feb 2018, Conrad Meyer wrote: > On Sat, Feb 3, 2018 at 6:46 AM, Bruce Evans wrote: >> On Tue, 2 Jan 2018, Conrad Meyer wrote: >>> ... >> Today I learned from the POSIX list that the pselect() function is designed >> to avoid this bug. It takes a signal mask arg (like msleep() in the >> kernel). >> >> I haven't noticed any function related to poll() or kevent that takes a >> signal mask. > > There is the similar function ppoll(), although it complies only with > the Linux standard, not POSIX. ppoll() is relatively new in FreeBSD (2014-11-13). Its man page says that it is first appeared in 11.0, but it is now in 10.x, and according to bsd-family-tree it actually appeared in the 10.2 release more than a year before it appeared in the 11.0 release: - 2014-11-13 pre-11.0 source tree commit - 2014-12-21 10.x source tree commit - 2015-08-13 10.2 release - 2016-10-10 11.0 release. > With kevent, you can simply mask all (or most) signals and watch on a > signal event. Conversion to kevent is more complicated, though. > >> Programs broken by buggy conversion: >> ... >> - rpcbind(8). This is not interactive and normally doesn't use ttys >> which might block. However, the -d flag makes it do fprintf() to >> stderr. This may block forever (e.g., for flow control), and you >> would like to be able to kill it using a signal. But write() will >> restart. rpcbind also uses plain signal() and doesn't know anything >> about SA_RESTART. > > This was not broken by conversion -- it was already broken in this > case. If the signal delivery raced with an fprintf, we ended up > invoking the stdio atexit handlers via exit(3) call in terminate(), > which of course encountered corrupted state. Now it is broken in a > slightly different way, yes, if signal delivery races fprintf *and* > fprintf is blocked in flow control. This might happen with a slow > serial for stderr but seems extraordinarily unlikely otherwise. Unsafe signal handlers are broken by their existence, but sometimes work. It is unlikely for ttys too. I forgot that stdio is clueless about ttys so it doesn't wait for output to drain even for stderr. So the output is normally buffered in the kernel and write() returns. > ... >> perror() >> is broken as designed since it uses stdio, so it is unsafe in signal >> handlers. The err() family copies this bug. Even *s*printf() is not >> required to be safe in signal handlers. I would fix the latter first. > > It does seem like the printf family of routines should be > signal-handler safe. Unfortunately, they are implemented in terms of > the unsafe stdio streams :-(. Even sprintf() uses the generic function __vfprintf() on a fake FILE. I think it has problems with locales. No ctype functions are in the list of async-signal-safe functions in at least the 2001 version of POSIX. It is easy to see why they might not be safe. They access lots of static storage, and setlocale() or a simpler function that changes state might run in another or just a nested signal handler, so locking is required... So the safe sprintf() would probably have to use the C locale. The locale is already passed to __vfprintf(), as needed for sprintf_l(). >... >>> Modified: head/usr.sbin/rpcbind/rpcbind.c >>> ... >>> terminate(int signum) >>> ... >>> + wr = write(terminate_wfd, &c, 1); >> >> >> Not async-signal-safe. Acccesses in signal handlers to objects with >> static storage duration give undefined behaviour except for assignment to >> objects of type volatile sig_atomic_t, but the access to terminate_wfd is >> a read and the type is plain int. > > The type can be changed to volatile sig_atomic_t if you believe plain > int will trigger nonsensical compiler behavior. The value is > initialized once, before the signal handler is registered, so unless > the compiler does something totally insane it should be fine on all > architectures FreeBSD runs on. sig_atomic_t is no better than plain int. This behaviour now makes complete sense. It is just like the undefined behaviour with the ctype functions, except since we own terminate_wfd we can guarantee that it doesn't change while the handler is active (and is valid when the handler is entered). We could also use atomic ops. However, the C standard doesn't require anything that we do to work (except maybe in C11, atomic ops might be explicitly or implicitly specifed to work for things like this). >>> + if (wr < 1) >>> + _exit(2); >> >> >> Best to not check for write errors, since the error handling of using >> _exit() >> is worse than none. It loses stdio flushing to handle an almost-harmless >> error. The main problem with keeping everything in a safe handler is that >> it >> is impossible to keep stdio flushing there and we would prefer to not lost >> the stdio flushing. > > I don't necessarily agree. If the write fails, we missed the signal > telling us to terminate the program and will never exit. That said, > how would the write ever fail? We still set the flag, so can only fail to exit() in the race case, but the write() failure affects all cases. I can't see how the write() can fail. That was part of the excuse for removing the check. Bruce From owner-svn-src-all@freebsd.org Sun Feb 4 12:33:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1980ECEE7A; Sun, 4 Feb 2018 12:33:54 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 34B637D6F7; Sun, 4 Feb 2018 12:33:53 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([77.179.182.56]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0M6SE3-1exCqd1Sd1-00yOat; Sun, 04 Feb 2018 13:33:48 +0100 Date: Sun, 4 Feb 2018 13:33:10 +0100 From: "O. Hartmann" To: David Wolfskill Cc: Jason Harmening , "O. Hartmann" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328489 - head/sys/conf Message-ID: <20180204133337.3d03f01d@thor.intern.walstatt.dynvpn.de> In-Reply-To: <20180129130022.GT1125@albert.catwhisker.org> References: <201801272013.w0RKDaMU098200@repo.freebsd.org> <20180127214755.3c59661e@thor.intern.walstatt.dynvpn.de> <98501f75-1a1b-9221-c52d-24415230a886@gmail.com> <20180129130022.GT1125@albert.catwhisker.org> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/S5Iawh7XtgTyZrIe3dy2apX"; protocol="application/pgp-signature" X-Provags-ID: V03:K0:hibmGnM1zlQyB1onl+MuFQmHg57tvVZJA8IIC59niaaX4jOpgu8 7r8zx1DJSVow2zn8xd0I+ItxlN9+VJYzs/4KDumZU7xePjhGUvWKIuN6R2h5zfbuNTwKTPK UeJ2S3AaKUeLKmdB1NFKc5P7eoNSUYoMKgUqIHL6BN3bA9gbR4ko4+ZJLBrdIFZK0AkBQOC v3ZxmAqkSLzcV4dBCQD1g== X-UI-Out-Filterresults: notjunk:1;V01:K0:pKsLbqs55+Y=:m0NQbtCaP3IUe/iVh2+6Gn C4c2BmqO4jERVPZ58R04733ewKMu1gNDtCbBUm9rs4FCG2OhhwRnqD6YAk28jjrt8nsiek9S4 dMWQIjylsZVWhfg6qKasb6rdjyuPHSRk7EDtll9KIln+GwS7XeAk/wMhrmajFqy+n4o1n+Wo8 9BQ5sPIrbKGjdLWFkUSzOuOail6hewAAOXf8jkrRquIlQfl1KIf4xW+S9n1U4biFoWKR25X5j ll+egI4AsJXl6Ryu4clKEnygvnptUqJhkC9QtsaozJb1Dq0kCIKjenySHUs+Li+esglvMcSOz XIirIXwO3lFv0X8GkO85e7xUQOPyOYQ9OLpqhJyM5fUu9lWPkSjjEvJi96HKwzirBtQM0uLj8 wH9D/79lECk71hTnDPFR43URS8BoRd61tCInQVqgeOqD9oi+68oAT7gB+ZjbSGoFkNgRHcVSf PZBxK9/TRQ86LgDt8Ylt03nBGvRbhpskOETypLAVqxV/ktbthzsk8PSUzKGCnDzh8PUlSx1Qf P7nBrSuXirZad7DRWWubW2eRK86hH4u09U1NcPCEZ2dt9A1VcmbZlZQU0SS3zZRT4WOzh0klT wxuYn2eMwgs4qTO7c7Gy/UjL39Nz6qAhOsZEE/hsEpaR8QwubXWRZkdd7m5uarSqD7TSXyKPU 29whI3dg4+RmrGKw6A03P22N5nRd8SVLhMNPB39PQXafFnwUBToOsMz5ndf+QI4/dbupa9w3y RPPIFJyO9Kue8R7f2n9V2yCxaDft17MQpvUn7O9mk2IGFYwIKwa6186kebjewwJKafb+QKV40 Fd5GkIyyw7HnqQdDKkdaOqQqHCF+g== X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Feb 2018 12:33:55 -0000 --Sig_/S5Iawh7XtgTyZrIe3dy2apX Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Am Mon, 29 Jan 2018 05:00:22 -0800 David Wolfskill schrieb: > On Mon, Jan 29, 2018 at 02:10:04AM -0800, Jason Harmening wrote: > > >=20 > > > This happens now if PORTS_MODULE=3Dx11/nvidia-driver is defined in /e= tc/src.conf: > > >=20 > > > [...] > > > --- kernel-install --- > > > mkdir -p /boot/kernel > > > install -p -m 555 -o root -g wheel kernel /boot/kernel/ > > > --- ports-install --- > > > Variable OBJTOP is recursive. > > >=20 > > > make[8]: stopped =20 > > ... > >=20 > > David sent me logs of the failing case; thanks David! =20 >=20 > Happy to help! :-) >=20 > > The failure happens when buildkernel and installkernel are run=20 > > separately instead of all-up, e.g. 'make kernel'. The installkernel=20 > > step is leaving MK_AUTO_OBJ=3Dno in the env passed to the port build. = It=20 > > looks like at least one of the install stages of nvidia-driver needs to= =20 > > generate temporary output, which leads to confusion when the port isn't= =20 > > built as though it's an in-tree component. > >=20 > > Can you guys try out the attached patch? =20 >=20 > I tried it both on my build machine (which does not use kernel modules > from ports, and thus did not exhibit the problem -- but I thought that > verifying that the patch did not break that case worth checking) and on > my laptop (which did exhibit the problem). >=20 > It worked in both cases with no issues for me. >=20 > Thanks! :-) >=20 > Peace, > david The problem still persists! I'm on CURRENT, FreeBSD 12.0-CURRENT #32: Sun Feb 4 09:41:39 CET 2018 amd6= 4, the source tree is at revision 328839. I use WITH_META_MODE=3DYES in /etc/src.conf. My /etc/make.conf consists of = a .include statement which reels in /usr/local/etc/ports.conf in which I define everyt= hing outside the source tree for ports (in case of the nvidia driver, its DISTVERSION). = This worked before and should work again. Today I checked out a completely fresh /usr/s= rc and gleanced the /usr/obj folder and rebuilt the system - and get the error again: [...] =3D=3D=3D> Ports module x11/nvidia-driver (install) cd ${PORTSDIR:-/usr/ports}/x11/nvidia-driver; env -u CC -u CXX -u CPP -= u MAKESYSPATH MAKEFLAGS=3D"-j 4 -J 15,16 .MAKE.LEVEL.ENV=3DMAKELEVEL KERNEL=3Dkernel MK_A= UTO_OBJ=3Dno TARGET=3Damd64 TARGET_ARCH=3Damd64" SYSDIR=3D/usr/src/sys PATH=3D/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/sbin:/usr/obj/usr/src/am= d64.amd64/tmp/legacy/usr/bin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/bin:/u= sr/obj/usr/src/amd64.amd64/tmp/usr/sbin:/usr/obj/usr/src/amd64.amd64/tmp/us= r/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin SRC_BASE=3D/usr/src OSVERSION=3D1200056 WRKDIRPREFIX=3D/usr/obj/usr/src/a= md64.amd64/sys/THOR make -B deinstall reinstall =3D=3D=3D> Deinstalling for nvidia-driver =3D= =3D=3D> Deinstalling nvidia-driver-387.34 Updating database digests format: . done Checking inte= grity... done (0 conflicting) Deinstallation has been requested for the following 1 packa= ges (of 0 packages in the universe): Installed packages to be REMOVED: nvidia-driver-387.34 Number of packages to be removed: 1 The operation will free 99 MiB. [1/1] Deinstalling nvidia-driver-387.34... [1/1] Deleting files for nvidia-driver-387.34: .......... done =3D=3D=3D> Staging for nvidia-driver-387.34 =3D=3D=3D> nvidia-driver-387.34 depends on file: /usr/local/lib/libGL.so = - found =3D=3D=3D> nvidia-driver-387.34 depends on file: /usr/local/libdata/pkgco= nfig/x11.pc - found =3D=3D=3D> nvidia-driver-387.34 depends on file: /usr/local/libdata/pkgco= nfig/xorg-server.pc - found =3D=3D=3D> nvidia-driver-387.34 depends on file: /usr/local/libda= ta/pkgconfig/xext.pc - found =3D=3D=3D> Generating temporary packing list =3D=3D=3D> src (install) =3D=3D=3D> src/nvidia (install) Variable OBJTOP is recursive. make[8]: stopped in /usr/obj/usr/src/amd64.amd64/sys/DUMMBOX/usr/ports/x11/nvidia-driver/wor= k/NVIDIA-FreeBSD-x86_64-387.34/src/nvidia *** Error code 2 Oliver --=20 O. Hartmann Ich widerspreche der Nutzung oder =C3=9Cbermittlung meiner Daten f=C3=BCr Werbezwecke oder f=C3=BCr die Markt- oder Meinungsforschung (=C2=A7 28 Abs.= 4 BDSG). --Sig_/S5Iawh7XtgTyZrIe3dy2apX Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iLUEARMKAB0WIQQZVZMzAtwC2T/86TrS528fyFhYlAUCWnb9oQAKCRDS528fyFhY lFWsAgCSs4C8ltf4ov+MhEpkxoaYC60Sm+oBODuddw1Dv3SpeAZUZIonbhlRCxzS gexQf0+t1Zj7FPYiVQsE4nBlfiwLAf9LuBW+ktdSkdr/cVBgJXiur2oMPDEY6zHg XQGZyncV/++xOwW89aYfnjb35e87wXpJtEQ/kr6rjchnhnMtVviS =OMYC -----END PGP SIGNATURE----- --Sig_/S5Iawh7XtgTyZrIe3dy2apX-- From owner-svn-src-all@freebsd.org Sun Feb 4 13:54:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D6CDED7E49; Sun, 4 Feb 2018 13:54:06 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D2DD880AE0; Sun, 4 Feb 2018 13:54:05 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CC9A11B010; Sun, 4 Feb 2018 13:54:05 +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 w14Ds5JR036831; Sun, 4 Feb 2018 13:54:05 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14Ds5j7036830; Sun, 4 Feb 2018 13:54:05 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201802041354.w14Ds5j7036830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 4 Feb 2018 13:54:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328841 - head/libexec/getty X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/libexec/getty X-SVN-Commit-Revision: 328841 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Feb 2018 13:54:06 -0000 Author: trasz Date: Sun Feb 4 13:54:05 2018 New Revision: 328841 URL: https://svnweb.freebsd.org/changeset/base/328841 Log: Remove unused variable. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/libexec/getty/extern.h Modified: head/libexec/getty/extern.h ============================================================================== --- head/libexec/getty/extern.h Sun Feb 4 13:53:45 2018 (r328840) +++ head/libexec/getty/extern.h Sun Feb 4 13:54:05 2018 (r328841) @@ -36,7 +36,6 @@ struct delayval; struct termios; extern char hostname[]; -extern int hopcount; extern struct termios tmode, omode; extern struct gettyflags gettyflags[]; extern struct gettynums gettynums[]; From owner-svn-src-all@freebsd.org Sun Feb 4 13:54:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52E1BED7E6D; Sun, 4 Feb 2018 13:54:44 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F298580BBE; Sun, 4 Feb 2018 13:54:43 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EBB5A1B011; Sun, 4 Feb 2018 13:54:43 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w14DshkL036912; Sun, 4 Feb 2018 13:54:43 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14DshSv036910; Sun, 4 Feb 2018 13:54:43 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802041354.w14DshSv036910@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sun, 4 Feb 2018 13:54: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: r328842 - stable/10/sys/amd64/vmm/amd X-SVN-Group: stable-10 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/10/sys/amd64/vmm/amd X-SVN-Commit-Revision: 328842 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Feb 2018 13:54:44 -0000 Author: avg Date: Sun Feb 4 13:54:43 2018 New Revision: 328842 URL: https://svnweb.freebsd.org/changeset/base/328842 Log: MFC r327726: vmm/svm: contigmalloc of the whole svm_softc is excessive Modified: stable/10/sys/amd64/vmm/amd/svm.c stable/10/sys/amd64/vmm/amd/svm_softc.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/vmm/amd/svm.c ============================================================================== --- stable/10/sys/amd64/vmm/amd/svm.c Sun Feb 4 13:54:05 2018 (r328841) +++ stable/10/sys/amd64/vmm/amd/svm.c Sun Feb 4 13:54:43 2018 (r328842) @@ -518,15 +518,26 @@ svm_vminit(struct vm *vm, pmap_t pmap) vm_paddr_t msrpm_pa, iopm_pa, pml4_pa; int i; - svm_sc = contigmalloc(sizeof (*svm_sc), M_SVM, M_WAITOK | M_ZERO, - 0, ~(vm_paddr_t)0, PAGE_SIZE, 0); + svm_sc = malloc(sizeof (*svm_sc), M_SVM, M_WAITOK | M_ZERO); + if (((uintptr_t)svm_sc & PAGE_MASK) != 0) + panic("malloc of svm_softc not aligned on page boundary"); + + svm_sc->msr_bitmap = contigmalloc(SVM_MSR_BITMAP_SIZE, M_SVM, + M_WAITOK, 0, ~(vm_paddr_t)0, PAGE_SIZE, 0); + if (svm_sc->msr_bitmap == NULL) + panic("contigmalloc of SVM MSR bitmap failed"); + svm_sc->iopm_bitmap = contigmalloc(SVM_IO_BITMAP_SIZE, M_SVM, + M_WAITOK, 0, ~(vm_paddr_t)0, PAGE_SIZE, 0); + if (svm_sc->iopm_bitmap == NULL) + panic("contigmalloc of SVM IO bitmap failed"); + svm_sc->vm = vm; svm_sc->nptp = (vm_offset_t)vtophys(pmap->pm_pml4); /* * Intercept read and write accesses to all MSRs. */ - memset(svm_sc->msr_bitmap, 0xFF, sizeof(svm_sc->msr_bitmap)); + memset(svm_sc->msr_bitmap, 0xFF, SVM_MSR_BITMAP_SIZE); /* * Access to the following MSRs is redirected to the VMCB when the @@ -554,7 +565,7 @@ svm_vminit(struct vm *vm, pmap_t pmap) svm_msr_rd_ok(svm_sc->msr_bitmap, MSR_EFER); /* Intercept access to all I/O ports. */ - memset(svm_sc->iopm_bitmap, 0xFF, sizeof(svm_sc->iopm_bitmap)); + memset(svm_sc->iopm_bitmap, 0xFF, SVM_IO_BITMAP_SIZE); iopm_pa = vtophys(svm_sc->iopm_bitmap); msrpm_pa = vtophys(svm_sc->msr_bitmap); @@ -2044,7 +2055,9 @@ svm_vmcleanup(void *arg) { struct svm_softc *sc = arg; - contigfree(sc, sizeof (*sc), M_SVM); + contigfree(sc->iopm_bitmap, SVM_IO_BITMAP_SIZE, M_SVM); + contigfree(sc->msr_bitmap, SVM_MSR_BITMAP_SIZE, M_SVM); + free(sc, M_SVM); } static register_t * Modified: stable/10/sys/amd64/vmm/amd/svm_softc.h ============================================================================== --- stable/10/sys/amd64/vmm/amd/svm_softc.h Sun Feb 4 13:54:05 2018 (r328841) +++ stable/10/sys/amd64/vmm/amd/svm_softc.h Sun Feb 4 13:54:43 2018 (r328842) @@ -56,13 +56,13 @@ struct svm_vcpu { * SVM softc, one per virtual machine. */ struct svm_softc { - uint8_t iopm_bitmap[SVM_IO_BITMAP_SIZE]; /* shared by all vcpus */ - uint8_t msr_bitmap[SVM_MSR_BITMAP_SIZE]; /* shared by all vcpus */ uint8_t apic_page[VM_MAXCPU][PAGE_SIZE]; struct svm_vcpu vcpu[VM_MAXCPU]; vm_offset_t nptp; /* nested page table */ + uint8_t *iopm_bitmap; /* shared by all vcpus */ + uint8_t *msr_bitmap; /* shared by all vcpus */ struct vm *vm; -} __aligned(PAGE_SIZE); +}; CTASSERT((offsetof(struct svm_softc, nptp) & PAGE_MASK) == 0); From owner-svn-src-all@freebsd.org Sun Feb 4 14:27:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13DCCED8D25; Sun, 4 Feb 2018 14:27:13 +0000 (UTC) (envelope-from swills@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B6A9B81DE7; Sun, 4 Feb 2018 14:27:12 +0000 (UTC) (envelope-from swills@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA7111B4E8; Sun, 4 Feb 2018 14:27:12 +0000 (UTC) (envelope-from swills@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w14ERCCH052522; Sun, 4 Feb 2018 14:27:12 GMT (envelope-from swills@FreeBSD.org) Received: (from swills@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14ERCBK052521; Sun, 4 Feb 2018 14:27:12 GMT (envelope-from swills@FreeBSD.org) Message-Id: <201802041427.w14ERCBK052521@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: swills set sender to swills@FreeBSD.org using -f From: Steve Wills Date: Sun, 4 Feb 2018 14:27:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328848 - head/sys/powerpc/conf X-SVN-Group: head X-SVN-Commit-Author: swills X-SVN-Commit-Paths: head/sys/powerpc/conf X-SVN-Commit-Revision: 328848 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Feb 2018 14:27:13 -0000 Author: swills (ports committer) Date: Sun Feb 4 14:27:12 2018 New Revision: 328848 URL: https://svnweb.freebsd.org/changeset/base/328848 Log: Create GENERIC64-NODEBUG for powerpc64 Approved by: jhibbits Differential Revision: https://reviews.freebsd.org/D14192 Added: head/sys/powerpc/conf/GENERIC64-NODEBUG (contents, props changed) Added: head/sys/powerpc/conf/GENERIC64-NODEBUG ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/conf/GENERIC64-NODEBUG Sun Feb 4 14:27:12 2018 (r328848) @@ -0,0 +1,37 @@ +# +# GENERIC64-NODEBUG -- WITNESS and INVARIANTS free kernel configuration file +# for FreeBSD/powerpc +# +# This configuration file removes several debugging options, including +# WITNESS and INVARIANTS checking, which are known to have significant +# performance impact on running systems. When benchmarking new features +# this kernel should be used instead of the standard GENERIC64. +# This kernel configuration should never appear outside of the HEAD +# of the FreeBSD tree. +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (https://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +include GENERIC64 + +ident GENERIC64-NODEBUG + +nooptions INVARIANTS +nooptions INVARIANT_SUPPORT +nooptions WITNESS +nooptions WITNESS_SKIPSPIN +nooptions DEADLKRES From owner-svn-src-all@freebsd.org Sun Feb 4 15:40:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B54DEDCC52; Sun, 4 Feb 2018 15:40:49 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE2A784EFB; Sun, 4 Feb 2018 15:40:48 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A94891C034; Sun, 4 Feb 2018 15:40:48 +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 w14FemFg088638; Sun, 4 Feb 2018 15:40:48 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14FemEQ088636; Sun, 4 Feb 2018 15:40:48 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201802041540.w14FemEQ088636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 4 Feb 2018 15:40:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328852 - head/sys/powerpc/conf X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/conf X-SVN-Commit-Revision: 328852 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Feb 2018 15:40:49 -0000 Author: jhibbits Date: Sun Feb 4 15:40:48 2018 New Revision: 328852 URL: https://svnweb.freebsd.org/changeset/base/328852 Log: Start building modules for MPC85XX and MPC85XXSPE These kernels aren't restricted to development boards anymore, they are closer in behavior to GENERIC, so build modules. Modified: head/sys/powerpc/conf/MPC85XX head/sys/powerpc/conf/MPC85XXSPE Modified: head/sys/powerpc/conf/MPC85XX ============================================================================== --- head/sys/powerpc/conf/MPC85XX Sun Feb 4 15:39:15 2018 (r328851) +++ head/sys/powerpc/conf/MPC85XX Sun Feb 4 15:40:48 2018 (r328852) @@ -14,7 +14,6 @@ include "dpaa/config.dpaa" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols makeoptions WITH_CTF=1 makeoptions WERROR="-Werror -Wno-format -Wno-redundant-decls" -makeoptions NO_MODULES=yes options FPU_EMU Modified: head/sys/powerpc/conf/MPC85XXSPE ============================================================================== --- head/sys/powerpc/conf/MPC85XXSPE Sun Feb 4 15:39:15 2018 (r328851) +++ head/sys/powerpc/conf/MPC85XXSPE Sun Feb 4 15:40:48 2018 (r328852) @@ -14,7 +14,6 @@ include "dpaa/config.dpaa" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols makeoptions WITH_CTF=1 makeoptions WERROR="-Werror -Wno-format -Wno-redundant-decls" -makeoptions NO_MODULES=yes options FPU_EMU From owner-svn-src-all@freebsd.org Sun Feb 4 13:58:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9E92ED8042; Sun, 4 Feb 2018 13:58:31 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9FFD380F06; Sun, 4 Feb 2018 13:58:31 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9AEC31B015; Sun, 4 Feb 2018 13:58:31 +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 w14DwVG0037349; Sun, 4 Feb 2018 13:58:31 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14DwVB2037348; Sun, 4 Feb 2018 13:58:31 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201802041358.w14DwVB2037348@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 4 Feb 2018 13:58:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328846 - head/libexec/getty X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/libexec/getty X-SVN-Commit-Revision: 328846 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Feb 2018 13:58:32 -0000 Author: trasz Date: Sun Feb 4 13:58:31 2018 New Revision: 328846 URL: https://svnweb.freebsd.org/changeset/base/328846 Log: Initialize all the fields. This is one of the steps required to bump WARNS. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/libexec/getty/init.c Modified: head/libexec/getty/init.c ============================================================================== --- head/libexec/getty/init.c Sun Feb 4 13:58:29 2018 (r328845) +++ head/libexec/getty/init.c Sun Feb 4 13:58:31 2018 (r328846) @@ -42,6 +42,7 @@ static const char rcsid[] = * * Melbourne getty. */ +#include #include #include "gettytab.h" #include "extern.h" @@ -55,101 +56,101 @@ static char datefmt[] = "%+"; #define M(a) (&omode.c_cc[a]) struct gettystrs gettystrs[] = { - { "nx" }, /* next table */ - { "cl" }, /* screen clear characters */ - { "im" }, /* initial message */ - { "lm", loginmsg }, /* login message */ - { "er", M(VERASE) }, /* erase character */ - { "kl", M(VKILL) }, /* kill character */ - { "et", M(VEOF) }, /* eof chatacter (eot) */ - { "pc", nullstr }, /* pad character */ - { "tt" }, /* terminal type */ - { "ev" }, /* environment */ - { "lo", loginprg }, /* login program */ - { "hn", hostname }, /* host name */ - { "he" }, /* host name edit */ - { "in", M(VINTR) }, /* interrupt char */ - { "qu", M(VQUIT) }, /* quit char */ - { "xn", M(VSTART) }, /* XON (start) char */ - { "xf", M(VSTOP) }, /* XOFF (stop) char */ - { "bk", M(VEOL) }, /* brk char (alt \n) */ - { "su", M(VSUSP) }, /* suspend char */ - { "ds", M(VDSUSP) }, /* delayed suspend */ - { "rp", M(VREPRINT) }, /* reprint char */ - { "fl", M(VDISCARD) }, /* flush output */ - { "we", M(VWERASE) }, /* word erase */ - { "ln", M(VLNEXT) }, /* literal next */ - { "Lo" }, /* locale for strftime() */ - { "pp" }, /* ppp login program */ - { "if" }, /* sysv-like 'issue' filename */ - { "ic" }, /* modem init-chat */ - { "ac" }, /* modem answer-chat */ - { "al" }, /* user to auto-login */ - { "df", datefmt}, /* format for strftime() */ - { "iM" }, /* initial message program */ - { 0 } + { "nx", NULL, NULL }, /* next table */ + { "cl", NULL, NULL }, /* screen clear characters */ + { "im", NULL, NULL }, /* initial message */ + { "lm", loginmsg, NULL }, /* login message */ + { "er", M(VERASE), NULL }, /* erase character */ + { "kl", M(VKILL), NULL }, /* kill character */ + { "et", M(VEOF), NULL }, /* eof chatacter (eot) */ + { "pc", nullstr, NULL }, /* pad character */ + { "tt", NULL, NULL }, /* terminal type */ + { "ev", NULL, NULL }, /* environment */ + { "lo", loginprg, NULL }, /* login program */ + { "hn", hostname, NULL }, /* host name */ + { "he", NULL, NULL }, /* host name edit */ + { "in", M(VINTR), NULL }, /* interrupt char */ + { "qu", M(VQUIT), NULL }, /* quit char */ + { "xn", M(VSTART), NULL }, /* XON (start) char */ + { "xf", M(VSTOP), NULL }, /* XOFF (stop) char */ + { "bk", M(VEOL), NULL }, /* brk char (alt \n) */ + { "su", M(VSUSP), NULL }, /* suspend char */ + { "ds", M(VDSUSP), NULL }, /* delayed suspend */ + { "rp", M(VREPRINT), NULL }, /* reprint char */ + { "fl", M(VDISCARD), NULL }, /* flush output */ + { "we", M(VWERASE), NULL }, /* word erase */ + { "ln", M(VLNEXT), NULL }, /* literal next */ + { "Lo", NULL, NULL }, /* locale for strftime() */ + { "pp", NULL, NULL }, /* ppp login program */ + { "if", NULL, NULL }, /* sysv-like 'issue' filename */ + { "ic", NULL, NULL }, /* modem init-chat */ + { "ac", NULL, NULL }, /* modem answer-chat */ + { "al", NULL, NULL }, /* user to auto-login */ + { "df", datefmt, NULL }, /* format for strftime() */ + { "iM" , NULL, NULL }, /* initial message program */ + { NULL, NULL, NULL } }; struct gettynums gettynums[] = { - { "is" }, /* input speed */ - { "os" }, /* output speed */ - { "sp" }, /* both speeds */ - { "nd" }, /* newline delay */ - { "cd" }, /* carriage-return delay */ - { "td" }, /* tab delay */ - { "fd" }, /* form-feed delay */ - { "bd" }, /* backspace delay */ - { "to" }, /* timeout */ - { "f0" }, /* output flags */ - { "f1" }, /* input flags */ - { "f2" }, /* user mode flags */ - { "pf" }, /* delay before flush at 1st prompt */ - { "c0" }, /* output c_flags */ - { "c1" }, /* input c_flags */ - { "c2" }, /* user mode c_flags */ - { "i0" }, /* output i_flags */ - { "i1" }, /* input i_flags */ - { "i2" }, /* user mode i_flags */ - { "l0" }, /* output l_flags */ - { "l1" }, /* input l_flags */ - { "l2" }, /* user mode l_flags */ - { "o0" }, /* output o_flags */ - { "o1" }, /* input o_flags */ - { "o2" }, /* user mode o_flags */ - { "de" }, /* delay before sending 1st prompt */ - { "rt" }, /* reset timeout */ - { "ct" }, /* chat script timeout */ - { "dc" }, /* debug chat script value */ - { 0 } + { "is", 0, 0, 0 }, /* input speed */ + { "os", 0, 0, 0 }, /* output speed */ + { "sp", 0, 0, 0 }, /* both speeds */ + { "nd", 0, 0, 0 }, /* newline delay */ + { "cd", 0, 0, 0 }, /* carriage-return delay */ + { "td", 0, 0, 0 }, /* tab delay */ + { "fd", 0, 0, 0 }, /* form-feed delay */ + { "bd", 0, 0, 0 }, /* backspace delay */ + { "to", 0, 0, 0 }, /* timeout */ + { "f0", 0, 0, 0 }, /* output flags */ + { "f1", 0, 0, 0 }, /* input flags */ + { "f2", 0, 0, 0 }, /* user mode flags */ + { "pf", 0, 0, 0 }, /* delay before flush at 1st prompt */ + { "c0", 0, 0, 0 }, /* output c_flags */ + { "c1", 0, 0, 0 }, /* input c_flags */ + { "c2", 0, 0, 0 }, /* user mode c_flags */ + { "i0", 0, 0, 0 }, /* output i_flags */ + { "i1", 0, 0, 0 }, /* input i_flags */ + { "i2", 0, 0, 0 }, /* user mode i_flags */ + { "l0", 0, 0, 0 }, /* output l_flags */ + { "l1", 0, 0, 0 }, /* input l_flags */ + { "l2", 0, 0, 0 }, /* user mode l_flags */ + { "o0", 0, 0, 0 }, /* output o_flags */ + { "o1", 0, 0, 0 }, /* input o_flags */ + { "o2", 0, 0, 0 }, /* user mode o_flags */ + { "de", 0, 0, 0 }, /* delay before sending 1st prompt */ + { "rt", 0, 0, 0 }, /* reset timeout */ + { "ct", 0, 0, 0 }, /* chat script timeout */ + { "dc", 0, 0, 0 }, /* debug chat script value */ + { NULL, 0, 0, 0 } }; struct gettyflags gettyflags[] = { - { "ht", 0 }, /* has tabs */ - { "nl", 1 }, /* has newline char */ - { "ep", 0 }, /* even parity */ - { "op", 0 }, /* odd parity */ - { "ap", 0 }, /* any parity */ - { "ec", 1 }, /* no echo */ - { "co", 0 }, /* console special */ - { "cb", 0 }, /* crt backspace */ - { "ck", 0 }, /* crt kill */ - { "ce", 0 }, /* crt erase */ - { "pe", 0 }, /* printer erase */ - { "rw", 1 }, /* don't use raw */ - { "xc", 1 }, /* don't ^X ctl chars */ - { "lc", 0 }, /* terminal las lower case */ - { "uc", 0 }, /* terminal has no lower case */ - { "ig", 0 }, /* ignore garbage */ - { "ps", 0 }, /* do port selector speed select */ - { "hc", 1 }, /* don't set hangup on close */ - { "ub", 0 }, /* unbuffered output */ - { "ab", 0 }, /* auto-baud detect with '\r' */ - { "dx", 0 }, /* set decctlq */ - { "np", 0 }, /* no parity at all (8bit chars) */ - { "mb", 0 }, /* do MDMBUF flow control */ - { "hw", 0 }, /* do CTSRTS flow control */ - { "nc", 0 }, /* set clocal (no carrier) */ - { "pl", 0 }, /* use PPP instead of login(1) */ - { 0 } + { "ht", 0, 0, 0, 0 }, /* has tabs */ + { "nl", 1, 0, 0, 0 }, /* has newline char */ + { "ep", 0, 0, 0, 0 }, /* even parity */ + { "op", 0, 0, 0, 0 }, /* odd parity */ + { "ap", 0, 0, 0, 0 }, /* any parity */ + { "ec", 1, 0, 0, 0 }, /* no echo */ + { "co", 0, 0, 0, 0 }, /* console special */ + { "cb", 0, 0, 0, 0 }, /* crt backspace */ + { "ck", 0, 0, 0, 0 }, /* crt kill */ + { "ce", 0, 0, 0, 0 }, /* crt erase */ + { "pe", 0, 0, 0, 0 }, /* printer erase */ + { "rw", 1, 0, 0, 0 }, /* don't use raw */ + { "xc", 1, 0, 0, 0 }, /* don't ^X ctl chars */ + { "lc", 0, 0, 0, 0 }, /* terminal las lower case */ + { "uc", 0, 0, 0, 0 }, /* terminal has no lower case */ + { "ig", 0, 0, 0, 0 }, /* ignore garbage */ + { "ps", 0, 0, 0, 0 }, /* do port selector speed select */ + { "hc", 1, 0, 0, 0 }, /* don't set hangup on close */ + { "ub", 0, 0, 0, 0 }, /* unbuffered output */ + { "ab", 0, 0, 0, 0 }, /* auto-baud detect with '\r' */ + { "dx", 0, 0, 0, 0 }, /* set decctlq */ + { "np", 0, 0, 0, 0 }, /* no parity at all (8bit chars) */ + { "mb", 0, 0, 0, 0 }, /* do MDMBUF flow control */ + { "hw", 0, 0, 0, 0 }, /* do CTSRTS flow control */ + { "nc", 0, 0, 0, 0 }, /* set clocal (no carrier) */ + { "pl", 0, 0, 0, 0 }, /* use PPP instead of login(1) */ + { NULL, 0, 0, 0, 0 } }; From owner-svn-src-all@freebsd.org Sun Feb 4 14:00:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D78EBED80F5; Sun, 4 Feb 2018 14:00:38 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D79E811FC; Sun, 4 Feb 2018 14:00:38 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 885FC1B024; Sun, 4 Feb 2018 14:00:38 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w14E0c4B038415; Sun, 4 Feb 2018 14:00:38 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14E0c6h038414; Sun, 4 Feb 2018 14:00:38 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802041400.w14E0c6h038414@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sun, 4 Feb 2018 14:00:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328847 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 328847 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Feb 2018 14:00:39 -0000 Author: avg Date: Sun Feb 4 14:00:38 2018 New Revision: 328847 URL: https://svnweb.freebsd.org/changeset/base/328847 Log: MFC r328126: correct read-ahead calculations in vfs_bio_getpages Modified: stable/11/sys/kern/vfs_bio.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/vfs_bio.c ============================================================================== --- stable/11/sys/kern/vfs_bio.c Sun Feb 4 13:58:31 2018 (r328846) +++ stable/11/sys/kern/vfs_bio.c Sun Feb 4 14:00:38 2018 (r328847) @@ -4764,7 +4764,14 @@ vfs_bio_getpages(struct vnode *vp, vm_page_t *ma, int la = IDX_TO_OFF(ma[count - 1]->pindex); if (la >= object->un_pager.vnp.vnp_size) return (VM_PAGER_BAD); - lpart = la + PAGE_SIZE > object->un_pager.vnp.vnp_size; + + /* + * Change the meaning of la from where the last requested page starts + * to where it ends, because that's the end of the requested region + * and the start of the potential read-ahead region. + */ + la += PAGE_SIZE; + lpart = la > object->un_pager.vnp.vnp_size; bo_bs = get_blksize(vp, get_lblkno(vp, IDX_TO_OFF(ma[0]->pindex))); /* From owner-svn-src-all@freebsd.org Sun Feb 4 14:49:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54B4AED9CA4; Sun, 4 Feb 2018 14:49:57 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E701182932; Sun, 4 Feb 2018 14:49:56 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D2A921B816; Sun, 4 Feb 2018 14:49:56 +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 w14Enu1N062349; Sun, 4 Feb 2018 14:49:56 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14EntCw062339; Sun, 4 Feb 2018 14:49:55 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201802041449.w14EntCw062339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 4 Feb 2018 14:49:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328849 - in head: sbin/geom/class/cache sbin/geom/class/concat sbin/geom/class/journal sbin/geom/class/label sbin/geom/class/mirror sbin/geom/class/raid3 sbin/geom/class/shsec sbin/geo... X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head: sbin/geom/class/cache sbin/geom/class/concat sbin/geom/class/journal sbin/geom/class/label sbin/geom/class/mirror sbin/geom/class/raid3 sbin/geom/class/shsec sbin/geom/class/stripe sbin/geom/... X-SVN-Commit-Revision: 328849 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Feb 2018 14:49:57 -0000 Author: asomers Date: Sun Feb 4 14:49:55 2018 New Revision: 328849 URL: https://svnweb.freebsd.org/changeset/base/328849 Log: geom: don't write stack garbage in disk labels Most consumers of g_metadata_store were passing in partially unallocated memory, resulting in stack garbage being written to disk labels. Fix them by zeroing the memory first. gvirstor repeated the same mistake, but in the kernel. Also, glabel's label contained a fixed-size string that wasn't initialized to zero. PR: 222077 Reported by: Maxim Khitrov Reviewed by: cem MFC after: 3 weeks X-MFC-With: 323314 X-MFC-With: 323338 Differential Revision: https://reviews.freebsd.org/D14164 Modified: head/sbin/geom/class/cache/geom_cache.c head/sbin/geom/class/concat/geom_concat.c head/sbin/geom/class/journal/geom_journal.c head/sbin/geom/class/label/geom_label.c head/sbin/geom/class/mirror/geom_mirror.c head/sbin/geom/class/raid3/geom_raid3.c head/sbin/geom/class/shsec/geom_shsec.c head/sbin/geom/class/stripe/geom_stripe.c head/sbin/geom/misc/subr.c head/sys/geom/virstor/g_virstor.c Modified: head/sbin/geom/class/cache/geom_cache.c ============================================================================== --- head/sbin/geom/class/cache/geom_cache.c Sun Feb 4 14:27:12 2018 (r328848) +++ head/sbin/geom/class/cache/geom_cache.c Sun Feb 4 14:49:55 2018 (r328849) @@ -137,6 +137,7 @@ cache_label(struct gctl_req *req) int error, nargs; intmax_t val; + bzero(sector, sizeof(sector)); nargs = gctl_get_int(req, "nargs"); if (nargs != 2) { gctl_error(req, "Invalid number of arguments."); Modified: head/sbin/geom/class/concat/geom_concat.c ============================================================================== --- head/sbin/geom/class/concat/geom_concat.c Sun Feb 4 14:27:12 2018 (r328848) +++ head/sbin/geom/class/concat/geom_concat.c Sun Feb 4 14:49:55 2018 (r328849) @@ -119,6 +119,7 @@ concat_label(struct gctl_req *req) const char *name; int error, i, hardcode, nargs; + bzero(sector, sizeof(sector)); nargs = gctl_get_int(req, "nargs"); if (nargs < 2) { gctl_error(req, "Too few arguments."); Modified: head/sbin/geom/class/journal/geom_journal.c ============================================================================== --- head/sbin/geom/class/journal/geom_journal.c Sun Feb 4 14:27:12 2018 (r328848) +++ head/sbin/geom/class/journal/geom_journal.c Sun Feb 4 14:49:55 2018 (r328849) @@ -144,6 +144,7 @@ journal_label(struct gctl_req *req) intmax_t jsize, msize, ssize; int error, force, i, nargs, checksum, hardcode; + bzero(sector, sizeof(sector)); nargs = gctl_get_int(req, "nargs"); str = NULL; /* gcc */ Modified: head/sbin/geom/class/label/geom_label.c ============================================================================== --- head/sbin/geom/class/label/geom_label.c Sun Feb 4 14:27:12 2018 (r328848) +++ head/sbin/geom/class/label/geom_label.c Sun Feb 4 14:49:55 2018 (r328849) @@ -125,6 +125,7 @@ label_label(struct gctl_req *req) u_char sector[512]; int error, nargs; + bzero(sector, sizeof(sector)); nargs = gctl_get_int(req, "nargs"); if (nargs != 2) { gctl_error(req, "Invalid number of arguments."); @@ -145,6 +146,7 @@ label_label(struct gctl_req *req) strlcpy(md.md_magic, G_LABEL_MAGIC, sizeof(md.md_magic)); md.md_version = G_LABEL_VERSION; label = gctl_get_ascii(req, "arg0"); + bzero(md.md_label, sizeof(md.md_label)); strlcpy(md.md_label, label, sizeof(md.md_label)); md.md_provsize = g_get_mediasize(name); if (md.md_provsize == 0) { Modified: head/sbin/geom/class/mirror/geom_mirror.c ============================================================================== --- head/sbin/geom/class/mirror/geom_mirror.c Sun Feb 4 14:27:12 2018 (r328848) +++ head/sbin/geom/class/mirror/geom_mirror.c Sun Feb 4 14:49:55 2018 (r328849) @@ -188,6 +188,7 @@ mirror_label(struct gctl_req *req) intmax_t val; int error, i, nargs, bal, hardcode; + bzero(sector, sizeof(sector)); nargs = gctl_get_int(req, "nargs"); if (nargs < 2) { gctl_error(req, "Too few arguments."); Modified: head/sbin/geom/class/raid3/geom_raid3.c ============================================================================== --- head/sbin/geom/class/raid3/geom_raid3.c Sun Feb 4 14:27:12 2018 (r328848) +++ head/sbin/geom/class/raid3/geom_raid3.c Sun Feb 4 14:49:55 2018 (r328849) @@ -151,6 +151,7 @@ raid3_label(struct gctl_req *req) int hardcode, round_robin, verify; int error, i, nargs; + bzero(sector, sizeof(sector)); nargs = gctl_get_int(req, "nargs"); if (nargs < 4) { gctl_error(req, "Too few arguments."); Modified: head/sbin/geom/class/shsec/geom_shsec.c ============================================================================== --- head/sbin/geom/class/shsec/geom_shsec.c Sun Feb 4 14:27:12 2018 (r328848) +++ head/sbin/geom/class/shsec/geom_shsec.c Sun Feb 4 14:49:55 2018 (r328849) @@ -112,6 +112,7 @@ shsec_label(struct gctl_req *req) const char *name; int error, i, nargs, hardcode; + bzero(sector, sizeof(sector)); nargs = gctl_get_int(req, "nargs"); if (nargs <= 2) { gctl_error(req, "Too few arguments."); Modified: head/sbin/geom/class/stripe/geom_stripe.c ============================================================================== --- head/sbin/geom/class/stripe/geom_stripe.c Sun Feb 4 14:27:12 2018 (r328848) +++ head/sbin/geom/class/stripe/geom_stripe.c Sun Feb 4 14:49:55 2018 (r328849) @@ -130,6 +130,7 @@ stripe_label(struct gctl_req *req) const char *name; int error, i, nargs, hardcode; + bzero(sector, sizeof(sector)); nargs = gctl_get_int(req, "nargs"); if (nargs < 3) { gctl_error(req, "Too few arguments."); Modified: head/sbin/geom/misc/subr.c ============================================================================== --- head/sbin/geom/misc/subr.c Sun Feb 4 14:27:12 2018 (r328848) +++ head/sbin/geom/misc/subr.c Sun Feb 4 14:49:55 2018 (r328849) @@ -273,6 +273,13 @@ out: return (error); } +/* + * Actually write the GEOM label to the provider + * + * @param name GEOM provider's name (ie "ada0") + * @param md Pointer to the label data to write + * @param size Size of the data pointed to by md + */ int g_metadata_store(const char *name, const unsigned char *md, size_t size) { Modified: head/sys/geom/virstor/g_virstor.c ============================================================================== --- head/sys/geom/virstor/g_virstor.c Sun Feb 4 14:27:12 2018 (r328848) +++ head/sys/geom/virstor/g_virstor.c Sun Feb 4 14:49:55 2018 (r328849) @@ -1042,6 +1042,7 @@ write_metadata(struct g_consumer *cp, struct g_virstor pp = cp->provider; buf = malloc(pp->sectorsize, M_GVIRSTOR, M_WAITOK); + bzero(buf, pp->sectorsize); virstor_metadata_encode(md, buf); g_topology_unlock(); error = g_write_data(cp, pp->mediasize - pp->sectorsize, buf, From owner-svn-src-all@freebsd.org Sun Feb 4 13:53:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0367CED7E28; Sun, 4 Feb 2018 13:53:46 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F8DD80A05; Sun, 4 Feb 2018 13:53:45 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 98D4B1B00F; Sun, 4 Feb 2018 13:53:45 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w14Drj2A036766; Sun, 4 Feb 2018 13:53:45 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14DrjRY036764; Sun, 4 Feb 2018 13:53:45 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802041353.w14DrjRY036764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sun, 4 Feb 2018 13:53:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328840 - stable/11/sys/amd64/vmm/amd X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/amd64/vmm/amd X-SVN-Commit-Revision: 328840 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Feb 2018 13:53:46 -0000 Author: avg Date: Sun Feb 4 13:53:45 2018 New Revision: 328840 URL: https://svnweb.freebsd.org/changeset/base/328840 Log: MFC r327726: vmm/svm: contigmalloc of the whole svm_softc is excessive Modified: stable/11/sys/amd64/vmm/amd/svm.c stable/11/sys/amd64/vmm/amd/svm_softc.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/vmm/amd/svm.c ============================================================================== --- stable/11/sys/amd64/vmm/amd/svm.c Sun Feb 4 12:16:36 2018 (r328839) +++ stable/11/sys/amd64/vmm/amd/svm.c Sun Feb 4 13:53:45 2018 (r328840) @@ -517,15 +517,26 @@ svm_vminit(struct vm *vm, pmap_t pmap) vm_paddr_t msrpm_pa, iopm_pa, pml4_pa; int i; - svm_sc = contigmalloc(sizeof (*svm_sc), M_SVM, M_WAITOK | M_ZERO, - 0, ~(vm_paddr_t)0, PAGE_SIZE, 0); + svm_sc = malloc(sizeof (*svm_sc), M_SVM, M_WAITOK | M_ZERO); + if (((uintptr_t)svm_sc & PAGE_MASK) != 0) + panic("malloc of svm_softc not aligned on page boundary"); + + svm_sc->msr_bitmap = contigmalloc(SVM_MSR_BITMAP_SIZE, M_SVM, + M_WAITOK, 0, ~(vm_paddr_t)0, PAGE_SIZE, 0); + if (svm_sc->msr_bitmap == NULL) + panic("contigmalloc of SVM MSR bitmap failed"); + svm_sc->iopm_bitmap = contigmalloc(SVM_IO_BITMAP_SIZE, M_SVM, + M_WAITOK, 0, ~(vm_paddr_t)0, PAGE_SIZE, 0); + if (svm_sc->iopm_bitmap == NULL) + panic("contigmalloc of SVM IO bitmap failed"); + svm_sc->vm = vm; svm_sc->nptp = (vm_offset_t)vtophys(pmap->pm_pml4); /* * Intercept read and write accesses to all MSRs. */ - memset(svm_sc->msr_bitmap, 0xFF, sizeof(svm_sc->msr_bitmap)); + memset(svm_sc->msr_bitmap, 0xFF, SVM_MSR_BITMAP_SIZE); /* * Access to the following MSRs is redirected to the VMCB when the @@ -553,7 +564,7 @@ svm_vminit(struct vm *vm, pmap_t pmap) svm_msr_rd_ok(svm_sc->msr_bitmap, MSR_EFER); /* Intercept access to all I/O ports. */ - memset(svm_sc->iopm_bitmap, 0xFF, sizeof(svm_sc->iopm_bitmap)); + memset(svm_sc->iopm_bitmap, 0xFF, SVM_IO_BITMAP_SIZE); iopm_pa = vtophys(svm_sc->iopm_bitmap); msrpm_pa = vtophys(svm_sc->msr_bitmap); @@ -2043,7 +2054,9 @@ svm_vmcleanup(void *arg) { struct svm_softc *sc = arg; - contigfree(sc, sizeof (*sc), M_SVM); + contigfree(sc->iopm_bitmap, SVM_IO_BITMAP_SIZE, M_SVM); + contigfree(sc->msr_bitmap, SVM_MSR_BITMAP_SIZE, M_SVM); + free(sc, M_SVM); } static register_t * Modified: stable/11/sys/amd64/vmm/amd/svm_softc.h ============================================================================== --- stable/11/sys/amd64/vmm/amd/svm_softc.h Sun Feb 4 12:16:36 2018 (r328839) +++ stable/11/sys/amd64/vmm/amd/svm_softc.h Sun Feb 4 13:53:45 2018 (r328840) @@ -56,13 +56,13 @@ struct svm_vcpu { * SVM softc, one per virtual machine. */ struct svm_softc { - uint8_t iopm_bitmap[SVM_IO_BITMAP_SIZE]; /* shared by all vcpus */ - uint8_t msr_bitmap[SVM_MSR_BITMAP_SIZE]; /* shared by all vcpus */ uint8_t apic_page[VM_MAXCPU][PAGE_SIZE]; struct svm_vcpu vcpu[VM_MAXCPU]; vm_offset_t nptp; /* nested page table */ + uint8_t *iopm_bitmap; /* shared by all vcpus */ + uint8_t *msr_bitmap; /* shared by all vcpus */ struct vm *vm; -} __aligned(PAGE_SIZE); +}; CTASSERT((offsetof(struct svm_softc, nptp) & PAGE_MASK) == 0); From owner-svn-src-all@freebsd.org Sun Feb 4 13:58:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E91B4ED803D; Sun, 4 Feb 2018 13:58:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9658780F01; Sun, 4 Feb 2018 13:58:29 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 902891B014; Sun, 4 Feb 2018 13:58:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w14DwT9R037297; Sun, 4 Feb 2018 13:58:29 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14DwTAp037296; Sun, 4 Feb 2018 13:58:29 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802041358.w14DwTAp037296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sun, 4 Feb 2018 13:58:29 +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: r328845 - stable/10/sys/dev/amdsbwd X-SVN-Group: stable-10 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/10/sys/dev/amdsbwd X-SVN-Commit-Revision: 328845 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Feb 2018 13:58:30 -0000 Author: avg Date: Sun Feb 4 13:58:29 2018 New Revision: 328845 URL: https://svnweb.freebsd.org/changeset/base/328845 Log: MFC r327775: amdsbwd: fix handling of timeout values beyond the supported range Modified: stable/10/sys/dev/amdsbwd/amdsbwd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/amdsbwd/amdsbwd.c ============================================================================== --- stable/10/sys/dev/amdsbwd/amdsbwd.c Sun Feb 4 13:57:15 2018 (r328844) +++ stable/10/sys/dev/amdsbwd/amdsbwd.c Sun Feb 4 13:58:29 2018 (r328845) @@ -208,21 +208,30 @@ static void amdsbwd_event(void *arg, unsigned int cmd, int *error) { struct amdsbwd_softc *sc = arg; - unsigned int timeout; + uint64_t timeout; - /* convert from power-of-two-ns to WDT ticks */ - cmd &= WD_INTERVAL; - if (cmd < WD_TO_1SEC) - cmd = 0; - if (cmd) { - timeout = ((uint64_t)1 << (cmd - WD_TO_1MS)) / sc->ms_per_tick; + if (cmd != 0) { + timeout = 0; + cmd &= WD_INTERVAL; + if (cmd >= WD_TO_1MS) { + timeout = (uint64_t)1 << (cmd - WD_TO_1MS); + timeout = timeout / sc->ms_per_tick; + } + /* For a too short timeout use 1 tick. */ + if (timeout == 0) + timeout = 1; + /* For a too long timeout stop the timer. */ if (timeout > sc->max_ticks) - timeout = sc->max_ticks; - if (timeout != sc->timeout) { + timeout = 0; + } else { + timeout = 0; + } + + if (timeout != 0) { + if (timeout != sc->timeout) amdsbwd_tmr_set(sc, timeout); - if (!sc->active) - amdsbwd_tmr_enable(sc); - } + if (!sc->active) + amdsbwd_tmr_enable(sc); amdsbwd_tmr_reload(sc); *error = 0; } else { From owner-svn-src-all@freebsd.org Sun Feb 4 15:39:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 535DEEDCA11; Sun, 4 Feb 2018 15:39:16 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 08E2C84D20; Sun, 4 Feb 2018 15:39:16 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 03D761C022; Sun, 4 Feb 2018 15:39:16 +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 w14FdFkD087614; Sun, 4 Feb 2018 15:39:15 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14FdF9w087613; Sun, 4 Feb 2018 15:39:15 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201802041539.w14FdF9w087613@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 4 Feb 2018 15:39:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328851 - head/sys/powerpc/conf X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/conf X-SVN-Commit-Revision: 328851 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Feb 2018 15:39:16 -0000 Author: jhibbits Date: Sun Feb 4 15:39:15 2018 New Revision: 328851 URL: https://svnweb.freebsd.org/changeset/base/328851 Log: Add sdhci to MPC85XX build Modified: head/sys/powerpc/conf/MPC85XX Modified: head/sys/powerpc/conf/MPC85XX ============================================================================== --- head/sys/powerpc/conf/MPC85XX Sun Feb 4 15:37:58 2018 (r328850) +++ head/sys/powerpc/conf/MPC85XX Sun Feb 4 15:39:15 2018 (r328851) @@ -95,6 +95,7 @@ device random #device rl device scbus device scc +device sdhci device sec device spibus device spigen From owner-svn-src-all@freebsd.org Sun Feb 4 13:55:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B60FED7E8E; Sun, 4 Feb 2018 13:55:21 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D06880C98; Sun, 4 Feb 2018 13:55:21 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DDD311B012; Sun, 4 Feb 2018 13:55:20 +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 w14DtK53037023; Sun, 4 Feb 2018 13:55:20 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14DtKJt037022; Sun, 4 Feb 2018 13:55:20 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201802041355.w14DtKJt037022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 4 Feb 2018 13:55:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328843 - head/libexec/getty X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/libexec/getty X-SVN-Commit-Revision: 328843 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Feb 2018 13:55:21 -0000 Author: trasz Date: Sun Feb 4 13:55:20 2018 New Revision: 328843 URL: https://svnweb.freebsd.org/changeset/base/328843 Log: Reduce code duplication; no functional changes. Obtained from: NetBSD MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/libexec/getty/init.c Modified: head/libexec/getty/init.c ============================================================================== --- head/libexec/getty/init.c Sun Feb 4 13:54:43 2018 (r328842) +++ head/libexec/getty/init.c Sun Feb 4 13:55:20 2018 (r328843) @@ -52,31 +52,33 @@ static char nullstr[] = ""; static char loginprg[] = _PATH_LOGIN; static char datefmt[] = "%+"; +#define M(a) (&omode.c_cc[a]) + struct gettystrs gettystrs[] = { { "nx" }, /* next table */ { "cl" }, /* screen clear characters */ { "im" }, /* initial message */ { "lm", loginmsg }, /* login message */ - { "er", &omode.c_cc[VERASE] }, /* erase character */ - { "kl", &omode.c_cc[VKILL] }, /* kill character */ - { "et", &omode.c_cc[VEOF] }, /* eof chatacter (eot) */ + { "er", M(VERASE) }, /* erase character */ + { "kl", M(VKILL) }, /* kill character */ + { "et", M(VEOF) }, /* eof chatacter (eot) */ { "pc", nullstr }, /* pad character */ { "tt" }, /* terminal type */ { "ev" }, /* environment */ { "lo", loginprg }, /* login program */ { "hn", hostname }, /* host name */ { "he" }, /* host name edit */ - { "in", &omode.c_cc[VINTR] }, /* interrupt char */ - { "qu", &omode.c_cc[VQUIT] }, /* quit char */ - { "xn", &omode.c_cc[VSTART] }, /* XON (start) char */ - { "xf", &omode.c_cc[VSTOP] }, /* XOFF (stop) char */ - { "bk", &omode.c_cc[VEOL] }, /* brk char (alt \n) */ - { "su", &omode.c_cc[VSUSP] }, /* suspend char */ - { "ds", &omode.c_cc[VDSUSP] }, /* delayed suspend */ - { "rp", &omode.c_cc[VREPRINT] },/* reprint char */ - { "fl", &omode.c_cc[VDISCARD] },/* flush output */ - { "we", &omode.c_cc[VWERASE] }, /* word erase */ - { "ln", &omode.c_cc[VLNEXT] }, /* literal next */ + { "in", M(VINTR) }, /* interrupt char */ + { "qu", M(VQUIT) }, /* quit char */ + { "xn", M(VSTART) }, /* XON (start) char */ + { "xf", M(VSTOP) }, /* XOFF (stop) char */ + { "bk", M(VEOL) }, /* brk char (alt \n) */ + { "su", M(VSUSP) }, /* suspend char */ + { "ds", M(VDSUSP) }, /* delayed suspend */ + { "rp", M(VREPRINT) }, /* reprint char */ + { "fl", M(VDISCARD) }, /* flush output */ + { "we", M(VWERASE) }, /* word erase */ + { "ln", M(VLNEXT) }, /* literal next */ { "Lo" }, /* locale for strftime() */ { "pp" }, /* ppp login program */ { "if" }, /* sysv-like 'issue' filename */ From owner-svn-src-all@freebsd.org Sun Feb 4 13:00:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30A9BED206B; Sun, 4 Feb 2018 13:00:34 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from mx.catwhisker.org (mx.catwhisker.org [198.144.209.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8FE7E7E1B7; Sun, 4 Feb 2018 13:00:33 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from albert.catwhisker.org (localhost [127.0.0.1]) by albert.catwhisker.org (8.15.2/8.15.2) with ESMTP id w14D0VJO002121; Sun, 4 Feb 2018 13:00:31 GMT (envelope-from david@albert.catwhisker.org) Received: (from david@localhost) by albert.catwhisker.org (8.15.2/8.15.2/Submit) id w14D0VjJ002120; Sun, 4 Feb 2018 05:00:31 -0800 (PST) (envelope-from david) Date: Sun, 4 Feb 2018 05:00:31 -0800 From: David Wolfskill To: "O. Hartmann" Cc: Jason Harmening , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328489 - head/sys/conf Message-ID: <20180204130031.GC1178@albert.catwhisker.org> References: <201801272013.w0RKDaMU098200@repo.freebsd.org> <20180127214755.3c59661e@thor.intern.walstatt.dynvpn.de> <98501f75-1a1b-9221-c52d-24415230a886@gmail.com> <20180129130022.GT1125@albert.catwhisker.org> <20180204133337.3d03f01d@thor.intern.walstatt.dynvpn.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="m51xatjYGsM+13rf" Content-Disposition: inline In-Reply-To: <20180204133337.3d03f01d@thor.intern.walstatt.dynvpn.de> User-Agent: Mutt/1.9.3 (2018-01-21) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Feb 2018 13:00:34 -0000 --m51xatjYGsM+13rf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Feb 04, 2018 at 01:33:10PM +0100, O. Hartmann wrote: > Am Mon, 29 Jan 2018 05:00:22 -0800 > David Wolfskill schrieb: > > On Mon, Jan 29, 2018 at 02:10:04AM -0800, Jason Harmening wrote: > > > > This happens now if PORTS_MODULE=3Dx11/nvidia-driver is defined in = /etc/src.conf: > > > >=20 > > > > [...] > > > > --- kernel-install --- > > > > mkdir -p /boot/kernel > > > > install -p -m 555 -o root -g wheel kernel /boot/kernel/ > > > > --- ports-install --- > > > > Variable OBJTOP is recursive. > > > >=20 > > > > make[8]: stopped =20 > > > ... > > >=20 > > > David sent me logs of the failing case; thanks David! =20 > >=20 > > Happy to help! :-) > >=20 > > > The failure happens when buildkernel and installkernel are run=20 > > > separately instead of all-up, e.g. 'make kernel'. The installkernel= =20 > > > step is leaving MK_AUTO_OBJ=3Dno in the env passed to the port build.= It=20 > > > looks like at least one of the install stages of nvidia-driver needs = to=20 > > > generate temporary output, which leads to confusion when the port isn= 't=20 > > > built as though it's an in-tree component. > > >=20 > > > Can you guys try out the attached patch? =20 > >=20 > > I tried it both on my build machine (which does not use kernel modules > > from ports, and thus did not exhibit the problem -- but I thought that > > verifying that the patch did not break that case worth checking) and on > > my laptop (which did exhibit the problem). > >=20 > > It worked in both cases with no issues for me. > >=20 > > Thanks! :-) > >=20 > > Peace, > > david >=20 > The problem still persists! >=20 > I'm on CURRENT, FreeBSD 12.0-CURRENT #32: Sun Feb 4 09:41:39 CET 2018 am= d64, the source > tree is at revision 328839. I have augmented with "new_typescript.txt" -- the typescript from this morning's update of head/amd64 from r328830 to r328838... which worked without complaint for me. And you can see in the log where x11/nvidia-driver-340 is rebuilt (starting around line 23660). > I use WITH_META_MODE=3DYES in /etc/src.conf. My /etc/make.conf consists o= f a .include > statement which reels in /usr/local/etc/ports.conf in which I define ever= ything outside > the source tree for ports (in case of the nvidia driver, its DISTVERSION)= =2E This worked > before and should work again. Today I checked out a completely fresh /usr= /src and gleanced > the /usr/obj folder and rebuilt the system - and get the error again: I also use 'WITH_META_MODE=3Dyes' (in /etc/src-env.conf). > [...] > =3D=3D=3D> Ports module x11/nvidia-driver (install) > cd ${PORTSDIR:-/usr/ports}/x11/nvidia-driver; env -u CC -u CXX -u CPP = -u MAKESYSPATH > MAKEFLAGS=3D"-j 4 -J 15,16 .MAKE.LEVEL.ENV=3DMAKELEVEL KERNEL=3Dkernel MK= _AUTO_OBJ=3Dno > TARGET=3Damd64 TARGET_ARCH=3Damd64" SYSDIR=3D/usr/src/sys > PATH=3D/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/sbin:/usr/obj/usr/src/= amd64.amd64/tmp/legacy/usr/bin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/bin:= /usr/obj/usr/src/amd64.amd64/tmp/usr/sbin:/usr/obj/usr/src/amd64.amd64/tmp/= usr/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin > SRC_BASE=3D/usr/src OSVERSION=3D1200056 WRKDIRPREFIX=3D/usr/obj/usr/src= /amd64.amd64/sys/THOR > make -B deinstall reinstall =3D=3D=3D> Deinstalling for nvidia-driver = =3D=3D=3D> Deinstalling > nvidia-driver-387.34 Updating database digests format: . done Checking in= tegrity... done > (0 conflicting) Deinstallation has been requested for the following 1 pac= kages (of 0 > packages in the universe): >=20 > Installed packages to be REMOVED: > nvidia-driver-387.34 >=20 > Number of packages to be removed: 1 >=20 > The operation will free 99 MiB. > [1/1] Deinstalling nvidia-driver-387.34... > [1/1] Deleting files for nvidia-driver-387.34: .......... done > =3D=3D=3D> Staging for nvidia-driver-387.34 > =3D=3D=3D> nvidia-driver-387.34 depends on file: /usr/local/lib/libGL.s= o - found > =3D=3D=3D> nvidia-driver-387.34 depends on file: /usr/local/libdata/pkg= config/x11.pc - found > =3D=3D=3D> nvidia-driver-387.34 depends on file: /usr/local/libdata/pkg= config/xorg-server.pc > - found =3D=3D=3D> nvidia-driver-387.34 depends on file: /usr/local/lib= data/pkgconfig/xext.pc > - found =3D=3D=3D> Generating temporary packing list > =3D=3D=3D> src (install) > =3D=3D=3D> src/nvidia (install) > Variable OBJTOP is recursive. >=20 > make[8]: stopped > in /usr/obj/usr/src/amd64.amd64/sys/DUMMBOX/usr/ports/x11/nvidia-driver/w= ork/NVIDIA-FreeBSD-x86_64-387.34/src/nvidia > *** Error code 2 >=20 >=20 >=20 > Oliver >=20 > --=20 > O. Hartmann > .... Well, it is working for me.... Peace, david --=20 David H. Wolfskill david@catwhisker.org The circus around that memo helps confirm that Mr. Trump is unfit for offic= e. See http://www.catwhisker.org/~david/publickey.gpg for my public key. --m51xatjYGsM+13rf Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEEzLfO+ReoAfQwZNd7FTnMQKBJ7hcFAlp3A+9fFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEND QjdDRUY5MTdBODAxRjQzMDY0RDc3QjE1MzlDQzQwQTA0OUVFMTcACgkQFTnMQKBJ 7hePMgf+M3h3HJY/38/aqdG5uZKDG8yKrFOSBizr32KgN70fT83tpEKjgpbf0nku Byx+o5Zj1IDSl5pprb8MDpNcdtDgQp+E40ldJ9EVEdroYg068/XqJUR71vrmSZB9 KZ9jBsCxx0SVH+3iDmTqB9EQVFlZbbSLJJfpTVt08oFX1b5B8NGz0DDx469A3+Bw V+vuw3sRPrPv3Mhka+DTD356n5DcLpREH+UuSu4IjwSvjZw6EdBkududJYEI4G1g JsnUiI5KHaJ5iGZXzq0s+iL/yvJuQaRaxmbGsoLUVKA9e82ykdrbazSMDJCgZfKY kEV9QuZHwPwb1JVCrapuNv+rpcyQuA== =/pEO -----END PGP SIGNATURE----- --m51xatjYGsM+13rf-- From owner-svn-src-all@freebsd.org Sun Feb 4 13:57:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CE8DED7FC8; Sun, 4 Feb 2018 13:57:16 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 32CC580DDE; Sun, 4 Feb 2018 13:57:16 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 299031B013; Sun, 4 Feb 2018 13:57:16 +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 w14DvFL7037186; Sun, 4 Feb 2018 13:57:15 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14DvFWf037185; Sun, 4 Feb 2018 13:57:15 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802041357.w14DvFWf037185@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sun, 4 Feb 2018 13:57:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328844 - stable/11/sys/dev/amdsbwd X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/dev/amdsbwd X-SVN-Commit-Revision: 328844 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Feb 2018 13:57:16 -0000 Author: avg Date: Sun Feb 4 13:57:15 2018 New Revision: 328844 URL: https://svnweb.freebsd.org/changeset/base/328844 Log: MFC r327775: amdsbwd: fix handling of timeout values beyond the supported range Modified: stable/11/sys/dev/amdsbwd/amdsbwd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/amdsbwd/amdsbwd.c ============================================================================== --- stable/11/sys/dev/amdsbwd/amdsbwd.c Sun Feb 4 13:55:20 2018 (r328843) +++ stable/11/sys/dev/amdsbwd/amdsbwd.c Sun Feb 4 13:57:15 2018 (r328844) @@ -208,21 +208,30 @@ static void amdsbwd_event(void *arg, unsigned int cmd, int *error) { struct amdsbwd_softc *sc = arg; - unsigned int timeout; + uint64_t timeout; - /* convert from power-of-two-ns to WDT ticks */ - cmd &= WD_INTERVAL; - if (cmd < WD_TO_1SEC) - cmd = 0; - if (cmd) { - timeout = ((uint64_t)1 << (cmd - WD_TO_1MS)) / sc->ms_per_tick; + if (cmd != 0) { + timeout = 0; + cmd &= WD_INTERVAL; + if (cmd >= WD_TO_1MS) { + timeout = (uint64_t)1 << (cmd - WD_TO_1MS); + timeout = timeout / sc->ms_per_tick; + } + /* For a too short timeout use 1 tick. */ + if (timeout == 0) + timeout = 1; + /* For a too long timeout stop the timer. */ if (timeout > sc->max_ticks) - timeout = sc->max_ticks; - if (timeout != sc->timeout) { + timeout = 0; + } else { + timeout = 0; + } + + if (timeout != 0) { + if (timeout != sc->timeout) amdsbwd_tmr_set(sc, timeout); - if (!sc->active) - amdsbwd_tmr_enable(sc); - } + if (!sc->active) + amdsbwd_tmr_enable(sc); amdsbwd_tmr_reload(sc); *error = 0; } else { From owner-svn-src-all@freebsd.org Sun Feb 4 15:37:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C2D8EDC999; Sun, 4 Feb 2018 15:37:59 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AEB5784BD2; Sun, 4 Feb 2018 15:37:58 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A55CA1C01C; Sun, 4 Feb 2018 15:37:58 +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 w14FbwVW087525; Sun, 4 Feb 2018 15:37:58 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14Fbw6T087524; Sun, 4 Feb 2018 15:37:58 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201802041537.w14Fbw6T087524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 4 Feb 2018 15:37:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328850 - head/sys/dev/mpr X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/dev/mpr X-SVN-Commit-Revision: 328850 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Feb 2018 15:37:59 -0000 Author: jhibbits Date: Sun Feb 4 15:37:58 2018 New Revision: 328850 URL: https://svnweb.freebsd.org/changeset/base/328850 Log: Minimal changes for MPR to build on architectures with physical addresses larger than virtual Summary: Some architectures use large (36-bit) physical addresses, with smaller virtual addresses. Casting between vm_paddr_t (or bus_addr_t) and void * is considered illegal, so cast through uintptr_t. No functional change on existing platforms. Reviewed By: scottl Differential Revision: https://reviews.freebsd.org/D14042 Modified: head/sys/dev/mpr/mpr.c Modified: head/sys/dev/mpr/mpr.c ============================================================================== --- head/sys/dev/mpr/mpr.c Sun Feb 4 14:49:55 2018 (r328849) +++ head/sys/dev/mpr/mpr.c Sun Feb 4 15:37:58 2018 (r328850) @@ -2763,7 +2763,7 @@ mpr_build_nvme_prp(struct mpr_softc *sc, struct mpr_co prp_entry_phys = prp_page_phys; /* Get physical address and length of the data buffer. */ - paddr = (bus_addr_t)data; + paddr = (bus_addr_t)(uintptr_t)data; if (data_in_sz) length = data_in_sz; else @@ -2947,7 +2947,7 @@ mpr_check_pcie_native_sgl(struct mpr_softc *sc, struct else if ((buff_len > (PAGE_SIZE * 4)) && (buff_len <= (PAGE_SIZE * 5)) ) { - msg_phys = (uint64_t *)segs[0].ds_addr; + msg_phys = (uint64_t *)(uintptr_t)segs[0].ds_addr; first_page_offset = ((uint32_t)(uint64_t)(uintptr_t)msg_phys & page_mask); From owner-svn-src-all@freebsd.org Sun Feb 4 17:31:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 820A6EE33F2; Sun, 4 Feb 2018 17:31:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 33A3C69B6B; Sun, 4 Feb 2018 17:31:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E9301D2F3; Sun, 4 Feb 2018 17:31:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w14HVp0J045762; Sun, 4 Feb 2018 17:31:51 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14HVpel045761; Sun, 4 Feb 2018 17:31:51 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802041731.w14HVpel045761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 4 Feb 2018 17:31:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328853 - head/stand/efi/fdt X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/efi/fdt X-SVN-Commit-Revision: 328853 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Feb 2018 17:31:51 -0000 Author: kevans Date: Sun Feb 4 17:31:50 2018 New Revision: 328853 URL: https://svnweb.freebsd.org/changeset/base/328853 Log: Remove now-unused variable after r328809 Fixed already in stable/11 by r328836 (emaste); remove now-unused variable. Modified: head/stand/efi/fdt/efi_fdt.c Modified: head/stand/efi/fdt/efi_fdt.c ============================================================================== --- head/stand/efi/fdt/efi_fdt.c Sun Feb 4 15:40:48 2018 (r328852) +++ head/stand/efi/fdt/efi_fdt.c Sun Feb 4 17:31:50 2018 (r328853) @@ -44,7 +44,6 @@ int fdt_platform_load_dtb(void) { struct fdt_header *hdr; - const char *s; hdr = efi_get_table(&fdtdtb); if (hdr == NULL) From owner-svn-src-all@freebsd.org Sun Feb 4 17:38:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BE8CEE3A77; Sun, 4 Feb 2018 17:38:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 09B8C6A04D; Sun, 4 Feb 2018 17:38:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E04AA1D33B; Sun, 4 Feb 2018 17:38:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w14Hcj81047644; Sun, 4 Feb 2018 17:38:45 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14HcjmK047643; Sun, 4 Feb 2018 17:38:45 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802041738.w14HcjmK047643@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 4 Feb 2018 17:38:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328854 - stable/11 X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11 X-SVN-Commit-Revision: 328854 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Feb 2018 17:38:46 -0000 Author: kevans Date: Sun Feb 4 17:38:45 2018 New Revision: 328854 URL: https://svnweb.freebsd.org/changeset/base/328854 Log: Record svn:mergeinfo for r328853 r328853 was actually a forward-port of r328836 (emaste) from stable/11. Record mergeinfo so it doesn't pop back up during MFC efforts. Modified: Directory Properties: stable/11/ (props changed) From owner-svn-src-all@freebsd.org Sun Feb 4 18:08:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F24ADEE5C9D; Sun, 4 Feb 2018 18:08:31 +0000 (UTC) (envelope-from jason.harmening@gmail.com) Received: from mail-pg0-x22f.google.com (mail-pg0-x22f.google.com [IPv6:2607:f8b0:400e:c05::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 2888E6B2A5; Sun, 4 Feb 2018 18:08:31 +0000 (UTC) (envelope-from jason.harmening@gmail.com) Received: by mail-pg0-x22f.google.com with SMTP id g2so715439pgn.7; Sun, 04 Feb 2018 10:08:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=ib0BItbcjswz/FCRl2Fs+hK5UUVSsa2T/fzS9JQqvhI=; b=eTUChHaIXyXeoN0Y5WPuw4y3EOoBbROU/rvYQ3XY5QkNZ17MFEJHAKtRft6scIyguA gtQtUNZaMFxZ+kETtgEVtWzhRVxyFNCvTE5LbK+18sft9wwnBWlNsPuyl6wAkwcq4T2T 1kkSsvc22Qko5I76720xshq0KUJkM47blbRQE5mJSi1uaUs9MMgGGz9a/Rvh+gXdKA3b OJhfnW2fEB18ExfETmPfnRoYPAy846NXlRs1Qn4pBqQoSlSnwjCVdQYk1S2m2G6zd0KD RUE3b2O8oaczjSOynFgkITbmtm7oKIvepL9nm5V4MBQtU7w06g5G1JBRxLZ0XzrdOK1D 0cmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ib0BItbcjswz/FCRl2Fs+hK5UUVSsa2T/fzS9JQqvhI=; b=VLybhCLftCS7ZGG4pq0Cg6lwETXIETYKPku0QB/L3wpIWqZivq8svxPgsaAgEBBBcT 70DUK113RkfK835V9lf75uwZlHGAdv2ko4cRAKq6V7Jafyl/CFw9+0LaaxfKY+o6efTF h1x73z2NibHYzFJh0bbck625clNwtrx+xNlxl2sc2JzRhERbID+2ol7m54LI3D/sNy08 PjUbA4LD1yHwJaN2vo7TeM7GhUA+Ml+/6MmDj2UNBOiVepIK7oORblzZl63E7d6Peb8n dKUuCeWOqTPNbcdRTVNJlZkvfGvjQ/TbhAiHgAliZOuggOFXYn7mSXili82J5FAmhM28 OJzg== X-Gm-Message-State: AKwxytfnD5uJFjeyD8ypLKxwF4y3N+w1s2hJDj40rm4KaxFHugmTwLWg VfnMnw/pHjd2ysEZZh26q23A X-Google-Smtp-Source: AH8x227KlzeUzsAAhR2fPlXEjL9sbQ7G0FL9BytSVJgKo1lFYG6NFEE6V7Ak/PPPH4Wh283IPGU/5w== X-Received: by 10.99.55.65 with SMTP id g1mr27810546pgn.284.1517767709805; Sun, 04 Feb 2018 10:08:29 -0800 (PST) Received: from [192.168.1.3] (c-67-188-30-11.hsd1.ca.comcast.net. [67.188.30.11]) by smtp.googlemail.com with ESMTPSA id z19sm14583896pff.3.2018.02.04.10.08.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 04 Feb 2018 10:08:29 -0800 (PST) Subject: Re: svn commit: r328489 - head/sys/conf To: "O. Hartmann" , David Wolfskill Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201801272013.w0RKDaMU098200@repo.freebsd.org> <20180127214755.3c59661e@thor.intern.walstatt.dynvpn.de> <98501f75-1a1b-9221-c52d-24415230a886@gmail.com> <20180129130022.GT1125@albert.catwhisker.org> <20180204133337.3d03f01d@thor.intern.walstatt.dynvpn.de> From: Jason Harmening Message-ID: Date: Sun, 4 Feb 2018 10:22:31 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20180204133337.3d03f01d@thor.intern.walstatt.dynvpn.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Feb 2018 18:08:32 -0000 On 02/04/18 04:33, O. Hartmann wrote: > Am Mon, 29 Jan 2018 05:00:22 -0800 > David Wolfskill schrieb: > >> On Mon, Jan 29, 2018 at 02:10:04AM -0800, Jason Harmening wrote: >>>> >>>> This happens now if PORTS_MODULE=x11/nvidia-driver is defined in /etc/src.conf: >>>> >>>> [...] >>>> --- kernel-install --- >>>> mkdir -p /boot/kernel >>>> install -p -m 555 -o root -g wheel kernel /boot/kernel/ >>>> --- ports-install --- >>>> Variable OBJTOP is recursive. >>>> >>>> make[8]: stopped >>> ... >>> >>> David sent me logs of the failing case; thanks David! >> >> Happy to help! :-) >> >>> The failure happens when buildkernel and installkernel are run >>> separately instead of all-up, e.g. 'make kernel'. The installkernel >>> step is leaving MK_AUTO_OBJ=no in the env passed to the port build. It >>> looks like at least one of the install stages of nvidia-driver needs to >>> generate temporary output, which leads to confusion when the port isn't >>> built as though it's an in-tree component. >>> >>> Can you guys try out the attached patch? >> >> I tried it both on my build machine (which does not use kernel modules >> from ports, and thus did not exhibit the problem -- but I thought that >> verifying that the patch did not break that case worth checking) and on >> my laptop (which did exhibit the problem). >> >> It worked in both cases with no issues for me. >> >> Thanks! :-) >> >> Peace, >> david > > The problem still persists! > > I'm on CURRENT, FreeBSD 12.0-CURRENT #32: Sun Feb 4 09:41:39 CET 2018 amd64, the source > tree is at revision 328839. > > > I use WITH_META_MODE=YES in /etc/src.conf. My /etc/make.conf consists of a .include > statement which reels in /usr/local/etc/ports.conf in which I define everything outside > the source tree for ports (in case of the nvidia driver, its DISTVERSION). This worked > before and should work again. Today I checked out a completely fresh /usr/src and gleanced > the /usr/obj folder and rebuilt the system - and get the error again: > > [...] > ===> Ports module x11/nvidia-driver (install) > cd ${PORTSDIR:-/usr/ports}/x11/nvidia-driver; env -u CC -u CXX -u CPP -u MAKESYSPATH > MAKEFLAGS="-j 4 -J 15,16 .MAKE.LEVEL.ENV=MAKELEVEL KERNEL=kernel MK_AUTO_OBJ=no ^^^^^ Looks like you haven't applied the patch? MK_AUTO_OBJ being left set in MAKEFLAGS by installkernel was part of the problem. That said, the fix I have up for review is slightly different: https://reviews.freebsd.org/D14143 > TARGET=amd64 TARGET_ARCH=amd64" SYSDIR=/usr/src/sys > PATH=/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/sbin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/bin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/bin:/usr/obj/usr/src/amd64.amd64/tmp/usr/sbin:/usr/obj/usr/src/amd64.amd64/tmp/usr/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin > SRC_BASE=/usr/src OSVERSION=1200056 WRKDIRPREFIX=/usr/obj/usr/src/amd64.amd64/sys/THOR > make -B deinstall reinstall ===> Deinstalling for nvidia-driver ===> Deinstalling > nvidia-driver-387.34 Updating database digests format: . done Checking integrity... done > (0 conflicting) Deinstallation has been requested for the following 1 packages (of 0 > packages in the universe): > > Installed packages to be REMOVED: > nvidia-driver-387.34 > > Number of packages to be removed: 1 > > The operation will free 99 MiB. > [1/1] Deinstalling nvidia-driver-387.34... > [1/1] Deleting files for nvidia-driver-387.34: .......... done > ===> Staging for nvidia-driver-387.34 > ===> nvidia-driver-387.34 depends on file: /usr/local/lib/libGL.so - found > ===> nvidia-driver-387.34 depends on file: /usr/local/libdata/pkgconfig/x11.pc - found > ===> nvidia-driver-387.34 depends on file: /usr/local/libdata/pkgconfig/xorg-server.pc > - found ===> nvidia-driver-387.34 depends on file: /usr/local/libdata/pkgconfig/xext.pc > - found ===> Generating temporary packing list > ===> src (install) > ===> src/nvidia (install) > Variable OBJTOP is recursive. > > make[8]: stopped > in /usr/obj/usr/src/amd64.amd64/sys/DUMMBOX/usr/ports/x11/nvidia-driver/work/NVIDIA-FreeBSD-x86_64-387.34/src/nvidia > *** Error code 2 > > > > Oliver > From owner-svn-src-all@freebsd.org Sun Feb 4 18:36:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D530EE7C55; Sun, 4 Feb 2018 18:36:25 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D2C026C4DE; Sun, 4 Feb 2018 18:36:24 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C8D931DCCB; Sun, 4 Feb 2018 18:36:24 +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 w14IaOZM077093; Sun, 4 Feb 2018 18:36:24 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14IaOEh077092; Sun, 4 Feb 2018 18:36:24 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201802041836.w14IaOEh077092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 4 Feb 2018 18:36:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328855 - head/libexec/getty X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/libexec/getty X-SVN-Commit-Revision: 328855 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Feb 2018 18:36:25 -0000 Author: trasz Date: Sun Feb 4 18:36:24 2018 New Revision: 328855 URL: https://svnweb.freebsd.org/changeset/base/328855 Log: Don't cast away the const, it's not been needed since r92925. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/libexec/getty/subr.c Modified: head/libexec/getty/subr.c ============================================================================== --- head/libexec/getty/subr.c Sun Feb 4 17:38:45 2018 (r328854) +++ head/libexec/getty/subr.c Sun Feb 4 18:36:24 2018 (r328855) @@ -101,7 +101,7 @@ gettable(const char *name, char *buf) firsttime = 0; } - switch (cgetent(&buf, (char **)dba, (char *)name)) { + switch (cgetent(&buf, (char **)dba, name)) { case 1: msg = "%s: couldn't resolve 'tc=' in gettytab '%s'"; case 0: @@ -126,7 +126,7 @@ gettable(const char *name, char *buf) } for (sp = gettystrs; sp->field; sp++) { - if ((l = cgetstr(buf, (char*)sp->field, &p)) >= 0) { + if ((l = cgetstr(buf, sp->field, &p)) >= 0) { if (sp->value) { /* prefer existing value */ if (strcmp(p, sp->value) != 0) @@ -144,7 +144,7 @@ gettable(const char *name, char *buf) } for (np = gettynums; np->field; np++) { - if (cgetnum(buf, (char*)np->field, &n) == -1) + if (cgetnum(buf, np->field, &n) == -1) np->set = 0; else { np->set = 1; @@ -153,7 +153,7 @@ gettable(const char *name, char *buf) } for (fp = gettyflags; fp->field; fp++) { - if (cgetcap(buf, (char *)fp->field, ':') == NULL) + if (cgetcap(buf, fp->field, ':') == NULL) fp->set = 0; else { fp->set = 1; From owner-svn-src-all@freebsd.org Sun Feb 4 18:39:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52F5BEE808C; Sun, 4 Feb 2018 18:39:59 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 04B066C812; Sun, 4 Feb 2018 18:39:59 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F39D91DCCE; Sun, 4 Feb 2018 18:39:58 +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 w14Idwvo077381; Sun, 4 Feb 2018 18:39:58 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14IdwP0077380; Sun, 4 Feb 2018 18:39:58 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201802041839.w14IdwP0077380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 4 Feb 2018 18:39:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328856 - head/libexec/getty X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/libexec/getty X-SVN-Commit-Revision: 328856 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Feb 2018 18:39:59 -0000 Author: trasz Date: Sun Feb 4 18:39:58 2018 New Revision: 328856 URL: https://svnweb.freebsd.org/changeset/base/328856 Log: Rename getty's getline() to get_line(), to avoid clash with getline(3). Obtained from: DragonFlyBSD MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/libexec/getty/main.c Modified: head/libexec/getty/main.c ============================================================================== --- head/libexec/getty/main.c Sun Feb 4 18:36:24 2018 (r328855) +++ head/libexec/getty/main.c Sun Feb 4 18:39:58 2018 (r328856) @@ -146,7 +146,7 @@ static void putf(const char *); static void putpad(const char *); static void puts(const char *); static void timeoverrun(int); -static char *getline(int); +static char *get_line(int); static void setttymode(int); static int opentty(const char *, int); @@ -318,7 +318,7 @@ main(int argc, char *argv[]) if ((fd = open(IF, O_RDONLY)) != -1) { char * cp; - while ((cp = getline(fd)) != NULL) { + while ((cp = get_line(fd)) != NULL) { putf(cp); } close(fd); @@ -707,7 +707,7 @@ prompt(void) static char * -getline(int fd) +get_line(int fd) { int i = 0; static char linebuf[512]; From owner-svn-src-all@freebsd.org Sun Feb 4 18:40:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27D30EE819D; Sun, 4 Feb 2018 18:40:37 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA6526C949; Sun, 4 Feb 2018 18:40:36 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C551D1DCD6; Sun, 4 Feb 2018 18:40:36 +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 w14Iea81077477; Sun, 4 Feb 2018 18:40:36 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14Ieavh077476; Sun, 4 Feb 2018 18:40:36 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201802041840.w14Ieavh077476@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 4 Feb 2018 18:40:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328857 - head/libexec/getty X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/libexec/getty X-SVN-Commit-Revision: 328857 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Feb 2018 18:40:37 -0000 Author: trasz Date: Sun Feb 4 18:40:36 2018 New Revision: 328857 URL: https://svnweb.freebsd.org/changeset/base/328857 Log: Add missing initializer. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/libexec/getty/subr.c Modified: head/libexec/getty/subr.c ============================================================================== --- head/libexec/getty/subr.c Sun Feb 4 18:39:58 2018 (r328856) +++ head/libexec/getty/subr.c Sun Feb 4 18:40:36 2018 (r328857) @@ -539,7 +539,7 @@ static struct speedtab { { 57600, B57600 }, { 115200, B115200 }, { 230400, B230400 }, - { 0 } + { 0, 0 } }; int From owner-svn-src-all@freebsd.org Sun Feb 4 19:05:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0CDBEE9BD7; Sun, 4 Feb 2018 19:05:14 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 727196D981; Sun, 4 Feb 2018 19:05: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D4781E1B9; Sun, 4 Feb 2018 19:05: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 w14J5ESc092674; Sun, 4 Feb 2018 19:05:14 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14J5Eoe092670; Sun, 4 Feb 2018 19:05:14 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201802041905.w14J5Eoe092670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 4 Feb 2018 19:05:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328858 - head/libexec/getty X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/libexec/getty X-SVN-Commit-Revision: 328858 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Feb 2018 19:05:15 -0000 Author: trasz Date: Sun Feb 4 19:05:13 2018 New Revision: 328858 URL: https://svnweb.freebsd.org/changeset/base/328858 Log: Sprinkle static; avoid nested externs. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/libexec/getty/extern.h head/libexec/getty/main.c head/libexec/getty/subr.c Modified: head/libexec/getty/extern.h ============================================================================== --- head/libexec/getty/extern.h Sun Feb 4 18:40:36 2018 (r328857) +++ head/libexec/getty/extern.h Sun Feb 4 19:05:13 2018 (r328858) @@ -35,6 +35,8 @@ struct delayval; struct termios; +extern char **environ; +extern char editedhost[]; extern char hostname[]; extern struct termios tmode, omode; extern struct gettyflags gettyflags[]; Modified: head/libexec/getty/main.c ============================================================================== --- head/libexec/getty/main.c Sun Feb 4 18:40:36 2018 (r328857) +++ head/libexec/getty/main.c Sun Feb 4 19:05:13 2018 (r328858) @@ -93,23 +93,23 @@ struct termios omode; /* current mode */ struct termios tmode; -int crmod, digit, lower, upper; +static int crmod, digit, lower, upper; char hostname[MAXHOSTNAMELEN]; -char name[MAXLOGNAME*3]; -char dev[] = _PATH_DEV; -char ttyn[32]; +static char name[MAXLOGNAME*3]; +static char dev[] = _PATH_DEV; +static char ttyn[32]; #define OBUFSIZ 128 #define TABBUFSIZ 512 -char defent[TABBUFSIZ]; -char tabent[TABBUFSIZ]; -const char *tname; +static char defent[TABBUFSIZ]; +static char tabent[TABBUFSIZ]; +static const char *tname; -char *env[128]; +static char *env[128]; -char partab[] = { +static char partab[] = { 0001,0201,0201,0001,0201,0001,0001,0201, 0202,0004,0003,0205,0005,0206,0201,0001, 0201,0001,0001,0201,0001,0201,0201,0001, @@ -150,7 +150,7 @@ static char *get_line(int); static void setttymode(int); static int opentty(const char *, int); -jmp_buf timeout; +static jmp_buf timeout; static void dingdong(int signo __unused) @@ -159,7 +159,7 @@ dingdong(int signo __unused) longjmp(timeout, 1); } -jmp_buf intrupt; +static jmp_buf intrupt; static void interrupt(int signo __unused) @@ -181,7 +181,6 @@ timeoverrun(int signo __unused) int main(int argc, char *argv[]) { - extern char **environ; int first_sleep = 1, first_time = 1; struct rlimit limit; int rval; @@ -666,8 +665,8 @@ puts(const char *s) putchr(*s++); } -char outbuf[OBUFSIZ]; -int obufcnt = 0; +static char outbuf[OBUFSIZ]; +static int obufcnt = 0; static void putchr(int cc) @@ -733,7 +732,6 @@ get_line(int fd) static void putf(const char *cp) { - extern char editedhost[]; time_t t; char *slash, db[100]; Modified: head/libexec/getty/subr.c ============================================================================== --- head/libexec/getty/subr.c Sun Feb 4 18:40:36 2018 (r328857) +++ head/libexec/getty/subr.c Sun Feb 4 19:05:13 2018 (r328858) @@ -588,7 +588,7 @@ makeenv(char *env[]) * baud rate. This string indicates the user's actual speed. * The routine below returns the terminal type mapped from derived speed. */ -struct portselect { +static struct portselect { const char *ps_baud; const char *ps_type; } portspeeds[] = { From owner-svn-src-all@freebsd.org Sun Feb 4 19:12:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E09DAEEA309; Sun, 4 Feb 2018 19:12:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 979F06DE77; Sun, 4 Feb 2018 19:12:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 70B341E356; Sun, 4 Feb 2018 19:12:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w14JC3HP096641; Sun, 4 Feb 2018 19:12:03 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14JC3Ls096640; Sun, 4 Feb 2018 19:12:03 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802041912.w14JC3Ls096640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 4 Feb 2018 19:12:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328859 - stable/11 X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11 X-SVN-Commit-Revision: 328859 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Feb 2018 19:12:04 -0000 Author: kevans Date: Sun Feb 4 19:12:03 2018 New Revision: 328859 URL: https://svnweb.freebsd.org/changeset/base/328859 Log: Record svn:mergeinfo from r326934 r326934 effectively MFC'd r326752 and r326754 with a direct commit to stable/11 due to path restructuring in HEAD. Modified: Directory Properties: stable/11/ (props changed) From owner-svn-src-all@freebsd.org Sun Feb 4 19:43:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97E67EEC570; Sun, 4 Feb 2018 19:43:52 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 491486F19D; Sun, 4 Feb 2018 19:43:52 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 435591E862; Sun, 4 Feb 2018 19:43:52 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w14JhqME012465; Sun, 4 Feb 2018 19:43:52 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14JhqR4012464; Sun, 4 Feb 2018 19:43:52 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201802041943.w14JhqR4012464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Sun, 4 Feb 2018 19:43:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328861 - head/contrib/blacklist/libexec X-SVN-Group: head X-SVN-Commit-Author: lidl X-SVN-Commit-Paths: head/contrib/blacklist/libexec X-SVN-Commit-Revision: 328861 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Feb 2018 19:43:52 -0000 Author: lidl Date: Sun Feb 4 19:43:51 2018 New Revision: 328861 URL: https://svnweb.freebsd.org/changeset/base/328861 Log: Update blacklist-helper to not emit messages from pf during operation. Use 'pfctl -k' when blocking a site to kill active tcp connections from the blocked address. Fix 'purge' operation for pf, which must dynamically determine which filters have been created, so the filters can be flushed by name. MFC after: 2 weeks Modified: head/contrib/blacklist/libexec/blacklistd-helper Modified: head/contrib/blacklist/libexec/blacklistd-helper ============================================================================== --- head/contrib/blacklist/libexec/blacklistd-helper Sun Feb 4 19:14:09 2018 (r328860) +++ head/contrib/blacklist/libexec/blacklistd-helper Sun Feb 4 19:43:51 2018 (r328861) @@ -80,8 +80,8 @@ add) echo "block in quick $proto from to any $port" | \ /sbin/pfctl -a "$2/$6" -f - # insert $ip/$mask into per-protocol/port anchored table - /sbin/pfctl -a "$2/$6" -t "port$6" -T add "$addr/$mask" && \ - echo OK + /sbin/pfctl -qa "$2/$6" -t "port$6" -T add "$addr/$mask" && \ + /sbin/pfctl -q -k $addr && echo OK ;; esac ;; @@ -101,7 +101,7 @@ rem) /sbin/npfctl rule "$2" rem-id "$7" ;; pf) - /sbin/pfctl -a "$2/$6" -t "port$6" -T delete "$addr/$mask" && \ + /sbin/pfctl -qa "$2/$6" -t "port$6" -T delete "$addr/$mask" && \ echo OK ;; esac @@ -118,7 +118,13 @@ flush) /sbin/npfctl rule "$2" flush ;; pf) - /sbin/pfctl -a "$2/$6" -t "port$6" -T flush && echo OK + # dynamically determine which anchors exist + anchors=$(/sbin/pfctl -a $2 -s Anchors) + for anchor in $anchors; do + /sbin/pfctl -a $anchor -t "port${anchor##*/}" -T flush + /sbin/pfctl -a $anchor -F rules + done + echo OK ;; esac ;; From owner-svn-src-all@freebsd.org Sun Feb 4 20:07:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84060EEDD70; Sun, 4 Feb 2018 20:07:09 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 31FE66FF97; Sun, 4 Feb 2018 20:07:09 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2CEED1EBAF; Sun, 4 Feb 2018 20:07:09 +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 w14K79XF022676; Sun, 4 Feb 2018 20:07:09 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14K79aQ022675; Sun, 4 Feb 2018 20:07:09 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201802042007.w14K79aQ022675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 4 Feb 2018 20:07:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328862 - head/sys/powerpc/mpc85xx X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/mpc85xx X-SVN-Commit-Revision: 328862 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Feb 2018 20:07:09 -0000 Author: jhibbits Date: Sun Feb 4 20:07:08 2018 New Revision: 328862 URL: https://svnweb.freebsd.org/changeset/base/328862 Log: Only look for L2 cache controllers for mpc85xx_cache The L3 cache controller (Corenet Platform Cache) is listed with one of its compatible strings as "cache", which this driver can't attach to. Restrict to a known list of primary cache controller strings, as found in the l2cache devicetree binding. Modified: head/sys/powerpc/mpc85xx/mpc85xx_cache.c Modified: head/sys/powerpc/mpc85xx/mpc85xx_cache.c ============================================================================== --- head/sys/powerpc/mpc85xx/mpc85xx_cache.c Sun Feb 4 19:43:51 2018 (r328861) +++ head/sys/powerpc/mpc85xx/mpc85xx_cache.c Sun Feb 4 20:07:08 2018 (r328862) @@ -56,11 +56,53 @@ struct mpc85xx_cache_softc { struct resource *sc_mem; }; +static struct ofw_compat_data compats[] = { + {"fsl,8540-l2-cache-controller", 1}, + {"fsl,8541-l2-cache-controller", 1}, + {"fsl,8544-l2-cache-controller", 1}, + {"fsl,8548-l2-cache-controller", 1}, + {"fsl,8555-l2-cache-controller", 1}, + {"fsl,8568-l2-cache-controller", 1}, + {"fsl,b4420-l2-cache-controller", 1}, + {"fsl,b4860-l2-cache-controller", 1}, + {"fsl,bsc9131-l2-cache-controller", 1}, + {"fsl,bsc9132-l2-cache-controller", 1}, + {"fsl,c293-l2-cache-controller", 1}, + {"fsl,mpc8536-l2-cache-controller", 1}, + {"fsl,mpc8540-l2-cache-controller", 1}, + {"fsl,mpc8541-l2-cache-controller", 1}, + {"fsl,mpc8544-l2-cache-controller", 1}, + {"fsl,mpc8548-l2-cache-controller", 1}, + {"fsl,mpc8555-l2-cache-controller", 1}, + {"fsl,mpc8560-l2-cache-controller", 1}, + {"fsl,mpc8568-l2-cache-controller", 1}, + {"fsl,mpc8569-l2-cache-controller", 1}, + {"fsl,mpc8572-l2-cache-controller", 1}, + {"fsl,p1010-l2-cache-controller", 1}, + {"fsl,p1011-l2-cache-controller", 1}, + {"fsl,p1012-l2-cache-controller", 1}, + {"fsl,p1013-l2-cache-controller", 1}, + {"fsl,p1014-l2-cache-controller", 1}, + {"fsl,p1015-l2-cache-controller", 1}, + {"fsl,p1016-l2-cache-controller", 1}, + {"fsl,p1020-l2-cache-controller", 1}, + {"fsl,p1021-l2-cache-controller", 1}, + {"fsl,p1022-l2-cache-controller", 1}, + {"fsl,p1023-l2-cache-controller", 1}, + {"fsl,p1024-l2-cache-controller", 1}, + {"fsl,p1025-l2-cache-controller", 1}, + {"fsl,p2010-l2-cache-controller", 1}, + {"fsl,p2020-l2-cache-controller", 1}, + {"fsl,t2080-l2-cache-controller", 1}, + {"fsl,t4240-l2-cache-controller", 1}, + {0, 0} +}; + static int mpc85xx_cache_probe(device_t dev) { - if (!ofw_bus_is_compatible(dev, "cache")) + if (ofw_bus_search_compatible(dev, compats)->ocd_str == NULL) return (ENXIO); device_set_desc(dev, "MPC85xx L2 cache"); From owner-svn-src-all@freebsd.org Sun Feb 4 20:33:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61AD3EEF8CC; Sun, 4 Feb 2018 20:33:48 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 04A1570F5D; Sun, 4 Feb 2018 20:33:48 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3AAE1F095; Sun, 4 Feb 2018 20:33:47 +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 w14KXlqC037144; Sun, 4 Feb 2018 20:33:47 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14KXlbe037143; Sun, 4 Feb 2018 20:33:47 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201802042033.w14KXlbe037143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 4 Feb 2018 20:33:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328863 - head/lib/clang X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/lib/clang X-SVN-Commit-Revision: 328863 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Feb 2018 20:33:48 -0000 Author: dim Date: Sun Feb 4 20:33:47 2018 New Revision: 328863 URL: https://svnweb.freebsd.org/changeset/base/328863 Log: Bump clang's __FreeBSD_cc_version, to cope with r328816, which removed -Wno-error=tautological-constant-compare again (this flag is now out of -Wextra after upstream https://reviews.llvm.org/rL322901). Otherwise the MK_SYSTEM_COMPILER logic will not build a cross-tools compiler. Reported by: jpaetzel, tuexen, Stefan Hagen Modified: head/lib/clang/freebsd_cc_version.h Modified: head/lib/clang/freebsd_cc_version.h ============================================================================== --- head/lib/clang/freebsd_cc_version.h Sun Feb 4 20:07:08 2018 (r328862) +++ head/lib/clang/freebsd_cc_version.h Sun Feb 4 20:33:47 2018 (r328863) @@ -1,3 +1,3 @@ /* $FreeBSD$ */ -#define FREEBSD_CC_VERSION 1200009 +#define FREEBSD_CC_VERSION 1200010 From owner-svn-src-all@freebsd.org Sun Feb 4 20:53:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65064EF0F95; Sun, 4 Feb 2018 20:53:15 +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 DB9B971DC4; Sun, 4 Feb 2018 20:53:14 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 6D8C1D6CBA5; Mon, 5 Feb 2018 07:53:05 +1100 (AEDT) Date: Mon, 5 Feb 2018 07:53:03 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: Conrad Meyer , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327495 - head/usr.sbin/rpcbind In-Reply-To: <20180204103334.GC9536@kib.kiev.ua> Message-ID: <20180205064120.K996@besplex.bde.org> References: <201801021725.w02HPDaj068477@repo.freebsd.org> <20180203232725.U1389@besplex.bde.org> <20180204150751.V909@besplex.bde.org> <20180204103334.GC9536@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=DIX/22Fb c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=vm9bT6jSjgWHGVm1leUA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Feb 2018 20:53:15 -0000 On Sun, 4 Feb 2018, Konstantin Belousov wrote: > On Sun, Feb 04, 2018 at 04:15:16PM +1100, Bruce Evans wrote: >> sig_atomic_t is no better than plain int. This behaviour now makes complete >> sense. It is just like the undefined behaviour with the ctype functions, >> except since we own terminate_wfd we can guarantee that it doesn't change >> while the handler is active (and is valid when the handler is entered). >> We could also use atomic ops. However, the C standard doesn't require >> anything that we do to work (except maybe in C11, atomic ops might be >> explicitly or implicitly specifed to work for things like this). > > Atomics are atomic WRT the signal handlers as well, the usual guarantees > of no torn writes and no out of air values on read hold. Since FreeBSD > memory model, as documented in atomic(9), claims that naturally aligned > machine-native integer types are atomic without special declarations on > access, all guarantees for the handler accesses are already provided. C11's precise wording is: [for async signals] the behavior is undefined if the signal handler refers to any object with static or thread storage duration that is not a lock-free atomic object other than by assigning a value to an object declared as volatile sig_atomic_t i.e., the same as in C99 except the behaviour is not specifically undefined for accesses to lock-free atomic objects. Do we document atomics in userland? C11 atomics are too hard for me. "lock-free atomic object" is a technical term and I don't know of any userland documentation that associates this term with naive ideas of atomics. atomic(9) doesn't mention this either. > C11 also has a tool to ensure weaker than usual consistency guarantee, > only between the thread and a signal handler executing in the context of > the thread. I do not see it useful in the discussed case. Is that just a check for the case if !async signals (ones that are the result of raise() and abort()?). Bruce From owner-svn-src-all@freebsd.org Sun Feb 4 21:02:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF8DDEC1C0F; Sun, 4 Feb 2018 21:02:15 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 772CB724BC; Sun, 4 Feb 2018 21:02:15 +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 w14L27LZ022191 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 4 Feb 2018 23:02:10 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w14L27LZ022191 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w14L27Pv022190; Sun, 4 Feb 2018 23:02:07 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 4 Feb 2018 23:02:07 +0200 From: Konstantin Belousov To: Bruce Evans Cc: Conrad Meyer , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327495 - head/usr.sbin/rpcbind Message-ID: <20180204210207.GF9536@kib.kiev.ua> References: <201801021725.w02HPDaj068477@repo.freebsd.org> <20180203232725.U1389@besplex.bde.org> <20180204150751.V909@besplex.bde.org> <20180204103334.GC9536@kib.kiev.ua> <20180205064120.K996@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180205064120.K996@besplex.bde.org> User-Agent: Mutt/1.9.3 (2018-01-21) 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.25 Precedence: list List-Id: "SVN commit messages 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, 04 Feb 2018 21:02:16 -0000 On Mon, Feb 05, 2018 at 07:53:03AM +1100, Bruce Evans wrote: > On Sun, 4 Feb 2018, Konstantin Belousov wrote: > > > On Sun, Feb 04, 2018 at 04:15:16PM +1100, Bruce Evans wrote: > >> sig_atomic_t is no better than plain int. This behaviour now makes complete > >> sense. It is just like the undefined behaviour with the ctype functions, > >> except since we own terminate_wfd we can guarantee that it doesn't change > >> while the handler is active (and is valid when the handler is entered). > >> We could also use atomic ops. However, the C standard doesn't require > >> anything that we do to work (except maybe in C11, atomic ops might be > >> explicitly or implicitly specifed to work for things like this). > > > > Atomics are atomic WRT the signal handlers as well, the usual guarantees > > of no torn writes and no out of air values on read hold. Since FreeBSD > > memory model, as documented in atomic(9), claims that naturally aligned > > machine-native integer types are atomic without special declarations on > > access, all guarantees for the handler accesses are already provided. > > C11's precise wording is: > > [for async signals] the behavior is undefined if the signal handler > refers to any object with static or thread storage duration that > is not a lock-free atomic object other than by assigning a value > to an object declared as volatile sig_atomic_t > > i.e., the same as in C99 except the behaviour is not specifically undefined > for accesses to lock-free atomic objects. > > Do we document atomics in userland? C11 atomics are too hard for me. > "lock-free atomic object" is a technical term and I don't know of any > userland documentation that associates this term with naive ideas of > atomics. atomic(9) doesn't mention this either. C11 atomics are not exactly same as FreeBSD atomics, and they are implemented by different API. Our atomic(9) API works same in kernel and in userland. A (C11) lock-free atomic is the object for which the atomic_is_lock_free() returns true. > > > C11 also has a tool to ensure weaker than usual consistency guarantee, > > only between the thread and a signal handler executing in the context of > > the thread. I do not see it useful in the discussed case. > > Is that just a check for the case if !async signals (ones that are the > result of raise() and abort()?). Probably it was too obscure. I mean atomic_signal_fence(). From owner-svn-src-all@freebsd.org Sun Feb 4 23:01:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DED23ED9698; Sun, 4 Feb 2018 23:01:48 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 95A1F76578; Sun, 4 Feb 2018 23:01:48 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 90869207AB; Sun, 4 Feb 2018 23:01:48 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w14N1mDw011856; Sun, 4 Feb 2018 23:01:48 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14N1mj9011855; Sun, 4 Feb 2018 23:01:48 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201802042301.w14N1mj9011855@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 4 Feb 2018 23:01:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328864 - head/sys/dev/atkbdc X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/atkbdc X-SVN-Commit-Revision: 328864 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 04 Feb 2018 23:01:49 -0000 Author: wulf Date: Sun Feb 4 23:01:48 2018 New Revision: 328864 URL: https://svnweb.freebsd.org/changeset/base/328864 Log: psm(4): Fix panic occuring soon after PS/2 packet has been rejected by synaptics or elantech sanity checker. After packet has been rejected contents of packet buffer is not cleared with setting of inputbytes counter to 0. So when this packet buffer is filled again being an element of circular queue, new data appends to old data rather than overwrites it. This leads to packet buffer overflow after 10 rounds. Fix it with setting of packet's inputbytes counter to 0 after rejection. While here add extra logging of rejected packets. PR: 222667 (for reference) Reported by: Neel Chauhan Tested by: Neel Chauhan MFC after: 1 week Modified: head/sys/dev/atkbdc/psm.c Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Sun Feb 4 20:33:47 2018 (r328863) +++ head/sys/dev/atkbdc/psm.c Sun Feb 4 23:01:48 2018 (r328864) @@ -4935,13 +4935,19 @@ psmsoftintr(void *arg) break; case MOUSE_MODEL_SYNAPTICS: - if (proc_synaptics(sc, pb, &ms, &x, &y, &z) != 0) + if (proc_synaptics(sc, pb, &ms, &x, &y, &z) != 0) { + VLOG(3, (LOG_DEBUG, "synaptics: " + "packet rejected\n")); goto next; + } break; case MOUSE_MODEL_ELANTECH: - if (proc_elantech(sc, pb, &ms, &x, &y, &z) != 0) + if (proc_elantech(sc, pb, &ms, &x, &y, &z) != 0) { + VLOG(3, (LOG_DEBUG, "elantech: " + "packet rejected\n")); goto next; + } break; case MOUSE_MODEL_TRACKPOINT: @@ -5037,9 +5043,9 @@ next_native: sizeof(sc->queue.buf); sc->queue.count += pb->inputbytes; } - pb->inputbytes = 0; next: + pb->inputbytes = 0; if (++sc->pqueue_start >= PSM_PACKETQUEUE) sc->pqueue_start = 0; } while (sc->pqueue_start != sc->pqueue_end); From owner-svn-src-all@freebsd.org Mon Feb 5 00:18:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 888B8EDF3D0; Mon, 5 Feb 2018 00:18:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3AEE579160; Mon, 5 Feb 2018 00:18:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3127821416; Mon, 5 Feb 2018 00:18:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w150IMwv047655; Mon, 5 Feb 2018 00:18:22 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w150ILoi047653; Mon, 5 Feb 2018 00:18:21 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201802050018.w150ILoi047653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Mon, 5 Feb 2018 00:18:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328865 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 328865 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 00:18:22 -0000 Author: marius Date: Mon Feb 5 00:18:21 2018 New Revision: 328865 URL: https://svnweb.freebsd.org/changeset/base/328865 Log: Flesh out the creation of sparc64 UFS images. This has only been verified to yield working images in a native build as rootgen.sh generally doesn't support cross-testing so far. Modified: head/tools/boot/install-boot.sh head/tools/boot/rootgen.sh Modified: head/tools/boot/install-boot.sh ============================================================================== --- head/tools/boot/install-boot.sh Sun Feb 4 23:01:48 2018 (r328864) +++ head/tools/boot/install-boot.sh Mon Feb 5 00:18:21 2018 (r328865) @@ -78,12 +78,22 @@ boot_nogeli_mbr_ufs_legacy() { doit gpart bootcode -b ${mbr0} ${dev} s=$(findpart $dev "freebsd-ufs") if [ -z "$s" ] ; then - die "No freebsd-zfs slice found" + die "No freebsd-ufs slice found" fi doit gpart bootcode -p ${mbr2} ${dev}s${s} exit 0 } +boot_nogeli_vtoc8_ufs_ofw() { + dev=$1 + dst=$2 + + # For non-native builds, ensure that geom_part(4) supports VTOC8. + kldload geom_part_vtoc8.ko + doit gpart bootcode -p ${vtoc8} ${dev} + exit 0 +} + DESTDIR=/ # Note: we really don't support geli boot in this script yet. @@ -127,6 +137,9 @@ gptzfs2=${DESTDIR}/boot/gptzfsboot # For MBR, we have lots of choices, but select boot0 mbr0=${DESTDIR}/boot/boot0 mbr2=${DESTDIR}/boot/boot + +# VTOC8 +vtoc8=${DESTDIR}/boot/boot1 # sanity check here Modified: head/tools/boot/rootgen.sh ============================================================================== --- head/tools/boot/rootgen.sh Sun Feb 4 23:01:48 2018 (r328864) +++ head/tools/boot/rootgen.sh Mon Feb 5 00:18:21 2018 (r328865) @@ -193,6 +193,29 @@ mk_geli_mbr_zfs_both() { # u-boot # powerpc +mk_sparc64_nogeli_vtoc8_ufs_ofw() { + src=$1 + img=$2 + mntpt=$3 + geli=$4 + scheme=$5 + fs=$6 + bios=$7 + + cat > ${src}/etc/fstab < ${DESTDIR}/boot.config # XXX @@ -396,18 +420,21 @@ for arch in powerpc powerpc64; do done for arch in sparc64; do - for scheme in sun; do - fs=ufs - for bios in ofw; do - # Create sparse file and mount newly created filesystem(s) on it - img=${IMGDIR}/${arch}-${geli}-${scheme}-${fs}-${bios}.img - sh=${IMGDIR}/${arch}-${geli}-${scheme}-${fs}-${bios}.sh - echo "vvvvvvvvvvvvvvvvvvvvvv Creating $img vvvvvvvvvvvvvvvvvvvvvvv" - rm -f ${img}* - eval mk_${geli}_${scheme}_${fs}_${bios} ${DESTDIR} ${img} ${MNTPT} ${geli} ${scheme} ${fs} ${bios} - eval qemu_${arch}_${bios} ${img} ${sh} - [ -n "${SUDO_USER}" ] && chown ${SUDO_USER} ${img}* - echo "^^^^^^^^^^^^^^^^^^^^^^ Creating $img ^^^^^^^^^^^^^^^^^^^^^^^" + for geli in nogeli; do + for scheme in vtoc8; do + for fs in ufs; do + for bios in ofw; do + # Create sparse file and mount newly created filesystem(s) on it + img=${IMGDIR}/${arch}-${geli}-${scheme}-${fs}-${bios}.img + sh=${IMGDIR}/${arch}-${geli}-${scheme}-${fs}-${bios}.sh + echo "vvvvvvvvvvvvvvvvvvvvvv Creating $img vvvvvvvvvvvvvvvvvvvvvvv" + rm -f ${img}* + eval mk_${arch}_${geli}_${scheme}_${fs}_${bios} ${DESTDIR} ${img} ${MNTPT} ${geli} ${scheme} ${fs} ${bios} + eval qemu_${arch}_${bios} ${img} ${sh} + [ -n "${SUDO_USER}" ] && chown ${SUDO_USER} ${img}* + echo "^^^^^^^^^^^^^^^^^^^^^^ Creating $img ^^^^^^^^^^^^^^^^^^^^^^^" + done + done done done done From owner-svn-src-all@freebsd.org Mon Feb 5 04:01:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52401EED763; Mon, 5 Feb 2018 04:01:02 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0118A802E1; Mon, 5 Feb 2018 04:01:02 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EFCA6237E3; Mon, 5 Feb 2018 04:01:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w15411j6059217; Mon, 5 Feb 2018 04:01:01 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w154102i058511; Mon, 5 Feb 2018 04:01:00 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802050401.w154102i058511@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 5 Feb 2018 04:01:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328866 - in stable/11/sys: boot/efi/boot1 boot/efi/loader boot/i386/boot2 boot/i386/gptboot boot/i386/gptzfsboot boot/i386/zfsboot boot/userboot/ficl boot/userboot/userboot boot/userbo... X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/sys: boot/efi/boot1 boot/efi/loader boot/i386/boot2 boot/i386/gptboot boot/i386/gptzfsboot boot/i386/zfsboot boot/userboot/ficl boot/userboot/userboot boot/userboot/zfs boot/zfs cddl/boot... X-SVN-Commit-Revision: 328866 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 04:01:02 -0000 Author: kevans Date: Mon Feb 5 04:00:59 2018 New Revision: 328866 URL: https://svnweb.freebsd.org/changeset/base/328866 Log: MFC r304321,304753,304754,306751,316077,316110: SHA512, skein, large block support for loader zfs MFC r304321: Add SHA512, skein, large blocks support for loader zfs. MFC r304753: loader: zio_checksum_verify() must test spa for NULL pointer MFC r304754: r304321 broken bhyve zvol VM bhyveload hang 100% WCPU MFC r306751: Disable loop unrolling in skein for sys/boot MFC r316077: Unbreak compilation with gcc 4.2.1 MFC r316110: Use `-Wno-missing-declarations` with CWARNFLAGS for skein.c Added: stable/11/sys/cddl/boot/zfs/skein_zfs.c - copied unchanged from r304321, head/sys/cddl/boot/zfs/skein_zfs.c Modified: stable/11/sys/boot/efi/boot1/Makefile stable/11/sys/boot/efi/loader/Makefile stable/11/sys/boot/i386/boot2/Makefile stable/11/sys/boot/i386/gptboot/Makefile stable/11/sys/boot/i386/gptboot/gptldr.S stable/11/sys/boot/i386/gptzfsboot/Makefile stable/11/sys/boot/i386/zfsboot/Makefile stable/11/sys/boot/i386/zfsboot/zfsboot.c stable/11/sys/boot/i386/zfsboot/zfsldr.S stable/11/sys/boot/userboot/ficl/Makefile stable/11/sys/boot/userboot/userboot/Makefile stable/11/sys/boot/userboot/userboot/main.c stable/11/sys/boot/userboot/zfs/Makefile stable/11/sys/boot/zfs/Makefile stable/11/sys/boot/zfs/zfsimpl.c stable/11/sys/cddl/boot/zfs/fletcher.c stable/11/sys/cddl/boot/zfs/sha256.c stable/11/sys/cddl/boot/zfs/zfsimpl.h stable/11/sys/cddl/boot/zfs/zfssubr.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/efi/boot1/Makefile ============================================================================== --- stable/11/sys/boot/efi/boot1/Makefile Mon Feb 5 00:18:21 2018 (r328865) +++ stable/11/sys/boot/efi/boot1/Makefile Mon Feb 5 04:00:59 2018 (r328866) @@ -19,12 +19,22 @@ CWARNFLAGS.zfs_module.c += -Wno-missing-prototypes CWARNFLAGS.zfs_module.c += -Wno-sign-compare CWARNFLAGS.zfs_module.c += -Wno-unused-parameter CWARNFLAGS.zfs_module.c += -Wno-unused-function +CWARNFLAGS.skein.c += -Wno-cast-align +.if ${COMPILER_TYPE} == "clang" +CWARNFLAGS.skein.c += -Wno-missing-variable-declarations +.else if ${COMPILER_TYPE} == "gcc" +CWARNFLAGS.skein.c += -Wno-missing-declarations .endif +.endif # architecture-specific loader code SRCS= boot1.c self_reloc.c start.S ufs_module.c .if ${MK_ZFS} != "no" SRCS+= zfs_module.c +SRCS+= skein.c skein_block.c +# Do not unroll skein loops, reduce code size +CFLAGS+= -DSKEIN_LOOP=111 +.PATH: ${.CURDIR}/../../../crypto/skein .endif .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201 @@ -44,6 +54,7 @@ CFLAGS+= -DEFI_DEBUG .if ${MK_ZFS} != "no" CFLAGS+= -I${.CURDIR}/../../zfs/ CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs/ +CFLAGS+= -I${.CURDIR}/../../../crypto/skein CFLAGS+= -DEFI_ZFS_BOOT .endif Modified: stable/11/sys/boot/efi/loader/Makefile ============================================================================== --- stable/11/sys/boot/efi/loader/Makefile Mon Feb 5 00:18:21 2018 (r328865) +++ stable/11/sys/boot/efi/loader/Makefile Mon Feb 5 04:00:59 2018 (r328866) @@ -24,6 +24,10 @@ SRCS= autoload.c \ .if ${MK_ZFS} != "no" SRCS+= zfs.c .PATH: ${.CURDIR}/../../zfs +SRCS+= skein.c skein_block.c +# Do not unroll skein loops, reduce code size +CFLAGS+= -DSKEIN_LOOP=111 +.PATH: ${.CURDIR}/../../../crypto/skein # Disable warnings that are currently incompatible with the zfs boot code CWARNFLAGS.zfs.c+= -Wno-sign-compare @@ -57,6 +61,7 @@ CFLAGS+= -I${.CURDIR}/../../i386/libi386 .if ${MK_ZFS} != "no" CFLAGS+= -I${.CURDIR}/../../zfs CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs +CFLAGS+= -I${.CURDIR}/../../../crypto/skein CFLAGS+= -DEFI_ZFS_BOOT .endif CFLAGS+= -DNO_PCI -DEFI Modified: stable/11/sys/boot/i386/boot2/Makefile ============================================================================== --- stable/11/sys/boot/i386/boot2/Makefile Mon Feb 5 00:18:21 2018 (r328865) +++ stable/11/sys/boot/i386/boot2/Makefile Mon Feb 5 04:00:59 2018 (r328866) @@ -33,7 +33,7 @@ CFLAGS= -fomit-frame-pointer \ -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \ -I${.CURDIR}/../../common \ -I${.CURDIR}/../btx/lib -I. \ - -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \ + -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ -Winline Modified: stable/11/sys/boot/i386/gptboot/Makefile ============================================================================== --- stable/11/sys/boot/i386/gptboot/Makefile Mon Feb 5 00:18:21 2018 (r328865) +++ stable/11/sys/boot/i386/gptboot/Makefile Mon Feb 5 04:00:59 2018 (r328866) @@ -32,10 +32,10 @@ CFLAGS= -DBOOTPROG=\"gptboot\" \ -I${.CURDIR}/../btx/lib -I. \ -I${.CURDIR}/../boot2 \ -I${.CURDIR}/../../.. \ - -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \ + -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ - -Winline + -Winline -Wno-pointer-sign CFLAGS.gcc+= --param max-inline-insns-single=100 Modified: stable/11/sys/boot/i386/gptboot/gptldr.S ============================================================================== --- stable/11/sys/boot/i386/gptboot/gptldr.S Mon Feb 5 00:18:21 2018 (r328865) +++ stable/11/sys/boot/i386/gptboot/gptldr.S Mon Feb 5 04:00:59 2018 (r328866) @@ -45,7 +45,7 @@ /* Misc. Constants */ .set SIZ_PAG,0x1000 # Page size .set SIZ_SEC,0x200 # Sector size - .set COPY_BLKS,0x4 # Number of blocks + .set COPY_BLKS,0x8 # Number of blocks # to copy for boot2 .set COPY_BLK_SZ,0x8000 # Copy in 32k blocks; must be # a multiple of 16 bytes Modified: stable/11/sys/boot/i386/gptzfsboot/Makefile ============================================================================== --- stable/11/sys/boot/i386/gptzfsboot/Makefile Mon Feb 5 00:18:21 2018 (r328865) +++ stable/11/sys/boot/i386/gptzfsboot/Makefile Mon Feb 5 04:00:59 2018 (r328866) @@ -1,8 +1,10 @@ # $FreeBSD$ +.include + .PATH: ${.CURDIR}/../boot2 ${.CURDIR}/../gptboot \ ${.CURDIR}/../zfsboot ${.CURDIR}/../common \ - ${.CURDIR}/../../common + ${.CURDIR}/../../common ${.CURDIR}/../../../crypto/skein FILES= gptzfsboot MAN= gptzfsboot.8 @@ -27,14 +29,23 @@ CFLAGS= -DBOOTPROG=\"gptzfsboot\" \ -I${.CURDIR}/../common \ -I${.CURDIR}/../../zfs \ -I${.CURDIR}/../../../cddl/boot/zfs \ + -I${.CURDIR}/../../../crypto/skein \ -I${.CURDIR}/../btx/lib -I. \ -I${.CURDIR}/../boot2 \ -I${.CURDIR}/../../.. \ - -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \ + -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ - -Winline + -Winline -Wno-pointer-sign +.if ${COMPILER_TYPE} == "clang" || \ + (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201) +CFLAGS+= -Wno-tentative-definition-incomplete-type +.endif + +# Do not unroll skein loops, reduce code size +CFLAGS+= -DSKEIN_LOOP=111 + .if !defined(LOADER_NO_GELI_SUPPORT) CFLAGS+= -DLOADER_GELI_SUPPORT CFLAGS+= -I${.CURDIR}/../../geli @@ -67,12 +78,13 @@ gptldr.out: gptldr.o ${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o CLEANFILES+= gptzfsboot.bin gptzfsboot.out zfsboot.o sio.o cons.o \ - drv.o gpt.o util.o ${OPENCRYPTO_XTS} + drv.o gpt.o util.o skein.o skein_block.o ${OPENCRYPTO_XTS} gptzfsboot.bin: gptzfsboot.out ${OBJCOPY} -S -O binary gptzfsboot.out ${.TARGET} -gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o cons.o util.o ${OPENCRYPTO_XTS} +gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o cons.o util.o \ + skein.o skein_block.o ${OPENCRYPTO_XTS} ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND} ${LIBGELIBOOT} zfsboot.o: ${.CURDIR}/../../zfs/zfsimpl.c Modified: stable/11/sys/boot/i386/zfsboot/Makefile ============================================================================== --- stable/11/sys/boot/i386/zfsboot/Makefile Mon Feb 5 00:18:21 2018 (r328865) +++ stable/11/sys/boot/i386/zfsboot/Makefile Mon Feb 5 04:00:59 2018 (r328866) @@ -1,6 +1,7 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../boot2 ${.CURDIR}/../common ${.CURDIR}/../../common +.PATH: ${.CURDIR}/../boot2 ${.CURDIR}/../common \ + ${.CURDIR}/../../common ${.CURDIR}/../../../crypto/skein FILES= zfsboot MAN= zfsboot.8 @@ -25,14 +26,17 @@ CFLAGS= -DBOOTPROG=\"zfsboot\" \ -I${.CURDIR}/../common \ -I${.CURDIR}/../../zfs \ -I${.CURDIR}/../../../cddl/boot/zfs \ + -I${.CURDIR}/../../../crypto/skein \ -I${.CURDIR}/../btx/lib -I. \ -I${.CURDIR}/../boot2 \ - -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \ + -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ -Winline CFLAGS.gcc+= --param max-inline-insns-single=100 +# Do not unroll skein loops, reduce code size +CFLAGS+= -DSKEIN_LOOP=111 LD_FLAGS=-static -N --gc-sections @@ -55,12 +59,13 @@ zfsldr.out: zfsldr.o ${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} zfsldr.o CLEANFILES+= zfsboot2 zfsboot.ld zfsboot.ldr zfsboot.bin zfsboot.out \ - zfsboot.o zfsboot.s zfsboot.s.tmp sio.o cons.o drv.o util.o + zfsboot.o zfsboot.s zfsboot.s.tmp sio.o cons.o drv.o util.o \ + skein.o skein_block.o -# We currently allow 65536 bytes for zfsboot - in practice it could be +# We currently allow 128k bytes for zfsboot - in practice it could be # any size up to 3.5Mb but keeping it fixed size simplifies zfsldr. # -BOOT2SIZE= 65536 +BOOT2SIZE= 131072 zfsboot2: zfsboot.ld @set -- `ls -l ${.ALLSRC}`; x=$$((${BOOT2SIZE}-$$5)); \ @@ -77,7 +82,7 @@ zfsboot.ldr: zfsboot.bin: zfsboot.out ${OBJCOPY} -S -O binary zfsboot.out ${.TARGET} -zfsboot.out: ${BTXCRT} zfsboot.o sio.o drv.o cons.o util.o +zfsboot.out: ${BTXCRT} zfsboot.o sio.o drv.o cons.o util.o skein.o skein_block.o ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND} SRCS= zfsboot.c Modified: stable/11/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- stable/11/sys/boot/i386/zfsboot/zfsboot.c Mon Feb 5 00:18:21 2018 (r328865) +++ stable/11/sys/boot/i386/zfsboot/zfsboot.c Mon Feb 5 04:00:59 2018 (r328866) @@ -105,7 +105,7 @@ static struct bios_smap smap; /* * The minimum amount of memory to reserve in bios_extmem for the heap. */ -#define HEAP_MIN (3 * 1024 * 1024) +#define HEAP_MIN (64 * 1024 * 1024) static char *heap_next; static char *heap_end; Modified: stable/11/sys/boot/i386/zfsboot/zfsldr.S ============================================================================== --- stable/11/sys/boot/i386/zfsboot/zfsldr.S Mon Feb 5 00:18:21 2018 (r328865) +++ stable/11/sys/boot/i386/zfsboot/zfsldr.S Mon Feb 5 04:00:59 2018 (r328866) @@ -32,8 +32,11 @@ /* Misc. Constants */ .set SIZ_PAG,0x1000 # Page size .set SIZ_SEC,0x200 # Sector size - - .set NSECT,0x80 + .set COPY_BLKS,0x8 # Number of blocks + # to copy for boot2 + .set COPY_BLK_SZ,0x8000 # Copy in 32k blocks; must be + # a multiple of 16 bytes + .set NSECT,(COPY_BLK_SZ / SIZ_SEC * COPY_BLKS) .globl start .code16 @@ -88,12 +91,12 @@ main.3: add $0x10,%si # Next entry /* * Ok, we have a slice and drive in %dx now, so use that to locate and * load boot2. %si references the start of the slice we are looking - * for, so go ahead and load up the 128 sectors starting at sector 1024 - * (i.e. after the two vdev labels). We don't have do anything fancy - * here to allow for an extra copy of boot1 and a partition table - * (compare to this section of the UFS bootstrap) so we just load it - * all at 0x9000. The first part of boot2 is BTX, which wants to run - * at 0x9000. The boot2.bin binary starts right after the end of BTX, + * for, so go ahead and load up the COPY_BLKS*COPY_BLK_SZ/SIZ_SEC sectors + * starting at sector 1024 (i.e. after the two vdev labels). We don't + * have do anything fancy here to allow for an extra copy of boot1 and + * a partition table (compare to this section of the UFS bootstrap) so we + * just load it all at 0x9000. The first part of boot2 is BTX, which wants + * to run at 0x9000. The boot2.bin binary starts right after the end of BTX, * so we have to figure out where the start of it is and then move the * binary to 0xc000. Normally, BTX clients start at MEM_USR, or 0xa000, * but when we use btxld to create zfsboot2, we use an entry point of @@ -116,23 +119,37 @@ main.6: pushal # Save params incl %eax # Advance to add $SIZ_SEC,%ebx # next sector loop main.6 # If not last, read another - mov MEM_BTX+0xa,%bx # Get BTX length - mov $NSECT*SIZ_SEC-1,%di # Size of load area (less one) - mov %di,%si # End of load area, 0x9000 rel - sub %bx,%di # End of client, 0xc000 rel - mov %di,%cx # Size of - inc %cx # client - mov $(MEM_BTX)>>4,%dx # Segment - mov %dx,%ds # addressing 0x9000 - mov $(MEM_USR+2*SIZ_PAG)>>4,%dx # Segment - mov %dx,%es # addressing 0xc000 - std # Move with decrement - rep # Relocate - movsb # client + + mov $MEM_BTX,%bx # BTX + mov 0xa(%bx),%si # Get BTX length and set + add %bx,%si # %si to start of boot2 + dec %si # Set %ds:%si to point at the + mov %si,%ax # last byte we want to copy + shr $4,%ax # from boot2, with %si made as + add $(COPY_BLKS*COPY_BLK_SZ/16),%ax # small as possible. + and $0xf,%si # + mov %ax,%ds # + mov $(MEM_USR+2*SIZ_PAG)/16,%ax # Set %es:(-1) to point at + add $(COPY_BLKS*COPY_BLK_SZ/16),%ax # the last byte we + mov %ax,%es # want to copy boot2 into. + mov $COPY_BLKS,%bx # Copy COPY_BLKS 32k blocks +copyloop: + add $COPY_BLK_SZ,%si # Adjust %ds:%si to point at + mov %ds,%ax # the end of the next 32k to + sub $COPY_BLK_SZ/16,%ax # copy from boot2 + mov %ax,%ds + mov $COPY_BLK_SZ-1,%di # Adjust %es:%di to point at + mov %es,%ax # the end of the next 32k into + sub $COPY_BLK_SZ/16,%ax # which we want boot2 copied + mov %ax,%es + mov $COPY_BLK_SZ,%cx # Copy 32k + std + rep movsb + dec %bx + jnz copyloop + mov %cx,%ds # Reset %ds and %es + mov %cx,%es cld # Back to increment - xor %dx,%dx # Back - mov %ds,%dx # to zero - mov %dx,%es # segment /* * Enable A20 so we can access memory above 1 meg. Modified: stable/11/sys/boot/userboot/ficl/Makefile ============================================================================== --- stable/11/sys/boot/userboot/ficl/Makefile Mon Feb 5 00:18:21 2018 (r328865) +++ stable/11/sys/boot/userboot/ficl/Makefile Mon Feb 5 04:00:59 2018 (r328866) @@ -10,6 +10,9 @@ BASE_SRCS= dict.c ficl.c fileaccess.c float.c loader.c SRCS= ${BASE_SRCS} sysdep.c softcore.c CLEANFILES= softcore.c testmain testmain.o + +CWARNFLAGS.loader.c.c += -Wno-implicit-function-declaration + .if HAVE_PNP CFLAGS+= -DHAVE_PNP .endif Modified: stable/11/sys/boot/userboot/userboot/Makefile ============================================================================== --- stable/11/sys/boot/userboot/userboot/Makefile Mon Feb 5 00:18:21 2018 (r328865) +++ stable/11/sys/boot/userboot/userboot/Makefile Mon Feb 5 04:00:59 2018 (r328866) @@ -35,6 +35,8 @@ CFLAGS+= -I${.CURDIR}/../../.. CFLAGS+= -I${.CURDIR}/../../../../lib/libstand CFLAGS+= -ffreestanding -I. +CWARNFLAGS.main.c += -Wno-implicit-function-declaration + LDFLAGS+= -nostdlib -Wl,-Bsymbolic NEWVERSWHAT= "User boot" ${MACHINE_CPUARCH} Modified: stable/11/sys/boot/userboot/userboot/main.c ============================================================================== --- stable/11/sys/boot/userboot/userboot/main.c Mon Feb 5 00:18:21 2018 (r328865) +++ stable/11/sys/boot/userboot/userboot/main.c Mon Feb 5 04:00:59 2018 (r328866) @@ -46,7 +46,7 @@ static int userboot_zfs_found; /* Minimum version required */ #define USERBOOT_VERSION USERBOOT_VERSION_3 -#define MALLOCSZ (10*1024*1024) +#define MALLOCSZ (64*1024*1024) struct loader_callbacks *callbacks; void *callbacks_arg; Modified: stable/11/sys/boot/userboot/zfs/Makefile ============================================================================== --- stable/11/sys/boot/userboot/zfs/Makefile Mon Feb 5 00:18:21 2018 (r328865) +++ stable/11/sys/boot/userboot/zfs/Makefile Mon Feb 5 04:00:59 2018 (r328866) @@ -2,15 +2,19 @@ S= ${.CURDIR}/../../zfs -.PATH: ${S} +.PATH: ${S} ${.CURDIR}/../../../crypto/skein LIB= zfsboot INTERNALLIB= -SRCS+= zfs.c +SRCS+= zfs.c skein.c skein_block.c +# Do not unroll skein loops, reduce code size +CFLAGS+= -DSKEIN_LOOP=111 + CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I. CFLAGS+= -I${.CURDIR}/../../../../lib/libstand CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs +CFLAGS+= -I${.CURDIR}/../../../crypto/skein CFLAGS+= -ffreestanding -fPIC CFLAGS+= -Wformat -Wall Modified: stable/11/sys/boot/zfs/Makefile ============================================================================== --- stable/11/sys/boot/zfs/Makefile Mon Feb 5 00:18:21 2018 (r328865) +++ stable/11/sys/boot/zfs/Makefile Mon Feb 5 04:00:59 2018 (r328866) @@ -5,10 +5,16 @@ INTERNALLIB= SRCS+= zfs.c +SRCS+= skein.c skein_block.c +# Do not unroll skein loops, reduce code size +CFLAGS+= -DSKEIN_LOOP=111 +.PATH: ${.CURDIR}/../../crypto/skein + CFLAGS+= -DBOOTPROG=\"zfsloader\" CFLAGS+= -I${.CURDIR}/../common -I${.CURDIR}/../.. -I. CFLAGS+= -I${.CURDIR}/../../../lib/libstand CFLAGS+= -I${.CURDIR}/../../cddl/boot/zfs +CFLAGS+= -I${.CURDIR}/../../crypto/skein .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -march=i386 Modified: stable/11/sys/boot/zfs/zfsimpl.c ============================================================================== --- stable/11/sys/boot/zfs/zfsimpl.c Mon Feb 5 00:18:21 2018 (r328865) +++ stable/11/sys/boot/zfs/zfsimpl.c Mon Feb 5 04:00:59 2018 (r328866) @@ -58,6 +58,8 @@ static const char *features_for_read[] = { "com.delphix:extensible_dataset", "com.delphix:embedded_data", "org.open-zfs:large_blocks", + "org.illumos:sha512", + "org.illumos:skein", NULL }; @@ -77,6 +79,9 @@ static char *zfs_temp_buf, *zfs_temp_end, *zfs_temp_pt static int zio_read(const spa_t *spa, const blkptr_t *bp, void *buf); static int zfs_get_root(const spa_t *spa, uint64_t *objid); static int zfs_rlookup(const spa_t *spa, uint64_t objnum, char *result); +static int zap_lookup(const spa_t *spa, const dnode_phys_t *dnode, + const char *name, uint64_t integer_size, uint64_t num_integers, + void *value); static void zfs_init(void) @@ -419,7 +424,7 @@ vdev_read_phys(vdev_t *vdev, const blkptr_t *bp, void rc = vdev->v_phys_read(vdev, vdev->v_read_priv, offset, buf, psize); if (rc) return (rc); - if (bp && zio_checksum_verify(bp, buf)) + if (bp && zio_checksum_verify(vdev->spa, bp, buf)) return (EIO); return (0); @@ -1073,6 +1078,7 @@ vdev_probe(vdev_phys_read_t *_read, void *read_priv, s } zfs_free(upbuf, VDEV_UBERBLOCK_SIZE(vdev)); + vdev->spa = spa; if (spap) *spap = spa; return (0); @@ -1121,7 +1127,7 @@ zio_read_gang(const spa_t *spa, const blkptr_t *bp, vo pbuf += BP_GET_PSIZE(gbp); } - if (zio_checksum_verify(bp, buf)) + if (zio_checksum_verify(spa, bp, buf)) return (EIO); return (0); } @@ -1223,7 +1229,8 @@ dnode_read(const spa_t *spa, const dnode_phys_t *dnode int i, rc; if (bsize > SPA_MAXBLOCKSIZE) { - printf("ZFS: I/O error - blocks larger than 128K are not supported\n"); + printf("ZFS: I/O error - blocks larger than %llu are not " + "supported\n", SPA_MAXBLOCKSIZE); return (EIO); } @@ -1363,12 +1370,73 @@ fzap_leaf_value(const zap_leaf_t *zl, const zap_leaf_c return value; } +static void +stv(int len, void *addr, uint64_t value) +{ + switch (len) { + case 1: + *(uint8_t *)addr = value; + return; + case 2: + *(uint16_t *)addr = value; + return; + case 4: + *(uint32_t *)addr = value; + return; + case 8: + *(uint64_t *)addr = value; + return; + } +} + /* + * Extract a array from a zap leaf entry. + */ +static void +fzap_leaf_array(const zap_leaf_t *zl, const zap_leaf_chunk_t *zc, + uint64_t integer_size, uint64_t num_integers, void *buf) +{ + uint64_t array_int_len = zc->l_entry.le_value_intlen; + uint64_t value = 0; + uint64_t *u64 = buf; + char *p = buf; + int len = MIN(zc->l_entry.le_value_numints, num_integers); + int chunk = zc->l_entry.le_value_chunk; + int byten = 0; + + if (integer_size == 8 && len == 1) { + *u64 = fzap_leaf_value(zl, zc); + return; + } + + while (len > 0) { + struct zap_leaf_array *la = &ZAP_LEAF_CHUNK(zl, chunk).l_array; + int i; + + ASSERT3U(chunk, <, ZAP_LEAF_NUMCHUNKS(zl)); + for (i = 0; i < ZAP_LEAF_ARRAY_BYTES && len > 0; i++) { + value = (value << 8) | la->la_array[i]; + byten++; + if (byten == array_int_len) { + stv(integer_size, p, value); + byten = 0; + len--; + if (len == 0) + return; + p += integer_size; + } + } + chunk = la->la_next; + } +} + +/* * Lookup a value in a fatzap directory. Assumes that the zap scratch * buffer contains the directory header. */ static int -fzap_lookup(const spa_t *spa, const dnode_phys_t *dnode, const char *name, uint64_t *value) +fzap_lookup(const spa_t *spa, const dnode_phys_t *dnode, const char *name, + uint64_t integer_size, uint64_t num_integers, void *value) { int bsize = dnode->dn_datablkszsec << SPA_MINBLOCKSHIFT; zap_phys_t zh = *(zap_phys_t *) zap_scratch; @@ -1435,9 +1503,10 @@ fzap_lookup(const spa_t *spa, const dnode_phys_t *dnod zc = &ZAP_LEAF_CHUNK(&zl, zc->l_entry.le_next); } if (fzap_name_equal(&zl, zc, name)) { - if (zc->l_entry.le_value_intlen * zc->l_entry.le_value_numints > 8) + if (zc->l_entry.le_value_intlen * zc->l_entry.le_value_numints > + integer_size * num_integers) return (E2BIG); - *value = fzap_leaf_value(&zl, zc); + fzap_leaf_array(&zl, zc, integer_size, num_integers, value); return (0); } @@ -1448,7 +1517,8 @@ fzap_lookup(const spa_t *spa, const dnode_phys_t *dnod * Lookup a name in a zap object and return its value as a uint64_t. */ static int -zap_lookup(const spa_t *spa, const dnode_phys_t *dnode, const char *name, uint64_t *value) +zap_lookup(const spa_t *spa, const dnode_phys_t *dnode, const char *name, + uint64_t integer_size, uint64_t num_integers, void *value) { int rc; uint64_t zap_type; @@ -1461,8 +1531,10 @@ zap_lookup(const spa_t *spa, const dnode_phys_t *dnode zap_type = *(uint64_t *) zap_scratch; if (zap_type == ZBT_MICRO) return mzap_lookup(dnode, name, value); - else if (zap_type == ZBT_HEADER) - return fzap_lookup(spa, dnode, name, value); + else if (zap_type == ZBT_HEADER) { + return fzap_lookup(spa, dnode, name, integer_size, + num_integers, value); + } printf("ZFS: invalid zap_type=%d\n", (int)zap_type); return (EIO); } @@ -1801,7 +1873,8 @@ zfs_lookup_dataset(const spa_t *spa, const char *name, if (objset_get_dnode(spa, &spa->spa_mos, DMU_POOL_DIRECTORY_OBJECT, &dir)) return (EIO); - if (zap_lookup(spa, &dir, DMU_POOL_ROOT_DATASET, &dir_obj)) + if (zap_lookup(spa, &dir, DMU_POOL_ROOT_DATASET, sizeof (dir_obj), + 1, &dir_obj)) return (EIO); p = name; @@ -1831,7 +1904,8 @@ zfs_lookup_dataset(const spa_t *spa, const char *name, return (EIO); /* Actual loop condition #2. */ - if (zap_lookup(spa, &child_dir_zap, element, &dir_obj) != 0) + if (zap_lookup(spa, &child_dir_zap, element, sizeof (dir_obj), + 1, &dir_obj) != 0) return (ENOENT); } @@ -1961,9 +2035,9 @@ zfs_get_root(const spa_t *spa, uint64_t *objid) /* * Lookup the pool_props and see if we can find a bootfs. */ - if (zap_lookup(spa, &dir, DMU_POOL_PROPS, &props) == 0 + if (zap_lookup(spa, &dir, DMU_POOL_PROPS, sizeof (props), 1, &props) == 0 && objset_get_dnode(spa, &spa->spa_mos, props, &propdir) == 0 - && zap_lookup(spa, &propdir, "bootfs", &bootfs) == 0 + && zap_lookup(spa, &propdir, "bootfs", sizeof (bootfs), 1, &bootfs) == 0 && bootfs != 0) { *objid = bootfs; @@ -1972,7 +2046,7 @@ zfs_get_root(const spa_t *spa, uint64_t *objid) /* * Lookup the root dataset directory */ - if (zap_lookup(spa, &dir, DMU_POOL_ROOT_DATASET, &root) + if (zap_lookup(spa, &dir, DMU_POOL_ROOT_DATASET, sizeof (root), 1, &root) || objset_get_dnode(spa, &spa->spa_mos, root, &dir)) { printf("ZFS: can't find root dsl_dir\n"); return (EIO); @@ -2046,7 +2120,8 @@ check_mos_features(const spa_t *spa) if ((rc = objset_get_dnode(spa, &spa->spa_mos, DMU_OT_OBJECT_DIRECTORY, &dir)) != 0) return (rc); - if ((rc = zap_lookup(spa, &dir, DMU_POOL_FEATURES_FOR_READ, &objnum)) != 0) { + if ((rc = zap_lookup(spa, &dir, DMU_POOL_FEATURES_FOR_READ, + sizeof (objnum), 1, &objnum)) != 0) { /* * It is older pool without features. As we have already * tested the label, just return without raising the error. @@ -2076,6 +2151,7 @@ check_mos_features(const spa_t *spa) static int zfs_spa_init(spa_t *spa) { + dnode_phys_t dir; int rc; if (zio_read(spa, &spa->spa_uberblock.ub_rootbp, &spa->spa_mos)) { @@ -2087,6 +2163,17 @@ zfs_spa_init(spa_t *spa) return (EIO); } + if (objset_get_dnode(spa, &spa->spa_mos, DMU_POOL_DIRECTORY_OBJECT, + &dir)) { + printf("ZFS: failed to read pool %s directory object\n", + spa->spa_name); + return (EIO); + } + /* this is allowed to fail, older pools do not have salt */ + rc = zap_lookup(spa, &dir, DMU_POOL_CHECKSUM_SALT, 1, + sizeof (spa->spa_cksum_salt.zcs_bytes), + spa->spa_cksum_salt.zcs_bytes); + rc = check_mos_features(spa); if (rc != 0) { printf("ZFS: pool %s is not supported\n", spa->spa_name); @@ -2239,7 +2326,7 @@ zfs_lookup(const struct zfsmount *mount, const char *u return (rc); } - rc = zap_lookup(spa, &dn, ZFS_ROOT_OBJ, &objnum); + rc = zap_lookup(spa, &dn, ZFS_ROOT_OBJ, sizeof (objnum), 1, &objnum); if (rc) { free(entry); return (rc); @@ -2299,7 +2386,7 @@ zfs_lookup(const struct zfsmount *mount, const char *u goto done; } - rc = zap_lookup(spa, &dn, element, &objnum); + rc = zap_lookup(spa, &dn, element, sizeof (objnum), 1, &objnum); if (rc) goto done; objnum = ZFS_DIRENT_OBJ(objnum); Modified: stable/11/sys/cddl/boot/zfs/fletcher.c ============================================================================== --- stable/11/sys/cddl/boot/zfs/fletcher.c Mon Feb 5 00:18:21 2018 (r328865) +++ stable/11/sys/cddl/boot/zfs/fletcher.c Mon Feb 5 04:00:59 2018 (r328866) @@ -23,10 +23,9 @@ * Use is subject to license terms. */ -/*#pragma ident "%Z%%M% %I% %E% SMI"*/ - static void -fletcher_2_native(const void *buf, uint64_t size, zio_cksum_t *zcp) +fletcher_2_native(const void *buf, uint64_t size, + const void *ctx_template __unused, zio_cksum_t *zcp) { const uint64_t *ip = buf; const uint64_t *ipend = ip + (size / sizeof (uint64_t)); @@ -43,7 +42,8 @@ fletcher_2_native(const void *buf, uint64_t size, zio_ } static void -fletcher_2_byteswap(const void *buf, uint64_t size, zio_cksum_t *zcp) +fletcher_2_byteswap(const void *buf, uint64_t size, + const void *ctx_template __unused, zio_cksum_t *zcp) { const uint64_t *ip = buf; const uint64_t *ipend = ip + (size / sizeof (uint64_t)); @@ -60,7 +60,8 @@ fletcher_2_byteswap(const void *buf, uint64_t size, zi } static void -fletcher_4_native(const void *buf, uint64_t size, zio_cksum_t *zcp) +fletcher_4_native(const void *buf, uint64_t size, + const void *ctx_template __unused, zio_cksum_t *zcp) { const uint32_t *ip = buf; const uint32_t *ipend = ip + (size / sizeof (uint32_t)); @@ -77,7 +78,8 @@ fletcher_4_native(const void *buf, uint64_t size, zio_ } static void -fletcher_4_byteswap(const void *buf, uint64_t size, zio_cksum_t *zcp) +fletcher_4_byteswap(const void *buf, uint64_t size, + const void *ctx_template __unused, zio_cksum_t *zcp) { const uint32_t *ip = buf; const uint32_t *ipend = ip + (size / sizeof (uint32_t)); Modified: stable/11/sys/cddl/boot/zfs/sha256.c ============================================================================== --- stable/11/sys/cddl/boot/zfs/sha256.c Mon Feb 5 00:18:21 2018 (r328865) +++ stable/11/sys/cddl/boot/zfs/sha256.c Mon Feb 5 04:00:59 2018 (r328866) @@ -23,19 +23,21 @@ * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright 2013 Saso Kiselkov. All rights reserved. + * Copyright 2015 Toomas Soome + */ -/*#pragma ident "%Z%%M% %I% %E% SMI"*/ - /* - * SHA-256 checksum, as specified in FIPS 180-2, available at: + * SHA-256 and SHA-512/256 hashes, as specified in FIPS 180-4, available at: * http://csrc.nist.gov/cryptval * - * This is a very compact implementation of SHA-256. + * This is a very compact implementation of SHA-256 and SHA-512/256. * It is designed to be simple and portable, not to be fast. */ /* - * The literal definitions according to FIPS180-2 would be: + * The literal definitions according to FIPS180-4 would be: * * Ch(x, y, z) (((x) & (y)) ^ ((~(x)) & (z))) * Maj(x, y, z) (((x) & (y)) | ((x) & (z)) | ((y) & (z))) @@ -44,12 +46,21 @@ */ #define Ch(x, y, z) ((z) ^ ((x) & ((y) ^ (z)))) #define Maj(x, y, z) (((x) & (y)) ^ ((z) & ((x) ^ (y)))) -#define Rot32(x, s) (((x) >> s) | ((x) << (32 - s))) -#define SIGMA0(x) (Rot32(x, 2) ^ Rot32(x, 13) ^ Rot32(x, 22)) -#define SIGMA1(x) (Rot32(x, 6) ^ Rot32(x, 11) ^ Rot32(x, 25)) -#define sigma0(x) (Rot32(x, 7) ^ Rot32(x, 18) ^ ((x) >> 3)) -#define sigma1(x) (Rot32(x, 17) ^ Rot32(x, 19) ^ ((x) >> 10)) +#define ROTR(x, n) (((x) >> (n)) | ((x) << ((sizeof (x) * NBBY)-(n)))) +/* SHA-224/256 operations */ +#define BIGSIGMA0_256(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22)) +#define BIGSIGMA1_256(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25)) +#define SIGMA0_256(x) (ROTR(x, 7) ^ ROTR(x, 18) ^ ((x) >> 3)) +#define SIGMA1_256(x) (ROTR(x, 17) ^ ROTR(x, 19) ^ ((x) >> 10)) + +/* SHA-384/512 operations */ +#define BIGSIGMA0_512(x) (ROTR((x), 28) ^ ROTR((x), 34) ^ ROTR((x), 39)) +#define BIGSIGMA1_512(x) (ROTR((x), 14) ^ ROTR((x), 18) ^ ROTR((x), 41)) +#define SIGMA0_512(x) (ROTR((x), 1) ^ ROTR((x), 8) ^ ((x) >> 7)) +#define SIGMA1_512(x) (ROTR((x), 19) ^ ROTR((x), 61) ^ ((x) >> 6)) + +/* SHA-256 round constants */ static const uint32_t SHA256_K[64] = { 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, @@ -69,46 +80,134 @@ static const uint32_t SHA256_K[64] = { 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 }; +/* SHA-512 round constants */ +static const uint64_t SHA512_K[80] = { + 0x428A2F98D728AE22ULL, 0x7137449123EF65CDULL, + 0xB5C0FBCFEC4D3B2FULL, 0xE9B5DBA58189DBBCULL, + 0x3956C25BF348B538ULL, 0x59F111F1B605D019ULL, + 0x923F82A4AF194F9BULL, 0xAB1C5ED5DA6D8118ULL, + 0xD807AA98A3030242ULL, 0x12835B0145706FBEULL, + 0x243185BE4EE4B28CULL, 0x550C7DC3D5FFB4E2ULL, + 0x72BE5D74F27B896FULL, 0x80DEB1FE3B1696B1ULL, + 0x9BDC06A725C71235ULL, 0xC19BF174CF692694ULL, + 0xE49B69C19EF14AD2ULL, 0xEFBE4786384F25E3ULL, + 0x0FC19DC68B8CD5B5ULL, 0x240CA1CC77AC9C65ULL, + 0x2DE92C6F592B0275ULL, 0x4A7484AA6EA6E483ULL, + 0x5CB0A9DCBD41FBD4ULL, 0x76F988DA831153B5ULL, + 0x983E5152EE66DFABULL, 0xA831C66D2DB43210ULL, + 0xB00327C898FB213FULL, 0xBF597FC7BEEF0EE4ULL, + 0xC6E00BF33DA88FC2ULL, 0xD5A79147930AA725ULL, + 0x06CA6351E003826FULL, 0x142929670A0E6E70ULL, + 0x27B70A8546D22FFCULL, 0x2E1B21385C26C926ULL, + 0x4D2C6DFC5AC42AEDULL, 0x53380D139D95B3DFULL, + 0x650A73548BAF63DEULL, 0x766A0ABB3C77B2A8ULL, + 0x81C2C92E47EDAEE6ULL, 0x92722C851482353BULL, + 0xA2BFE8A14CF10364ULL, 0xA81A664BBC423001ULL, + 0xC24B8B70D0F89791ULL, 0xC76C51A30654BE30ULL, + 0xD192E819D6EF5218ULL, 0xD69906245565A910ULL, + 0xF40E35855771202AULL, 0x106AA07032BBD1B8ULL, + 0x19A4C116B8D2D0C8ULL, 0x1E376C085141AB53ULL, + 0x2748774CDF8EEB99ULL, 0x34B0BCB5E19B48A8ULL, + 0x391C0CB3C5C95A63ULL, 0x4ED8AA4AE3418ACBULL, + 0x5B9CCA4F7763E373ULL, 0x682E6FF3D6B2B8A3ULL, + 0x748F82EE5DEFB2FCULL, 0x78A5636F43172F60ULL, + 0x84C87814A1F0AB72ULL, 0x8CC702081A6439ECULL, + 0x90BEFFFA23631E28ULL, 0xA4506CEBDE82BDE9ULL, + 0xBEF9A3F7B2C67915ULL, 0xC67178F2E372532BULL, + 0xCA273ECEEA26619CULL, 0xD186B8C721C0C207ULL, + 0xEADA7DD6CDE0EB1EULL, 0xF57D4F7FEE6ED178ULL, + 0x06F067AA72176FBAULL, 0x0A637DC5A2C898A6ULL, + 0x113F9804BEF90DAEULL, 0x1B710B35131C471BULL, + 0x28DB77F523047D84ULL, 0x32CAAB7B40C72493ULL, + 0x3C9EBE0A15C9BEBCULL, 0x431D67C49C100D4CULL, + 0x4CC5D4BECB3E42B6ULL, 0x597F299CFC657E2AULL, + 0x5FCB6FAB3AD6FAECULL, 0x6C44198C4A475817ULL +}; + static void SHA256Transform(uint32_t *H, const uint8_t *cp) { uint32_t a, b, c, d, e, f, g, h, t, T1, T2, W[64]; - for (t = 0; t < 16; t++, cp += 4) + /* copy chunk into the first 16 words of the message schedule */ + for (t = 0; t < 16; t++, cp += sizeof (uint32_t)) W[t] = (cp[0] << 24) | (cp[1] << 16) | (cp[2] << 8) | cp[3]; + /* extend the first 16 words into the remaining 48 words */ for (t = 16; t < 64; t++) - W[t] = sigma1(W[t - 2]) + W[t - 7] + - sigma0(W[t - 15]) + W[t - 16]; + W[t] = SIGMA1_256(W[t - 2]) + W[t - 7] + + SIGMA0_256(W[t - 15]) + W[t - 16]; + /* init working variables to the current hash value */ a = H[0]; b = H[1]; c = H[2]; d = H[3]; e = H[4]; f = H[5]; g = H[6]; h = H[7]; + /* iterate the compression function for all rounds of the hash */ for (t = 0; t < 64; t++) { - T1 = h + SIGMA1(e) + Ch(e, f, g) + SHA256_K[t] + W[t]; - T2 = SIGMA0(a) + Maj(a, b, c); + T1 = h + BIGSIGMA1_256(e) + Ch(e, f, g) + SHA256_K[t] + W[t]; + T2 = BIGSIGMA0_256(a) + Maj(a, b, c); h = g; g = f; f = e; e = d + T1; d = c; c = b; b = a; a = T1 + T2; } + /* add the compressed chunk to the current hash value */ H[0] += a; H[1] += b; H[2] += c; H[3] += d; H[4] += e; H[5] += f; H[6] += g; H[7] += h; } static void -zio_checksum_SHA256(const void *buf, uint64_t size, zio_cksum_t *zcp) +SHA512Transform(uint64_t *H, const uint8_t *cp) { - uint32_t H[8] = { 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, - 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 }; + uint64_t a, b, c, d, e, f, g, h, t, T1, T2, W[80]; + + /* copy chunk into the first 16 words of the message schedule */ + for (t = 0; t < 16; t++, cp += sizeof (uint64_t)) + W[t] = ((uint64_t)cp[0] << 56) | ((uint64_t)cp[1] << 48) | + ((uint64_t)cp[2] << 40) | ((uint64_t)cp[3] << 32) | + ((uint64_t)cp[4] << 24) | ((uint64_t)cp[5] << 16) | + ((uint64_t)cp[6] << 8) | (uint64_t)cp[7]; + + /* extend the first 16 words into the remaining 64 words */ + for (t = 16; t < 80; t++) + W[t] = SIGMA1_512(W[t - 2]) + W[t - 7] + + SIGMA0_512(W[t - 15]) + W[t - 16]; + + /* init working variables to the current hash value */ + a = H[0]; b = H[1]; c = H[2]; d = H[3]; + e = H[4]; f = H[5]; g = H[6]; h = H[7]; + + /* iterate the compression function for all rounds of the hash */ + for (t = 0; t < 80; t++) { + T1 = h + BIGSIGMA1_512(e) + Ch(e, f, g) + SHA512_K[t] + W[t]; + T2 = BIGSIGMA0_512(a) + Maj(a, b, c); + h = g; g = f; f = e; e = d + T1; + d = c; c = b; b = a; a = T1 + T2; + } + + /* add the compressed chunk to the current hash value */ + H[0] += a; H[1] += b; H[2] += c; H[3] += d; + H[4] += e; H[5] += f; H[6] += g; H[7] += h; +} + +/* + * Implements the SHA-224 and SHA-256 hash algos - to select between them + * pass the appropriate initial values of 'H' and truncate the last 32 bits + * in case of SHA-224. + */ +static void +SHA256(uint32_t *H, const void *buf, uint64_t size, zio_cksum_t *zcp) +{ uint8_t pad[128]; - int padsize = size & 63; - int i; + unsigned padsize = size & 63; + unsigned i, k; + /* process all blocks up to the last one */ for (i = 0; i < size - padsize; i += 64) SHA256Transform(H, (uint8_t *)buf + i); - for (i = 0; i < padsize; i++) - pad[i] = ((uint8_t *)buf)[i]; + /* process the last block and padding */ + for (k = 0; k < padsize; k++) + pad[k] = ((uint8_t *)buf)[k+i]; for (pad[padsize++] = 0x80; (padsize & 63) != 56; padsize++) pad[padsize] = 0; @@ -124,4 +223,103 @@ zio_checksum_SHA256(const void *buf, uint64_t size, zi (uint64_t)H[2] << 32 | H[3], (uint64_t)H[4] << 32 | H[5], (uint64_t)H[6] << 32 | H[7]); +} + +/* + * encode 64bit data in big-endian format. + */ +static void +Encode64(uint8_t *output, uint64_t *input, size_t len) +{ + size_t i, j; + for (i = 0, j = 0; j < len; i++, j += 8) { + output[j] = (input[i] >> 56) & 0xff; + output[j + 1] = (input[i] >> 48) & 0xff; + output[j + 2] = (input[i] >> 40) & 0xff; + output[j + 3] = (input[i] >> 32) & 0xff; + output[j + 4] = (input[i] >> 24) & 0xff; + output[j + 5] = (input[i] >> 16) & 0xff; + output[j + 6] = (input[i] >> 8) & 0xff; + output[j + 7] = input[i] & 0xff; + } +} + +/* + * Implements the SHA-384, SHA-512 and SHA-512/t hash algos - to select + * between them pass the appropriate initial values for 'H'. The output + * of this function is truncated to the first 256 bits that fit into 'zcp'. + */ +static void +SHA512(uint64_t *H, const void *buf, uint64_t size, zio_cksum_t *zcp) +{ + uint64_t c64[2]; + uint8_t pad[256]; + unsigned padsize = size & 127; + unsigned i, k; + + /* process all blocks up to the last one */ + for (i = 0; i < size - padsize; i += 128) + SHA512Transform(H, (uint8_t *)buf + i); + + /* process the last block and padding */ + for (k = 0; k < padsize; k++) + pad[k] = ((uint8_t *)buf)[k+i]; + + if (padsize < 112) { + for (pad[padsize++] = 0x80; padsize < 112; padsize++) + pad[padsize] = 0; + } else { + for (pad[padsize++] = 0x80; padsize < 240; padsize++) + pad[padsize] = 0; + } + + c64[0] = 0; + c64[1] = size << 3; + Encode64(pad+padsize, c64, sizeof (c64)); + padsize += sizeof (c64); + + for (i = 0; i < padsize; i += 128) + SHA512Transform(H, pad + i); + + /* truncate the output to the first 256 bits which fit into 'zcp' */ + Encode64((uint8_t *)zcp, H, sizeof (uint64_t) * 4); +} + +static void +zio_checksum_SHA256(const void *buf, uint64_t size, + const void *ctx_template __unused, zio_cksum_t *zcp) +{ + /* SHA-256 as per FIPS 180-4. */ + uint32_t H[] = { + 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, + 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 + }; + SHA256(H, buf, size, zcp); +} + +static void +zio_checksum_SHA512_native(const void *buf, uint64_t size, + const void *ctx_template __unused, zio_cksum_t *zcp) +{ + /* SHA-512/256 as per FIPS 180-4. */ + uint64_t H[] = { + 0x22312194FC2BF72CULL, 0x9F555FA3C84C64C2ULL, + 0x2393B86B6F53B151ULL, 0x963877195940EABDULL, + 0x96283EE2A88EFFE3ULL, 0xBE5E1E2553863992ULL, + 0x2B0199FC2C85B8AAULL, 0x0EB72DDC81C52CA2ULL + }; + SHA512(H, buf, size, zcp); +} + +static void +zio_checksum_SHA512_byteswap(const void *buf, uint64_t size, + const void *ctx_template, zio_cksum_t *zcp) +{ + zio_cksum_t tmp; + + zio_checksum_SHA512_native(buf, size, ctx_template, &tmp); + zcp->zc_word[0] = BSWAP_64(tmp.zc_word[0]); + zcp->zc_word[1] = BSWAP_64(tmp.zc_word[1]); + zcp->zc_word[2] = BSWAP_64(tmp.zc_word[2]); + zcp->zc_word[3] = BSWAP_64(tmp.zc_word[3]); } Copied: stable/11/sys/cddl/boot/zfs/skein_zfs.c (from r304321, head/sys/cddl/boot/zfs/skein_zfs.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/cddl/boot/zfs/skein_zfs.c Mon Feb 5 04:00:59 2018 (r328866, copy of r304321, head/sys/cddl/boot/zfs/skein_zfs.c) @@ -0,0 +1,92 @@ +/* + * CDDL HEADER START *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Feb 5 04:46:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA35BEF05BA; Mon, 5 Feb 2018 04:46:36 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 98F6281B83; Mon, 5 Feb 2018 04:46: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8CDEF23FB0; Mon, 5 Feb 2018 04:46:36 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w154ka7n082035; Mon, 5 Feb 2018 04:46:36 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w154kaHn082034; Mon, 5 Feb 2018 04:46:36 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201802050446.w154kaHn082034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 5 Feb 2018 04:46:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328867 - head/sys/mips/conf X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/mips/conf X-SVN-Commit-Revision: 328867 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 04:46:37 -0000 Author: adrian Date: Mon Feb 5 04:46:36 2018 New Revision: 328867 URL: https://svnweb.freebsd.org/changeset/base/328867 Log: [ar71xx] New world order - don't reference ath_pci here, it's a module now Modified: head/sys/mips/conf/DB120 Modified: head/sys/mips/conf/DB120 ============================================================================== --- head/sys/mips/conf/DB120 Mon Feb 5 04:00:59 2018 (r328866) +++ head/sys/mips/conf/DB120 Mon Feb 5 04:46:36 2018 (r328867) @@ -45,7 +45,6 @@ options GEOM_UZIP device geom_map # yes, this board has a PCI connected atheros device -device ath_pci options AR71XX_ATH_EEPROM device firmware # Used by the above options ATH_EEPROM_FIRMWARE From owner-svn-src-all@freebsd.org Mon Feb 5 04:47:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73777EF06B8; Mon, 5 Feb 2018 04:47:14 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 242C581CEE; Mon, 5 Feb 2018 04:47: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F25723FB1; Mon, 5 Feb 2018 04:47: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 w154lDON082105; Mon, 5 Feb 2018 04:47:13 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w154lDbS082104; Mon, 5 Feb 2018 04:47:13 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201802050447.w154lDbS082104@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 5 Feb 2018 04:47:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328868 - head/sys/mips/conf X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/mips/conf X-SVN-Commit-Revision: 328868 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 04:47:14 -0000 Author: adrian Date: Mon Feb 5 04:47:13 2018 New Revision: 328868 URL: https://svnweb.freebsd.org/changeset/base/328868 Log: [ar71xx] AR934x is a MIPS74k board - use the right hwpmc module Modified: head/sys/mips/conf/std.AR934X Modified: head/sys/mips/conf/std.AR934X ============================================================================== --- head/sys/mips/conf/std.AR934X Mon Feb 5 04:46:36 2018 (r328867) +++ head/sys/mips/conf/std.AR934X Mon Feb 5 04:47:13 2018 (r328868) @@ -49,7 +49,7 @@ options FFS #Berkeley Fast Filesy options NO_FFS_SNAPSHOT # We don't require snapshot support include "std.AR_MIPS_BASE" -makeoptions MODULES_OVERRIDE+="hwpmc_mips24k" +makeoptions MODULES_OVERRIDE+="hwpmc_mips74k" # EEPROM caldata for AHB connected device options AR71XX_ATH_EEPROM From owner-svn-src-all@freebsd.org Mon Feb 5 04:48:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CDC3EF082A; Mon, 5 Feb 2018 04:48:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2EB0181E90; Mon, 5 Feb 2018 04:48: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0FC9223FB2; Mon, 5 Feb 2018 04:48: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 w154mfVI082198; Mon, 5 Feb 2018 04:48:41 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w154mfwv082197; Mon, 5 Feb 2018 04:48:41 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201802050448.w154mfwv082197@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 5 Feb 2018 04:48:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328869 - head/sys/mips/conf X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/mips/conf X-SVN-Commit-Revision: 328869 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 04:48:42 -0000 Author: adrian Date: Mon Feb 5 04:48:41 2018 New Revision: 328869 URL: https://svnweb.freebsd.org/changeset/base/328869 Log: [ar71xx] Fix DB120 AHB device hints in the new world order. This allows the on-chip (AHB bus) device to attach correctly as a module. Tested: * DB120, AR9344 (SoC + 2x2 2G wifi) + QCA9580 PCI 3x3 5G wifi Modified: head/sys/mips/conf/DB120.hints Modified: head/sys/mips/conf/DB120.hints ============================================================================== --- head/sys/mips/conf/DB120.hints Mon Feb 5 04:47:13 2018 (r328868) +++ head/sys/mips/conf/DB120.hints Mon Feb 5 04:48:41 2018 (r328869) @@ -84,10 +84,16 @@ hint.arge.1.miimode=1 # GMII # MAC for arge1 is the second 6 bytes of the ART hint.arge.1.eeprommac=0x1f7f0006 -# ath0: Where the ART is - last 64k in the flash -hint.ath.0.eepromaddr=0x1fff0000 -hint.ath.0.eepromsize=16384 +# ART calibration data mapping - for the AR934x AHB device +hint.ar71xx_caldata.0.at="nexus0" +hint.ar71xx_caldata.0.order=0 +# Where the ART is - last 64k in the first 8MB of flash +hint.ar71xx_caldata.0.map.0.ath_fixup_addr=0x1fff0000 +hint.ar71xx_caldata.0.map.0.ath_fixup_size=16384 +# And now tell the ath(4) driver where to look! +hint.ath.0.eeprom_firmware="ar71xx_caldata.0.map.0.eeprom_firmware" + # ath1: it's different; it's a PCIe attached device, so # we instead need to teach the PCIe bridge code about it # (ie, the 'early pci fixup' stuff that programs the PCIe @@ -119,19 +125,20 @@ hint.map.1.end=0x00050000 # 64k u-boot-env hint.map.1.name="u-boot-env" hint.map.1.readonly=1 -# 6336KiB rootfs +# 6336KiB rootfs + 1344KiB uImage; turn into a single long +# combo image for FreeBSD. + hint.map.2.at="flash/spi0" hint.map.2.start=0x00050000 -hint.map.2.end=0x00680000 # 6336k rootfs -hint.map.2.name="rootfs" -hint.map.2.readonly=1 +hint.map.2.end="search:0x00050000:0x10000:.!/bin/sh" +hint.map.2.name="kernel" +hint.map.2.readonly=0 -# 1344KiB uImage hint.map.3.at="flash/spi0" -hint.map.3.start=0x00680000 -hint.map.3.end=0x007d0000 # 1408k uImage, 64k off the end.. -hint.map.3.name="uImage" -hint.map.3.readonly=1 +hint.map.3.start="search:0x00050000:0x10000:.!/bin/sh" +hint.map.3.end=0x007d0000 +hint.map.3.name="rootfs" +hint.map.3.readonly=0 # 64KiB cfg hint.map.4.at="flash/spi0" From owner-svn-src-all@freebsd.org Mon Feb 5 05:02:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD816EF14EF; Mon, 5 Feb 2018 05:02:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 828E9826B0; Mon, 5 Feb 2018 05:02:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 63DF8242AE; Mon, 5 Feb 2018 05:02:01 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w155212G091062; Mon, 5 Feb 2018 05:02:01 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15521oo091061; Mon, 5 Feb 2018 05:02:01 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802050502.w15521oo091061@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 5 Feb 2018 05:02:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328870 - stable/11 X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11 X-SVN-Commit-Revision: 328870 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 05:02:01 -0000 Author: kevans Date: Mon Feb 5 05:02:01 2018 New Revision: 328870 URL: https://svnweb.freebsd.org/changeset/base/328870 Log: Record r303039 in mergeinfo r303039 was MFC'd in r303333 Modified: Directory Properties: stable/11/ (props changed) From owner-svn-src-all@freebsd.org Mon Feb 5 05:51:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97FBCEF3CC5; Mon, 5 Feb 2018 05:51:38 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47EDD83CCC; Mon, 5 Feb 2018 05:51:38 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 42BC524996; Mon, 5 Feb 2018 05:51: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 w155pc9T013787; Mon, 5 Feb 2018 05:51:38 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w155pcwx013786; Mon, 5 Feb 2018 05:51:38 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201802050551.w155pcwx013786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 5 Feb 2018 05:51:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328871 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/etherswitch/arswitch X-SVN-Commit-Revision: 328871 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 05:51:38 -0000 Author: adrian Date: Mon Feb 5 05:51:37 2018 New Revision: 328871 URL: https://svnweb.freebsd.org/changeset/base/328871 Log: [arswitch] Break out of the loop upon any error, not just -1. This fixes the AR9340 "unimplemented" thingy for now. Modified: head/sys/dev/etherswitch/arswitch/arswitch.c Modified: head/sys/dev/etherswitch/arswitch/arswitch.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch.c Mon Feb 5 05:02:01 2018 (r328870) +++ head/sys/dev/etherswitch/arswitch/arswitch.c Mon Feb 5 05:51:37 2018 (r328871) @@ -1187,7 +1187,7 @@ arswitch_atu_fetch_table(device_t dev, etherswitch_atu err = sc->hal.arswitch_atu_fetch_table(sc, NULL, 0); /* fetch - ideally yes we'd fetch into a separate table then switch */ - while (err != -1 && nitems < sc->atu.size) { + while (err == 0 && nitems < sc->atu.size) { err = sc->hal.arswitch_atu_fetch_table(sc, &sc->atu.entries[nitems], 1); if (err == 0) { From owner-svn-src-all@freebsd.org Mon Feb 5 07:03:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F50AECBD84; Mon, 5 Feb 2018 07:03:46 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE17385B97; Mon, 5 Feb 2018 07:03:45 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BFF09255F3; Mon, 5 Feb 2018 07:03:45 +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 w1573jNT051353; Mon, 5 Feb 2018 07:03:45 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1573jxL051352; Mon, 5 Feb 2018 07:03:45 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201802050703.w1573jxL051352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 5 Feb 2018 07:03:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328872 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/etherswitch/arswitch X-SVN-Commit-Revision: 328872 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 07:03:46 -0000 Author: adrian Date: Mon Feb 5 07:03:45 2018 New Revision: 328872 URL: https://svnweb.freebsd.org/changeset/base/328872 Log: [arswitch] fix mac address field definition. Whilst here, add some further fields for future experimenting. Tested: * AR9340 switch * AR9330 switch * AR7240 switch Modified: head/sys/dev/etherswitch/arswitch/arswitchreg.h Modified: head/sys/dev/etherswitch/arswitch/arswitchreg.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitchreg.h Mon Feb 5 05:51:37 2018 (r328871) +++ head/sys/dev/etherswitch/arswitch/arswitchreg.h Mon Feb 5 07:03:45 2018 (r328872) @@ -139,10 +139,10 @@ #define AR8216_ATU_PORT_NUM BITS(8, 4) #define AR8216_ATU_PORT_NUM_S 8 #define AR8216_ATU_FULL_VIO BIT(12) -#define AR8216_ATU_ADDR4 BITS(16, 8) -#define AR8216_ATU_ADDR4_S 16 -#define AR8216_ATU_ADDR5 BITS(24, 8) -#define AR8216_ATU_ADDR5_S 24 +#define AR8216_ATU_ADDR5 BITS(16, 8) +#define AR8216_ATU_ADDR5_S 16 +#define AR8216_ATU_ADDR4 BITS(24, 8) +#define AR8216_ATU_ADDR4_S 24 #define AR8216_REG_ATU_DATA 0x0054 #define AR8216_ATU_ADDR3 BITS(0, 8) @@ -157,13 +157,26 @@ #define AR8216_REG_ATU_CTRL2 0x0058 #define AR8216_ATU_CTRL2_DESPORT BITS(0, 5) #define AR8216_ATU_CTRL2_DESPORT_S 0 +#define AR934X_ATU_CROSS_STATE_PORT_EN BIT(8) +#define AR934X_ATU_HASH_HIGH_ADDR BIT(9) /* Used for CPU_FUNC (get_next_valid) */ #define AR8216_ATU_CTRL2_AT_PRIORITY BITS(10, 2) #define AR8216_ATU_CTRL2_AT_PRIORITY_EN BIT(12) #define AR8216_ATU_CTRL2_MIRROR_EN BIT(13) #define AR8216_ATU_CTRL2_SA_DROP_EN BIT(14) +#define AR934X_ATU_CTRL2_MAC_CLONE BIT(15) #define AR8216_ATU_CTRL2_AT_STATUS BITS(16, 4) #define AR8216_ATU_CTRL2_AT_STATUS_S 16 +/* + * For at least the AR9340 - + * 0: empty + * 1-7: dynamic, valid + * 15: static, won't be aged + */ #define AR8216_ATU_CTRL2_VLAN_LEAKY_EN BIT(24) +/* + * This defines whether this MAC will leak between VLANs; + * controlled by ARL_UNI_LEAKY_EN and ARL_MULTI_LEAKY_EN. + */ #define AR8216_ATU_CTRL2_REDIRECT2CPU BIT(25) #define AR8216_ATU_CTRL2_COPY2CPU BIT(26) @@ -351,6 +364,7 @@ #define AR934X_REG_OPER_MODE1_PHY4_MII_EN (1 << 28) #define AR934X_REG_FLOOD_MASK 0x2c +#define AR934X_FLOOD_MASK_MC_DP(_p) (1 << (0 + (_p))) #define AR934X_FLOOD_MASK_MC_DP(_p) (1 << (16 + (_p))) #define AR934X_FLOOD_MASK_BC_DP(_p) (1 << (25 + (_p))) From owner-svn-src-all@freebsd.org Mon Feb 5 07:05:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85121ECBF89; Mon, 5 Feb 2018 07:05:29 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3898B85D1B; Mon, 5 Feb 2018 07:05: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C93F255F4; Mon, 5 Feb 2018 07:05: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 w1575TLo051469; Mon, 5 Feb 2018 07:05:29 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1575T9K051468; Mon, 5 Feb 2018 07:05:29 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201802050705.w1575T9K051468@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 5 Feb 2018 07:05:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328873 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/etherswitch/arswitch X-SVN-Commit-Revision: 328873 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 07:05:29 -0000 Author: adrian Date: Mon Feb 5 07:05:28 2018 New Revision: 328873 URL: https://svnweb.freebsd.org/changeset/base/328873 Log: [arswitch] Enable ATU dump support for the AR9340. This indeed uses the same registers as the AR8216 and later chips. There seems to be an issue with ARP requests being sent out from the CPU through this switch here, so figuring that out is next. Learning works fine on the AR8327 ethernet switch on the /other/ gigabit ethernet port, so I don't think it's the network stack or ethernet driver. Tested: * DB120 - AR9340 SOC + ethernet switch (and other bits.) Modified: head/sys/dev/etherswitch/arswitch/arswitch_9340.c Modified: head/sys/dev/etherswitch/arswitch/arswitch_9340.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_9340.c Mon Feb 5 07:03:45 2018 (r328872) +++ head/sys/dev/etherswitch/arswitch/arswitch_9340.c Mon Feb 5 07:05:28 2018 (r328873) @@ -120,6 +120,11 @@ ar9340_hw_global_setup(struct arswitch_softc *sc) arswitch_modifyreg(sc->sc_dev, AR934X_REG_FLOOD_MASK, AR934X_FLOOD_MASK_MC_DP(0), AR934X_FLOOD_MASK_MC_DP(0)); +#if 0 + arswitch_modifyreg(sc->sc_dev, AR934X_REG_FLOOD_MASK, + AR934X_FLOOD_MASK_UC_DP(0), + AR934X_FLOOD_MASK_UC_DP(0)); +#endif /* Enable MIB counters */ arswitch_modifyreg(sc->sc_dev, AR8X16_REG_MIB_FUNC0, @@ -183,16 +188,6 @@ ar9340_hw_global_setup(struct arswitch_softc *sc) return (0); } -static int -ar9340_atu_fetch_table(struct arswitch_softc *sc, etherswitch_atu_entry_t *e, - int atu_fetch_op) -{ - - /* XXX TODO */ - return (ENXIO); -} - - /* * The AR9340 switch probes (almost) the same as the AR7240 on-chip switch. * @@ -223,7 +218,12 @@ ar9340_attach(struct arswitch_softc *sc) sc->hal.arswitch_hw_setup = ar9340_hw_setup; sc->hal.arswitch_hw_global_setup = ar9340_hw_global_setup; sc->hal.arswitch_atu_learn_default = ar9340_atu_learn_default; - sc->hal.arswitch_atu_fetch_table = ar9340_atu_fetch_table; + /* + * Note: the ar9340 table fetch code/registers matche + * the ar8216/ar8316 for now because we're not supporting + * static entry programming that includes any of the extra + * bits in the AR9340. + */ /* Set the switch vlan capabilities. */ sc->info.es_vlan_caps = ETHERSWITCH_VLAN_DOT1Q | From owner-svn-src-all@freebsd.org Mon Feb 5 08:20:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2DEDED8F85; Mon, 5 Feb 2018 08:20:13 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48AB0682BA; Mon, 5 Feb 2018 08:20:13 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 25FA726116; Mon, 5 Feb 2018 08:20:13 +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 w158KDLU086760; Mon, 5 Feb 2018 08:20:13 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w158KBwv086748; Mon, 5 Feb 2018 08:20:11 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201802050820.w158KBwv086748@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Mon, 5 Feb 2018 08:20:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328874 - in stable/11: contrib/file contrib/file/doc contrib/file/magic contrib/file/magic/Magdir contrib/file/python contrib/file/src contrib/file/tests lib/libmagic X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: in stable/11: contrib/file contrib/file/doc contrib/file/magic contrib/file/magic/Magdir contrib/file/python contrib/file/src contrib/file/tests lib/libmagic X-SVN-Commit-Revision: 328874 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 08:20:14 -0000 Author: eadler Date: Mon Feb 5 08:20:11 2018 New Revision: 328874 URL: https://svnweb.freebsd.org/changeset/base/328874 Log: MFC r323683: MFV r323678: file 5.32 Added: stable/11/contrib/file/magic/Magdir/apache - copied unchanged from r323683, head/contrib/file/magic/Magdir/apache stable/11/contrib/file/magic/Magdir/bhl - copied unchanged from r323683, head/contrib/file/magic/Magdir/bhl stable/11/contrib/file/magic/Magdir/gconv - copied unchanged from r323683, head/contrib/file/magic/Magdir/gconv stable/11/contrib/file/magic/Magdir/gpu - copied unchanged from r323683, head/contrib/file/magic/Magdir/gpu stable/11/contrib/file/magic/Magdir/webassembly - copied unchanged from r323683, head/contrib/file/magic/Magdir/webassembly stable/11/contrib/file/magic/Magdir/yara - copied unchanged from r323683, head/contrib/file/magic/Magdir/yara stable/11/contrib/file/tests/hddrawcopytool.result - copied unchanged from r323683, head/contrib/file/tests/hddrawcopytool.result stable/11/contrib/file/tests/hddrawcopytool.testfile - copied unchanged from r323683, head/contrib/file/tests/hddrawcopytool.testfile Modified: stable/11/contrib/file/ChangeLog stable/11/contrib/file/aclocal.m4 stable/11/contrib/file/config.guess stable/11/contrib/file/config.sub stable/11/contrib/file/configure stable/11/contrib/file/configure.ac stable/11/contrib/file/doc/file.man stable/11/contrib/file/doc/libmagic.man stable/11/contrib/file/doc/magic.man stable/11/contrib/file/magic/Localstuff stable/11/contrib/file/magic/Magdir/adventure stable/11/contrib/file/magic/Magdir/amanda stable/11/contrib/file/magic/Magdir/amigaos stable/11/contrib/file/magic/Magdir/android stable/11/contrib/file/magic/Magdir/animation stable/11/contrib/file/magic/Magdir/apple stable/11/contrib/file/magic/Magdir/archive stable/11/contrib/file/magic/Magdir/att3b stable/11/contrib/file/magic/Magdir/audio stable/11/contrib/file/magic/Magdir/blackberry stable/11/contrib/file/magic/Magdir/blender stable/11/contrib/file/magic/Magdir/c-lang stable/11/contrib/file/magic/Magdir/cad stable/11/contrib/file/magic/Magdir/cafebabe stable/11/contrib/file/magic/Magdir/clipper stable/11/contrib/file/magic/Magdir/coff stable/11/contrib/file/magic/Magdir/commands stable/11/contrib/file/magic/Magdir/compress stable/11/contrib/file/magic/Magdir/console stable/11/contrib/file/magic/Magdir/cups stable/11/contrib/file/magic/Magdir/database stable/11/contrib/file/magic/Magdir/der stable/11/contrib/file/magic/Magdir/diff stable/11/contrib/file/magic/Magdir/dolby stable/11/contrib/file/magic/Magdir/dump stable/11/contrib/file/magic/Magdir/dyadic stable/11/contrib/file/magic/Magdir/editors stable/11/contrib/file/magic/Magdir/filesystems stable/11/contrib/file/magic/Magdir/flash stable/11/contrib/file/magic/Magdir/fonts stable/11/contrib/file/magic/Magdir/fsav stable/11/contrib/file/magic/Magdir/games stable/11/contrib/file/magic/Magdir/geo stable/11/contrib/file/magic/Magdir/gnu stable/11/contrib/file/magic/Magdir/gpt stable/11/contrib/file/magic/Magdir/gringotts stable/11/contrib/file/magic/Magdir/hitachi-sh stable/11/contrib/file/magic/Magdir/ibm370 stable/11/contrib/file/magic/Magdir/ibm6000 stable/11/contrib/file/magic/Magdir/icc stable/11/contrib/file/magic/Magdir/images stable/11/contrib/file/magic/Magdir/intel stable/11/contrib/file/magic/Magdir/isz stable/11/contrib/file/magic/Magdir/jpeg stable/11/contrib/file/magic/Magdir/kerberos stable/11/contrib/file/magic/Magdir/kml stable/11/contrib/file/magic/Magdir/linux stable/11/contrib/file/magic/Magdir/lisp stable/11/contrib/file/magic/Magdir/m4 stable/11/contrib/file/magic/Magdir/macintosh stable/11/contrib/file/magic/Magdir/make stable/11/contrib/file/magic/Magdir/maple stable/11/contrib/file/magic/Magdir/marc21 stable/11/contrib/file/magic/Magdir/mathematica stable/11/contrib/file/magic/Magdir/metastore stable/11/contrib/file/magic/Magdir/meteorological stable/11/contrib/file/magic/Magdir/microfocus stable/11/contrib/file/magic/Magdir/mime stable/11/contrib/file/magic/Magdir/misctools stable/11/contrib/file/magic/Magdir/modem stable/11/contrib/file/magic/Magdir/mozilla stable/11/contrib/file/magic/Magdir/msdos stable/11/contrib/file/magic/Magdir/msvc stable/11/contrib/file/magic/Magdir/msx stable/11/contrib/file/magic/Magdir/mup stable/11/contrib/file/magic/Magdir/nasa stable/11/contrib/file/magic/Magdir/netbsd stable/11/contrib/file/magic/Magdir/netscape stable/11/contrib/file/magic/Magdir/nitpicker stable/11/contrib/file/magic/Magdir/os2 stable/11/contrib/file/magic/Magdir/os9 stable/11/contrib/file/magic/Magdir/pbf stable/11/contrib/file/magic/Magdir/pc88 stable/11/contrib/file/magic/Magdir/pc98 stable/11/contrib/file/magic/Magdir/pdf stable/11/contrib/file/magic/Magdir/pdp stable/11/contrib/file/magic/Magdir/perl stable/11/contrib/file/magic/Magdir/pgf stable/11/contrib/file/magic/Magdir/pgp stable/11/contrib/file/magic/Magdir/printer stable/11/contrib/file/magic/Magdir/project stable/11/contrib/file/magic/Magdir/psdbms stable/11/contrib/file/magic/Magdir/python stable/11/contrib/file/magic/Magdir/riff stable/11/contrib/file/magic/Magdir/ruby stable/11/contrib/file/magic/Magdir/sccs stable/11/contrib/file/magic/Magdir/scientific stable/11/contrib/file/magic/Magdir/sendmail stable/11/contrib/file/magic/Magdir/sequent stable/11/contrib/file/magic/Magdir/sgml stable/11/contrib/file/magic/Magdir/sharc stable/11/contrib/file/magic/Magdir/sketch stable/11/contrib/file/magic/Magdir/sql stable/11/contrib/file/magic/Magdir/ssl stable/11/contrib/file/magic/Magdir/sysex stable/11/contrib/file/magic/Magdir/terminfo stable/11/contrib/file/magic/Magdir/vms stable/11/contrib/file/magic/Magdir/vmware stable/11/contrib/file/magic/Magdir/vorbis stable/11/contrib/file/magic/Magdir/windows stable/11/contrib/file/magic/Magdir/xenix stable/11/contrib/file/magic/Magdir/xilinx stable/11/contrib/file/magic/Magdir/xwindows stable/11/contrib/file/magic/Makefile.am stable/11/contrib/file/magic/Makefile.in stable/11/contrib/file/python/magic.py stable/11/contrib/file/src/apprentice.c stable/11/contrib/file/src/cdf.c stable/11/contrib/file/src/cdf.h stable/11/contrib/file/src/cdf_time.c stable/11/contrib/file/src/compress.c stable/11/contrib/file/src/der.c stable/11/contrib/file/src/file.h stable/11/contrib/file/src/fsmagic.c stable/11/contrib/file/src/funcs.c stable/11/contrib/file/src/is_tar.c stable/11/contrib/file/src/magic.c stable/11/contrib/file/src/magic.h.in stable/11/contrib/file/src/print.c stable/11/contrib/file/src/readcdf.c stable/11/contrib/file/src/readelf.c stable/11/contrib/file/src/readelf.h stable/11/contrib/file/src/softmagic.c stable/11/contrib/file/src/vasprintf.c stable/11/contrib/file/tests/Makefile.am stable/11/contrib/file/tests/Makefile.in stable/11/contrib/file/tests/test.c stable/11/lib/libmagic/config.h Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/file/ChangeLog ============================================================================== --- stable/11/contrib/file/ChangeLog Mon Feb 5 07:05:28 2018 (r328873) +++ stable/11/contrib/file/ChangeLog Mon Feb 5 08:20:11 2018 (r328874) @@ -1,6 +1,60 @@ +2017-09-02 11:53 Christos Zoulas + + * release 5.32 + +2017-08-28 16:37 Christos Zoulas + + * Always reset state in {file,buffer}_apprentice (Krzysztof Wilczynski) + +2017-08-27 03:55 Christos Zoulas + + * Fix always true condition (Thomas Jarosch) + +2017-05-24 17:30 Christos Zoulas + + * pickier parsing of numeric values in magic files. + +2017-05-23 17:55 Christos Zoulas + + * PR/615 add magic_getflags() + +2017-05-23 13:55 Christos Zoulas + + * release 5.31 + +2017-03-17 20:32 Christos Zoulas + + * remove trailing spaces from magic files + * refactor is_tar + * better bounds checks for cdf + +2017-02-10 12:24 Christos Zoulas + + * release 5.30 + +2017-02-07 23:27 Christos Zoulas + + * If we exceeded the offset in a search return no match + (Christoph Biedl) + * Be more lenient on corrupt CDF files (Christoph Biedl) + +2017-02-04 16:46 Christos Zoulas + + * pacify ubsan sign extension (oss-fuzz/524) + +2017-02-01 12:42 Christos Zoulas + + * off by one in cdf parsing (PR/593) + * report debugging sections in elf (PR/591) + +2016-11-06 10:52 Christos Zoulas + + * Allow @@@ in extensions + * Add missing overflow check in der magic (Jonas Wagner) + 2016-10-25 10:40 Christos Zoulas - * release 5.28 + * release 5.29 2016-10-24 11:20 Christos Zoulas @@ -387,7 +441,7 @@ ` 2013-11-06 14:40 Christos Zoulas - * fix erroneous non-zero exit code from non-existant file and message + * fix erroneous non-zero exit code from non-existent file and message 2013-10-29 14:25 Christos Zoulas Modified: stable/11/contrib/file/aclocal.m4 ============================================================================== --- stable/11/contrib/file/aclocal.m4 Mon Feb 5 07:05:28 2018 (r328873) +++ stable/11/contrib/file/aclocal.m4 Mon Feb 5 08:20:11 2018 (r328874) @@ -21,7 +21,7 @@ If you have problems, you may need to regenerate the b To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # visibility.m4 serial 5 (gettext-0.18.2) -dnl Copyright (C) 2005, 2008, 2010-2014 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2008, 2010-2016 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. Modified: stable/11/contrib/file/config.guess ============================================================================== --- stable/11/contrib/file/config.guess Mon Feb 5 07:05:28 2018 (r328873) +++ stable/11/contrib/file/config.guess Mon Feb 5 08:20:11 2018 (r328874) @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2015 Free Software Foundation, Inc. +# Copyright 1992-2017 Free Software Foundation, Inc. -timestamp='2015-03-04' +timestamp='2017-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -27,7 +27,7 @@ timestamp='2015-03-04' # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # # Please send patches to . @@ -50,7 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2015 Free Software Foundation, Inc. +Copyright 1992-2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -186,9 +186,12 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. + # to ELF recently (or will in the future) and ABI. case "${UNAME_MACHINE_ARCH}" in - arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax) + earm*) + os=netbsdelf + ;; + arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ @@ -221,7 +224,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE release='-gnu' ;; *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: @@ -237,6 +240,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} + exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; @@ -249,6 +256,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; + *:Sortix:*:*) + echo ${UNAME_MACHINE}-unknown-sortix + exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) @@ -265,42 +275,42 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; + UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; + UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; + UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; + UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; + UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; + UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; + UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; + UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; + UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 @@ -373,16 +383,16 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build - SUN_ARCH="i386" + SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then - SUN_ARCH="x86_64" + SUN_ARCH=x86_64 fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` @@ -407,7 +417,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} @@ -632,13 +642,13 @@ EOF sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi @@ -677,11 +687,11 @@ EOF exit (0); } EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac - if [ ${HP_ARCH} = "hppa2.0w" ] + if [ ${HP_ARCH} = hppa2.0w ] then eval $set_cc_for_build @@ -694,12 +704,12 @@ EOF # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then - HP_ARCH="hppa2.0w" + HP_ARCH=hppa2.0w else - HP_ARCH="hppa64" + HP_ARCH=hppa64 fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} @@ -804,14 +814,14 @@ EOF echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) @@ -893,7 +903,7 @@ EOF exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix @@ -916,7 +926,7 @@ EOF EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="gnulibc1" ; fi + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) @@ -962,6 +972,9 @@ EOF ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; + k1om:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; @@ -987,6 +1000,9 @@ EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; + mips64el:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-${LIBC} exit ;; @@ -1019,6 +1035,9 @@ EOF ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; + riscv32:Linux:*:* | riscv64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; @@ -1038,7 +1057,7 @@ EOF echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} @@ -1117,7 +1136,7 @@ EOF # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configury will decide that + # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; @@ -1266,6 +1285,9 @@ EOF SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; + SX-ACE:SUPER-UX:*:*) + echo sxace-nec-superux${UNAME_RELEASE} + exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; @@ -1279,9 +1301,9 @@ EOF UNAME_PROCESSOR=powerpc fi if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in @@ -1303,7 +1325,7 @@ EOF exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then + if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi @@ -1334,7 +1356,7 @@ EOF # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. - if test "$cputype" = "386"; then + if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" @@ -1376,7 +1398,7 @@ EOF echo i386-pc-xenix exit ;; i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos @@ -1387,23 +1409,25 @@ EOF x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; + amd64:Isilon\ OneFS:*:*) + echo x86_64-unknown-onefs + exit ;; esac cat >&2 < in order to provide the needed -information to handle your system. +If $0 has already been updated, send the following data and any +information you think might be pertinent to config-patches@gnu.org to +provide the necessary information to handle your system. config.guess timestamp = $timestamp Modified: stable/11/contrib/file/config.sub ============================================================================== --- stable/11/contrib/file/config.sub Mon Feb 5 07:05:28 2018 (r328873) +++ stable/11/contrib/file/config.sub Mon Feb 5 08:20:11 2018 (r328874) @@ -1,8 +1,8 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2015 Free Software Foundation, Inc. +# Copyright 1992-2017 Free Software Foundation, Inc. -timestamp='2015-03-08' +timestamp='2017-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -33,7 +33,7 @@ timestamp='2015-03-08' # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases @@ -53,8 +53,7 @@ timestamp='2015-03-08' me=`echo "$0" | sed -e 's,.*/,,'` usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. @@ -68,7 +67,7 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright 1992-2015 Free Software Foundation, Inc. +Copyright 1992-2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -118,7 +117,7 @@ case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ - kopensolaris*-gnu* | \ + kopensolaris*-gnu* | cloudabi*-eabi* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` @@ -255,6 +254,7 @@ case $basic_machine in | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ + | ba \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ @@ -301,11 +301,12 @@ case $basic_machine in | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pru \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ @@ -376,6 +377,7 @@ case $basic_machine in | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ + | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ @@ -427,13 +429,15 @@ case $basic_machine in | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pru-* \ | pyramid-* \ + | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ @@ -518,7 +522,7 @@ case $basic_machine in basic_machine=i386-pc os=-aros ;; - asmjs) + asmjs) basic_machine=asmjs-unknown ;; aux) @@ -641,6 +645,14 @@ case $basic_machine in basic_machine=m68k-bull os=-sysv3 ;; + e500v[12]) + basic_machine=powerpc-unknown + os=$os"spe" + ;; + e500v[12]-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + os=$os"spe" + ;; ebmon29k) basic_machine=a29k-amd os=-ebmon @@ -1020,7 +1032,7 @@ case $basic_machine in ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - ppcle | powerpclittle | ppc-le | powerpc-little) + ppcle | powerpclittle) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) @@ -1030,7 +1042,7 @@ case $basic_machine in ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) + ppc64le | powerpc64little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) @@ -1376,18 +1388,18 @@ case $os in | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* | -cloudabi* \ + | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -bitrig* | -openbsd* | -solidbsd* \ + | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* | -cegcc* \ + | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ @@ -1396,7 +1408,8 @@ case $os in | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ + | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1528,6 +1541,8 @@ case $os in ;; -nacl*) ;; + -ios) + ;; -none) ;; *) @@ -1622,6 +1637,9 @@ case $basic_machine in ;; sparc-* | *-sun) os=-sunos4.1.1 + ;; + pru-*) + os=-elf ;; *-be) os=-beos Modified: stable/11/contrib/file/configure ============================================================================== --- stable/11/contrib/file/configure Mon Feb 5 07:05:28 2018 (r328873) +++ stable/11/contrib/file/configure Mon Feb 5 08:20:11 2018 (r328874) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for file 5.29. +# Generated by GNU Autoconf 2.69 for file 5.32. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='file' PACKAGE_TARNAME='file' -PACKAGE_VERSION='5.29' -PACKAGE_STRING='file 5.29' +PACKAGE_VERSION='5.32' +PACKAGE_STRING='file 5.32' PACKAGE_BUGREPORT='christos@astron.com' PACKAGE_URL='' @@ -1328,7 +1328,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures file 5.29 to adapt to many kinds of systems. +\`configure' configures file 5.32 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1398,7 +1398,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of file 5.29:";; + short | recursive ) echo "Configuration of file 5.32:";; esac cat <<\_ACEOF @@ -1509,7 +1509,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -file configure 5.29 +file configure 5.32 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2165,7 +2165,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by file $as_me 5.29, which was +It was created by file $as_me 5.32, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3031,7 +3031,7 @@ fi # Define the identity of the package. PACKAGE='file' - VERSION='5.29' + VERSION='5.32' cat >>confdefs.h <<_ACEOF @@ -15075,7 +15075,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by file $as_me 5.29, which was +This file was extended by file $as_me 5.32, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15141,7 +15141,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -file config.status 5.29 +file config.status 5.32 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: stable/11/contrib/file/configure.ac ============================================================================== --- stable/11/contrib/file/configure.ac Mon Feb 5 07:05:28 2018 (r328873) +++ stable/11/contrib/file/configure.ac Mon Feb 5 08:20:11 2018 (r328874) @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([file],[5.29],[christos@astron.com]) +AC_INIT([file],[5.32],[christos@astron.com]) AM_INIT_AUTOMAKE([subdir-objects foreign]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) Modified: stable/11/contrib/file/doc/file.man ============================================================================== --- stable/11/contrib/file/doc/file.man Mon Feb 5 07:05:28 2018 (r328873) +++ stable/11/contrib/file/doc/file.man Mon Feb 5 08:20:11 2018 (r328874) @@ -1,4 +1,4 @@ -.\" $File: file.man,v 1.124 2016/10/19 20:52:45 christos Exp $ +.\" $File: file.man,v 1.125 2017/01/03 11:24:46 christos Exp $ .Dd October 19, 2016 .Dt FILE __CSECTION__ .Os @@ -238,8 +238,8 @@ or at least one filename argument must be present; to test the standard input, use .Sq - as a filename argument. -Please note that -.Ar namefile +Please note that +.Ar namefile is unwrapped and the enclosed filenames are processed when this option is encountered and before any further options processing is done. This allows one to process multiple lists of files with different command line @@ -411,10 +411,10 @@ and .Fl h options. .Sh SEE ALSO -.Xr magic __FSECTION__ , .Xr hexdump 1 , .Xr od 1 , .Xr strings 1 , +.Xr magic __FSECTION__ , .Xr fstyp 8 .Sh STANDARDS CONFORMANCE This program is believed to exceed the System V Interface Definition @@ -531,16 +531,15 @@ John Gilmore revised the code extensively, making it b the first version. Geoff Collyer found several inadequacies and provided some magic file entries. -Contributions by the +Contributions of the .Sq \*[Am] operator by Rob McMahon, .Aq cudcv@warwick.ac.uk , 1989. .Pp -Guy Harris, +Guy Harris, .Aq guy@netapp.com , made many changes from 1993 to the present. -1989. .Pp Primary development and maintenance from 1990 to the present by Christos Zoulas @@ -588,7 +587,6 @@ program, and are not covered by the above license. .Nm returns 0 on success, and non-zero on error. .Sh BUGS -.Pp Please report bugs and send patches to the bug tracker at .Pa http://bugs.gw.com/ or the mailing list at @@ -597,7 +595,6 @@ or the mailing list at .Pa http://mx.gw.com/mailman/listinfo/file first to subscribe). .Sh TODO -.Pp Fix output so that tests for MIME and APPLE flags are not needed all over the place, and actual output is only done in one place. This needs a design. @@ -646,16 +643,16 @@ Fix .Dq name and .Dq use -to check for consistency at compile time (duplicate +to check for consistency at compile time (duplicate .Dq name , .Dq use pointing to undefined .Dq name ). -Make +Make .Dq name / -.Dq use +.Dq use more efficient by keeping a sorted list of names. Special-case ^ to flip endianness in the parser so that it does not have to be escaped, and document it. Modified: stable/11/contrib/file/doc/libmagic.man ============================================================================== --- stable/11/contrib/file/doc/libmagic.man Mon Feb 5 07:05:28 2018 (r328873) +++ stable/11/contrib/file/doc/libmagic.man Mon Feb 5 08:20:11 2018 (r328874) @@ -1,4 +1,4 @@ -.\" $File: libmagic.man,v 1.40 2016/03/31 17:51:12 christos Exp $ +.\" $File: libmagic.man,v 1.41 2017/05/23 21:54:07 christos Exp $ .\" .\" Copyright (c) Christos Zoulas 2003. .\" All Rights Reserved. @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 11, 2015 +.Dd May 23, 2017 .Dt LIBMAGIC 3 .Os .Sh NAME @@ -35,6 +35,7 @@ .Nm magic_errno , .Nm magic_descriptor , .Nm magic_buffer , +.Nm magic_getflags , .Nm magic_setflags , .Nm magic_check , .Nm magic_compile , @@ -64,6 +65,8 @@ .Ft const char * .Fn magic_buffer "magic_t cookie" "const void *buffer" "size_t length" .Ft int +.Fn magic_getflags "magic_t cookie" +.Ft int .Fn magic_setflags "magic_t cookie" "int flags" .Ft int .Fn magic_check "magic_t cookie" "const char *filename" @@ -204,6 +207,12 @@ function returns a textual description of the contents argument with .Ar length bytes size. +.Pp +The +.Fn magic_getflags +functions returns a value representing current +.Ar flags +set. .Pp The .Fn magic_setflags Modified: stable/11/contrib/file/doc/magic.man ============================================================================== --- stable/11/contrib/file/doc/magic.man Mon Feb 5 07:05:28 2018 (r328873) +++ stable/11/contrib/file/doc/magic.man Mon Feb 5 08:20:11 2018 (r328874) @@ -1,5 +1,5 @@ -.\" $File: magic.man,v 1.88 2016/07/27 09:42:49 rrt Exp $ -.Dd July 20, 2016 +.\" $File: magic.man,v 1.91 2017/02/12 15:30:08 christos Exp $ +.Dd February 12, 2017 .Dt MAGIC __FSECTION__ .Os .\" install as magic.4 on USG, magic.5 on V7, Berkeley and Linux systems. @@ -7,7 +7,7 @@ .Nm magic .Nd file command's magic pattern file .Sh DESCRIPTION -This manual page documents the format of the magic file as +This manual page documents the format of magic files as used by the .Xr file __CSECTION__ command, version __VERSION__. @@ -17,13 +17,19 @@ command identifies the type of a file using, among other tests, a test for whether the file contains certain .Dq "magic patterns" . -The file -.Pa __MAGIC__ -specifies what patterns are to be tested for, what message or +The database of these +.Dq "magic patterns" +is usually located in a binary file in +.Pa __MAGIC__.mgc +or a directory of source text magic pattern fragment files in +.Pa __MAGIC__ . +The database specifies what patterns are to be tested for, what message or MIME type to print if a particular pattern is found, and additional information to extract from the file. .Pp -Each line of the file specifies a test to be performed. +The format of the source fragment files that are used to build this database +is as follows: +Each line of a fragment file specifies a test to be performed. A test compares the data starting at a particular offset in the file with a byte value, a string or a numeric value. If the test succeeds, a message is printed. @@ -98,13 +104,13 @@ The following modifiers are supported: .It B A byte length (default). .It H -A 2 byte big endian length. +A 4 byte big endian length. .It h -A 2 byte big little length. +A 2 byte big endian length. .It L -A 4 byte big endian length. +A 4 byte little endian length. .It l -A 4 byte big little length. +A 2 byte little endian length. .It J The length includes itself in its count. .El @@ -651,7 +657,7 @@ start of the main indirect offset. \*[Gt]\*[Gt]\*[Gt]\*[Gt](\*[Am]0xe.l+(-4)) string PK\e3\e4 \eb, ZIP self-extracting archive .Ed .Pp -If you have a list of known avalues at a particular continuation level, +If you have a list of known values at a particular continuation level, and you want to provide a switch-like default case: .Bd -literal -offset indent # clear that continuation level match Modified: stable/11/contrib/file/magic/Localstuff ============================================================================== --- stable/11/contrib/file/magic/Localstuff Mon Feb 5 07:05:28 2018 (r328873) +++ stable/11/contrib/file/magic/Localstuff Mon Feb 5 08:20:11 2018 (r328874) @@ -2,6 +2,6 @@ #------------------------------------------------------------------------------ # Localstuff: file(1) magic for locally observed files # -# $File: Localstuff,v 1.4 2003/03/23 04:17:27 christos Exp $ +# $File: Localstuff,v 1.5 2007/01/12 17:38:27 christos Exp $ # Add any locally observed files here. Remember: # text if readable, executable if runnable binary, data if unreadable. Modified: stable/11/contrib/file/magic/Magdir/adventure ============================================================================== --- stable/11/contrib/file/magic/Magdir/adventure Mon Feb 5 07:05:28 2018 (r328873) +++ stable/11/contrib/file/magic/Magdir/adventure Mon Feb 5 08:20:11 2018 (r328874) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: adventure,v 1.15 2015/09/07 10:03:21 christos Exp $ +# $File: adventure,v 1.17 2017/07/03 16:03:40 christos Exp $ # adventure: file(1) magic for Adventure game files # # from Allen Garvin @@ -36,11 +36,12 @@ >0 ubyte <9 >>16 belong&0xfe00f0f0 0x3030 >>>0 ubyte < 10 ->>>>2 ubeshort < 10 +>>>>2 ubeshort x >>>>>18 regex [0-9][0-9][0-9][0-9][0-9][0-9] ->>>>>>0 ubyte < 10 Infocom (Z-machine %d, ->>>>>>>2 ubeshort < 10 Release %d / ->>>>>>>>18 string >\0 Serial %.6s) +>>>>>>0 ubyte < 10 Infocom (Z-machine %d +>>>>>>>2 ubeshort x \b, Release %d +>>>>>>>>18 string >\0 \b, Serial %.6s +>>>>>>>>18 string x \b) !:strength + 40 !:mime application/x-zmachine @@ -78,7 +79,7 @@ !:mime application/x-tads # Some saved game files start with "TADS2 save/g\n\r\032\0", a little-endian # 2-byte length N, the N-char name of the game file *without* a NUL (darn!), -# "TADS2 save\n\r\032\0" and the interpreter version. +# "TADS2 save\n\r\032\0" and the interpreter version. 0 string TADS2\ save/g TADS >12 belong !0x0A0D1A00 saved game data, CORRUPTED >12 belong 0x0A0D1A00 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Feb 5 08:50:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A6C1EDB5DA; Mon, 5 Feb 2018 08:50:36 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E2996947B; Mon, 5 Feb 2018 08:50: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E2E00265E0; Mon, 5 Feb 2018 08:50:35 +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 w158oZ4o001581; Mon, 5 Feb 2018 08:50:35 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w158oY6m001569; Mon, 5 Feb 2018 08:50:34 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201802050850.w158oY6m001569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Mon, 5 Feb 2018 08:50:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r328875 - in stable/10: contrib/file contrib/file/doc contrib/file/magic contrib/file/magic/Magdir contrib/file/python contrib/file/src contrib/file/tests lib/libmagic X-SVN-Group: stable-10 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: in stable/10: contrib/file contrib/file/doc contrib/file/magic contrib/file/magic/Magdir contrib/file/python contrib/file/src contrib/file/tests lib/libmagic X-SVN-Commit-Revision: 328875 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 08:50:36 -0000 Author: eadler Date: Mon Feb 5 08:50:34 2018 New Revision: 328875 URL: https://svnweb.freebsd.org/changeset/base/328875 Log: MFC r323683: MFV r323678: file 5.32 Added: stable/10/contrib/file/magic/Magdir/apache - copied unchanged from r323683, head/contrib/file/magic/Magdir/apache stable/10/contrib/file/magic/Magdir/bhl - copied unchanged from r323683, head/contrib/file/magic/Magdir/bhl stable/10/contrib/file/magic/Magdir/gconv - copied unchanged from r323683, head/contrib/file/magic/Magdir/gconv stable/10/contrib/file/magic/Magdir/gpu - copied unchanged from r323683, head/contrib/file/magic/Magdir/gpu stable/10/contrib/file/magic/Magdir/webassembly - copied unchanged from r323683, head/contrib/file/magic/Magdir/webassembly stable/10/contrib/file/magic/Magdir/yara - copied unchanged from r323683, head/contrib/file/magic/Magdir/yara stable/10/contrib/file/tests/hddrawcopytool.result - copied unchanged from r323683, head/contrib/file/tests/hddrawcopytool.result stable/10/contrib/file/tests/hddrawcopytool.testfile - copied unchanged from r323683, head/contrib/file/tests/hddrawcopytool.testfile Modified: stable/10/contrib/file/ChangeLog stable/10/contrib/file/aclocal.m4 stable/10/contrib/file/config.guess stable/10/contrib/file/config.sub stable/10/contrib/file/configure stable/10/contrib/file/configure.ac stable/10/contrib/file/doc/file.man stable/10/contrib/file/doc/libmagic.man stable/10/contrib/file/doc/magic.man stable/10/contrib/file/magic/Localstuff stable/10/contrib/file/magic/Magdir/adventure stable/10/contrib/file/magic/Magdir/amanda stable/10/contrib/file/magic/Magdir/amigaos stable/10/contrib/file/magic/Magdir/android stable/10/contrib/file/magic/Magdir/animation stable/10/contrib/file/magic/Magdir/apple stable/10/contrib/file/magic/Magdir/archive stable/10/contrib/file/magic/Magdir/att3b stable/10/contrib/file/magic/Magdir/audio stable/10/contrib/file/magic/Magdir/blackberry stable/10/contrib/file/magic/Magdir/blender stable/10/contrib/file/magic/Magdir/c-lang stable/10/contrib/file/magic/Magdir/cad stable/10/contrib/file/magic/Magdir/cafebabe stable/10/contrib/file/magic/Magdir/clipper stable/10/contrib/file/magic/Magdir/coff stable/10/contrib/file/magic/Magdir/commands stable/10/contrib/file/magic/Magdir/compress stable/10/contrib/file/magic/Magdir/console stable/10/contrib/file/magic/Magdir/cups stable/10/contrib/file/magic/Magdir/database stable/10/contrib/file/magic/Magdir/der stable/10/contrib/file/magic/Magdir/diff stable/10/contrib/file/magic/Magdir/dolby stable/10/contrib/file/magic/Magdir/dump stable/10/contrib/file/magic/Magdir/dyadic stable/10/contrib/file/magic/Magdir/editors stable/10/contrib/file/magic/Magdir/filesystems stable/10/contrib/file/magic/Magdir/flash stable/10/contrib/file/magic/Magdir/fonts stable/10/contrib/file/magic/Magdir/fsav stable/10/contrib/file/magic/Magdir/games stable/10/contrib/file/magic/Magdir/geo stable/10/contrib/file/magic/Magdir/gnu stable/10/contrib/file/magic/Magdir/gpt stable/10/contrib/file/magic/Magdir/gringotts stable/10/contrib/file/magic/Magdir/hitachi-sh stable/10/contrib/file/magic/Magdir/ibm370 stable/10/contrib/file/magic/Magdir/ibm6000 stable/10/contrib/file/magic/Magdir/icc stable/10/contrib/file/magic/Magdir/images stable/10/contrib/file/magic/Magdir/intel stable/10/contrib/file/magic/Magdir/isz stable/10/contrib/file/magic/Magdir/jpeg stable/10/contrib/file/magic/Magdir/kerberos stable/10/contrib/file/magic/Magdir/kml stable/10/contrib/file/magic/Magdir/linux stable/10/contrib/file/magic/Magdir/lisp stable/10/contrib/file/magic/Magdir/m4 stable/10/contrib/file/magic/Magdir/macintosh stable/10/contrib/file/magic/Magdir/make stable/10/contrib/file/magic/Magdir/maple stable/10/contrib/file/magic/Magdir/marc21 stable/10/contrib/file/magic/Magdir/mathematica stable/10/contrib/file/magic/Magdir/metastore stable/10/contrib/file/magic/Magdir/meteorological stable/10/contrib/file/magic/Magdir/microfocus stable/10/contrib/file/magic/Magdir/mime stable/10/contrib/file/magic/Magdir/misctools stable/10/contrib/file/magic/Magdir/modem stable/10/contrib/file/magic/Magdir/mozilla stable/10/contrib/file/magic/Magdir/msdos stable/10/contrib/file/magic/Magdir/msvc stable/10/contrib/file/magic/Magdir/msx stable/10/contrib/file/magic/Magdir/mup stable/10/contrib/file/magic/Magdir/nasa stable/10/contrib/file/magic/Magdir/netbsd stable/10/contrib/file/magic/Magdir/netscape stable/10/contrib/file/magic/Magdir/nitpicker stable/10/contrib/file/magic/Magdir/os2 stable/10/contrib/file/magic/Magdir/os9 stable/10/contrib/file/magic/Magdir/pbf stable/10/contrib/file/magic/Magdir/pc88 stable/10/contrib/file/magic/Magdir/pc98 stable/10/contrib/file/magic/Magdir/pdf stable/10/contrib/file/magic/Magdir/pdp stable/10/contrib/file/magic/Magdir/perl stable/10/contrib/file/magic/Magdir/pgf stable/10/contrib/file/magic/Magdir/pgp stable/10/contrib/file/magic/Magdir/printer stable/10/contrib/file/magic/Magdir/project stable/10/contrib/file/magic/Magdir/psdbms stable/10/contrib/file/magic/Magdir/python stable/10/contrib/file/magic/Magdir/riff stable/10/contrib/file/magic/Magdir/ruby stable/10/contrib/file/magic/Magdir/sccs stable/10/contrib/file/magic/Magdir/scientific stable/10/contrib/file/magic/Magdir/sendmail stable/10/contrib/file/magic/Magdir/sequent stable/10/contrib/file/magic/Magdir/sgml stable/10/contrib/file/magic/Magdir/sharc stable/10/contrib/file/magic/Magdir/sketch stable/10/contrib/file/magic/Magdir/sql stable/10/contrib/file/magic/Magdir/ssl stable/10/contrib/file/magic/Magdir/sysex stable/10/contrib/file/magic/Magdir/terminfo stable/10/contrib/file/magic/Magdir/vms stable/10/contrib/file/magic/Magdir/vmware stable/10/contrib/file/magic/Magdir/vorbis stable/10/contrib/file/magic/Magdir/windows stable/10/contrib/file/magic/Magdir/xenix stable/10/contrib/file/magic/Magdir/xilinx stable/10/contrib/file/magic/Magdir/xwindows stable/10/contrib/file/magic/Makefile.am stable/10/contrib/file/magic/Makefile.in stable/10/contrib/file/python/magic.py stable/10/contrib/file/src/apprentice.c stable/10/contrib/file/src/cdf.c stable/10/contrib/file/src/cdf.h stable/10/contrib/file/src/cdf_time.c stable/10/contrib/file/src/compress.c stable/10/contrib/file/src/der.c stable/10/contrib/file/src/file.h stable/10/contrib/file/src/fsmagic.c stable/10/contrib/file/src/funcs.c stable/10/contrib/file/src/is_tar.c stable/10/contrib/file/src/magic.c stable/10/contrib/file/src/magic.h.in stable/10/contrib/file/src/print.c stable/10/contrib/file/src/readcdf.c stable/10/contrib/file/src/readelf.c stable/10/contrib/file/src/readelf.h stable/10/contrib/file/src/softmagic.c stable/10/contrib/file/src/vasprintf.c stable/10/contrib/file/tests/Makefile.am stable/10/contrib/file/tests/Makefile.in stable/10/contrib/file/tests/test.c stable/10/lib/libmagic/config.h Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/file/ChangeLog ============================================================================== --- stable/10/contrib/file/ChangeLog Mon Feb 5 08:20:11 2018 (r328874) +++ stable/10/contrib/file/ChangeLog Mon Feb 5 08:50:34 2018 (r328875) @@ -1,6 +1,60 @@ +2017-09-02 11:53 Christos Zoulas + + * release 5.32 + +2017-08-28 16:37 Christos Zoulas + + * Always reset state in {file,buffer}_apprentice (Krzysztof Wilczynski) + +2017-08-27 03:55 Christos Zoulas + + * Fix always true condition (Thomas Jarosch) + +2017-05-24 17:30 Christos Zoulas + + * pickier parsing of numeric values in magic files. + +2017-05-23 17:55 Christos Zoulas + + * PR/615 add magic_getflags() + +2017-05-23 13:55 Christos Zoulas + + * release 5.31 + +2017-03-17 20:32 Christos Zoulas + + * remove trailing spaces from magic files + * refactor is_tar + * better bounds checks for cdf + +2017-02-10 12:24 Christos Zoulas + + * release 5.30 + +2017-02-07 23:27 Christos Zoulas + + * If we exceeded the offset in a search return no match + (Christoph Biedl) + * Be more lenient on corrupt CDF files (Christoph Biedl) + +2017-02-04 16:46 Christos Zoulas + + * pacify ubsan sign extension (oss-fuzz/524) + +2017-02-01 12:42 Christos Zoulas + + * off by one in cdf parsing (PR/593) + * report debugging sections in elf (PR/591) + +2016-11-06 10:52 Christos Zoulas + + * Allow @@@ in extensions + * Add missing overflow check in der magic (Jonas Wagner) + 2016-10-25 10:40 Christos Zoulas - * release 5.28 + * release 5.29 2016-10-24 11:20 Christos Zoulas @@ -387,7 +441,7 @@ ` 2013-11-06 14:40 Christos Zoulas - * fix erroneous non-zero exit code from non-existant file and message + * fix erroneous non-zero exit code from non-existent file and message 2013-10-29 14:25 Christos Zoulas Modified: stable/10/contrib/file/aclocal.m4 ============================================================================== --- stable/10/contrib/file/aclocal.m4 Mon Feb 5 08:20:11 2018 (r328874) +++ stable/10/contrib/file/aclocal.m4 Mon Feb 5 08:50:34 2018 (r328875) @@ -21,7 +21,7 @@ If you have problems, you may need to regenerate the b To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # visibility.m4 serial 5 (gettext-0.18.2) -dnl Copyright (C) 2005, 2008, 2010-2014 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2008, 2010-2016 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. Modified: stable/10/contrib/file/config.guess ============================================================================== --- stable/10/contrib/file/config.guess Mon Feb 5 08:20:11 2018 (r328874) +++ stable/10/contrib/file/config.guess Mon Feb 5 08:50:34 2018 (r328875) @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2015 Free Software Foundation, Inc. +# Copyright 1992-2017 Free Software Foundation, Inc. -timestamp='2015-03-04' +timestamp='2017-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -27,7 +27,7 @@ timestamp='2015-03-04' # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # # Please send patches to . @@ -50,7 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2015 Free Software Foundation, Inc. +Copyright 1992-2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -186,9 +186,12 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. + # to ELF recently (or will in the future) and ABI. case "${UNAME_MACHINE_ARCH}" in - arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax) + earm*) + os=netbsdelf + ;; + arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ @@ -221,7 +224,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE release='-gnu' ;; *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: @@ -237,6 +240,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} + exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; @@ -249,6 +256,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; + *:Sortix:*:*) + echo ${UNAME_MACHINE}-unknown-sortix + exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) @@ -265,42 +275,42 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; + UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; + UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; + UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; + UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; + UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; + UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; + UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; + UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; + UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 @@ -373,16 +383,16 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build - SUN_ARCH="i386" + SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then - SUN_ARCH="x86_64" + SUN_ARCH=x86_64 fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` @@ -407,7 +417,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} @@ -632,13 +642,13 @@ EOF sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi @@ -677,11 +687,11 @@ EOF exit (0); } EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac - if [ ${HP_ARCH} = "hppa2.0w" ] + if [ ${HP_ARCH} = hppa2.0w ] then eval $set_cc_for_build @@ -694,12 +704,12 @@ EOF # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then - HP_ARCH="hppa2.0w" + HP_ARCH=hppa2.0w else - HP_ARCH="hppa64" + HP_ARCH=hppa64 fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} @@ -804,14 +814,14 @@ EOF echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) @@ -893,7 +903,7 @@ EOF exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix @@ -916,7 +926,7 @@ EOF EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="gnulibc1" ; fi + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) @@ -962,6 +972,9 @@ EOF ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; + k1om:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; @@ -987,6 +1000,9 @@ EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; + mips64el:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-${LIBC} exit ;; @@ -1019,6 +1035,9 @@ EOF ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; + riscv32:Linux:*:* | riscv64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; @@ -1038,7 +1057,7 @@ EOF echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} @@ -1117,7 +1136,7 @@ EOF # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configury will decide that + # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; @@ -1266,6 +1285,9 @@ EOF SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; + SX-ACE:SUPER-UX:*:*) + echo sxace-nec-superux${UNAME_RELEASE} + exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; @@ -1279,9 +1301,9 @@ EOF UNAME_PROCESSOR=powerpc fi if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in @@ -1303,7 +1325,7 @@ EOF exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then + if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi @@ -1334,7 +1356,7 @@ EOF # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. - if test "$cputype" = "386"; then + if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" @@ -1376,7 +1398,7 @@ EOF echo i386-pc-xenix exit ;; i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos @@ -1387,23 +1409,25 @@ EOF x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; + amd64:Isilon\ OneFS:*:*) + echo x86_64-unknown-onefs + exit ;; esac cat >&2 < in order to provide the needed -information to handle your system. +If $0 has already been updated, send the following data and any +information you think might be pertinent to config-patches@gnu.org to +provide the necessary information to handle your system. config.guess timestamp = $timestamp Modified: stable/10/contrib/file/config.sub ============================================================================== --- stable/10/contrib/file/config.sub Mon Feb 5 08:20:11 2018 (r328874) +++ stable/10/contrib/file/config.sub Mon Feb 5 08:50:34 2018 (r328875) @@ -1,8 +1,8 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2015 Free Software Foundation, Inc. +# Copyright 1992-2017 Free Software Foundation, Inc. -timestamp='2015-03-08' +timestamp='2017-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -33,7 +33,7 @@ timestamp='2015-03-08' # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases @@ -53,8 +53,7 @@ timestamp='2015-03-08' me=`echo "$0" | sed -e 's,.*/,,'` usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. @@ -68,7 +67,7 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright 1992-2015 Free Software Foundation, Inc. +Copyright 1992-2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -118,7 +117,7 @@ case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ - kopensolaris*-gnu* | \ + kopensolaris*-gnu* | cloudabi*-eabi* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` @@ -255,6 +254,7 @@ case $basic_machine in | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ + | ba \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ @@ -301,11 +301,12 @@ case $basic_machine in | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pru \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ @@ -376,6 +377,7 @@ case $basic_machine in | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ + | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ @@ -427,13 +429,15 @@ case $basic_machine in | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pru-* \ | pyramid-* \ + | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ @@ -518,7 +522,7 @@ case $basic_machine in basic_machine=i386-pc os=-aros ;; - asmjs) + asmjs) basic_machine=asmjs-unknown ;; aux) @@ -641,6 +645,14 @@ case $basic_machine in basic_machine=m68k-bull os=-sysv3 ;; + e500v[12]) + basic_machine=powerpc-unknown + os=$os"spe" + ;; + e500v[12]-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + os=$os"spe" + ;; ebmon29k) basic_machine=a29k-amd os=-ebmon @@ -1020,7 +1032,7 @@ case $basic_machine in ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - ppcle | powerpclittle | ppc-le | powerpc-little) + ppcle | powerpclittle) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) @@ -1030,7 +1042,7 @@ case $basic_machine in ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) + ppc64le | powerpc64little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) @@ -1376,18 +1388,18 @@ case $os in | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* | -cloudabi* \ + | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -bitrig* | -openbsd* | -solidbsd* \ + | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* | -cegcc* \ + | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ @@ -1396,7 +1408,8 @@ case $os in | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ + | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1528,6 +1541,8 @@ case $os in ;; -nacl*) ;; + -ios) + ;; -none) ;; *) @@ -1622,6 +1637,9 @@ case $basic_machine in ;; sparc-* | *-sun) os=-sunos4.1.1 + ;; + pru-*) + os=-elf ;; *-be) os=-beos Modified: stable/10/contrib/file/configure ============================================================================== --- stable/10/contrib/file/configure Mon Feb 5 08:20:11 2018 (r328874) +++ stable/10/contrib/file/configure Mon Feb 5 08:50:34 2018 (r328875) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for file 5.29. +# Generated by GNU Autoconf 2.69 for file 5.32. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='file' PACKAGE_TARNAME='file' -PACKAGE_VERSION='5.29' -PACKAGE_STRING='file 5.29' +PACKAGE_VERSION='5.32' +PACKAGE_STRING='file 5.32' PACKAGE_BUGREPORT='christos@astron.com' PACKAGE_URL='' @@ -1328,7 +1328,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures file 5.29 to adapt to many kinds of systems. +\`configure' configures file 5.32 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1398,7 +1398,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of file 5.29:";; + short | recursive ) echo "Configuration of file 5.32:";; esac cat <<\_ACEOF @@ -1509,7 +1509,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -file configure 5.29 +file configure 5.32 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2165,7 +2165,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by file $as_me 5.29, which was +It was created by file $as_me 5.32, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3031,7 +3031,7 @@ fi # Define the identity of the package. PACKAGE='file' - VERSION='5.29' + VERSION='5.32' cat >>confdefs.h <<_ACEOF @@ -15075,7 +15075,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by file $as_me 5.29, which was +This file was extended by file $as_me 5.32, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15141,7 +15141,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -file config.status 5.29 +file config.status 5.32 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: stable/10/contrib/file/configure.ac ============================================================================== --- stable/10/contrib/file/configure.ac Mon Feb 5 08:20:11 2018 (r328874) +++ stable/10/contrib/file/configure.ac Mon Feb 5 08:50:34 2018 (r328875) @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([file],[5.29],[christos@astron.com]) +AC_INIT([file],[5.32],[christos@astron.com]) AM_INIT_AUTOMAKE([subdir-objects foreign]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) Modified: stable/10/contrib/file/doc/file.man ============================================================================== --- stable/10/contrib/file/doc/file.man Mon Feb 5 08:20:11 2018 (r328874) +++ stable/10/contrib/file/doc/file.man Mon Feb 5 08:50:34 2018 (r328875) @@ -1,4 +1,4 @@ -.\" $File: file.man,v 1.124 2016/10/19 20:52:45 christos Exp $ +.\" $File: file.man,v 1.125 2017/01/03 11:24:46 christos Exp $ .Dd October 19, 2016 .Dt FILE __CSECTION__ .Os @@ -238,8 +238,8 @@ or at least one filename argument must be present; to test the standard input, use .Sq - as a filename argument. -Please note that -.Ar namefile +Please note that +.Ar namefile is unwrapped and the enclosed filenames are processed when this option is encountered and before any further options processing is done. This allows one to process multiple lists of files with different command line @@ -411,10 +411,10 @@ and .Fl h options. .Sh SEE ALSO -.Xr magic __FSECTION__ , .Xr hexdump 1 , .Xr od 1 , .Xr strings 1 , +.Xr magic __FSECTION__ , .Xr fstyp 8 .Sh STANDARDS CONFORMANCE This program is believed to exceed the System V Interface Definition @@ -531,16 +531,15 @@ John Gilmore revised the code extensively, making it b the first version. Geoff Collyer found several inadequacies and provided some magic file entries. -Contributions by the +Contributions of the .Sq \*[Am] operator by Rob McMahon, .Aq cudcv@warwick.ac.uk , 1989. .Pp -Guy Harris, +Guy Harris, .Aq guy@netapp.com , made many changes from 1993 to the present. -1989. .Pp Primary development and maintenance from 1990 to the present by Christos Zoulas @@ -588,7 +587,6 @@ program, and are not covered by the above license. .Nm returns 0 on success, and non-zero on error. .Sh BUGS -.Pp Please report bugs and send patches to the bug tracker at .Pa http://bugs.gw.com/ or the mailing list at @@ -597,7 +595,6 @@ or the mailing list at .Pa http://mx.gw.com/mailman/listinfo/file first to subscribe). .Sh TODO -.Pp Fix output so that tests for MIME and APPLE flags are not needed all over the place, and actual output is only done in one place. This needs a design. @@ -646,16 +643,16 @@ Fix .Dq name and .Dq use -to check for consistency at compile time (duplicate +to check for consistency at compile time (duplicate .Dq name , .Dq use pointing to undefined .Dq name ). -Make +Make .Dq name / -.Dq use +.Dq use more efficient by keeping a sorted list of names. Special-case ^ to flip endianness in the parser so that it does not have to be escaped, and document it. Modified: stable/10/contrib/file/doc/libmagic.man ============================================================================== --- stable/10/contrib/file/doc/libmagic.man Mon Feb 5 08:20:11 2018 (r328874) +++ stable/10/contrib/file/doc/libmagic.man Mon Feb 5 08:50:34 2018 (r328875) @@ -1,4 +1,4 @@ -.\" $File: libmagic.man,v 1.40 2016/03/31 17:51:12 christos Exp $ +.\" $File: libmagic.man,v 1.41 2017/05/23 21:54:07 christos Exp $ .\" .\" Copyright (c) Christos Zoulas 2003. .\" All Rights Reserved. @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 11, 2015 +.Dd May 23, 2017 .Dt LIBMAGIC 3 .Os .Sh NAME @@ -35,6 +35,7 @@ .Nm magic_errno , .Nm magic_descriptor , .Nm magic_buffer , +.Nm magic_getflags , .Nm magic_setflags , .Nm magic_check , .Nm magic_compile , @@ -64,6 +65,8 @@ .Ft const char * .Fn magic_buffer "magic_t cookie" "const void *buffer" "size_t length" .Ft int +.Fn magic_getflags "magic_t cookie" +.Ft int .Fn magic_setflags "magic_t cookie" "int flags" .Ft int .Fn magic_check "magic_t cookie" "const char *filename" @@ -204,6 +207,12 @@ function returns a textual description of the contents argument with .Ar length bytes size. +.Pp +The +.Fn magic_getflags +functions returns a value representing current +.Ar flags +set. .Pp The .Fn magic_setflags Modified: stable/10/contrib/file/doc/magic.man ============================================================================== --- stable/10/contrib/file/doc/magic.man Mon Feb 5 08:20:11 2018 (r328874) +++ stable/10/contrib/file/doc/magic.man Mon Feb 5 08:50:34 2018 (r328875) @@ -1,5 +1,5 @@ -.\" $File: magic.man,v 1.88 2016/07/27 09:42:49 rrt Exp $ -.Dd July 20, 2016 +.\" $File: magic.man,v 1.91 2017/02/12 15:30:08 christos Exp $ +.Dd February 12, 2017 .Dt MAGIC __FSECTION__ .Os .\" install as magic.4 on USG, magic.5 on V7, Berkeley and Linux systems. @@ -7,7 +7,7 @@ .Nm magic .Nd file command's magic pattern file .Sh DESCRIPTION -This manual page documents the format of the magic file as +This manual page documents the format of magic files as used by the .Xr file __CSECTION__ command, version __VERSION__. @@ -17,13 +17,19 @@ command identifies the type of a file using, among other tests, a test for whether the file contains certain .Dq "magic patterns" . -The file -.Pa __MAGIC__ -specifies what patterns are to be tested for, what message or +The database of these +.Dq "magic patterns" +is usually located in a binary file in +.Pa __MAGIC__.mgc +or a directory of source text magic pattern fragment files in +.Pa __MAGIC__ . +The database specifies what patterns are to be tested for, what message or MIME type to print if a particular pattern is found, and additional information to extract from the file. .Pp -Each line of the file specifies a test to be performed. +The format of the source fragment files that are used to build this database +is as follows: +Each line of a fragment file specifies a test to be performed. A test compares the data starting at a particular offset in the file with a byte value, a string or a numeric value. If the test succeeds, a message is printed. @@ -98,13 +104,13 @@ The following modifiers are supported: .It B A byte length (default). .It H -A 2 byte big endian length. +A 4 byte big endian length. .It h -A 2 byte big little length. +A 2 byte big endian length. .It L -A 4 byte big endian length. +A 4 byte little endian length. .It l -A 4 byte big little length. +A 2 byte little endian length. .It J The length includes itself in its count. .El @@ -651,7 +657,7 @@ start of the main indirect offset. \*[Gt]\*[Gt]\*[Gt]\*[Gt](\*[Am]0xe.l+(-4)) string PK\e3\e4 \eb, ZIP self-extracting archive .Ed .Pp -If you have a list of known avalues at a particular continuation level, +If you have a list of known values at a particular continuation level, and you want to provide a switch-like default case: .Bd -literal -offset indent # clear that continuation level match Modified: stable/10/contrib/file/magic/Localstuff ============================================================================== --- stable/10/contrib/file/magic/Localstuff Mon Feb 5 08:20:11 2018 (r328874) +++ stable/10/contrib/file/magic/Localstuff Mon Feb 5 08:50:34 2018 (r328875) @@ -2,6 +2,6 @@ #------------------------------------------------------------------------------ # Localstuff: file(1) magic for locally observed files # -# $File: Localstuff,v 1.4 2003/03/23 04:17:27 christos Exp $ +# $File: Localstuff,v 1.5 2007/01/12 17:38:27 christos Exp $ # Add any locally observed files here. Remember: # text if readable, executable if runnable binary, data if unreadable. Modified: stable/10/contrib/file/magic/Magdir/adventure ============================================================================== --- stable/10/contrib/file/magic/Magdir/adventure Mon Feb 5 08:20:11 2018 (r328874) +++ stable/10/contrib/file/magic/Magdir/adventure Mon Feb 5 08:50:34 2018 (r328875) @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ -# $File: adventure,v 1.15 2015/09/07 10:03:21 christos Exp $ +# $File: adventure,v 1.17 2017/07/03 16:03:40 christos Exp $ # adventure: file(1) magic for Adventure game files # # from Allen Garvin @@ -36,11 +36,12 @@ >0 ubyte <9 >>16 belong&0xfe00f0f0 0x3030 >>>0 ubyte < 10 ->>>>2 ubeshort < 10 +>>>>2 ubeshort x >>>>>18 regex [0-9][0-9][0-9][0-9][0-9][0-9] ->>>>>>0 ubyte < 10 Infocom (Z-machine %d, ->>>>>>>2 ubeshort < 10 Release %d / ->>>>>>>>18 string >\0 Serial %.6s) +>>>>>>0 ubyte < 10 Infocom (Z-machine %d +>>>>>>>2 ubeshort x \b, Release %d +>>>>>>>>18 string >\0 \b, Serial %.6s +>>>>>>>>18 string x \b) !:strength + 40 !:mime application/x-zmachine @@ -78,7 +79,7 @@ !:mime application/x-tads # Some saved game files start with "TADS2 save/g\n\r\032\0", a little-endian # 2-byte length N, the N-char name of the game file *without* a NUL (darn!), -# "TADS2 save\n\r\032\0" and the interpreter version. +# "TADS2 save\n\r\032\0" and the interpreter version. 0 string TADS2\ save/g TADS >12 belong !0x0A0D1A00 saved game data, CORRUPTED >12 belong 0x0A0D1A00 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Feb 5 09:22:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8353EDDEEB; Mon, 5 Feb 2018 09:22:07 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF5656A8B1; Mon, 5 Feb 2018 09:22:07 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B9C8226B16; Mon, 5 Feb 2018 09:22:07 +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 w159M7a7020871; Mon, 5 Feb 2018 09:22:07 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w159M7TP020867; Mon, 5 Feb 2018 09:22:07 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201802050922.w159M7TP020867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 5 Feb 2018 09:22:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328876 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 328876 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 09:22:08 -0000 Author: ae Date: Mon Feb 5 09:22:07 2018 New Revision: 328876 URL: https://svnweb.freebsd.org/changeset/base/328876 Log: Modify ip6_get_prevhdr() to be able use it safely. Instead of returning pointer to the previous header, return its offset. In frag6_input() use m_copyback() and determined offset to store next header instead of accessing to it by pointer and assuming that the memory is contiguous. In rip6_input() use offset returned by ip6_get_prevhdr() instead of calculating it from pointers arithmetic, because IP header can belong to another mbuf in the chain. Reported by: Maxime Villard Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D14158 Modified: head/sys/netinet6/frag6.c head/sys/netinet6/ip6_input.c head/sys/netinet6/ip6_var.h head/sys/netinet6/raw_ip6.c Modified: head/sys/netinet6/frag6.c ============================================================================== --- head/sys/netinet6/frag6.c Mon Feb 5 08:50:34 2018 (r328875) +++ head/sys/netinet6/frag6.c Mon Feb 5 09:22:07 2018 (r328876) @@ -578,10 +578,8 @@ insert: /* * Store NXT to the original. */ - { - char *prvnxtp = ip6_get_prevhdr(m, offset); /* XXX */ - *prvnxtp = nxt; - } + m_copyback(m, ip6_get_prevhdr(m, offset), sizeof(uint8_t), + (caddr_t)&nxt); frag6_remque(q6); V_frag6_nfrags -= q6->ip6q_nfrag; Modified: head/sys/netinet6/ip6_input.c ============================================================================== --- head/sys/netinet6/ip6_input.c Mon Feb 5 08:50:34 2018 (r328875) +++ head/sys/netinet6/ip6_input.c Mon Feb 5 09:22:07 2018 (r328876) @@ -1711,49 +1711,39 @@ ip6_pullexthdr(struct mbuf *m, size_t off, int nxt) /* * Get pointer to the previous header followed by the header * currently processed. - * XXX: This function supposes that - * M includes all headers, - * the next header field and the header length field of each header - * are valid, and - * the sum of each header length equals to OFF. - * Because of these assumptions, this function must be called very - * carefully. Moreover, it will not be used in the near future when - * we develop `neater' mechanism to process extension headers. */ -char * +int ip6_get_prevhdr(const struct mbuf *m, int off) { - struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); + struct ip6_ext ip6e; + struct ip6_hdr *ip6; + int len, nlen, nxt; if (off == sizeof(struct ip6_hdr)) - return (&ip6->ip6_nxt); - else { - int len, nxt; - struct ip6_ext *ip6e = NULL; + return (offsetof(struct ip6_hdr, ip6_nxt)); + if (off < sizeof(struct ip6_hdr)) + panic("%s: off < sizeof(struct ip6_hdr)", __func__); - nxt = ip6->ip6_nxt; - len = sizeof(struct ip6_hdr); - while (len < off) { - ip6e = (struct ip6_ext *)(mtod(m, caddr_t) + len); - - switch (nxt) { - case IPPROTO_FRAGMENT: - len += sizeof(struct ip6_frag); - break; - case IPPROTO_AH: - len += (ip6e->ip6e_len + 2) << 2; - break; - default: - len += (ip6e->ip6e_len + 1) << 3; - break; - } - nxt = ip6e->ip6e_nxt; + ip6 = mtod(m, struct ip6_hdr *); + nxt = ip6->ip6_nxt; + len = sizeof(struct ip6_hdr); + nlen = 0; + while (len < off) { + m_copydata(m, len, sizeof(ip6e), (caddr_t)&ip6e); + switch (nxt) { + case IPPROTO_FRAGMENT: + nlen = sizeof(struct ip6_frag); + break; + case IPPROTO_AH: + nlen = (ip6e.ip6e_len + 2) << 2; + break; + default: + nlen = (ip6e.ip6e_len + 1) << 3; } - if (ip6e) - return (&ip6e->ip6e_nxt); - else - return NULL; + len += nlen; + nxt = ip6e.ip6e_nxt; } + return (len - nlen); } /* Modified: head/sys/netinet6/ip6_var.h ============================================================================== --- head/sys/netinet6/ip6_var.h Mon Feb 5 08:50:34 2018 (r328875) +++ head/sys/netinet6/ip6_var.h Mon Feb 5 09:22:07 2018 (r328876) @@ -364,7 +364,7 @@ void ip6_direct_input(struct mbuf *); void ip6_freepcbopts(struct ip6_pktopts *); int ip6_unknown_opt(u_int8_t *, struct mbuf *, int); -char * ip6_get_prevhdr(const struct mbuf *, int); +int ip6_get_prevhdr(const struct mbuf *, int); int ip6_nexthdr(const struct mbuf *, int, int, int *); int ip6_lasthdr(const struct mbuf *, int, int, int *); Modified: head/sys/netinet6/raw_ip6.c ============================================================================== --- head/sys/netinet6/raw_ip6.c Mon Feb 5 08:50:34 2018 (r328875) +++ head/sys/netinet6/raw_ip6.c Mon Feb 5 09:22:07 2018 (r328876) @@ -325,12 +325,10 @@ rip6_input(struct mbuf **mp, int *offp, int proto) RIP6STAT_INC(rip6s_nosockmcast); if (proto == IPPROTO_NONE) m_freem(m); - else { - char *prvnxtp = ip6_get_prevhdr(m, *offp); /* XXX */ + else icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_NEXTHEADER, - prvnxtp - mtod(m, char *)); - } + ip6_get_prevhdr(m, *offp)); IP6STAT_DEC(ip6s_delivered); } return (IPPROTO_DONE); From owner-svn-src-all@freebsd.org Mon Feb 5 09:25:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F418AEDE2BA; Mon, 5 Feb 2018 09:25:02 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A6D816AB0A; Mon, 5 Feb 2018 09:25:02 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D9D626C36; Mon, 5 Feb 2018 09:25:02 +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 w159P2b4021712; Mon, 5 Feb 2018 09:25:02 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w159P2Yl021711; Mon, 5 Feb 2018 09:25:02 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201802050925.w159P2Yl021711@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 5 Feb 2018 09:25:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328877 - stable/11/sys/netinet6 X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/11/sys/netinet6 X-SVN-Commit-Revision: 328877 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 09:25:03 -0000 Author: ae Date: Mon Feb 5 09:25:02 2018 New Revision: 328877 URL: https://svnweb.freebsd.org/changeset/base/328877 Log: MFC r328770: Merge r1.120 from NetBSD: Fix a pretty simple, yet pretty tragic typo: we should return IPPROTO_DONE, not IPPROTO_NONE. With IPPROTO_NONE we will keep parsing the header chain on an mbuf that was already freed. Reported by: Maxime Villard Modified: stable/11/sys/netinet6/ip6_mroute.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet6/ip6_mroute.c ============================================================================== --- stable/11/sys/netinet6/ip6_mroute.c Mon Feb 5 09:22:07 2018 (r328876) +++ stable/11/sys/netinet6/ip6_mroute.c Mon Feb 5 09:25:02 2018 (r328877) @@ -1854,7 +1854,7 @@ pim6_input(struct mbuf **mp, int *offp, int proto) "of the inner packet", (eip6->ip6_vfc & IPV6_VERSION)); m_freem(m); - return (IPPROTO_NONE); + return (IPPROTO_DONE); } /* verify the inner packet is destined to a mcast group */ From owner-svn-src-all@freebsd.org Mon Feb 5 09:25:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D34D3EDE39A; Mon, 5 Feb 2018 09:25:53 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 892986AC4B; Mon, 5 Feb 2018 09:25:53 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 83DED26C37; Mon, 5 Feb 2018 09:25:53 +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 w159PrYR021795; Mon, 5 Feb 2018 09:25:53 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w159PriS021794; Mon, 5 Feb 2018 09:25:53 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201802050925.w159PriS021794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 5 Feb 2018 09:25: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: r328878 - stable/10/sys/netinet6 X-SVN-Group: stable-10 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/10/sys/netinet6 X-SVN-Commit-Revision: 328878 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 09:25:54 -0000 Author: ae Date: Mon Feb 5 09:25:53 2018 New Revision: 328878 URL: https://svnweb.freebsd.org/changeset/base/328878 Log: MFC r328770: Merge r1.120 from NetBSD: Fix a pretty simple, yet pretty tragic typo: we should return IPPROTO_DONE, not IPPROTO_NONE. With IPPROTO_NONE we will keep parsing the header chain on an mbuf that was already freed. Reported by: Maxime Villard Modified: stable/10/sys/netinet6/ip6_mroute.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet6/ip6_mroute.c ============================================================================== --- stable/10/sys/netinet6/ip6_mroute.c Mon Feb 5 09:25:02 2018 (r328877) +++ stable/10/sys/netinet6/ip6_mroute.c Mon Feb 5 09:25:53 2018 (r328878) @@ -1840,7 +1840,7 @@ pim6_input(struct mbuf **mp, int *offp, int proto) "of the inner packet", (eip6->ip6_vfc & IPV6_VERSION)); m_freem(m); - return (IPPROTO_NONE); + return (IPPROTO_DONE); } /* verify the inner packet is destined to a mcast group */ From owner-svn-src-all@freebsd.org Mon Feb 5 10:29:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BE64EE332D; Mon, 5 Feb 2018 10:29:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F2E86CD19; Mon, 5 Feb 2018 10:29:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 35EFA275F2; Mon, 5 Feb 2018 10:29:58 +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 w15ATwxx051478; Mon, 5 Feb 2018 10:29:58 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15ATwak051477; Mon, 5 Feb 2018 10:29:58 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201802051029.w15ATwak051477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 5 Feb 2018 10:29:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328879 - stable/11/sys/vm X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/vm X-SVN-Commit-Revision: 328879 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 10:29:58 -0000 Author: kib Date: Mon Feb 5 10:29:57 2018 New Revision: 328879 URL: https://svnweb.freebsd.org/changeset/base/328879 Log: MFC r328773: On pageout, in vnode generic pager, for partially dirty page, only clear dirty bits for completely invalid blocks. PR: 225586 Modified: stable/11/sys/vm/vnode_pager.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vnode_pager.c ============================================================================== --- stable/11/sys/vm/vnode_pager.c Mon Feb 5 09:25:53 2018 (r328878) +++ stable/11/sys/vm/vnode_pager.c Mon Feb 5 10:29:57 2018 (r328879) @@ -1223,6 +1223,8 @@ vnode_pager_generic_putpages(struct vnode *vp, vm_page maxsize = object->un_pager.vnp.vnp_size - poffset; ncount = btoc(maxsize); if ((pgoff = (int)maxsize & PAGE_MASK) != 0) { + pgoff = roundup2(pgoff, DEV_BSIZE); + /* * If the object is locked and the following * conditions hold, then the page's dirty From owner-svn-src-all@freebsd.org Mon Feb 5 12:49:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B2CCEEDC3A; Mon, 5 Feb 2018 12:49:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C333D71C5D; Mon, 5 Feb 2018 12:49:20 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A54BDD29; Mon, 5 Feb 2018 12:49: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 w15CnKnL020408; Mon, 5 Feb 2018 12:49:20 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15CnKxn020407; Mon, 5 Feb 2018 12:49:20 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201802051249.w15CnKxn020407@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 5 Feb 2018 12:49:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328880 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 328880 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 12:49:21 -0000 Author: kib Date: Mon Feb 5 12:49:20 2018 New Revision: 328880 URL: https://svnweb.freebsd.org/changeset/base/328880 Log: On munlock(), unwire correct page. It is possible, for complex fork()/collapse situations, to have sibling address spaces to partially share shadow chains. If one sibling performs wiring, it can happen that a transient page, invalid and busy, is installed into a shadow object which is visible to other sibling for the duration of vm_fault_hold(). When the backing object contains the valid page, and the wiring is performed on read-only entry, the transient page is eventually removed. But the sibling which observed the transient page might perform the unwire, executing vm_object_unwire(). There, the first page found in the shadow chain is considered as the page that was wired for the mapping. It is really the page below it which is wired. So we unwire the wrong page, either triggering the asserts of breaking the page' wire counter. As the fix, wait for the busy state to finish if we find such page during unwire, and restart the shadow chain walk after the sleep. Reported and tested by: pho Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D14184 Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Mon Feb 5 10:29:57 2018 (r328879) +++ head/sys/vm/vm_object.c Mon Feb 5 12:49:20 2018 (r328880) @@ -2278,7 +2278,7 @@ void vm_object_unwire(vm_object_t object, vm_ooffset_t offset, vm_size_t length, uint8_t queue) { - vm_object_t tobject; + vm_object_t tobject, t1object; vm_page_t m, tm; vm_pindex_t end_pindex, pindex, tpindex; int depth, locked_depth; @@ -2292,6 +2292,7 @@ vm_object_unwire(vm_object_t object, vm_ooffset_t offs return; pindex = OFF_TO_IDX(offset); end_pindex = pindex + atop(length); +again: locked_depth = 1; VM_OBJECT_RLOCK(object); m = vm_page_find_least(object, pindex); @@ -2325,16 +2326,26 @@ vm_object_unwire(vm_object_t object, vm_ooffset_t offs m = TAILQ_NEXT(m, listq); } vm_page_lock(tm); + if (vm_page_xbusied(tm)) { + for (tobject = object; locked_depth >= 1; + locked_depth--) { + t1object = tobject->backing_object; + VM_OBJECT_RUNLOCK(tobject); + tobject = t1object; + } + vm_page_busy_sleep(tm, "unwbo", true); + goto again; + } vm_page_unwire(tm, queue); vm_page_unlock(tm); next_page: pindex++; } /* Release the accumulated object locks. */ - for (depth = 0; depth < locked_depth; depth++) { - tobject = object->backing_object; - VM_OBJECT_RUNLOCK(object); - object = tobject; + for (tobject = object; locked_depth >= 1; locked_depth--) { + t1object = tobject->backing_object; + VM_OBJECT_RUNLOCK(tobject); + tobject = t1object; } } From owner-svn-src-all@freebsd.org Mon Feb 5 14:19:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55FB8EF3C74; Mon, 5 Feb 2018 14:19:37 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B682751D8; Mon, 5 Feb 2018 14:19:37 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 012341B96; Mon, 5 Feb 2018 14:19:36 +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 w15EJa5Z065380; Mon, 5 Feb 2018 14:19:36 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15EJarM065379; Mon, 5 Feb 2018 14:19:36 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802051419.w15EJarM065379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 5 Feb 2018 14:19:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328881 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 328881 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 14:19:37 -0000 Author: avg Date: Mon Feb 5 14:19:36 2018 New Revision: 328881 URL: https://svnweb.freebsd.org/changeset/base/328881 Log: zfs: move a utility function, ioflags, closer to its consumers No functional change. MFC after: 1 week 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 Feb 5 12:49:20 2018 (r328880) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Feb 5 14:19:36 2018 (r328881) @@ -4514,21 +4514,6 @@ zfs_setsecattr(vnode_t *vp, vsecattr_t *vsecp, int fla } static int -ioflags(int ioflags) -{ - int flags = 0; - - if (ioflags & IO_APPEND) - flags |= FAPPEND; - if (ioflags & IO_NDELAY) - flags |= FNONBLOCK; - if (ioflags & IO_SYNC) - flags |= (FSYNC | FDSYNC | FRSYNC); - - return (flags); -} - -static int zfs_getpages(struct vnode *vp, vm_page_t *m, int count, int *rbehind, int *rahead) { @@ -4848,6 +4833,21 @@ zfs_freebsd_ioctl(ap) return (zfs_ioctl(ap->a_vp, ap->a_command, (intptr_t)ap->a_data, ap->a_fflag, ap->a_cred, NULL, NULL)); +} + +static int +ioflags(int ioflags) +{ + int flags = 0; + + if (ioflags & IO_APPEND) + flags |= FAPPEND; + if (ioflags & IO_NDELAY) + flags |= FNONBLOCK; + if (ioflags & IO_SYNC) + flags |= (FSYNC | FDSYNC | FRSYNC); + + return (flags); } static int From owner-svn-src-all@freebsd.org Mon Feb 5 14:30:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17600EF4771; Mon, 5 Feb 2018 14:30:28 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B743E75887; Mon, 5 Feb 2018 14:30:27 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE0B71D32; Mon, 5 Feb 2018 14:30:27 +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 w15EURHB070274; Mon, 5 Feb 2018 14:30:27 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15EURWm070273; Mon, 5 Feb 2018 14:30:27 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201802051430.w15EURWm070273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 5 Feb 2018 14:30:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328882 - head/sys/fs/ext2fs X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/fs/ext2fs X-SVN-Commit-Revision: 328882 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 14:30:28 -0000 Author: pfg Date: Mon Feb 5 14:30:27 2018 New Revision: 328882 URL: https://svnweb.freebsd.org/changeset/base/328882 Log: ext2fs: Cleanup variable assignments for extents. Delay the initialization of variables until the are needed. In the case of ext4_ext_rm_leaf(), make sure 'error' value is not undefined. Reported by: Clang's static analyzer Differential Revision: https://reviews.freebsd.org/D14193 Modified: head/sys/fs/ext2fs/ext2_extents.c Modified: head/sys/fs/ext2fs/ext2_extents.c ============================================================================== --- head/sys/fs/ext2fs/ext2_extents.c Mon Feb 5 14:19:36 2018 (r328881) +++ head/sys/fs/ext2fs/ext2_extents.c Mon Feb 5 14:30:27 2018 (r328882) @@ -1159,14 +1159,13 @@ ext4_new_blocks(struct inode *ip, daddr_t lbn, e4fs_da struct m_ext2fs *fs; e4fs_daddr_t newblk; - fs = ip->i_e2fs; - /* * We will allocate only single block for now. */ if (*count > 1) return (0); + fs = ip->i_e2fs; EXT2_LOCK(ip->i_ump); *perror = ext2_alloc(ip, lbn, pref, (int)fs->e2fs_bsize, cred, &newblk); if (*perror) @@ -1193,13 +1192,12 @@ ext4_ext_get_blocks(struct inode *ip, e4fs_daddr_t ibl unsigned long allocated = 0; int error = 0, depth; - fs = ip->i_e2fs; - *pallocated = 0; - path = NULL; if(bpp) *bpp = NULL; + *pallocated = 0; /* Check cache. */ + path = NULL; if ((bpref = ext4_ext_in_cache(ip, iblk, &newex))) { if (bpref == EXT4_EXT_CACHE_IN) { /* Block is already allocated. */ @@ -1271,6 +1269,7 @@ out: if (bpp) { + fs = ip->i_e2fs; error = bread(ip->i_devvp, fsbtodb(fs, newblk), fs->e2fs_bsize, cred, &bp); if (error) { @@ -1304,7 +1303,7 @@ static inline struct ext4_extent_header * ext4_ext_header(struct inode *ip) { - return (struct ext4_extent_header *)ip->i_db; + return ((struct ext4_extent_header *)ip->i_db); } static int @@ -1345,19 +1344,15 @@ static int ext4_ext_rm_leaf(struct inode *ip, struct ext4_extent_path *path, uint64_t start) { - struct m_ext2fs *fs; - int depth; struct ext4_extent_header *eh; + struct ext4_extent *ex; unsigned int a, b, block, num; unsigned long ex_blk; unsigned short ex_len; - struct ext4_extent *ex; + int depth; int error, correct_index; - fs = ip->i_e2fs; depth = ext4_ext_inode_depth(ip); - correct_index = 0; - if (!path[depth].ep_header) { if (path[depth].ep_data == NULL) return (EINVAL); @@ -1367,7 +1362,8 @@ ext4_ext_rm_leaf(struct inode *ip, struct ext4_extent_ eh = path[depth].ep_header; if (!eh) { - ext2_fserr(fs, ip->i_uid, "bad header => extent corrupted"); + ext2_fserr(ip->i_e2fs, ip->i_uid, + "bad header => extent corrupted"); return (EIO); } @@ -1375,6 +1371,8 @@ ext4_ext_rm_leaf(struct inode *ip, struct ext4_extent_ ex_blk = ex->e_blk; ex_len = ext4_ext_get_actual_len(ex); + error = 0; + correct_index = 0; while (ex >= EXT_FIRST_EXTENT(eh) && ex_blk + ex_len > start) { path[depth].ep_ext = ex; a = ex_blk > start ? ex_blk : start; @@ -1442,7 +1440,6 @@ ext4_read_extent_tree_block(struct inode *ip, e4fs_dad int error; fs = ip->i_e2fs; - error = bread(ip->i_devvp, fsbtodb(fs, pblk), fs->e2fs_bsize, NOCRED, &bp); if (error) { @@ -1506,10 +1503,10 @@ ext4_ext_remove_space(struct inode *ip, off_t length, if (!path) return (ENOMEM); - i = 0; path[0].ep_header = ehp; path[0].ep_depth = depth; - while (i >= 0 && error == 0) { + i = 0; + while (error == 0 && i >= 0) { if (i == depth) { /* This is leaf. */ error = ext4_ext_rm_leaf(ip, path, length); @@ -1568,7 +1565,6 @@ ext4_ext_remove_space(struct inode *ip, off_t length, ext4_ext_header(ip)->eh_depth = 0; ext4_ext_header(ip)->eh_max = ext4_ext_space_root(ip); ext4_ext_dirty(ip, path); - } ext4_ext_drop_refs(path); From owner-svn-src-all@freebsd.org Mon Feb 5 14:53:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 500EDEC9680; Mon, 5 Feb 2018 14:53:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 01E8D76844; Mon, 5 Feb 2018 14:53:19 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F0A3721FB; Mon, 5 Feb 2018 14:53:18 +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 w15ErIc4084865; Mon, 5 Feb 2018 14:53:18 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15ErI2M084863; Mon, 5 Feb 2018 14:53:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201802051453.w15ErI2M084863@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 5 Feb 2018 14:53:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328883 - in head/sys/modules: linux linux64 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/sys/modules: linux linux64 X-SVN-Commit-Revision: 328883 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 14:53:19 -0000 Author: emaste Date: Mon Feb 5 14:53:18 2018 New Revision: 328883 URL: https://svnweb.freebsd.org/changeset/base/328883 Log: Move assym.s to DPSRCS in linux modules assym.s exists only to be included by other .s files, and should not actually be assembled by itself. Sponsored by: Turing Robotic Industries Inc. Modified: head/sys/modules/linux/Makefile head/sys/modules/linux64/Makefile Modified: head/sys/modules/linux/Makefile ============================================================================== --- head/sys/modules/linux/Makefile Mon Feb 5 14:30:27 2018 (r328882) +++ head/sys/modules/linux/Makefile Mon Feb 5 14:53:18 2018 (r328883) @@ -17,9 +17,9 @@ SRCS= linux_fork.c linux${SFX}_dummy.c linux_file.c li linux${SFX}_sysvec.c linux_uid16.c linux_time.c \ linux_timer.c linux_vdso.c \ opt_inet6.h opt_compat.h opt_posix.h opt_usb.h vnode_if.h \ - device_if.h bus_if.h assym.s \ + device_if.h bus_if.h \ linux${SFX}_support.s -DPSRCS= linux${SFX}_genassym.c +DPSRCS= assym.s linux${SFX}_genassym.c # XXX: for assym.s SRCS+= opt_kstack_pages.h opt_nfs.h opt_compat.h opt_hwpmc_hooks.h Modified: head/sys/modules/linux64/Makefile ============================================================================== --- head/sys/modules/linux64/Makefile Mon Feb 5 14:30:27 2018 (r328882) +++ head/sys/modules/linux64/Makefile Mon Feb 5 14:53:18 2018 (r328883) @@ -11,9 +11,9 @@ SRCS= linux_fork.c linux_dummy.c linux_file.c linux_ev linux_socket.c linux_stats.c linux_sysctl.c linux_sysent.c \ linux_sysvec.c linux_time.c linux_vdso.c linux_timer.c \ opt_inet6.h opt_compat.h opt_posix.h opt_usb.h \ - vnode_if.h device_if.h bus_if.h assym.s \ + vnode_if.h device_if.h bus_if.h \ linux_support.s -DPSRCS= linux_genassym.c +DPSRCS= assym.s linux_genassym.c # XXX: for assym.s SRCS+= opt_kstack_pages.h opt_nfs.h opt_hwpmc_hooks.h From owner-svn-src-all@freebsd.org Mon Feb 5 15:02:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21629ECB44F; Mon, 5 Feb 2018 15:02:36 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C7A0176EE4; Mon, 5 Feb 2018 15:02: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C259E2399; Mon, 5 Feb 2018 15:02: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 w15F2Z3N090019; Mon, 5 Feb 2018 15:02:35 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15F2Zj5090018; Mon, 5 Feb 2018 15:02:35 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201802051502.w15F2Zj5090018@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 5 Feb 2018 15:02:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328884 - stable/11/lib/libedit X-SVN-Group: stable-11 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: stable/11/lib/libedit X-SVN-Commit-Revision: 328884 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 15:02:36 -0000 Author: pfg Date: Mon Feb 5 15:02:35 2018 New Revision: 328884 URL: https://svnweb.freebsd.org/changeset/base/328884 Log: MFC r328567: libedit: sort the Makefile in line with NetBSD's version. NetBSD's libedit has been been cleaned-up considerably so the non-widecharacter version is no longer an option. Re-sorting the Makefile should make it easier for some brave soul trying to update it. No functional change intended. Modified: stable/11/lib/libedit/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libedit/Makefile ============================================================================== --- stable/11/lib/libedit/Makefile Mon Feb 5 14:53:18 2018 (r328883) +++ stable/11/lib/libedit/Makefile Mon Feb 5 15:02:35 2018 (r328884) @@ -3,18 +3,19 @@ # $FreeBSD$ PACKAGE=clibs -LIB= edit + SHLIB_MAJOR= 7 SHLIBDIR?= /lib WARNS?= 3 +LIB= edit +LIBADD= ncursesw + OSRCS= chared.c common.c el.c eln.c emacs.c fcns.c filecomplete.c help.c \ hist.c keymacro.c map.c chartype.c \ parse.c prompt.c read.c refresh.c search.c sig.c terminal.c tty.c vi.c -LIBADD= ncursesw - MAN= editline.3 editrc.5 MLINKS= editline.3 el_deletestr.3 editline.3 el_end.3 editline.3 el_init.3 \ @@ -28,25 +29,26 @@ MLINKS= editline.3 el_deletestr.3 editline.3 el_end.3 editline.3 tok_line.3 editline.3 tok_str.3 # For speed and debugging -#SRCS= ${OSRCS} +#SRCS= ${OSRCS} readline.c tokenizer.c history.c # For protection -SRCS= editline.c -SRCS+= tokenizer.c history.c readline.c +SRCS= editline.c readline.c tokenizer.c history.c SRCS+= common.h emacs.h fcns.h help.h vi.h -CLEANFILES+= common.h editline.c emacs.h fcns.c fcns.h help.c help.h vi.h -INCS= histedit.h - +# Widechar SRCS+= tokenizern.c historyn.c CLEANFILES+= tokenizern.c historyn.c + +INCS= histedit.h + +CLEANFILES+= common.h editline.c emacs.h fcns.c fcns.h help.c help.h vi.h CFLAGS+= -I. -I${.CURDIR} -I${.CURDIR}/edit -DWIDECHAR #CFLAGS+= -DDEBUG_TTY -DDEBUG_KEY -DDEBUG_READ -DDEBUG -DDEBUG_REFRESH #CFLAGS+= -DDEBUG_PASTE -DDEBUG_EDIT -SUBDIR= edit/readline - AHDR= vi.h emacs.h common.h ASRC= ${.CURDIR}/vi.c ${.CURDIR}/emacs.c ${.CURDIR}/common.c + +SUBDIR= edit/readline .for hdr in vi emacs common ${hdr}.h: ${hdr}.c makelist From owner-svn-src-all@freebsd.org Mon Feb 5 15:14:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08DC9ECC316; Mon, 5 Feb 2018 15:14:02 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B2AD9777A0; Mon, 5 Feb 2018 15:14:01 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD7F1252D; Mon, 5 Feb 2018 15:14:01 +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 w15FE1ZN095076; Mon, 5 Feb 2018 15:14:01 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15FE1IW095074; Mon, 5 Feb 2018 15:14:01 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201802051514.w15FE1IW095074@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 5 Feb 2018 15:14:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328885 - head/sys/fs/ext2fs X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/fs/ext2fs X-SVN-Commit-Revision: 328885 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 15:14:02 -0000 Author: pfg Date: Mon Feb 5 15:14:01 2018 New Revision: 328885 URL: https://svnweb.freebsd.org/changeset/base/328885 Log: ext2fs: remove EXT4F_RO_INCOMPAT_SUPP This was a hack to be able to mount ext4 filesystems read-only while not supporting all the features. We now support all those features so it doesn't make sense to keep the undocumented hack. Discussed with: fsu Modified: head/sys/fs/ext2fs/ext2_vfsops.c head/sys/fs/ext2fs/ext2fs.h Modified: head/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vfsops.c Mon Feb 5 15:02:35 2018 (r328884) +++ head/sys/fs/ext2fs/ext2_vfsops.c Mon Feb 5 15:14:01 2018 (r328885) @@ -290,8 +290,7 @@ ext2_check_sb_compat(struct ext2fs *es, struct cdev *d return (1); } if (es->e2fs_rev > E2FS_REV0) { - mask = es->e2fs_features_incompat & ~(EXT2F_INCOMPAT_SUPP | - EXT4F_RO_INCOMPAT_SUPP); + mask = es->e2fs_features_incompat & ~(EXT2F_INCOMPAT_SUPP); if (mask) { printf("WARNING: mount of %s denied due to " "unsupported optional features:\n", devtoname(dev)); Modified: head/sys/fs/ext2fs/ext2fs.h ============================================================================== --- head/sys/fs/ext2fs/ext2fs.h Mon Feb 5 15:02:35 2018 (r328884) +++ head/sys/fs/ext2fs/ext2fs.h Mon Feb 5 15:14:01 2018 (r328885) @@ -319,11 +319,6 @@ static const struct ext2_feature incompat[] = { * - EXT2F_ROCOMPAT_HUGE_FILE * - EXT2F_INCOMPAT_EXTENTS * - * We do not support these EXT4 features but they are irrelevant - * for read-only support: - * - EXT2F_INCOMPAT_RECOVER - * - EXT2F_INCOMPAT_FLEX_BG - * - EXT2F_INCOMPAT_META_BG */ #define EXT2F_COMPAT_SUPP EXT2F_COMPAT_DIRHASHINDEX #define EXT2F_ROCOMPAT_SUPP (EXT2F_ROCOMPAT_SPARSESUPER | \ @@ -339,7 +334,6 @@ static const struct ext2_feature incompat[] = { EXT2F_INCOMPAT_64BIT | \ EXT2F_INCOMPAT_FLEX_BG | \ EXT2F_INCOMPAT_CSUM_SEED) -#define EXT4F_RO_INCOMPAT_SUPP EXT2F_INCOMPAT_RECOVER /* Assume that user mode programs are passing in an ext2fs superblock, not * a kernel struct super_block. This will allow us to call the feature-test From owner-svn-src-all@freebsd.org Mon Feb 5 16:28:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4231ED9C9C; Mon, 5 Feb 2018 16:28:03 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9338C7A8FE; Mon, 5 Feb 2018 16:28:03 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 86489304B; Mon, 5 Feb 2018 16:28:03 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w15GS3RX030655; Mon, 5 Feb 2018 16:28:03 GMT (envelope-from n_hibma@FreeBSD.org) Received: (from n_hibma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15GS3Vf030653; Mon, 5 Feb 2018 16:28:03 GMT (envelope-from n_hibma@FreeBSD.org) Message-Id: <201802051628.w15GS3Vf030653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: n_hibma set sender to n_hibma@FreeBSD.org using -f From: Nick Hibma Date: Mon, 5 Feb 2018 16:28:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328888 - in stable/11/sys/dev/usb: . serial X-SVN-Group: stable-11 X-SVN-Commit-Author: n_hibma X-SVN-Commit-Paths: in stable/11/sys/dev/usb: . serial X-SVN-Commit-Revision: 328888 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 16:28:04 -0000 Author: n_hibma Date: Mon Feb 5 16:28:03 2018 New Revision: 328888 URL: https://svnweb.freebsd.org/changeset/base/328888 Log: Merge r327951 Add IDs for Quectel EC25. Submitted by: Samuel Crookes Modified: stable/11/sys/dev/usb/serial/u3g.c stable/11/sys/dev/usb/usbdevs Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/serial/u3g.c ============================================================================== --- stable/11/sys/dev/usb/serial/u3g.c Mon Feb 5 16:01:34 2018 (r328887) +++ stable/11/sys/dev/usb/serial/u3g.c Mon Feb 5 16:28:03 2018 (r328888) @@ -487,6 +487,7 @@ static const STRUCT_USB_HOST_ID u3g_devs[] = { U3G_DEV(QUANTA, GLX, 0), U3G_DEV(QUANTA, Q101, 0), U3G_DEV(QUANTA, Q111, 0), + U3G_DEV(QUECTEL, EC25, 0), U3G_DEV(SIERRA, AC402, 0), U3G_DEV(SIERRA, AC595U, 0), U3G_DEV(SIERRA, AC313U, 0), Modified: stable/11/sys/dev/usb/usbdevs ============================================================================== --- stable/11/sys/dev/usb/usbdevs Mon Feb 5 16:01:34 2018 (r328887) +++ stable/11/sys/dev/usb/usbdevs Mon Feb 5 16:28:03 2018 (r328888) @@ -746,6 +746,7 @@ vendor TRIPPLITE 0x2478 Tripp-Lite vendor HIROSE 0x2631 Hirose Electric vendor NHJ 0x2770 NHJ vendor PLANEX 0x2c02 Planex Communications +vendor QUECTEL 0x2c7c Quectel Wireless Solutions vendor VIDZMEDIA 0x3275 VidzMedia Pte Ltd vendor LINKINSTRUMENTS 0x3195 Link Instruments Inc. vendor AEI 0x3334 AEI @@ -3757,11 +3758,14 @@ product QUANTA GKE 0xea05 HSDPA modem product QUANTA GLE 0xea06 HSDPA modem product QUANTA RW6815R 0xf003 HP iPAQ rw6815 RNDIS -/* Qtronix products */ -product QTRONIX 980N 0x2011 Scorpion-980N keyboard +/* Quectel products */ +product QUECTEL EC25 0x0125 LTE modem /* Quickshot products */ product QUICKSHOT STRIKEPAD 0x6238 USB StrikePad + +/* Qtronix products */ +product QTRONIX 980N 0x2011 Scorpion-980N keyboard /* Radio Shack */ product RADIOSHACK USBCABLE 0x4026 USB to Serial Cable From owner-svn-src-all@freebsd.org Mon Feb 5 17:01:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B542EDC922; Mon, 5 Feb 2018 17:01:22 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF5937BF97; Mon, 5 Feb 2018 17:01:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA09C39B4; Mon, 5 Feb 2018 17:01:21 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w15H1Lor046247; Mon, 5 Feb 2018 17:01:21 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15H1JS8046220; Mon, 5 Feb 2018 17:01:19 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802051701.w15H1JS8046220@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 5 Feb 2018 17:01:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328889 - in stable/11: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/mips/beri/loader sys/boot/ofw/libof... X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11: lib/libstand sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/i386/libfirewire sys/boot/i386/libi386 sys/boot/mips/beri/loader sys/boot/ofw/libofw sys/boot/pc98/libpc98 s... X-SVN-Commit-Revision: 328889 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 17:01:22 -0000 Author: kevans Date: Mon Feb 5 17:01:18 2018 New Revision: 328889 URL: https://svnweb.freebsd.org/changeset/base/328889 Log: MFC r308434, 308827 MFC r308434: Loader paged/pageable data is not always paged. MFC r308827: lsdev device name section headers should be printed by dv_print callback. Modified: stable/11/lib/libstand/stand.h stable/11/sys/boot/common/commands.c stable/11/sys/boot/common/dev_net.c stable/11/sys/boot/common/md.c stable/11/sys/boot/common/module.c stable/11/sys/boot/common/part.c stable/11/sys/boot/common/util.c stable/11/sys/boot/common/util.h stable/11/sys/boot/efi/libefi/efinet.c stable/11/sys/boot/efi/libefi/efipart.c stable/11/sys/boot/efi/loader/main.c stable/11/sys/boot/i386/libfirewire/firewire.c stable/11/sys/boot/i386/libi386/bioscd.c stable/11/sys/boot/i386/libi386/biosdisk.c stable/11/sys/boot/i386/libi386/pxe.c stable/11/sys/boot/mips/beri/loader/beri_disk_cfi.c stable/11/sys/boot/mips/beri/loader/beri_disk_sdcard.c stable/11/sys/boot/ofw/libofw/ofw_disk.c stable/11/sys/boot/pc98/libpc98/bioscd.c stable/11/sys/boot/pc98/libpc98/biosdisk.c stable/11/sys/boot/powerpc/kboot/hostdisk.c stable/11/sys/boot/powerpc/ps3/ps3cdrom.c stable/11/sys/boot/powerpc/ps3/ps3disk.c stable/11/sys/boot/uboot/lib/disk.c stable/11/sys/boot/usb/storage/umass_loader.c stable/11/sys/boot/userboot/userboot/host.c stable/11/sys/boot/userboot/userboot/userboot_disk.c stable/11/sys/boot/zfs/zfs.c stable/11/sys/boot/zfs/zfsimpl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libstand/stand.h ============================================================================== --- stable/11/lib/libstand/stand.h Mon Feb 5 16:28:03 2018 (r328888) +++ stable/11/lib/libstand/stand.h Mon Feb 5 17:01:18 2018 (r328889) @@ -143,7 +143,7 @@ struct devsw { int (*dv_open)(struct open_file *f, ...); int (*dv_close)(struct open_file *f); int (*dv_ioctl)(struct open_file *f, u_long cmd, void *data); - void (*dv_print)(int verbose); /* print device information */ + int (*dv_print)(int verbose); /* print device information */ void (*dv_cleanup)(void); }; Modified: stable/11/sys/boot/common/commands.c ============================================================================== --- stable/11/sys/boot/common/commands.c Mon Feb 5 16:28:03 2018 (r328888) +++ stable/11/sys/boot/common/commands.c Mon Feb 5 17:01:18 2018 (r328889) @@ -491,10 +491,8 @@ command_lsdev(int argc, char *argv[]) pager_open(); for (i = 0; devsw[i] != NULL; i++) { if (devsw[i]->dv_print != NULL){ - sprintf(line, "%s devices:\n", devsw[i]->dv_name); - if (pager_output(line)) - break; - devsw[i]->dv_print(verbose); + if (devsw[i]->dv_print(verbose)) + break; } else { sprintf(line, "%s: (unknown)\n", devsw[i]->dv_name); if (pager_output(line)) Modified: stable/11/sys/boot/common/dev_net.c ============================================================================== --- stable/11/sys/boot/common/dev_net.c Mon Feb 5 16:28:03 2018 (r328888) +++ stable/11/sys/boot/common/dev_net.c Mon Feb 5 17:01:18 2018 (r328889) @@ -80,7 +80,7 @@ static int net_open(struct open_file *, ...); static int net_close(struct open_file *); static void net_cleanup(void); static int net_strategy(); -static void net_print(int); +static int net_print(int); static int net_getparams(int sock); @@ -325,23 +325,34 @@ exit: return (0); } -static void +static int net_print(int verbose) { struct netif_driver *drv; int i, d, cnt; + int ret = 0; + if (netif_drivers[0] == NULL) + return (ret); + + printf("%s devices:", netdev.dv_name); + if ((ret = pager_output("\n")) != 0) + return (ret); + cnt = 0; for (d = 0; netif_drivers[d]; d++) { drv = netif_drivers[d]; for (i = 0; i < drv->netif_nifs; i++) { - printf("\t%s%d:", "net", cnt++); - if (verbose) + printf("\t%s%d:", netdev.dv_name, cnt++); + if (verbose) { printf(" (%s%d)", drv->netif_bname, drv->netif_ifs[i].dif_unit); + } + if ((ret = pager_output("\n")) != 0) + return (ret); } } - printf("\n"); + return (ret); } /* Modified: stable/11/sys/boot/common/md.c ============================================================================== --- stable/11/sys/boot/common/md.c Mon Feb 5 16:28:03 2018 (r328888) +++ stable/11/sys/boot/common/md.c Mon Feb 5 17:01:18 2018 (r328889) @@ -63,7 +63,7 @@ static int md_init(void); static int md_strategy(void *, int, daddr_t, size_t, char *, size_t *); static int md_open(struct open_file *, ...); static int md_close(struct open_file *); -static void md_print(int); +static int md_print(int); struct devsw md_dev = { "md", @@ -143,9 +143,14 @@ md_close(struct open_file *f) return ((dev->d_unit != 0) ? ENXIO : 0); } -static void +static int md_print(int verbose) { - printf("MD (%u bytes)\n", MD_IMAGE_SIZE); + printf("%s devices:", md_dev.dv_name); + if (pager_output("\n") != 0) + return (1); + + printf("MD (%u bytes)", MD_IMAGE_SIZE); + return (pager_output("\n")); } Modified: stable/11/sys/boot/common/module.c ============================================================================== --- stable/11/sys/boot/common/module.c Mon Feb 5 16:28:03 2018 (r328888) +++ stable/11/sys/boot/common/module.c Mon Feb 5 17:01:18 2018 (r328889) @@ -252,7 +252,7 @@ command_lsmod(int argc, char *argv[]) struct kernel_module *mp; struct file_metadata *md; char lbuf[80]; - int ch, verbose; + int ch, verbose, ret = 0; verbose = 0; optind = 1; @@ -271,11 +271,13 @@ command_lsmod(int argc, char *argv[]) pager_open(); for (fp = preloaded_files; fp; fp = fp->f_next) { - sprintf(lbuf, " %p: ", (void *) fp->f_addr); + snprintf(lbuf, sizeof(lbuf), " %p: ", (void *) fp->f_addr); pager_output(lbuf); pager_output(fp->f_name); - sprintf(lbuf, " (%s, 0x%lx)\n", fp->f_type, (long)fp->f_size); - pager_output(lbuf); + snprintf(lbuf, sizeof(lbuf), " (%s, 0x%lx)\n", fp->f_type, + (long)fp->f_size); + if (pager_output(lbuf)) + break; if (fp->f_args != NULL) { pager_output(" args: "); pager_output(fp->f_args); @@ -285,7 +287,8 @@ command_lsmod(int argc, char *argv[]) if (fp->f_modules) { pager_output(" modules: "); for (mp = fp->f_modules; mp; mp = mp->m_next) { - sprintf(lbuf, "%s.%d ", mp->m_name, mp->m_version); + snprintf(lbuf, sizeof(lbuf), "%s.%d ", mp->m_name, + mp->m_version); pager_output(lbuf); } if (pager_output("\n")) @@ -294,11 +297,14 @@ command_lsmod(int argc, char *argv[]) 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); + snprintf(lbuf, sizeof(lbuf), " 0x%04x, 0x%lx\n", + md->md_type, (long) md->md_size); if (pager_output(lbuf)) break; } } + if (ret) + break; } pager_close(); return(CMD_OK); Modified: stable/11/sys/boot/common/part.c ============================================================================== --- stable/11/sys/boot/common/part.c Mon Feb 5 16:28:03 2018 (r328888) +++ stable/11/sys/boot/common/part.c Mon Feb 5 17:01:18 2018 (r328889) @@ -835,6 +835,7 @@ ptable_iterate(const struct ptable *table, void *arg, { struct pentry *entry; char name[32]; + int ret = 0; name[0] = '\0'; STAILQ_FOREACH(entry, &table->entries, entry) { @@ -857,9 +858,8 @@ ptable_iterate(const struct ptable *table, void *arg, if (table->type == PTABLE_BSD) sprintf(name, "%c", (u_char) 'a' + entry->part.index); - if (iter(arg, name, &entry->part)) - return 1; + if ((ret = iter(arg, name, &entry->part)) != 0) + return (ret); } - return 0; + return (ret); } - Modified: stable/11/sys/boot/common/util.c ============================================================================== --- stable/11/sys/boot/common/util.c Mon Feb 5 16:28:03 2018 (r328888) +++ stable/11/sys/boot/common/util.c Mon Feb 5 17:01:18 2018 (r328889) @@ -114,7 +114,7 @@ strlen(const char *s) return (len); } -void +int printf(const char *fmt, ...) { va_list ap; @@ -178,4 +178,5 @@ nextfmt: } } va_end(ap); + return (0); } Modified: stable/11/sys/boot/common/util.h ============================================================================== --- stable/11/sys/boot/common/util.h Mon Feb 5 16:28:03 2018 (r328888) +++ stable/11/sys/boot/common/util.h Mon Feb 5 17:01:18 2018 (r328889) @@ -48,6 +48,6 @@ void strcat(char *dst, const char *src); char *strchr(const char *s, char ch); size_t strlen(const char *s); -void printf(const char *fmt, ...); +int printf(const char *fmt, ...); #endif /* !_UTIL_H_ */ Modified: stable/11/sys/boot/efi/libefi/efinet.c ============================================================================== --- stable/11/sys/boot/efi/libefi/efinet.c Mon Feb 5 16:28:03 2018 (r328888) +++ stable/11/sys/boot/efi/libefi/efinet.c Mon Feb 5 17:01:18 2018 (r328889) @@ -252,7 +252,7 @@ efinet_end(struct netif *nif) } static int efinet_dev_init(void); -static void efinet_dev_print(int); +static int efinet_dev_print(int); struct devsw efinet_dev = { .dv_name = "net", @@ -346,14 +346,17 @@ efinet_dev_init() return (0); } -static void +static int efinet_dev_print(int verbose) { CHAR16 *text; EFI_HANDLE h; - int unit; + int unit, ret = 0; - pager_open(); + printf("%s devices:", efinet_dev.dv_name); + if ((ret = pager_output("\n")) != 0) + return (ret); + for (unit = 0, h = efi_find_handle(&efinet_dev, 0); h != NULL; h = efi_find_handle(&efinet_dev, ++unit)) { printf(" %s%d:", efinet_dev.dv_name, unit); @@ -362,8 +365,8 @@ efinet_dev_print(int verbose) printf(" %S", text); efi_free_devpath_name(text); } - if (pager_output("\n")) + if ((ret = pager_output("\n")) != 0) break; } - pager_close(); + return (ret); } Modified: stable/11/sys/boot/efi/libefi/efipart.c ============================================================================== --- stable/11/sys/boot/efi/libefi/efipart.c Mon Feb 5 16:28:03 2018 (r328888) +++ stable/11/sys/boot/efi/libefi/efipart.c Mon Feb 5 17:01:18 2018 (r328889) @@ -45,7 +45,7 @@ static int efipart_strategy(void *, int, daddr_t, size static int efipart_realstrategy(void *, int, daddr_t, size_t, char *, size_t *); static int efipart_open(struct open_file *, ...); static int efipart_close(struct open_file *); -static void efipart_print(int); +static int efipart_print(int); struct devsw efipart_dev = { .dv_name = "part", @@ -160,7 +160,7 @@ efipart_init(void) return (err); } -static void +static int efipart_print(int verbose) { char line[80]; @@ -168,28 +168,33 @@ efipart_print(int verbose) EFI_HANDLE h; EFI_STATUS status; u_int unit; + int ret = 0; - pager_open(); + printf("%s devices:", efipart_dev.dv_name); + if ((ret = pager_output("\n")) != 0) + return (ret); + 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); - if (pager_output(line)) + snprintf(line, sizeof(line), " %s%d:", + efipart_dev.dv_name, unit); + if ((ret = pager_output(line)) != 0) break; status = BS->HandleProtocol(h, &blkio_guid, (void **)&blkio); if (!EFI_ERROR(status)) { - sprintf(line, " %llu blocks", + snprintf(line, sizeof(line), " %llu blocks", (unsigned long long)(blkio->Media->LastBlock + 1)); - if (pager_output(line)) + if ((ret = pager_output(line)) != 0) break; if (blkio->Media->RemovableMedia) - if (pager_output(" (removable)")) + if ((ret = pager_output(" (removable)")) != 0) break; } - if (pager_output("\n")) + if ((ret = pager_output("\n")) != 0) break; } - pager_close(); + return (ret); } static int Modified: stable/11/sys/boot/efi/loader/main.c ============================================================================== --- stable/11/sys/boot/efi/loader/main.c Mon Feb 5 16:28:03 2018 (r328888) +++ stable/11/sys/boot/efi/loader/main.c Mon Feb 5 17:01:18 2018 (r328889) @@ -503,6 +503,7 @@ command_memmap(int argc, char *argv[]) UINT32 dver; EFI_STATUS status; int i, ndesc; + char line[80]; static char *types[] = { "Reserved", "LoaderCode", @@ -534,14 +535,19 @@ command_memmap(int argc, char *argv[]) } ndesc = sz / dsz; - printf("%23s %12s %12s %8s %4s\n", + snprintf(line, sizeof(line), "%23s %12s %12s %8s %4s\n", "Type", "Physical", "Virtual", "#Pages", "Attr"); + pager_open(); + if (pager_output(line)) { + pager_close(); + return (CMD_OK); + } for (i = 0, p = map; i < ndesc; i++, p = NextMemoryDescriptor(p, dsz)) { printf("%23s %012jx %012jx %08jx ", types[p->Type], - (uintmax_t)p->PhysicalStart, (uintmax_t)p->VirtualStart, - (uintmax_t)p->NumberOfPages); + (uintmax_t)p->PhysicalStart, (uintmax_t)p->VirtualStart, + (uintmax_t)p->NumberOfPages); if (p->Attribute & EFI_MEMORY_UC) printf("UC "); if (p->Attribute & EFI_MEMORY_WC) @@ -558,9 +564,11 @@ command_memmap(int argc, char *argv[]) printf("RP "); if (p->Attribute & EFI_MEMORY_XP) printf("XP "); - printf("\n"); + if (pager_output("\n")) + break; } + pager_close(); return (CMD_OK); } @@ -582,10 +590,17 @@ guid_to_string(EFI_GUID *guid) static int command_configuration(int argc, char *argv[]) { + char line[80]; UINTN i; - printf("NumberOfTableEntries=%lu\n", + snprintf(line, sizeof(line), "NumberOfTableEntries=%lu\n", (unsigned long)ST->NumberOfTableEntries); + pager_open(); + if (pager_output(line)) { + pager_close(); + return (CMD_OK); + } + for (i = 0; i < ST->NumberOfTableEntries; i++) { EFI_GUID *guid; @@ -611,9 +626,13 @@ command_configuration(int argc, char *argv[]) printf("FDT Table"); else printf("Unknown Table (%s)", guid_to_string(guid)); - printf(" at %p\n", ST->ConfigurationTable[i].VendorTable); + snprintf(line, sizeof(line), " at %p\n", + ST->ConfigurationTable[i].VendorTable); + if (pager_output(line)) + break; } + pager_close(); return (CMD_OK); } Modified: stable/11/sys/boot/i386/libfirewire/firewire.c ============================================================================== --- stable/11/sys/boot/i386/libfirewire/firewire.c Mon Feb 5 16:28:03 2018 (r328888) +++ stable/11/sys/boot/i386/libfirewire/firewire.c Mon Feb 5 17:01:18 2018 (r328889) @@ -69,7 +69,7 @@ static int fw_strategy(void *devdata, int flag, daddr_ size_t size, char *buf, size_t *rsize); static int fw_open(struct open_file *f, ...); static int fw_close(struct open_file *f); -static void fw_print(int verbose); +static int fw_print(int verbose); static void fw_cleanup(void); void fw_enable(void); @@ -148,21 +148,30 @@ fw_init(void) /* * Print information about OHCI chips */ -static void +static int fw_print(int verbose) { - int i; + char line[80]; + int i, ret = 0; struct fwohci_softc *sc; + printf("%s devices:", fwohci.dv_name); + if ((ret = pager_output("\n")) != 0) + return (ret); + for (i = 0; i < MAX_OHCI; i ++) { sc = &fwinfo[i]; if (sc->state == FWOHCI_STATE_DEAD) break; - printf("%d: locator=0x%04x devid=0x%08x" + snprintf(line, sizeof(line), "%d: locator=0x%04x devid=0x%08x" " base_addr=0x%08x handle=0x%08x bus_id=0x%08x\n", i, sc->locator, sc->devid, sc->base_addr, sc->handle, sc->bus_id); + ret = pager_output(line); + if (ret != 0) + break; } + return (ret); } static int Modified: stable/11/sys/boot/i386/libi386/bioscd.c ============================================================================== --- stable/11/sys/boot/i386/libi386/bioscd.c Mon Feb 5 16:28:03 2018 (r328888) +++ stable/11/sys/boot/i386/libi386/bioscd.c Mon Feb 5 17:01:18 2018 (r328889) @@ -100,7 +100,7 @@ static int bc_realstrategy(void *devdata, int flag, da size_t size, char *buf, size_t *rsize); static int bc_open(struct open_file *f, ...); static int bc_close(struct open_file *f); -static void bc_print(int verbose); +static int bc_print(int verbose); struct devsw bioscd = { "cd", @@ -177,20 +177,26 @@ bc_add(int biosdev) /* * Print information about disks */ -static void +static int bc_print(int verbose) { char line[80]; - int i; + int i, ret = 0; - pager_open(); + if (nbcinfo == 0) + return (0); + + printf("%s devices:", bioscd.dv_name); + if ((ret = pager_output("\n")) != 0) + return (ret); + for (i = 0; i < nbcinfo; i++) { - sprintf(line, " cd%d: Device 0x%x\n", i, + snprintf(line, sizeof(line), " cd%d: Device 0x%x\n", i, bcinfo[i].bc_sp.sp_devicespec); - if (pager_output(line)) + if ((ret = pager_output(line)) != 0) break; } - pager_close(); + return (ret); } /* Modified: stable/11/sys/boot/i386/libi386/biosdisk.c ============================================================================== --- stable/11/sys/boot/i386/libi386/biosdisk.c Mon Feb 5 16:28:03 2018 (r328888) +++ stable/11/sys/boot/i386/libi386/biosdisk.c Mon Feb 5 17:01:18 2018 (r328889) @@ -135,7 +135,7 @@ static int bd_realstrategy(void *devdata, int flag, da static int bd_open(struct open_file *f, ...); static int bd_close(struct open_file *f); static int bd_ioctl(struct open_file *f, u_long cmd, void *data); -static void bd_print(int verbose); +static int bd_print(int verbose); static void bd_cleanup(void); #ifdef LOADER_GELI_SUPPORT @@ -306,21 +306,28 @@ bd_int13probe(struct bdinfo *bd) /* * Print information about disks */ -static void +static int bd_print(int verbose) { static char line[80]; struct disk_devdesc dev; - int i; + int i, ret = 0; - pager_open(); + if (nbdinfo == 0) + return (0); + + printf("%s devices:", biosdisk.dv_name); + if ((ret = pager_output("\n")) != 0) + return (ret); + for (i = 0; i < nbdinfo; i++) { - sprintf(line, " disk%d: BIOS drive %c (%ju X %u):\n", i, + snprintf(line, sizeof(line), + " disk%d: BIOS drive %c (%ju X %u):\n", i, (bdinfo[i].bd_unit < 0x80) ? ('A' + bdinfo[i].bd_unit): ('C' + bdinfo[i].bd_unit - 0x80), (uintmax_t)bdinfo[i].bd_sectors, bdinfo[i].bd_sectorsize); - if (pager_output(line)) + if ((ret = pager_output(line)) != 0) break; dev.d_dev = &biosdisk; dev.d_unit = i; @@ -331,12 +338,14 @@ bd_print(int verbose) bdinfo[i].bd_sectorsize, (bdinfo[i].bd_flags & BD_FLOPPY) ? DISK_F_NOCACHE: 0) == 0) { - sprintf(line, " disk%d", i); - disk_print(&dev, line, verbose); + snprintf(line, sizeof(line), " disk%d", i); + ret = disk_print(&dev, line, verbose); disk_close(&dev); + if (ret != 0) + return (ret); } } - pager_close(); + return (ret); } /* Modified: stable/11/sys/boot/i386/libi386/pxe.c ============================================================================== --- stable/11/sys/boot/i386/libi386/pxe.c Mon Feb 5 16:28:03 2018 (r328888) +++ stable/11/sys/boot/i386/libi386/pxe.c Mon Feb 5 17:01:18 2018 (r328889) @@ -75,7 +75,7 @@ static int pxe_strategy(void *devdata, int flag, daddr size_t size, char *buf, size_t *rsize); static int pxe_open(struct open_file *f, ...); static int pxe_close(struct open_file *f); -static void pxe_print(int verbose); +static int pxe_print(int verbose); static void pxe_cleanup(void); static void pxe_setnfshandle(char *rootpath); @@ -382,14 +382,23 @@ pxe_close(struct open_file *f) return (0); } -static void +static int pxe_print(int verbose) { - + char line[255]; if (pxe_call == NULL) - return; + return (0); - printf(" pxe0: %s:%s\n", inet_ntoa(rootip), rootpath); + printf("%s devices:", pxedisk.dv_name); + if (pager_output("\n") != 0) + return (1); + if (verbose) { + snprintf(line, sizeof(line), " pxe0: %s:%s\n", + inet_ntoa(rootip), rootpath); + } else { + snprintf(line, sizeof(line), " pxe0:\n"); + } + return (pager_output(line)); } static void Modified: stable/11/sys/boot/mips/beri/loader/beri_disk_cfi.c ============================================================================== --- stable/11/sys/boot/mips/beri/loader/beri_disk_cfi.c Mon Feb 5 16:28:03 2018 (r328888) +++ stable/11/sys/boot/mips/beri/loader/beri_disk_cfi.c Mon Feb 5 17:01:18 2018 (r328889) @@ -47,7 +47,7 @@ static int beri_cfi_disk_close(struct open_file *); static void beri_cfi_disk_cleanup(void); static int beri_cfi_disk_strategy(void *, int, daddr_t, size_t, char *, size_t *); -static void beri_cfi_disk_print(int); +static int beri_cfi_disk_print(int); struct devsw beri_cfi_disk = { .dv_name = "cfi", @@ -112,25 +112,33 @@ beri_cfi_disk_close(struct open_file *f) return (disk_close(dev)); } -static void +static int beri_cfi_disk_print(int verbose) { struct disk_devdesc dev; char line[80]; + int ret; - sprintf(line, " cfi%d CFI flash device\n", 0); - pager_output(line); + printf("%s devices:", beri_cfi_disk.dv_name); + if ((ret = pager_output("\n")) != 0) + return (ret); + + snprintf(line, sizeof(line), " cfi%d CFI flash device\n", 0); + ret = pager_output(line); + if (ret != 0) + return (ret); dev.d_dev = &beri_cfi_disk; dev.d_unit = 0; dev.d_slice = -1; dev.d_partition = -1; if (disk_open(&dev, cfi_get_mediasize(), cfi_get_sectorsize(), 0) == 0) { - sprintf(line, " cfi%d", 0); - disk_print(&dev, line, verbose); + snprintf(line, sizeof(line), " cfi%d", 0); + ret = disk_print(&dev, line, verbose); disk_close(&dev); } + return (ret); } static void Modified: stable/11/sys/boot/mips/beri/loader/beri_disk_sdcard.c ============================================================================== --- stable/11/sys/boot/mips/beri/loader/beri_disk_sdcard.c Mon Feb 5 16:28:03 2018 (r328888) +++ stable/11/sys/boot/mips/beri/loader/beri_disk_sdcard.c Mon Feb 5 17:01:18 2018 (r328889) @@ -47,7 +47,7 @@ static int beri_sdcard_disk_close(struct open_file *); static void beri_sdcard_disk_cleanup(void); static int beri_sdcard_disk_strategy(void *, int, daddr_t, size_t, char *, size_t *); -static void beri_sdcard_disk_print(int); +static int beri_sdcard_disk_print(int); struct devsw beri_sdcard_disk = { .dv_name = "sdcard", @@ -123,19 +123,27 @@ beri_sdcard_disk_print(int verbose) { struct disk_devdesc dev; char line[80]; + int ret; - sprintf(line, " sdcard%d Altera SD card drive\n", 0); - pager_output(line); + printf("%s devices:", beri_sdcard_disk.dv_name); + if ((ret = pager_output("\n")) != 0) + return (ret); + + snprintf(line, sizeof(line), " sdcard%d Altera SD card drive\n", 0); + ret = pager_output(line); + if (ret != 0) + return (ret); dev.d_dev = &beri_sdcard_disk; dev.d_unit = 0; dev.d_slice = -1; dev.d_partition = -1; if (disk_open(&dev, altera_sdcard_get_mediasize(), altera_sdcard_get_sectorsize(), 0) == 0) { - sprintf(line, " sdcard%d", 0); - disk_print(&dev, line, verbose); + snprintf(line, sizeof(line), " sdcard%d", 0); + ret = disk_print(&dev, line, verbose); disk_close(&dev); } + return (ret); } static void Modified: stable/11/sys/boot/ofw/libofw/ofw_disk.c ============================================================================== --- stable/11/sys/boot/ofw/libofw/ofw_disk.c Mon Feb 5 16:28:03 2018 (r328888) +++ stable/11/sys/boot/ofw/libofw/ofw_disk.c Mon Feb 5 17:01:18 2018 (r328889) @@ -47,7 +47,7 @@ static int ofwd_strategy(void *devdata, int flag, dadd static int ofwd_open(struct open_file *f, ...); static int ofwd_close(struct open_file *f); static int ofwd_ioctl(struct open_file *f, u_long cmd, void *data); -static void ofwd_print(int verbose); +static int ofwd_print(int verbose); struct devsw ofwdisk = { "block", @@ -161,8 +161,8 @@ ofwd_ioctl(struct open_file *f __unused, u_long cmd __ return (EINVAL); } -static void +static int ofwd_print(int verbose __unused) { - + return (0); } Modified: stable/11/sys/boot/pc98/libpc98/bioscd.c ============================================================================== --- stable/11/sys/boot/pc98/libpc98/bioscd.c Mon Feb 5 16:28:03 2018 (r328888) +++ stable/11/sys/boot/pc98/libpc98/bioscd.c Mon Feb 5 17:01:18 2018 (r328889) @@ -99,7 +99,7 @@ static int bc_realstrategy(void *devdata, int flag, da size_t size, char *buf, size_t *rsize); static int bc_open(struct open_file *f, ...); static int bc_close(struct open_file *f); -static void bc_print(int verbose); +static int bc_print(int verbose); struct devsw bioscd = { "cd", @@ -173,20 +173,26 @@ bc_add(int biosdev) /* * Print information about disks */ -static void +static int bc_print(int verbose) { char line[80]; - int i; + int i, ret = 0; - pager_open(); + if (nbcinfo == 0) + return (0); + + printf("%s devices:", bioscd.dv_name); + if ((ret = pager_output("\n")) != 0) + return (ret); + for (i = 0; i < nbcinfo; i++) { sprintf(line, " cd%d: Device 0x%x\n", i, bcinfo[i].bc_sp.sp_devicespec); - if (pager_output(line)) + if ((ret = pager_output(line)) != 0) break; } - pager_close(); + return (ret); } /* Modified: stable/11/sys/boot/pc98/libpc98/biosdisk.c ============================================================================== --- stable/11/sys/boot/pc98/libpc98/biosdisk.c Mon Feb 5 16:28:03 2018 (r328888) +++ stable/11/sys/boot/pc98/libpc98/biosdisk.c Mon Feb 5 17:01:18 2018 (r328889) @@ -123,7 +123,7 @@ static int bd_realstrategy(void *devdata, int flag, da size_t size, char *buf, size_t *rsize); static int bd_open(struct open_file *f, ...); static int bd_close(struct open_file *f); -static void bd_print(int verbose); +static int bd_print(int verbose); struct devsw biosdisk = { "disk", @@ -249,22 +249,28 @@ bd_int13probe(struct bdinfo *bd) /* * Print information about disks */ -static void +static int bd_print(int verbose) { - int i, j, done; + int i, j, ret = 0; char line[80]; struct i386_devdesc dev; struct open_disk *od; struct pc98_partition *dptr; - pager_open(); - done = 0; - for (i = 0; i < nbdinfo && !done; i++) { - sprintf(line, " disk%d: BIOS drive %c:\n", i, 'A' + i); - if (pager_output(line)) - break; + if (nbdinfo == 0) + return (0); + printf("%s devices:", biosdisk.dv_name); + if ((ret = pager_output("\n")) != 0) + return (ret); + + for (i = 0; i < nbdinfo; i++) { + snprintf(line, sizeof(line), " disk%d: BIOS drive %c:\n", + i, 'A' + i); + if ((ret = pager_output(line)) != 0) + break; + /* try to open the whole disk */ dev.d_unit = i; dev.d_kind.biosdisk.slice = -1; @@ -278,17 +284,17 @@ 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); - if (bd_printslice(od, &dptr[j], line, verbose)) { - done = 1; - break; - } + snprintf(line, sizeof(line), " disk%ds%d", i, j + 1); + if ((ret = bd_printslice(od, &dptr[j], line, verbose)) != 0) + break; } } bd_closedisk(od); + if (ret != 0) + break; } } - pager_close(); + return (ret); } /* Given a size in 512 byte sectors, convert it to a human-readable number. */ Modified: stable/11/sys/boot/powerpc/kboot/hostdisk.c ============================================================================== --- stable/11/sys/boot/powerpc/kboot/hostdisk.c Mon Feb 5 16:28:03 2018 (r328888) +++ stable/11/sys/boot/powerpc/kboot/hostdisk.c Mon Feb 5 17:01:18 2018 (r328889) @@ -37,7 +37,7 @@ static int hostdisk_strategy(void *devdata, int flag, static int hostdisk_open(struct open_file *f, ...); static int hostdisk_close(struct open_file *f); static int hostdisk_ioctl(struct open_file *f, u_long cmd, void *data); -static void hostdisk_print(int verbose); +static int hostdisk_print(int verbose); struct devsw hostdisk = { "/dev", @@ -117,9 +117,9 @@ hostdisk_ioctl(struct open_file *f, u_long cmd, void * return (EINVAL); } -static void +static int hostdisk_print(int verbose) { - + return (0); } Modified: stable/11/sys/boot/powerpc/ps3/ps3cdrom.c ============================================================================== --- stable/11/sys/boot/powerpc/ps3/ps3cdrom.c Mon Feb 5 16:28:03 2018 (r328888) +++ stable/11/sys/boot/powerpc/ps3/ps3cdrom.c Mon Feb 5 17:01:18 2018 (r328889) @@ -49,7 +49,7 @@ static int ps3cdrom_strategy(void *devdata, int flag, size_t size, char *buf, size_t *rsize); static int ps3cdrom_open(struct open_file *f, ...); static int ps3cdrom_close(struct open_file *f); -static void ps3cdrom_print(int verbose); +static int ps3cdrom_print(int verbose); struct devsw ps3cdrom = { "cd", @@ -149,6 +149,7 @@ static int ps3cdrom_close(struct open_file *f) return 0; } -static void ps3cdrom_print(int verbose) +static int ps3cdrom_print(int verbose) { + return (0); } Modified: stable/11/sys/boot/powerpc/ps3/ps3disk.c ============================================================================== --- stable/11/sys/boot/powerpc/ps3/ps3disk.c Mon Feb 5 16:28:03 2018 (r328888) +++ stable/11/sys/boot/powerpc/ps3/ps3disk.c Mon Feb 5 17:01:18 2018 (r328889) @@ -61,7 +61,7 @@ static int ps3disk_strategy(void *devdata, int flag, d size_t size, char *buf, size_t *rsize); static int ps3disk_open(struct open_file *f, ...); static int ps3disk_close(struct open_file *f); -static void ps3disk_print(int verbose); +static int ps3disk_print(int verbose); struct devsw ps3disk = { "disk", @@ -186,8 +186,9 @@ static int ps3disk_close(struct open_file *f) return 0; } -static void ps3disk_print(int verbose) +static int ps3disk_print(int verbose) { + return (0); } static int ps3disk_open_gpt(struct ps3_devdesc *dev, struct open_dev *od) Modified: stable/11/sys/boot/uboot/lib/disk.c ============================================================================== --- stable/11/sys/boot/uboot/lib/disk.c Mon Feb 5 16:28:03 2018 (r328888) +++ stable/11/sys/boot/uboot/lib/disk.c Mon Feb 5 17:01:18 2018 (r328889) @@ -77,7 +77,7 @@ static int stor_strategy(void *, int, daddr_t, size_t, static int stor_open(struct open_file *, ...); static int stor_close(struct open_file *); static int stor_ioctl(struct open_file *f, u_long cmd, void *data); -static void stor_print(int); +static int stor_print(int); static void stor_cleanup(void); struct devsw uboot_storage = { @@ -237,30 +237,38 @@ stor_readdev(struct disk_devdesc *dev, daddr_t blk, si return (err); } -static void +static int stor_print(int verbose) { struct disk_devdesc dev; static char line[80]; - int i; + int i, ret = 0; - pager_open(); + if (stor_info_no == 0) + return (ret); + + printf("%s devices:", uboot_storage.dv_name); + if ((ret = pager_output("\n")) != 0) + return (ret); + for (i = 0; i < stor_info_no; i++) { dev.d_dev = &uboot_storage; dev.d_unit = i; dev.d_slice = -1; dev.d_partition = -1; - sprintf(line, "\tdisk%d (%s)\n", i, + snprintf(line, sizeof(line), "\tdisk%d (%s)\n", i, ub_stor_type(SI(&dev).type)); - if (pager_output(line)) + if ((ret = pager_output(line)) != 0) break; if (stor_opendev(&dev) == 0) { sprintf(line, "\tdisk%d", i); - disk_print(&dev, line, verbose); + ret = disk_print(&dev, line, verbose); disk_close(&dev); + if (ret != 0) + break; } } - pager_close(); + return (ret); } static int Modified: stable/11/sys/boot/usb/storage/umass_loader.c ============================================================================== --- stable/11/sys/boot/usb/storage/umass_loader.c Mon Feb 5 16:28:03 2018 (r328888) +++ stable/11/sys/boot/usb/storage/umass_loader.c Mon Feb 5 17:01:18 2018 (r328889) @@ -49,7 +49,7 @@ static int umass_disk_close(struct open_file *); static void umass_disk_cleanup(void); static int umass_disk_ioctl(struct open_file *, u_long, void *); static int umass_disk_strategy(void *, int, daddr_t, size_t, char *, size_t *); -static void umass_disk_print(int); +static int umass_disk_print(int); struct devsw umass_disk = { .dv_name = "umass", @@ -169,23 +169,30 @@ umass_disk_close(struct open_file *f) return (disk_close(dev)); } -static void +static int umass_disk_print(int verbose) { struct disk_devdesc dev; + printf("%s devices:", umass_disk.dv_name); + if (pager_output("\n") != 0) + return (1); + memset(&dev, 0, sizeof(dev)); - pager_output(" umass0 UMASS device\n"); + ret = pager_output(" umass0 UMASS device\n"); + if (ret != 0) + return (ret); dev.d_dev = &umass_disk; dev.d_unit = 0; dev.d_slice = -1; dev.d_partition = -1; if (umass_disk_open_sub(&dev) == 0) { - disk_print(&dev, " umass0", verbose); + ret = disk_print(&dev, " umass0", verbose); disk_close(&dev); } + return (ret); } static void Modified: stable/11/sys/boot/userboot/userboot/host.c ============================================================================== --- stable/11/sys/boot/userboot/userboot/host.c Mon Feb 5 16:28:03 2018 (r328888) +++ stable/11/sys/boot/userboot/userboot/host.c Mon Feb 5 17:01:18 2018 (r328889) @@ -134,13 +134,17 @@ host_dev_init(void) return (0); } -static void +static int host_dev_print(int verbose) { char line[80]; - sprintf(line, " host%d: Host filesystem\n", 0); - pager_output(line); + printf("%s devices:", host_dev.dv_name); + if (pager_output("\n") != 0) + return (1); + + snprintf(line, sizeof(line), " host%d: Host filesystem\n", 0); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Feb 5 17:29:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED857EDF3FA; Mon, 5 Feb 2018 17:29:15 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9B0F57DA2D; Mon, 5 Feb 2018 17:29:15 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 955AC3E3A; Mon, 5 Feb 2018 17:29:15 +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 w15HTF4L060939; Mon, 5 Feb 2018 17:29:15 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15HTCri060904; Mon, 5 Feb 2018 17:29:12 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201802051729.w15HTCri060904@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 5 Feb 2018 17:29:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328890 - in head/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Commit-Revision: 328890 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 17:29:16 -0000 Author: emaste Date: Mon Feb 5 17:29:12 2018 New Revision: 328890 URL: https://svnweb.freebsd.org/changeset/base/328890 Log: Linuxolator whitespace cleanup A version of each of the MD files by necessity exists for each CPU architecture supported by the Linuxolator. Clean these up so that new architectures do not inherit whitespace issues. Clean up shared Linuxolator files while here. Sponsored by: Turing Robotic Industries Inc. Modified: head/sys/amd64/linux/linux.h head/sys/amd64/linux/linux_ptrace.c head/sys/amd64/linux/linux_sysvec.c head/sys/amd64/linux/syscalls.master head/sys/amd64/linux32/linux.h head/sys/amd64/linux32/linux32_dummy.c head/sys/amd64/linux32/linux32_locore.s head/sys/amd64/linux32/linux32_sysvec.c head/sys/amd64/linux32/syscalls.master head/sys/compat/linux/check_internal_locks.d head/sys/compat/linux/linux_emul.c head/sys/compat/linux/linux_event.c head/sys/compat/linux/linux_file.h head/sys/compat/linux/linux_fork.c head/sys/compat/linux/linux_ioctl.c head/sys/compat/linux/linux_ioctl.h head/sys/compat/linux/linux_ipc.c head/sys/compat/linux/linux_ipc.h head/sys/compat/linux/linux_ipc64.h head/sys/compat/linux/linux_misc.c head/sys/compat/linux/linux_persona.h head/sys/compat/linux/linux_signal.c head/sys/compat/linux/linux_socket.c head/sys/compat/linux/linux_socket.h head/sys/compat/linux/linux_time.c head/sys/compat/linux/linux_util.h head/sys/compat/linux/stats_timing.d head/sys/compat/linux/trace_futexes.d head/sys/i386/linux/linux.h head/sys/i386/linux/linux_dummy.c head/sys/i386/linux/linux_locore.s head/sys/i386/linux/linux_machdep.c head/sys/i386/linux/linux_support.s head/sys/i386/linux/linux_sysvec.c head/sys/i386/linux/syscalls.master Modified: head/sys/amd64/linux/linux.h ============================================================================== --- head/sys/amd64/linux/linux.h Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/amd64/linux/linux.h Mon Feb 5 17:29:12 2018 (r328890) @@ -459,7 +459,7 @@ struct l_pollfd { struct linux_robust_list { l_uintptr_t next; }; - + struct linux_robust_list_head { struct linux_robust_list list; l_long futex_offset; Modified: head/sys/amd64/linux/linux_ptrace.c ============================================================================== --- head/sys/amd64/linux/linux_ptrace.c Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/amd64/linux/linux_ptrace.c Mon Feb 5 17:29:12 2018 (r328890) @@ -74,7 +74,7 @@ __FBSDID("$FreeBSD$"); #define LINUX_PTRACE_O_TRACEVFORKDONE 32 #define LINUX_PTRACE_O_TRACEEXIT 64 #define LINUX_PTRACE_O_TRACESECCOMP 128 -#define LINUX_PTRACE_O_EXITKILL 1048576 +#define LINUX_PTRACE_O_EXITKILL 1048576 #define LINUX_PTRACE_O_SUSPEND_SECCOMP 2097152 #define LINUX_NT_PRSTATUS 1 @@ -239,7 +239,7 @@ linux_ptrace_setoptions(struct thread *td, pid_t pid, if (data & LINUX_PTRACE_O_TRACEFORK) mask |= PTRACE_FORK; - if (data & LINUX_PTRACE_O_TRACEVFORK) + if (data & LINUX_PTRACE_O_TRACEVFORK) mask |= PTRACE_VFORK; if (data & LINUX_PTRACE_O_TRACECLONE) Modified: head/sys/amd64/linux/linux_sysvec.c ============================================================================== --- head/sys/amd64/linux/linux_sysvec.c Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/amd64/linux/linux_sysvec.c Mon Feb 5 17:29:12 2018 (r328890) @@ -758,7 +758,7 @@ linux_vsyscall(struct thread *td) struct trapframe *frame; uint64_t retqaddr; int code, traced; - int error; + int error; frame = td->td_frame; @@ -832,7 +832,7 @@ linux_vdso_install(void *param) amd64_lower_shared_page(&elf_linux_sysvec); - linux_szsigcode = (&_binary_linux_locore_o_end - + linux_szsigcode = (&_binary_linux_locore_o_end - &_binary_linux_locore_o_start); if (linux_szsigcode > elf_linux_sysvec.sv_shared_page_len) Modified: head/sys/amd64/linux/syscalls.master ============================================================================== --- head/sys/amd64/linux/syscalls.master Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/amd64/linux/syscalls.master Mon Feb 5 17:29:12 2018 (r328890) @@ -471,10 +471,10 @@ 278 AUE_NULL STD { int linux_vmsplice(void); } 279 AUE_NULL STD { int linux_move_pages(void); } 280 AUE_FUTIMESAT STD { int linux_utimensat(l_int dfd, const char *pathname, \ - const struct l_timespec *times, l_int flags); } -281 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \ - l_int maxevents, l_int timeout, l_sigset_t *mask, \ - l_size_t sigsetsize); } + const struct l_timespec *times, l_int flags); } +281 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \ + l_int maxevents, l_int timeout, l_sigset_t *mask, \ + l_size_t sigsetsize); } 282 AUE_NULL STD { int linux_signalfd(void); } 283 AUE_NULL STD { int linux_timerfd_create(l_int clockid, l_int flags); } 284 AUE_NULL STD { int linux_eventfd(l_uint initval); } @@ -496,10 +496,10 @@ 293 AUE_NULL STD { int linux_pipe2(l_int *pipefds, l_int flags); } 294 AUE_NULL STD { int linux_inotify_init1(l_int flags); } ; linux 2.6.30: -295 AUE_NULL STD { int linux_preadv(l_ulong fd, \ +295 AUE_NULL STD { int linux_preadv(l_ulong fd, \ struct iovec *vec, l_ulong vlen, \ l_ulong pos_l, l_ulong pos_h); } -296 AUE_NULL STD { int linux_pwritev(l_ulong fd, \ +296 AUE_NULL STD { int linux_pwritev(l_ulong fd, \ struct iovec *vec, l_ulong vlen, \ l_ulong pos_l, l_ulong pos_h); } ; linux 2.6.31: @@ -551,7 +551,7 @@ void *attr, l_uint size, l_uint flags); } ; linux 3.15: 316 AUE_NULL STD { int linux_renameat2(l_int oldfd, \ - const char *oldname, l_int newfd, \ + const char *oldname, l_int newfd, \ const char *newname, unsigned int flags); } ; linux 3.17: 317 AUE_NULL STD { int linux_seccomp(l_uint op, l_uint flags, \ Modified: head/sys/amd64/linux32/linux.h ============================================================================== --- head/sys/amd64/linux32/linux.h Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/amd64/linux32/linux.h Mon Feb 5 17:29:12 2018 (r328890) @@ -242,19 +242,19 @@ struct l_stat64 { l_ulonglong st_ino; } __packed; -struct l_statfs64 { - l_int f_type; - l_int f_bsize; - uint64_t f_blocks; - uint64_t f_bfree; - uint64_t f_bavail; - uint64_t f_files; - uint64_t f_ffree; - l_fsid_t f_fsid; - l_int f_namelen; - l_int f_frsize; - l_int f_flags; - l_int f_spare[4]; +struct l_statfs64 { + l_int f_type; + l_int f_bsize; + uint64_t f_blocks; + uint64_t f_bfree; + uint64_t f_bavail; + uint64_t f_files; + uint64_t f_ffree; + l_fsid_t f_fsid; + l_int f_namelen; + l_int f_frsize; + l_int f_flags; + l_int f_spare[4]; } __packed; /* sigaction flags */ @@ -454,11 +454,11 @@ struct l_sigframe { struct l_rt_sigframe { l_int sf_sig; - l_uintptr_t sf_siginfo; + l_uintptr_t sf_siginfo; l_uintptr_t sf_ucontext; l_siginfo_t sf_si; - struct l_ucontext sf_sc; - l_handler_t sf_handler; + struct l_ucontext sf_sc; + l_handler_t sf_handler; } __packed; /* Modified: head/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- head/sys/amd64/linux32/linux32_dummy.c Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/amd64/linux32/linux32_dummy.c Mon Feb 5 17:29:12 2018 (r328890) @@ -8,7 +8,7 @@ * 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 + * notice, this list of conditions and the following disclaimer * in this position and unchanged. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the Modified: head/sys/amd64/linux32/linux32_locore.s ============================================================================== --- head/sys/amd64/linux32/linux32_locore.s Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/amd64/linux32/linux32_locore.s Mon Feb 5 17:29:12 2018 (r328890) @@ -72,12 +72,12 @@ NON_GPROF_ENTRY(linux32_vsyscall) .previous #endif -#define do_cfa_expr(offset) \ - .byte 0x0f; /* DW_CFA_def_cfa_expression */ \ - .uleb128 11f-10f; /* length */ \ -10: .byte 0x74; /* DW_OP_breg4 */ \ - .sleb128 offset; /* offset */ \ - .byte 0x06; /* DW_OP_deref */ \ +#define do_cfa_expr(offset) \ + .byte 0x0f; /* DW_CFA_def_cfa_expression */ \ + .uleb128 11f-10f; /* length */ \ +10: .byte 0x74; /* DW_OP_breg4 */ \ + .sleb128 offset; /* offset */ \ + .byte 0x06; /* DW_OP_deref */ \ 11: Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/amd64/linux32/linux32_sysvec.c Mon Feb 5 17:29:12 2018 (r328890) @@ -125,7 +125,7 @@ static int elf_linux_fixup(register_t **stack_base, struct image_params *iparams); static register_t *linux_copyout_strings(struct image_params *imgp); static void linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask); -static void exec_linux_setregs(struct thread *td, +static void exec_linux_setregs(struct thread *td, struct image_params *imgp, u_long stack); static void linux32_fixlimit(struct rlimit *rl, int which); static boolean_t linux32_trans_osrel(const Elf_Note *note, int32_t *osrel); @@ -298,7 +298,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigse int oonstack; int sig; int code; - + sig = ksi->ksi_signo; code = ksi->ksi_code; PROC_LOCK_ASSERT(p, MA_OWNED); @@ -971,10 +971,8 @@ SYSCTL_ULONG(_compat_linux32, OID_AUTO, maxvmem, CTLFL &linux32_maxvmem, 0, ""); #if defined(DEBUG) -SYSCTL_PROC(_compat_linux32, OID_AUTO, debug, - CTLTYPE_STRING | CTLFLAG_RW, - 0, 0, linux_sysctl_debug, "A", - "Linux debugging control"); +SYSCTL_PROC(_compat_linux32, OID_AUTO, debug, CTLTYPE_STRING | CTLFLAG_RW, 0, 0, + linux_sysctl_debug, "A", "Linux debugging control"); #endif static void @@ -1042,14 +1040,14 @@ struct sysentvec elf_linux_sysvec = { .sv_shared_page_len = PAGE_SIZE, .sv_schedtail = linux_schedtail, .sv_thread_detach = linux_thread_detach, - .sv_trap = NULL, + .sv_trap = NULL, }; static void linux_vdso_install(void *param) { - linux_szsigcode = (&_binary_linux32_locore_o_end - + linux_szsigcode = (&_binary_linux32_locore_o_end - &_binary_linux32_locore_o_start); if (linux_szsigcode > elf_linux_sysvec.sv_shared_page_len) Modified: head/sys/amd64/linux32/syscalls.master ============================================================================== --- head/sys/amd64/linux32/syscalls.master Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/amd64/linux32/syscalls.master Mon Feb 5 17:29:12 2018 (r328890) @@ -22,7 +22,7 @@ ; types: ; STD always included ; UNIMPL not implemented, placeholder only -; NOPROTO same as STD except do not create structure or +; NOPROTO same as STD except do not create structure or ; function prototype in sys/sysproto.h. Does add a ; definition to syscall.h besides adding a sysent. @@ -532,9 +532,9 @@ 317 AUE_NULL STD { int linux_move_pages(void); } ; linux 2.6.19: 318 AUE_NULL STD { int linux_getcpu(void); } -319 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \ - l_int maxevents, l_int timeout, l_sigset_t *mask, \ - l_size_t sigsetsize); } +319 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \ + l_int maxevents, l_int timeout, l_sigset_t *mask, \ + l_size_t sigsetsize); } ; linux 2.6.22: 320 AUE_FUTIMESAT STD { int linux_utimensat(l_int dfd, const char *pathname, \ const struct l_timespec *times, l_int flags); } Modified: head/sys/compat/linux/check_internal_locks.d ============================================================================== --- head/sys/compat/linux/check_internal_locks.d Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/compat/linux/check_internal_locks.d Mon Feb 5 17:29:12 2018 (r328890) @@ -92,6 +92,6 @@ tick-10s END { - printf("Number of locks per type:"); + printf("Number of locks per type:"); printa(@stats); } Modified: head/sys/compat/linux/linux_emul.c ============================================================================== --- head/sys/compat/linux/linux_emul.c Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/compat/linux/linux_emul.c Mon Feb 5 17:29:12 2018 (r328890) @@ -140,7 +140,7 @@ linux_proc_init(struct thread *td, struct thread *newt } -void +void linux_proc_exit(void *arg __unused, struct proc *p) { struct linux_pemuldata *pem; @@ -155,7 +155,7 @@ linux_proc_exit(void *arg __unused, struct proc *p) pem = pem_find(p); if (pem == NULL) - return; + return; (p->p_sysent->sv_thread_detach)(td); p->p_emuldata = NULL; @@ -170,7 +170,7 @@ linux_proc_exit(void *arg __unused, struct proc *p) free(pem, M_LINUX); } -int +int linux_common_execve(struct thread *td, struct image_args *eargs) { struct linux_pemuldata *pem; @@ -218,7 +218,7 @@ linux_common_execve(struct thread *td, struct image_ar return (EJUSTRETURN); } -void +void linux_proc_exec(void *arg __unused, struct proc *p, struct image_params *imgp) { struct thread *td = curthread; Modified: head/sys/compat/linux/linux_event.c ============================================================================== --- head/sys/compat/linux/linux_event.c Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/compat/linux/linux_event.c Mon Feb 5 17:29:12 2018 (r328890) @@ -343,7 +343,7 @@ epoll_to_kevent(struct thread *td, struct file *epfp, return (0); } -/* +/* * Structure converting function from kevent to epoll. In a case * this is called on error in registration we store the error in * event->data and pick it up later in linux_epoll_ctl(). @@ -370,7 +370,7 @@ kevent_to_epoll(struct kevent *kevent, struct epoll_ev } } -/* +/* * Copyout callback used by kevent. This converts kevent * events to epoll events and copies them back to the * userspace. This is also called on error on registering @@ -417,7 +417,7 @@ epoll_kev_copyout(void *arg, struct kevent *kevp, int /* * Copyin callback used by kevent. This copies already - * converted filters from kernel memory to the kevent + * converted filters from kernel memory to the kevent * internal kernel memory. Hence the memcpy instead of * copyin. */ @@ -600,7 +600,7 @@ linux_epoll_wait_common(struct thread *td, int epfd, s if (error == 0 && coargs.error != 0) error = coargs.error; - /* + /* * kern_kevent might return ENOMEM which is not expected from epoll_wait. * Maybe we should translate that but I don't think it matters at all. */ @@ -696,7 +696,7 @@ eventfd_create(struct thread *td, uint32_t initval, in knlist_init_mtx(&efd->efd_sel.si_note, &efd->efd_lock); - fflags = FREAD | FWRITE; + fflags = FREAD | FWRITE; if ((flags & LINUX_O_NONBLOCK) != 0) fflags |= FNONBLOCK; Modified: head/sys/compat/linux/linux_file.h ============================================================================== --- head/sys/compat/linux/linux_file.h Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/compat/linux/linux_file.h Mon Feb 5 17:29:12 2018 (r328890) @@ -42,10 +42,10 @@ */ #define LINUX_POSIX_FADV_NORMAL 0 #define LINUX_POSIX_FADV_RANDOM 1 -#define LINUX_POSIX_FADV_SEQUENTIAL 2 -#define LINUX_POSIX_FADV_WILLNEED 3 -#define LINUX_POSIX_FADV_DONTNEED 4 -#define LINUX_POSIX_FADV_NOREUSE 5 +#define LINUX_POSIX_FADV_SEQUENTIAL 2 +#define LINUX_POSIX_FADV_WILLNEED 3 +#define LINUX_POSIX_FADV_DONTNEED 4 +#define LINUX_POSIX_FADV_NOREUSE 5 /* * mount flags Modified: head/sys/compat/linux/linux_fork.c ============================================================================== --- head/sys/compat/linux/linux_fork.c Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/compat/linux/linux_fork.c Mon Feb 5 17:29:12 2018 (r328890) @@ -123,7 +123,7 @@ linux_vfork(struct thread *td, struct linux_vfork_args linux_proc_init(td, td2, 0); - td->td_retval[0] = p2->p_pid; + td->td_retval[0] = p2->p_pid; /* * Make this runnable after we are finished with it. @@ -198,12 +198,12 @@ linux_clone_proc(struct thread *td, struct linux_clone if (args->flags & LINUX_CLONE_CHILD_SETTID) em->child_set_tid = args->child_tidptr; else - em->child_set_tid = NULL; + em->child_set_tid = NULL; if (args->flags & LINUX_CLONE_CHILD_CLEARTID) em->child_clear_tid = args->child_tidptr; else - em->child_clear_tid = NULL; + em->child_clear_tid = NULL; if (args->flags & LINUX_CLONE_PARENT_SETTID) { error = copyout(&p2->p_pid, args->parent_tidptr, @@ -226,7 +226,7 @@ linux_clone_proc(struct thread *td, struct linux_clone linux_set_cloned_tls(td2, args->tls); /* - * If CLONE_PARENT is set, then the parent of the new process will be + * If CLONE_PARENT is set, then the parent of the new process will be * the same as that of the calling process. */ if (args->flags & LINUX_CLONE_PARENT) { @@ -324,15 +324,15 @@ linux_clone_thread(struct thread *td, struct linux_clo if (args->flags & LINUX_CLONE_CHILD_SETTID) em->child_set_tid = args->child_tidptr; else - em->child_set_tid = NULL; + em->child_set_tid = NULL; if (args->flags & LINUX_CLONE_CHILD_CLEARTID) em->child_clear_tid = args->child_tidptr; else - em->child_clear_tid = NULL; + em->child_clear_tid = NULL; cpu_thread_clean(newtd); - + linux_set_upcall_kse(newtd, PTROUT(args->stack)); PROC_LOCK(p); @@ -465,7 +465,7 @@ linux_thread_detach(struct thread *td) LINUX_CTR2(thread_detach, "thread(%d) %p", em->em_tid, child_clear_tid); - + error = suword32(child_clear_tid, 0); if (error != 0) return; Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/compat/linux/linux_ioctl.c Mon Feb 5 17:29:12 2018 (r328890) @@ -241,7 +241,7 @@ linux_ioctl_hdio(struct thread *td, struct linux_ioctl #if defined(DEBUG) linux_msg(td, "HDIO_GET_GEO: mediasize %jd, c/h/s %d/%d/%d, " "bpc %jd", - (intmax_t)mediasize, fwcylinders, fwheads, fwsectors, + (intmax_t)mediasize, fwcylinders, fwheads, fwsectors, (intmax_t)bytespercyl); #endif if ((args->cmd & 0xffff) == LINUX_HDIO_GET_GEO) { @@ -1050,7 +1050,7 @@ linux_ioctl_termio(struct thread *td, struct linux_ioc break; case LINUX_TIOCGPTN: { int nb; - + error = fo_ioctl(fp, TIOCGPTN, (caddr_t)&nb, td->td_ucred, td); if (!error) error = copyout(&nb, (void *)args->arg, @@ -2319,7 +2319,7 @@ again: goto again; } - ifc.ifc_len = valid_len; + ifc.ifc_len = valid_len; sbuf_finish(sb); error = copyout(sbuf_data(sb), PTRIN(ifc.ifc_buf), ifc.ifc_len); if (error == 0) @@ -2393,12 +2393,12 @@ bsd_to_linux_ifreq(struct ifreq *arg) struct ifreq ifr; size_t ifr_len = sizeof(struct ifreq); int error; - + if ((error = copyin(arg, &ifr, ifr_len))) return (error); - + *(u_short *)&ifr.ifr_addr = ifr.ifr_addr.sa_family; - + error = copyout(&ifr, arg, ifr_len); return (error); @@ -2980,7 +2980,7 @@ linux_v4l_cliplist_copy(struct l_video_window *lvw, st } } ppvc = &((*ppvc)->next); - plvc = PTRIN(((struct l_video_clip *) plvc)->next); + plvc = PTRIN(((struct l_video_clip *) plvc)->next); } } else { /* Modified: head/sys/compat/linux/linux_ioctl.h ============================================================================== --- head/sys/compat/linux/linux_ioctl.h Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/compat/linux/linux_ioctl.h Mon Feb 5 17:29:12 2018 (r328890) @@ -252,7 +252,7 @@ #define LINUX_IOCTL_SOCKET_MAX LINUX_SIOCGIFCOUNT /* - * Device private ioctl calls + * Device private ioctl calls */ #define LINUX_SIOCDEVPRIVATE 0x89F0 /* to 89FF */ #define LINUX_IOCTL_PRIVATE_MIN LINUX_SIOCDEVPRIVATE @@ -430,7 +430,7 @@ /* In addition to the termio values */ #define LINUX_VSTART 8 #define LINUX_VSTOP 9 -#define LINUX_VSUSP 10 +#define LINUX_VSUSP 10 #define LINUX_VEOL 11 #define LINUX_VREPRINT 12 #define LINUX_VDISCARD 13 Modified: head/sys/compat/linux/linux_ipc.c ============================================================================== --- head/sys/compat/linux/linux_ipc.c Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/compat/linux/linux_ipc.c Mon Feb 5 17:29:12 2018 (r328890) @@ -731,8 +731,8 @@ linux_msgctl(struct thread *td, struct linux_msgctl_ar return (error); } - /* - * TODO: implement this + /* + * TODO: implement this * case LINUX_MSG_STAT: */ case LINUX_IPC_STAT: Modified: head/sys/compat/linux/linux_ipc.h ============================================================================== --- head/sys/compat/linux/linux_ipc.h Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/compat/linux/linux_ipc.h Mon Feb 5 17:29:12 2018 (r328890) @@ -86,7 +86,7 @@ #if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) -struct linux_msgctl_args +struct linux_msgctl_args { l_int msqid; l_int cmd; Modified: head/sys/compat/linux/linux_ipc64.h ============================================================================== --- head/sys/compat/linux/linux_ipc64.h Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/compat/linux/linux_ipc64.h Mon Feb 5 17:29:12 2018 (r328890) @@ -149,7 +149,7 @@ struct l_shminfo64 { l_ulong shmmni; l_ulong shmseg; l_ulong shmall; - l_ulong __unused1; + l_ulong __unused1; l_ulong __unused2; l_ulong __unused3; l_ulong __unused4; Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/compat/linux/linux_misc.c Mon Feb 5 17:29:12 2018 (r328890) @@ -116,7 +116,7 @@ int stclohz; /* Statistics clock frequency */ static unsigned int linux_to_bsd_resource[LINUX_RLIM_NLIMITS] = { RLIMIT_CPU, RLIMIT_FSIZE, RLIMIT_DATA, RLIMIT_STACK, RLIMIT_CORE, RLIMIT_RSS, RLIMIT_NPROC, RLIMIT_NOFILE, - RLIMIT_MEMLOCK, RLIMIT_AS + RLIMIT_MEMLOCK, RLIMIT_AS }; struct l_sysinfo { @@ -839,7 +839,7 @@ linux_utimensat_nsec_valid(l_long nsec) return (1); } -int +int linux_utimensat(struct thread *td, struct linux_utimensat_args *args) { struct l_timespec l_times[2]; @@ -914,7 +914,7 @@ linux_utimensat(struct thread *td, struct linux_utimen error = kern_futimens(td, dfd, timesp, UIO_SYSSPACE); else { error = kern_utimensat(td, dfd, path, UIO_SYSSPACE, timesp, - UIO_SYSSPACE, flags); + UIO_SYSSPACE, flags); LFREEPATH(path); } @@ -1222,7 +1222,7 @@ struct l_itimerval { l_timeval it_value; }; -#define B2L_ITIMERVAL(bip, lip) \ +#define B2L_ITIMERVAL(bip, lip) \ (bip)->it_interval.tv_sec = (lip)->it_interval.tv_sec; \ (bip)->it_interval.tv_usec = (lip)->it_interval.tv_usec; \ (bip)->it_value.tv_sec = (lip)->it_value.tv_sec; \ Modified: head/sys/compat/linux/linux_persona.h ============================================================================== --- head/sys/compat/linux/linux_persona.h Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/compat/linux/linux_persona.h Mon Feb 5 17:29:12 2018 (r328890) @@ -12,7 +12,7 @@ */ enum { LINUX_UNAME26 = 0x0020000, - LINUX_ADDR_NO_RANDOMIZE = 0x0040000, /* disable randomization + LINUX_ADDR_NO_RANDOMIZE = 0x0040000, /* disable randomization * of VA space */ LINUX_FDPIC_FUNCPTRS = 0x0080000, /* userspace function Modified: head/sys/compat/linux/linux_signal.c ============================================================================== --- head/sys/compat/linux/linux_signal.c Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/compat/linux/linux_signal.c Mon Feb 5 17:29:12 2018 (r328890) @@ -436,7 +436,7 @@ linux_rt_sigtimedwait(struct thread *td, tv.tv_sec = (long)ltv.tv_sec; tv.tv_usec = (suseconds_t)ltv.tv_usec; if (itimerfix(&tv)) { - /* + /* * The timeout was invalid. Convert it to something * valid that will act as it does under Linux. */ @@ -475,7 +475,7 @@ linux_rt_sigtimedwait(struct thread *td, error = copyout(&linfo, args->ptr, sizeof(linfo)); } if (error == 0) - td->td_retval[0] = sig; + td->td_retval[0] = sig; return (error); } Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/compat/linux/linux_socket.c Mon Feb 5 17:29:12 2018 (r328890) @@ -170,7 +170,7 @@ linux_getsockaddr(struct sockaddr **sap, const struct name = ((struct sockaddr_un *)kosa)->sun_path; if (*name == '\0') { /* - * Linux abstract namespace starts with a NULL byte. + * Linux abstract namespace starts with a NULL byte. * XXX We do not support abstract namespace yet. */ namelen = strnlen(name + 1, salen - hdrlen - 1) + 1; @@ -761,7 +761,7 @@ linux_bind(struct thread *td, struct linux_bind_args * error = kern_bindat(td, AT_FDCWD, args->s, sa); free(sa, M_SONAME); if (error == EADDRNOTAVAIL && args->namelen != sizeof(struct sockaddr_in)) - return (EINVAL); + return (EINVAL); return (error); } Modified: head/sys/compat/linux/linux_socket.h ============================================================================== --- head/sys/compat/linux/linux_socket.h Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/compat/linux/linux_socket.h Mon Feb 5 17:29:12 2018 (r328890) @@ -152,19 +152,19 @@ struct linux_accept_args { int linux_accept(struct thread *td, struct linux_accept_args *args); /* Operations for socketcall */ -#define LINUX_SOCKET 1 +#define LINUX_SOCKET 1 #define LINUX_BIND 2 -#define LINUX_CONNECT 3 -#define LINUX_LISTEN 4 -#define LINUX_ACCEPT 5 +#define LINUX_CONNECT 3 +#define LINUX_LISTEN 4 +#define LINUX_ACCEPT 5 #define LINUX_GETSOCKNAME 6 #define LINUX_GETPEERNAME 7 #define LINUX_SOCKETPAIR 8 #define LINUX_SEND 9 #define LINUX_RECV 10 -#define LINUX_SENDTO 11 -#define LINUX_RECVFROM 12 -#define LINUX_SHUTDOWN 13 +#define LINUX_SENDTO 11 +#define LINUX_RECVFROM 12 +#define LINUX_SHUTDOWN 13 #define LINUX_SETSOCKOPT 14 #define LINUX_GETSOCKOPT 15 #define LINUX_SENDMSG 16 Modified: head/sys/compat/linux/linux_time.c ============================================================================== --- head/sys/compat/linux/linux_time.c Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/compat/linux/linux_time.c Mon Feb 5 17:29:12 2018 (r328890) @@ -437,7 +437,7 @@ linux_clock_getres(struct thread *td, struct linux_clo } /* - * Check user supplied clock id in case of per-process + * Check user supplied clock id in case of per-process * or thread-specific cpu-time clock. */ switch (nwhich) { @@ -464,7 +464,7 @@ linux_clock_getres(struct thread *td, struct linux_clo if (args->tp == NULL) { LIN_SDT_PROBE0(time, linux_clock_getres, nullcall); LIN_SDT_PROBE1(time, linux_clock_getres, return, 0); - return (0); + return (0); } switch (nwhich) { Modified: head/sys/compat/linux/linux_util.h ============================================================================== --- head/sys/compat/linux/linux_util.h Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/compat/linux/linux_util.h Mon Feb 5 17:29:12 2018 (r328890) @@ -64,7 +64,7 @@ int linux_emul_convpath(struct thread *, const char *, return (_error); \ } while (0) -#define LCONVPATH(td, upath, pathp, i) \ +#define LCONVPATH(td, upath, pathp, i) \ LCONVPATH_AT(td, upath, pathp, i, AT_FDCWD) #define LCONVPATHEXIST(td, upath, pathp) LCONVPATH(td, upath, pathp, 0) Modified: head/sys/compat/linux/stats_timing.d ============================================================================== --- head/sys/compat/linux/stats_timing.d Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/compat/linux/stats_timing.d Mon Feb 5 17:29:12 2018 (r328890) @@ -57,7 +57,7 @@ linuxulator*:::return @stats[probeprov, execname, probefunc] = quantize(this->timediff); @longest[probeprov, probefunc] = max(this->timediff); - + self->time[probefunc] = 0; } Modified: head/sys/compat/linux/trace_futexes.d ============================================================================== --- head/sys/compat/linux/trace_futexes.d Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/compat/linux/trace_futexes.d Mon Feb 5 17:29:12 2018 (r328890) @@ -157,10 +157,10 @@ linuxulator*:futex::return { this->timediff = self->time[probefunc] - timestamp; - @timestats[probeprov, execname, probefunc] = quantize(this->timediff); - @longest[probeprov, probefunc] = max(this->timediff); + @timestats[probeprov, execname, probefunc] = quantize(this->timediff); + @longest[probeprov, probefunc] = max(this->timediff); - self->time[probefunc] = 0; + self->time[probefunc] = 0; } Modified: head/sys/i386/linux/linux.h ============================================================================== --- head/sys/i386/linux/linux.h Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/i386/linux/linux.h Mon Feb 5 17:29:12 2018 (r328890) @@ -217,19 +217,19 @@ struct l_stat64 { l_ulonglong st_ino; }; -struct l_statfs64 { - l_int f_type; - l_int f_bsize; - uint64_t f_blocks; - uint64_t f_bfree; - uint64_t f_bavail; - uint64_t f_files; - uint64_t f_ffree; - l_fsid_t f_fsid; - l_int f_namelen; - l_int f_frsize; - l_int f_flags; - l_int f_spare[4]; +struct l_statfs64 { + l_int f_type; + l_int f_bsize; + uint64_t f_blocks; + uint64_t f_bfree; + uint64_t f_bavail; + uint64_t f_files; + uint64_t f_ffree; + l_fsid_t f_fsid; + l_int f_namelen; + l_int f_frsize; + l_int f_flags; + l_int f_spare[4]; }; #define LINUX_NSIG_WORDS 2 @@ -431,11 +431,11 @@ struct l_sigframe { struct l_rt_sigframe { l_int sf_sig; - l_siginfo_t *sf_siginfo; + l_siginfo_t *sf_siginfo; struct l_ucontext *sf_ucontext; l_siginfo_t sf_si; - struct l_ucontext sf_sc; - l_handler_t sf_handler; + struct l_ucontext sf_sc; + l_handler_t sf_handler; }; extern struct sysentvec linux_sysvec; Modified: head/sys/i386/linux/linux_dummy.c ============================================================================== --- head/sys/i386/linux/linux_dummy.c Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/i386/linux/linux_dummy.c Mon Feb 5 17:29:12 2018 (r328890) @@ -8,7 +8,7 @@ * 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 + * notice, this list of conditions and the following disclaimer * in this position and unchanged. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the Modified: head/sys/i386/linux/linux_locore.s ============================================================================== --- head/sys/i386/linux/linux_locore.s Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/i386/linux/linux_locore.s Mon Feb 5 17:29:12 2018 (r328890) @@ -65,12 +65,12 @@ NON_GPROF_ENTRY(linux_vsyscall) .previous #endif -#define do_cfa_expr(offset) \ - .byte 0x0f; /* DW_CFA_def_cfa_expression */ \ - .uleb128 11f-10f; /* length */ \ -10: .byte 0x74; /* DW_OP_breg4 */ \ - .sleb128 offset; /* offset */ \ - .byte 0x06; /* DW_OP_deref */ \ +#define do_cfa_expr(offset) \ + .byte 0x0f; /* DW_CFA_def_cfa_expression */ \ + .uleb128 11f-10f; /* length */ \ +10: .byte 0x74; /* DW_OP_breg4 */ \ + .sleb128 offset; /* offset */ \ + .byte 0x06; /* DW_OP_deref */ \ 11: Modified: head/sys/i386/linux/linux_machdep.c ============================================================================== --- head/sys/i386/linux/linux_machdep.c Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/i386/linux/linux_machdep.c Mon Feb 5 17:29:12 2018 (r328890) @@ -282,7 +282,7 @@ linux_set_cloned_tls(struct thread *td, void *desc) } else { idx = info.entry_number; - /* + /* * looks like we're getting the idx we returned * in the set_thread_area() syscall */ @@ -293,8 +293,8 @@ linux_set_cloned_tls(struct thread *td, void *desc) /* this doesnt happen in practice */ if (idx == 6) { - /* we might copy out the entry_number as 3 */ - info.entry_number = 3; + /* we might copy out the entry_number as 3 */ + info.entry_number = 3; error = copyout(&info, desc, sizeof(struct l_user_desc)); if (error) printf(LMSG("copyout failed!")); @@ -638,51 +638,51 @@ linux_set_thread_area(struct thread *td, struct linux_ #ifdef DEBUG if (ldebug(set_thread_area)) - printf(ARGS(set_thread_area, "%i, %x, %x, %i, %i, %i, %i, %i, %i\n"), + printf(ARGS(set_thread_area, "%i, %x, %x, %i, %i, %i, %i, %i, %i\n"), info.entry_number, - info.base_addr, - info.limit, - info.seg_32bit, + info.base_addr, + info.limit, + info.seg_32bit, info.contents, - info.read_exec_only, - info.limit_in_pages, - info.seg_not_present, - info.useable); + info.read_exec_only, + info.limit_in_pages, + info.seg_not_present, + info.useable); #endif idx = info.entry_number; - /* + /* * Semantics of linux version: every thread in the system has array of - * 3 tls descriptors. 1st is GLIBC TLS, 2nd is WINE, 3rd unknown. This + * 3 tls descriptors. 1st is GLIBC TLS, 2nd is WINE, 3rd unknown. This * syscall loads one of the selected tls decriptors with a value and * also loads GDT descriptors 6, 7 and 8 with the content of the * per-thread descriptors. * - * Semantics of fbsd version: I think we can ignore that linux has 3 + * Semantics of fbsd version: I think we can ignore that linux has 3 * per-thread descriptors and use just the 1st one. The tls_array[] * is used only in set/get-thread_area() syscalls and for loading the * GDT descriptors. In fbsd we use just one GDT descriptor for TLS so - * we will load just one. + * we will load just one. * * XXX: this doesn't work when a user space process tries to use more * than 1 TLS segment. Comment in the linux sources says wine might do * this. */ - /* - * we support just GLIBC TLS now + /* + * we support just GLIBC TLS now * we should let 3 proceed as well because we use this segment so * if code does two subsequent calls it should succeed */ if (idx != 6 && idx != -1 && idx != 3) return (EINVAL); - /* + /* * we have to copy out the GDT entry we use * FreeBSD uses GDT entry #3 for storing %gs so load that * * XXX: what if a user space program doesn't check this value and tries - * to use 6, 7 or 8? + * to use 6, 7 or 8? */ idx = info.entry_number = 3; error = copyout(&info, args->desc, sizeof(struct l_user_desc)); @@ -700,7 +700,7 @@ linux_set_thread_area(struct thread *td, struct linux_ memcpy(&sd, &a, sizeof(a)); #ifdef DEBUG if (ldebug(set_thread_area)) - printf("Segment created in set_thread_area: lobase: %x, hibase: %x, lolimit: %x, hilimit: %x, type: %i, dpl: %i, p: %i, xx: %i, def32: %i, gran: %i\n", sd.sd_lobase, + printf("Segment created in set_thread_area: lobase: %x, hibase: %x, lolimit: %x, hilimit: %x, type: %i, dpl: %i, p: %i, xx: %i, def32: %i, gran: %i\n", sd.sd_lobase, sd.sd_hibase, sd.sd_lolimit, sd.sd_hilimit, @@ -719,14 +719,14 @@ linux_set_thread_area(struct thread *td, struct linux_ PCPU_GET(fsgs_gdt)[1] = sd; load_gs(GSEL(GUGS_SEL, SEL_UPL)); critical_exit(); - + return (0); } int linux_get_thread_area(struct thread *td, struct linux_get_thread_area_args *args) { - + struct l_user_desc info; int error; int idx; @@ -767,7 +767,7 @@ linux_get_thread_area(struct thread *td, struct linux_ error = copyout(&info, args->desc, sizeof(struct l_user_desc)); if (error) - return (EFAULT); + return (EFAULT); return (0); } @@ -777,7 +777,7 @@ int linux_mq_open(struct thread *td, struct linux_mq_open_args *args) { #ifdef P1003_1B_MQUEUE - return sys_kmq_open(td, (struct kmq_open_args *) args); + return sys_kmq_open(td, (struct kmq_open_args *) args); #else return (ENOSYS); #endif @@ -787,7 +787,7 @@ int linux_mq_unlink(struct thread *td, struct linux_mq_unlink_args *args) { #ifdef P1003_1B_MQUEUE - return sys_kmq_unlink(td, (struct kmq_unlink_args *) args); + return sys_kmq_unlink(td, (struct kmq_unlink_args *) args); #else return (ENOSYS); #endif @@ -797,7 +797,7 @@ int linux_mq_timedsend(struct thread *td, struct linux_mq_timedsend_args *args) { #ifdef P1003_1B_MQUEUE - return sys_kmq_timedsend(td, (struct kmq_timedsend_args *) args); + return sys_kmq_timedsend(td, (struct kmq_timedsend_args *) args); #else return (ENOSYS); #endif @@ -807,7 +807,7 @@ int linux_mq_timedreceive(struct thread *td, struct linux_mq_timedreceive_args *args) { #ifdef P1003_1B_MQUEUE - return sys_kmq_timedreceive(td, (struct kmq_timedreceive_args *) args); + return sys_kmq_timedreceive(td, (struct kmq_timedreceive_args *) args); #else return (ENOSYS); #endif @@ -827,7 +827,7 @@ int linux_mq_getsetattr(struct thread *td, struct linux_mq_getsetattr_args *args) { #ifdef P1003_1B_MQUEUE - return sys_kmq_setattr(td, (struct kmq_setattr_args *) args); + return sys_kmq_setattr(td, (struct kmq_setattr_args *) args); #else return (ENOSYS); #endif Modified: head/sys/i386/linux/linux_support.s ============================================================================== --- head/sys/i386/linux/linux_support.s Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/i386/linux/linux_support.s Mon Feb 5 17:29:12 2018 (r328890) @@ -46,7 +46,7 @@ ENTRY(futex_xchgl) movl 4(%esp),%eax movl 8(%esp),%edx cmpl $VM_MAXUSER_ADDRESS-4,%edx - ja futex_fault + ja futex_fault xchgl %eax,(%edx) movl 12(%esp),%edx movl %eax,(%edx) @@ -60,7 +60,7 @@ ENTRY(futex_addl) movl 4(%esp),%eax movl 8(%esp),%edx cmpl $VM_MAXUSER_ADDRESS-4,%edx - ja futex_fault + ja futex_fault #ifdef SMP lock #endif @@ -76,7 +76,7 @@ ENTRY(futex_orl) movl $futex_fault_decx,PCB_ONFAULT(%ecx) movl 8(%esp),%edx cmpl $VM_MAXUSER_ADDRESS-4,%edx - ja futex_fault + ja futex_fault movl (%edx),%eax 1: movl %eax,%ecx orl 4(%esp),%ecx @@ -85,7 +85,7 @@ ENTRY(futex_orl) #endif cmpxchgl %ecx,(%edx) jnz 1b -futex_tail: +futex_tail: movl 12(%esp),%edx movl %eax,(%edx) xorl %eax,%eax @@ -98,7 +98,7 @@ ENTRY(futex_andl) movl $futex_fault_decx,PCB_ONFAULT(%ecx) movl 8(%esp),%edx cmpl $VM_MAXUSER_ADDRESS-4,%edx *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Feb 5 17:33:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB5ABEDFB26; Mon, 5 Feb 2018 17:33:16 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B9CE7DFA2; Mon, 5 Feb 2018 17:33:16 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 863E3400D; Mon, 5 Feb 2018 17:33:16 +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 w15HXGDo065826; Mon, 5 Feb 2018 17:33:16 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15HXG6D065825; Mon, 5 Feb 2018 17:33:16 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201802051733.w15HXG6D065825@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 5 Feb 2018 17:33:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328891 - head/lib/libcasper/libcasper X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/lib/libcasper/libcasper X-SVN-Commit-Revision: 328891 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 17:33:17 -0000 Author: markj Date: Mon Feb 5 17:33:16 2018 New Revision: 328891 URL: https://svnweb.freebsd.org/changeset/base/328891 Log: Document the need for WITH_CASPER. After r325062, consumers need to define WITH_CASPER for libcasper to function as expected. Modified: head/lib/libcasper/libcasper/libcasper.3 Modified: head/lib/libcasper/libcasper/libcasper.3 ============================================================================== --- head/lib/libcasper/libcasper/libcasper.3 Mon Feb 5 17:29:12 2018 (r328890) +++ head/lib/libcasper/libcasper/libcasper.3 Mon Feb 5 17:33:16 2018 (r328891) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 3, 2018 +.Dd February 5, 2018 .Dt LIBCASPER 3 .Os .Sh NAME @@ -47,6 +47,7 @@ .Sh LIBRARY .Lb libcasper .Sh SYNOPSIS +.Fd #define WITH_CASPER .In sys/nv.h .In libcasper.h .Ft "cap_channel_t *" From owner-svn-src-all@freebsd.org Mon Feb 5 18:06:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D46BAEE2A65; Mon, 5 Feb 2018 18:06:54 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 845F580951; Mon, 5 Feb 2018 18:06:54 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 78E364561; Mon, 5 Feb 2018 18:06:54 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w15I6sZU083366; Mon, 5 Feb 2018 18:06:54 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15I6sEA083365; Mon, 5 Feb 2018 18:06:54 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201802051806.w15I6sEA083365@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 5 Feb 2018 18:06:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328892 - head/sys/mips/mips X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/mips/mips X-SVN-Commit-Revision: 328892 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 18:06:55 -0000 Author: brooks Date: Mon Feb 5 18:06:54 2018 New Revision: 328892 URL: https://svnweb.freebsd.org/changeset/base/328892 Log: Garbage collect trailing whitespace. Sponsored by: DARPA, AFRL Modified: head/sys/mips/mips/busdma_machdep.c Modified: head/sys/mips/mips/busdma_machdep.c ============================================================================== --- head/sys/mips/mips/busdma_machdep.c Mon Feb 5 17:33:16 2018 (r328891) +++ head/sys/mips/mips/busdma_machdep.c Mon Feb 5 18:06:54 2018 (r328892) @@ -277,7 +277,7 @@ run_filter(bus_dma_tag_t dmat, bus_addr_t paddr) || (*dmat->filter)(dmat->filterarg, paddr) != 0)) retval = 1; - dmat = dmat->parent; + dmat = dmat->parent; } while (retval == 0 && dmat != NULL); return (retval); } @@ -292,7 +292,7 @@ _bus_dma_can_bounce(vm_offset_t lowaddr, vm_offset_t h int i; for (i = 0; phys_avail[i] && phys_avail[i + 1]; i += 2) { if ((lowaddr >= phys_avail[i] && lowaddr <= phys_avail[i + 1]) - || (lowaddr < phys_avail[i] && + || (lowaddr < phys_avail[i] && highaddr > phys_avail[i])) return (1); } @@ -356,7 +356,7 @@ _busdma_alloc_dmamap(bus_dma_tag_t dmat) return (map); } -static __inline void +static __inline void _busdma_free_dmamap(bus_dmamap_t map) { @@ -497,10 +497,10 @@ bus_dma_tag_destroy(bus_dma_tag_t dmat) if (dmat != NULL) { if (dmat->map_count != 0) return (EBUSY); - + while (dmat != NULL) { bus_dma_tag_t parent; - + parent = dmat->parent; atomic_subtract_int(&dmat->ref_count, 1); if (dmat->ref_count == 0) { @@ -1394,7 +1394,7 @@ alloc_bounce_pages(bus_dma_tag_t dmat, u_int numpages) break; } bpage->busaddr = pmap_kextract(bpage->vaddr); - bpage->vaddr_nocache = + bpage->vaddr_nocache = (vm_offset_t)pmap_mapdev(bpage->busaddr, PAGE_SIZE); mtx_lock(&bounce_lock); STAILQ_INSERT_TAIL(&bz->bounce_page_list, bpage, links); From owner-svn-src-all@freebsd.org Mon Feb 5 18:10:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB39CEE2ECF; Mon, 5 Feb 2018 18:10:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 889C080BD0; Mon, 5 Feb 2018 18:10:28 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E0964565; Mon, 5 Feb 2018 18:10:28 +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 w15IASlr083555; Mon, 5 Feb 2018 18:10:28 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15IASQX083554; Mon, 5 Feb 2018 18:10:28 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201802051810.w15IASQX083554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 5 Feb 2018 18:10:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328893 - head/lib/libc/mips/gen X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/lib/libc/mips/gen X-SVN-Commit-Revision: 328893 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 18:10:29 -0000 Author: jhb Date: Mon Feb 5 18:10:28 2018 New Revision: 328893 URL: https://svnweb.freebsd.org/changeset/base/328893 Log: Fix makecontext() on MIPS O32. The GP register can be clobbered by the callback, so save it in S1 while invoking the callback function. While here, add a comment expounding on the treatment of GP for the various ABIs and the assumptions made. Reviewed by: jmallett (earlier version) Sponsored by: DARPA / AFRL Differential Revision: https://reviews.freebsd.org/D14179 Modified: head/lib/libc/mips/gen/_ctx_start.S Modified: head/lib/libc/mips/gen/_ctx_start.S ============================================================================== --- head/lib/libc/mips/gen/_ctx_start.S Mon Feb 5 18:06:54 2018 (r328892) +++ head/lib/libc/mips/gen/_ctx_start.S Mon Feb 5 18:10:28 2018 (r328893) @@ -28,11 +28,25 @@ __FBSDID("$FreeBSD$"); /* - * XXX gp? + * This requires makecontext() to setup a valid GP for locating + * _ctx_done rather than deriving GP from T9 on entry. Currently this + * uses the GP inherited from getcontext() assuming that getcontext() + * is in the same shared object as _ctx_done(). For N32 and N64, GP + * is caller-save so will be preserved across the call to the callback + * function. For O32, GP is callee-save, so save it in a different + * caller-save register (S1) while invoking the callback. This is + * done instead of the usual SETUP_GP/SAVE_GP to avoid disturbing the + * stack frame setup by makecontext() for the callback function. */ ENTRY(_ctx_start) +#ifdef __mips_o32 + move s1, gp +#endif jalr t9 +#ifdef __mips_o32 + move gp, s1 +#endif move a0, s0 PTR_LA t9, _ctx_done jalr t9 From owner-svn-src-all@freebsd.org Mon Feb 5 18:39:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D6DBEE52BC; Mon, 5 Feb 2018 18:39:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E0B7582167; Mon, 5 Feb 2018 18:39:06 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D741E4A83; Mon, 5 Feb 2018 18:39:06 +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 w15Id6Pw098795; Mon, 5 Feb 2018 18:39:06 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15Id6ir098793; Mon, 5 Feb 2018 18:39:06 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201802051839.w15Id6ir098793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 5 Feb 2018 18:39:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328894 - in head/sys: amd64/linux i386/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/sys: amd64/linux i386/linux X-SVN-Commit-Revision: 328894 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 18:39:07 -0000 Author: emaste Date: Mon Feb 5 18:39:06 2018 New Revision: 328894 URL: https://svnweb.freebsd.org/changeset/base/328894 Log: Additional linuxolator whitespace cleanup, missed in r328890 Modified: head/sys/amd64/linux/syscalls.master head/sys/i386/linux/syscalls.master Modified: head/sys/amd64/linux/syscalls.master ============================================================================== --- head/sys/amd64/linux/syscalls.master Mon Feb 5 18:10:28 2018 (r328893) +++ head/sys/amd64/linux/syscalls.master Mon Feb 5 18:39:06 2018 (r328894) @@ -76,7 +76,7 @@ l_size_t nbyte, l_loff_t offset); } 18 AUE_PWRITE STD { int linux_pwrite(l_uint fd, char *buf, \ l_size_t nbyte, l_loff_t offset); } -19 AUE_READV NOPROTO { int readv(int fd, struct iovec *iovp, \ +19 AUE_READV NOPROTO { int readv(int fd, struct iovec *iovp, \ u_int iovcnt); } 20 AUE_WRITEV NOPROTO { int writev(int fd, struct iovec *iovp, \ u_int iovcnt); } @@ -472,7 +472,7 @@ 279 AUE_NULL STD { int linux_move_pages(void); } 280 AUE_FUTIMESAT STD { int linux_utimensat(l_int dfd, const char *pathname, \ const struct l_timespec *times, l_int flags); } -281 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \ +281 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \ l_int maxevents, l_int timeout, l_sigset_t *mask, \ l_size_t sigsetsize); } 282 AUE_NULL STD { int linux_signalfd(void); } Modified: head/sys/i386/linux/syscalls.master ============================================================================== --- head/sys/i386/linux/syscalls.master Mon Feb 5 18:10:28 2018 (r328893) +++ head/sys/i386/linux/syscalls.master Mon Feb 5 18:39:06 2018 (r328894) @@ -121,10 +121,10 @@ 61 AUE_CHROOT NOPROTO { int chroot(char *path); } 62 AUE_NULL STD { int linux_ustat(l_dev_t dev, \ struct l_ustat *ubuf); } -63 AUE_DUP2 NOPROTO { int dup2(u_int from, u_int to); } +63 AUE_DUP2 NOPROTO { int dup2(u_int from, u_int to); } 64 AUE_GETPPID STD { int linux_getppid(void); } -65 AUE_GETPGRP NOPROTO { int getpgrp(void); } -66 AUE_SETSID NOPROTO { int setsid(void); } +65 AUE_GETPGRP NOPROTO { int getpgrp(void); } +66 AUE_SETSID NOPROTO { int setsid(void); } 67 AUE_NULL STD { int linux_sigaction(l_int sig, \ l_osigaction_t *nsa, \ l_osigaction_t *osa); } From owner-svn-src-all@freebsd.org Mon Feb 5 18:45:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 328C5EE5C2A; Mon, 5 Feb 2018 18:45:22 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DC31E829DC; Mon, 5 Feb 2018 18:45:21 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D2BC24C1F; Mon, 5 Feb 2018 18:45:21 +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 w15IjLV2003876; Mon, 5 Feb 2018 18:45:21 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15IjLHq003875; Mon, 5 Feb 2018 18:45:21 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201802051845.w15IjLHq003875@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 5 Feb 2018 18:45:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328895 - head/etc X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/etc X-SVN-Commit-Revision: 328895 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 18:45:22 -0000 Author: emaste Date: Mon Feb 5 18:45:21 2018 New Revision: 328895 URL: https://svnweb.freebsd.org/changeset/base/328895 Log: Correct Russia spelling in regdomain.xml PR: 225658 MFC after: 1 week Modified: head/etc/regdomain.xml Modified: head/etc/regdomain.xml ============================================================================== --- head/etc/regdomain.xml Mon Feb 5 18:39:06 2018 (r328894) +++ head/etc/regdomain.xml Mon Feb 5 18:45:21 2018 (r328895) @@ -1595,7 +1595,7 @@ 642 Romania - 643 Rusia + 643 Russia 682 Saudi Arabia From owner-svn-src-all@freebsd.org Mon Feb 5 18:48:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C307EE6086; Mon, 5 Feb 2018 18:48:01 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CDC4282DC0; Mon, 5 Feb 2018 18:48:00 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C89BC4C24; Mon, 5 Feb 2018 18:48:00 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w15Im0EB004134; Mon, 5 Feb 2018 18:48:00 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15Im031004131; Mon, 5 Feb 2018 18:48:00 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201802051848.w15Im031004131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 5 Feb 2018 18:48:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328896 - in head: contrib/netbsd-tests/kernel tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: contrib/netbsd-tests/kernel tests/sys/kern X-SVN-Commit-Revision: 328896 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 18:48:01 -0000 Author: brooks Date: Mon Feb 5 18:48:00 2018 New Revision: 328896 URL: https://svnweb.freebsd.org/changeset/base/328896 Log: Fix and enable SysV IPC tests. Don't declare some types that FreeBSD incorrectly declares. Fix an incorrect call to open() (missing mode). ANSIfy prototypes. Enable SysV message queue, semaphore, and shared memory tests. With exception of the workaround for union semun, these fixes have been committed to NetBSD. Reviewed by: asomers Approved by: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D13471 Modified: head/contrib/netbsd-tests/kernel/t_sysv.c head/tests/sys/kern/Makefile Modified: head/contrib/netbsd-tests/kernel/t_sysv.c ============================================================================== --- head/contrib/netbsd-tests/kernel/t_sysv.c Mon Feb 5 18:45:21 2018 (r328895) +++ head/contrib/netbsd-tests/kernel/t_sysv.c Mon Feb 5 18:48:00 2018 (r328896) @@ -72,7 +72,7 @@ void sharer(void); #define MESSAGE_TEXT_LEN 256 -struct mymsg { +struct testmsg { long mtype; char mtext[MESSAGE_TEXT_LEN]; }; @@ -94,11 +94,13 @@ key_t msgkey, semkey, shmkey; int maxloop = 1; +#ifndef __FreeBSD__ union semun { int val; /* value for SETVAL */ struct semid_ds *buf; /* buffer for IPC_{STAT,SET} */ u_short *array; /* array for GETALL & SETALL */ }; +#endif /* Writes an integer to a file. To be used from the body of the test @@ -174,7 +176,7 @@ key_t get_ftok(int id) /* Create the file, since ftok() requires it to exist! */ - fd = open(token_key, O_RDWR | O_CREAT | O_EXCL); + fd = open(token_key, O_RDWR | O_CREAT | O_EXCL, 0600); if (fd == -1) { rmdir(tmpdir); atf_tc_fail("open() of temp file failed: %d", errno); @@ -202,7 +204,7 @@ ATF_TC_BODY(msg, tc) { struct sigaction sa; struct msqid_ds m_ds; - struct mymsg m; + struct testmsg m; sigset_t sigmask; int sender_msqid; int loop; @@ -347,9 +349,7 @@ ATF_TC_CLEANUP(msg, tc) } void -print_msqid_ds(mp, mode) - struct msqid_ds *mp; - mode_t mode; +print_msqid_ds(struct msqid_ds *mp, mode_t mode) { uid_t uid = geteuid(); gid_t gid = getegid(); @@ -381,9 +381,9 @@ print_msqid_ds(mp, mode) } void -receiver() +receiver(void) { - struct mymsg m; + struct testmsg m; int msqid, loop; if ((msqid = msgget(msgkey, 0)) == -1) @@ -588,9 +588,7 @@ ATF_TC_CLEANUP(sem, tc) } void -print_semid_ds(sp, mode) - struct semid_ds *sp; - mode_t mode; +print_semid_ds(struct semid_ds *sp, mode_t mode) { uid_t uid = geteuid(); gid_t gid = getegid(); @@ -620,7 +618,7 @@ print_semid_ds(sp, mode) } void -waiter() +waiter(void) { struct sembuf s; int semid; @@ -789,9 +787,7 @@ ATF_TC_CLEANUP(shm, tc) } void -print_shmid_ds(sp, mode) - struct shmid_ds *sp; - mode_t mode; +print_shmid_ds(struct shmid_ds *sp, mode_t mode) { uid_t uid = geteuid(); gid_t gid = getegid(); @@ -823,7 +819,7 @@ print_shmid_ds(sp, mode) } void -sharer() +sharer(void) { int shmid; void *shm_buf; Modified: head/tests/sys/kern/Makefile ============================================================================== --- head/tests/sys/kern/Makefile Mon Feb 5 18:45:21 2018 (r328895) +++ head/tests/sys/kern/Makefile Mon Feb 5 18:48:00 2018 (r328896) @@ -26,6 +26,7 @@ LIBADD.unix_seqpacket_test+= pthread NETBSD_ATF_TESTS_C+= lockf_test NETBSD_ATF_TESTS_C+= mqueue_test +NETBSD_ATF_TESTS_C+= sysv_test CFLAGS.mqueue_test+= -I${SRCTOP}/tests LIBADD.mqueue_test+= rt From owner-svn-src-all@freebsd.org Mon Feb 5 18:56:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2FEEEE6D16; Mon, 5 Feb 2018 18:56:34 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 95252839ED; Mon, 5 Feb 2018 18:56:34 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F60D4DBB; Mon, 5 Feb 2018 18:56:34 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w15IuYTa009577; Mon, 5 Feb 2018 18:56:34 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15IuYNt009576; Mon, 5 Feb 2018 18:56:34 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201802051856.w15IuYNt009576@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Mon, 5 Feb 2018 18:56:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328897 - stable/11/sys/netinet6 X-SVN-Group: stable-11 X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: stable/11/sys/netinet6 X-SVN-Commit-Revision: 328897 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 18:56:35 -0000 Author: vangyzen Date: Mon Feb 5 18:56:34 2018 New Revision: 328897 URL: https://svnweb.freebsd.org/changeset/base/328897 Log: MFC r328552 ND6: Set the correct state for new neighbor cache entries Restore state 6. Many of the UNH tests end up exercising this state, where we have a new neighbor cache entry and a new link-layer entry is being created for it. The link-layer address is currently unknown so the initial state of the "llentry" should remain initialized to ND6_LLINFO_NOSTATE so that the ND code will send a solicitation. Setting this to ND6_LLINFO_STALE implies that the link-level entry is valid and can be used (but needs to be refreshed via the Neighbor Unreachability state machine). https://forums.freebsd.org/threads/64287/ Submitted by: Farrell Woods Reviewed by: mjoras, dab, ae Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D14059 Modified: stable/11/sys/netinet6/nd6.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet6/nd6.c ============================================================================== --- stable/11/sys/netinet6/nd6.c Mon Feb 5 18:48:00 2018 (r328896) +++ stable/11/sys/netinet6/nd6.c Mon Feb 5 18:56:34 2018 (r328897) @@ -2030,10 +2030,11 @@ nd6_cache_lladdr(struct ifnet *ifp, struct in6_addr *f if (ln_tmp == NULL) { /* No existing lle, mark as new entry (6,7) */ is_newentry = 1; - nd6_llinfo_setstate(ln, ND6_LLINFO_STALE); - if (lladdr != NULL) /* (7) */ + if (lladdr != NULL) { /* (7) */ + nd6_llinfo_setstate(ln, ND6_LLINFO_STALE); EVENTHANDLER_INVOKE(lle_event, ln, LLENTRY_RESOLVED); + } } else { lltable_free_entry(LLTABLE6(ifp), ln); ln = ln_tmp; From owner-svn-src-all@freebsd.org Mon Feb 5 18:58:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61766EE6FDC; Mon, 5 Feb 2018 18:58:56 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 17F0983C02; Mon, 5 Feb 2018 18:58:56 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E1344DBC; Mon, 5 Feb 2018 18:58:56 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w15Iwtci009736; Mon, 5 Feb 2018 18:58:55 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15IwtjP009735; Mon, 5 Feb 2018 18:58:55 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201802051858.w15IwtjP009735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 5 Feb 2018 18:58:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328898 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 328898 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 18:58:56 -0000 Author: brooks Date: Mon Feb 5 18:58:55 2018 New Revision: 328898 URL: https://svnweb.freebsd.org/changeset/base/328898 Log: ANSIfy syscall implementations. Reviewed by: rwatson Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14172 Modified: head/sys/kern/vfs_extattr.c Modified: head/sys/kern/vfs_extattr.c ============================================================================== --- head/sys/kern/vfs_extattr.c Mon Feb 5 18:56:34 2018 (r328897) +++ head/sys/kern/vfs_extattr.c Mon Feb 5 18:58:55 2018 (r328898) @@ -56,16 +56,17 @@ __FBSDID("$FreeBSD$"); * * Currently this is used only by UFS1 extended attributes. */ +#ifndef _SYS_SYSPROTO_H_ +struct extattrctl_args { + const char *path; + int cmd; + const char *filename; + int attrnamespace; + const char *attrname; +}; +#endif int -sys_extattrctl(td, uap) - struct thread *td; - struct extattrctl_args /* { - const char *path; - int cmd; - const char *filename; - int attrnamespace; - const char *attrname; - } */ *uap; +sys_extattrctl(struct thread *td, struct extattrctl_args *uap) { struct vnode *filename_vp; struct nameidata nd; @@ -206,16 +207,17 @@ done: return (error); } +#ifndef _SYS_SYSPROTO_H_ +struct extattr_set_fd_args { + int fd; + int attrnamespace; + const char *attrname; + void *data; + size_t nbytes; +}; +#endif int -sys_extattr_set_fd(td, uap) - struct thread *td; - struct extattr_set_fd_args /* { - int fd; - int attrnamespace; - const char *attrname; - void *data; - size_t nbytes; - } */ *uap; +sys_extattr_set_fd(struct thread *td, struct extattr_set_fd_args *uap) { struct file *fp; char attrname[EXTATTR_MAXNAMELEN]; @@ -241,16 +243,17 @@ sys_extattr_set_fd(td, uap) return (error); } +#ifndef _SYS_SYSPROTO_H_ +struct extattr_set_file_args { + const char *path; + int attrnamespace; + const char *attrname; + void *data; + size_t nbytes; +}; +#endif int -sys_extattr_set_file(td, uap) - struct thread *td; - struct extattr_set_file_args /* { - const char *path; - int attrnamespace; - const char *attrname; - void *data; - size_t nbytes; - } */ *uap; +sys_extattr_set_file(struct thread *td, struct extattr_set_file_args *uap) { struct nameidata nd; char attrname[EXTATTR_MAXNAMELEN]; @@ -276,16 +279,17 @@ sys_extattr_set_file(td, uap) return (error); } +#ifndef _SYS_SYSPROTO_H_ +struct extattr_set_link_args { + const char *path; + int attrnamespace; + const char *attrname; + void *data; + size_t nbytes; +}; +#endif int -sys_extattr_set_link(td, uap) - struct thread *td; - struct extattr_set_link_args /* { - const char *path; - int attrnamespace; - const char *attrname; - void *data; - size_t nbytes; - } */ *uap; +sys_extattr_set_link(struct thread *td, struct extattr_set_link_args *uap) { struct nameidata nd; char attrname[EXTATTR_MAXNAMELEN]; @@ -381,16 +385,17 @@ done: return (error); } +#ifndef _SYS_SYSPROTO_H_ +struct extattr_get_fd_args { + int fd; + int attrnamespace; + const char *attrname; + void *data; + size_t nbytes; +}; +#endif int -sys_extattr_get_fd(td, uap) - struct thread *td; - struct extattr_get_fd_args /* { - int fd; - int attrnamespace; - const char *attrname; - void *data; - size_t nbytes; - } */ *uap; +sys_extattr_get_fd(struct thread *td, struct extattr_get_fd_args *uap) { struct file *fp; char attrname[EXTATTR_MAXNAMELEN]; @@ -416,16 +421,17 @@ sys_extattr_get_fd(td, uap) return (error); } +#ifndef _SYS_SYSPROTO_H_ +struct extattr_get_file_args { + const char *path; + int attrnamespace; + const char *attrname; + void *data; + size_t nbytes; +}; +#endif int -sys_extattr_get_file(td, uap) - struct thread *td; - struct extattr_get_file_args /* { - const char *path; - int attrnamespace; - const char *attrname; - void *data; - size_t nbytes; - } */ *uap; +sys_extattr_get_file(struct thread *td, struct extattr_get_file_args *uap) { struct nameidata nd; char attrname[EXTATTR_MAXNAMELEN]; @@ -450,16 +456,17 @@ sys_extattr_get_file(td, uap) return (error); } +#ifndef _SYS_SYSPROTO_H_ +struct extattr_get_link_args { + const char *path; + int attrnamespace; + const char *attrname; + void *data; + size_t nbytes; +}; +#endif int -sys_extattr_get_link(td, uap) - struct thread *td; - struct extattr_get_link_args /* { - const char *path; - int attrnamespace; - const char *attrname; - void *data; - size_t nbytes; - } */ *uap; +sys_extattr_get_link(struct thread *td, struct extattr_get_link_args *uap) { struct nameidata nd; char attrname[EXTATTR_MAXNAMELEN]; @@ -527,14 +534,15 @@ done: return (error); } +#ifndef _SYS_SYSPROTO_H_ +struct extattr_delete_fd_args { + int fd; + int attrnamespace; + const char *attrname; +}; +#endif int -sys_extattr_delete_fd(td, uap) - struct thread *td; - struct extattr_delete_fd_args /* { - int fd; - int attrnamespace; - const char *attrname; - } */ *uap; +sys_extattr_delete_fd(struct thread *td, struct extattr_delete_fd_args *uap) { struct file *fp; char attrname[EXTATTR_MAXNAMELEN]; @@ -559,14 +567,15 @@ sys_extattr_delete_fd(td, uap) return (error); } +#ifndef _SYS_SYSPROTO_H_ +struct extattr_delete_file_args { + const char *path; + int attrnamespace; + const char *attrname; +}; +#endif int -sys_extattr_delete_file(td, uap) - struct thread *td; - struct extattr_delete_file_args /* { - const char *path; - int attrnamespace; - const char *attrname; - } */ *uap; +sys_extattr_delete_file(struct thread *td, struct extattr_delete_file_args *uap) { struct nameidata nd; char attrname[EXTATTR_MAXNAMELEN]; @@ -589,14 +598,15 @@ sys_extattr_delete_file(td, uap) return(error); } +#ifndef _SYS_SYSPROTO_H_ +struct extattr_delete_link_args { + const char *path; + int attrnamespace; + const char *attrname; +}; +#endif int -sys_extattr_delete_link(td, uap) - struct thread *td; - struct extattr_delete_link_args /* { - const char *path; - int attrnamespace; - const char *attrname; - } */ *uap; +sys_extattr_delete_link(struct thread *td, struct extattr_delete_link_args *uap) { struct nameidata nd; char attrname[EXTATTR_MAXNAMELEN]; @@ -684,15 +694,16 @@ done: } +#ifndef _SYS_SYSPROTO_H_ +struct extattr_list_fd_args { + int fd; + int attrnamespace; + void *data; + size_t nbytes; +}; +#endif int -sys_extattr_list_fd(td, uap) - struct thread *td; - struct extattr_list_fd_args /* { - int fd; - int attrnamespace; - void *data; - size_t nbytes; - } */ *uap; +sys_extattr_list_fd(struct thread *td, struct extattr_list_fd_args *uap) { struct file *fp; cap_rights_t rights; @@ -712,15 +723,16 @@ sys_extattr_list_fd(td, uap) return (error); } +#ifndef _SYS_SYSPROTO_H_ +struct extattr_list_file_args { + const char *path; + int attrnamespace; + void *data; + size_t nbytes; +} +#endif int -sys_extattr_list_file(td, uap) - struct thread*td; - struct extattr_list_file_args /* { - const char *path; - int attrnamespace; - void *data; - size_t nbytes; - } */ *uap; +sys_extattr_list_file(struct thread *td, struct extattr_list_file_args *uap) { struct nameidata nd; int error; @@ -739,15 +751,16 @@ sys_extattr_list_file(td, uap) return (error); } +#ifndef _SYS_SYSPROTO_H_ +struct extattr_list_link_args { + const char *path; + int attrnamespace; + void *data; + size_t nbytes; +}; +#endif int -sys_extattr_list_link(td, uap) - struct thread*td; - struct extattr_list_link_args /* { - const char *path; - int attrnamespace; - void *data; - size_t nbytes; - } */ *uap; +sys_extattr_list_link(struct thread *td, struct extattr_list_link_args *uap) { struct nameidata nd; int error; From owner-svn-src-all@freebsd.org Mon Feb 5 19:06:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4AA31EE79CF; Mon, 5 Feb 2018 19:06:35 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 000BA8441A; Mon, 5 Feb 2018 19:06:34 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA89D4F58; Mon, 5 Feb 2018 19:06:34 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w15J6YwM015008; Mon, 5 Feb 2018 19:06:34 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15J6YgE015007; Mon, 5 Feb 2018 19:06:34 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201802051906.w15J6YgE015007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 5 Feb 2018 19:06:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328899 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 328899 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 19:06:35 -0000 Author: brooks Date: Mon Feb 5 19:06:34 2018 New Revision: 328899 URL: https://svnweb.freebsd.org/changeset/base/328899 Log: Reduce duplication in extattr_*_(file|link) syscalls. Reviewed by: rwatson Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14173 Modified: head/sys/kern/vfs_extattr.c Modified: head/sys/kern/vfs_extattr.c ============================================================================== --- head/sys/kern/vfs_extattr.c Mon Feb 5 18:58:55 2018 (r328898) +++ head/sys/kern/vfs_extattr.c Mon Feb 5 19:06:34 2018 (r328899) @@ -49,6 +49,17 @@ __FBSDID("$FreeBSD$"); #include #include +static int kern_extattr_set_path(struct thread *td, const char *path, + int attrnamespace, const char *attrname, void *data, + size_t nbytes, int follow); +static int kern_extattr_get_path(struct thread *td, const char *path, + int attrnamespace, const char *attrname, void *data, + size_t nbytes, int follow); +static int kern_extattr_delete_path(struct thread *td, const char *path, + int attrnamespace, const char *attrname, int follow); +static int kern_extattr_list_path(struct thread *td, const char *path, + int attrnamespace, void *data, size_t nbytes, int follow); + /* * Syscall to push extended attribute configuration information into the VFS. * Accepts a path, which it converts to a mountpoint, as well as a command @@ -255,28 +266,9 @@ struct extattr_set_file_args { int sys_extattr_set_file(struct thread *td, struct extattr_set_file_args *uap) { - struct nameidata nd; - char attrname[EXTATTR_MAXNAMELEN]; - int error; - AUDIT_ARG_VALUE(uap->attrnamespace); - error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL); - if (error) - return (error); - AUDIT_ARG_TEXT(attrname); - - NDINIT(&nd, LOOKUP, FOLLOW | AUDITVNODE1, UIO_USERSPACE, - uap->path, td); - error = namei(&nd); - if (error) - return (error); - NDFREE(&nd, NDF_ONLY_PNBUF); - - error = extattr_set_vp(nd.ni_vp, uap->attrnamespace, attrname, - uap->data, uap->nbytes, td); - - vrele(nd.ni_vp); - return (error); + return (kern_extattr_set_path(td, uap->path, uap->attrnamespace, + uap->attrname, uap->data, uap->nbytes, FOLLOW)); } #ifndef _SYS_SYSPROTO_H_ @@ -291,25 +283,33 @@ struct extattr_set_link_args { int sys_extattr_set_link(struct thread *td, struct extattr_set_link_args *uap) { + + return (kern_extattr_set_path(td, uap->path, uap->attrnamespace, + uap->attrname, uap->data, uap->nbytes, NOFOLLOW)); +} + +static int +kern_extattr_set_path(struct thread *td, const char *path, int attrnamespace, + const char *uattrname, void *data, size_t nbytes, int follow) +{ struct nameidata nd; char attrname[EXTATTR_MAXNAMELEN]; int error; - AUDIT_ARG_VALUE(uap->attrnamespace); - error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL); + AUDIT_ARG_VALUE(attrnamespace); + error = copyinstr(uattrname, attrname, EXTATTR_MAXNAMELEN, NULL); if (error) return (error); AUDIT_ARG_TEXT(attrname); - NDINIT(&nd, LOOKUP, NOFOLLOW | AUDITVNODE1, UIO_USERSPACE, - uap->path, td); + NDINIT(&nd, LOOKUP, follow | AUDITVNODE1, UIO_USERSPACE, path, td); error = namei(&nd); if (error) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); - error = extattr_set_vp(nd.ni_vp, uap->attrnamespace, attrname, - uap->data, uap->nbytes, td); + error = extattr_set_vp(nd.ni_vp, attrnamespace, attrname, data, + nbytes, td); vrele(nd.ni_vp); return (error); @@ -433,27 +433,8 @@ struct extattr_get_file_args { int sys_extattr_get_file(struct thread *td, struct extattr_get_file_args *uap) { - struct nameidata nd; - char attrname[EXTATTR_MAXNAMELEN]; - int error; - - AUDIT_ARG_VALUE(uap->attrnamespace); - error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL); - if (error) - return (error); - AUDIT_ARG_TEXT(attrname); - - NDINIT(&nd, LOOKUP, FOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, td); - error = namei(&nd); - if (error) - return (error); - NDFREE(&nd, NDF_ONLY_PNBUF); - - error = extattr_get_vp(nd.ni_vp, uap->attrnamespace, attrname, - uap->data, uap->nbytes, td); - - vrele(nd.ni_vp); - return (error); + return (kern_extattr_get_path(td, uap->path, uap->attrnamespace, + uap->attrname, uap->data, uap->nbytes, FOLLOW)); } #ifndef _SYS_SYSPROTO_H_ @@ -468,25 +449,32 @@ struct extattr_get_link_args { int sys_extattr_get_link(struct thread *td, struct extattr_get_link_args *uap) { + return (kern_extattr_get_path(td, uap->path, uap->attrnamespace, + uap->attrname, uap->data, uap->nbytes, NOFOLLOW)); +} + +static int +kern_extattr_get_path(struct thread *td, const char *path, int attrnamespace, + const char *uattrname, void *data, size_t nbytes, int follow) +{ struct nameidata nd; char attrname[EXTATTR_MAXNAMELEN]; int error; - AUDIT_ARG_VALUE(uap->attrnamespace); - error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL); + AUDIT_ARG_VALUE(attrnamespace); + error = copyinstr(uattrname, attrname, EXTATTR_MAXNAMELEN, NULL); if (error) return (error); AUDIT_ARG_TEXT(attrname); - NDINIT(&nd, LOOKUP, NOFOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, - td); + NDINIT(&nd, LOOKUP, follow | AUDITVNODE1, UIO_USERSPACE, path, td); error = namei(&nd); if (error) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); - error = extattr_get_vp(nd.ni_vp, uap->attrnamespace, attrname, - uap->data, uap->nbytes, td); + error = extattr_get_vp(nd.ni_vp, attrnamespace, attrname, data, + nbytes, td); vrele(nd.ni_vp); return (error); @@ -577,25 +565,9 @@ struct extattr_delete_file_args { int sys_extattr_delete_file(struct thread *td, struct extattr_delete_file_args *uap) { - struct nameidata nd; - char attrname[EXTATTR_MAXNAMELEN]; - int error; - AUDIT_ARG_VALUE(uap->attrnamespace); - error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL); - if (error) - return(error); - AUDIT_ARG_TEXT(attrname); - - NDINIT(&nd, LOOKUP, FOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, td); - error = namei(&nd); - if (error) - return(error); - NDFREE(&nd, NDF_ONLY_PNBUF); - - error = extattr_delete_vp(nd.ni_vp, uap->attrnamespace, attrname, td); - vrele(nd.ni_vp); - return(error); + return (kern_extattr_delete_path(td, uap->path, uap->attrnamespace, + uap->attrname, FOLLOW)); } #ifndef _SYS_SYSPROTO_H_ @@ -608,23 +580,32 @@ struct extattr_delete_link_args { int sys_extattr_delete_link(struct thread *td, struct extattr_delete_link_args *uap) { + + return (kern_extattr_delete_path(td, uap->path, uap->attrnamespace, + uap->attrname, NOFOLLOW)); +} + +static int +kern_extattr_delete_path(struct thread *td, const char *path, int attrnamespace, + const char *uattrname, int follow) +{ struct nameidata nd; char attrname[EXTATTR_MAXNAMELEN]; int error; - AUDIT_ARG_VALUE(uap->attrnamespace); - error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL); + AUDIT_ARG_VALUE(attrnamespace); + error = copyinstr(uattrname, attrname, EXTATTR_MAXNAMELEN, NULL); if (error) return(error); AUDIT_ARG_TEXT(attrname); - NDINIT(&nd, LOOKUP, NOFOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, follow | AUDITVNODE1, UIO_USERSPACE, path, td); error = namei(&nd); if (error) return(error); NDFREE(&nd, NDF_ONLY_PNBUF); - error = extattr_delete_vp(nd.ni_vp, uap->attrnamespace, attrname, td); + error = extattr_delete_vp(nd.ni_vp, attrnamespace, attrname, td); vrele(nd.ni_vp); return(error); } @@ -734,21 +715,9 @@ struct extattr_list_file_args { int sys_extattr_list_file(struct thread *td, struct extattr_list_file_args *uap) { - struct nameidata nd; - int error; - AUDIT_ARG_VALUE(uap->attrnamespace); - NDINIT(&nd, LOOKUP, FOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, td); - error = namei(&nd); - if (error) - return (error); - NDFREE(&nd, NDF_ONLY_PNBUF); - - error = extattr_list_vp(nd.ni_vp, uap->attrnamespace, uap->data, - uap->nbytes, td); - - vrele(nd.ni_vp); - return (error); + return (kern_extattr_list_path(td, uap->path, uap->attrnamespace, + uap->data, uap->nbytes, FOLLOW)); } #ifndef _SYS_SYSPROTO_H_ @@ -762,19 +731,26 @@ struct extattr_list_link_args { int sys_extattr_list_link(struct thread *td, struct extattr_list_link_args *uap) { + + return (kern_extattr_list_path(td, uap->path, uap->attrnamespace, + uap->data, uap->nbytes, NOFOLLOW)); +} + +static int +kern_extattr_list_path(struct thread *td, const char *path, int attrnamespace, + void *data, size_t nbytes, int follow) +{ struct nameidata nd; int error; - AUDIT_ARG_VALUE(uap->attrnamespace); - NDINIT(&nd, LOOKUP, NOFOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, - td); + AUDIT_ARG_VALUE(attrnamespace); + NDINIT(&nd, LOOKUP, follow | AUDITVNODE1, UIO_USERSPACE, path, td); error = namei(&nd); if (error) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); - error = extattr_list_vp(nd.ni_vp, uap->attrnamespace, uap->data, - uap->nbytes, td); + error = extattr_list_vp(nd.ni_vp, attrnamespace, data, nbytes, td); vrele(nd.ni_vp); return (error); From owner-svn-src-all@freebsd.org Mon Feb 5 20:30:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98D88EED40A; Mon, 5 Feb 2018 20:30:54 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4AA3987AFE; Mon, 5 Feb 2018 20:30: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 45AE05C58; Mon, 5 Feb 2018 20:30:54 +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 w15KUsd0056562; Mon, 5 Feb 2018 20:30:54 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15KUsjO056561; Mon, 5 Feb 2018 20:30:54 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201802052030.w15KUsjO056561@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 5 Feb 2018 20:30:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328900 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/etherswitch/arswitch X-SVN-Commit-Revision: 328900 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 20:30:54 -0000 Author: adrian Date: Mon Feb 5 20:30:53 2018 New Revision: 328900 URL: https://svnweb.freebsd.org/changeset/base/328900 Log: [arswitch] fix build breakage. Apparently the last time I checked building this it didn't pick up that the header had changed. Modified: head/sys/dev/etherswitch/arswitch/arswitchreg.h Modified: head/sys/dev/etherswitch/arswitch/arswitchreg.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitchreg.h Mon Feb 5 19:06:34 2018 (r328899) +++ head/sys/dev/etherswitch/arswitch/arswitchreg.h Mon Feb 5 20:30:53 2018 (r328900) @@ -364,7 +364,7 @@ #define AR934X_REG_OPER_MODE1_PHY4_MII_EN (1 << 28) #define AR934X_REG_FLOOD_MASK 0x2c -#define AR934X_FLOOD_MASK_MC_DP(_p) (1 << (0 + (_p))) +#define AR934X_FLOOD_MASK_UC_DP(_p) (1 << (0 + (_p))) #define AR934X_FLOOD_MASK_MC_DP(_p) (1 << (16 + (_p))) #define AR934X_FLOOD_MASK_BC_DP(_p) (1 << (25 + (_p))) From owner-svn-src-all@freebsd.org Mon Feb 5 20:37:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90A66EEDDD8; Mon, 5 Feb 2018 20:37:30 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 34942881E6; Mon, 5 Feb 2018 20:37:30 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2ACE75DDE; Mon, 5 Feb 2018 20:37:30 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w15KbTCo061595; Mon, 5 Feb 2018 20:37:29 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15KbTsw061594; Mon, 5 Feb 2018 20:37:29 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201802052037.w15KbTsw061594@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 5 Feb 2018 20:37:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328901 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/etherswitch/arswitch X-SVN-Commit-Revision: 328901 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 20:37:30 -0000 Author: adrian Date: Mon Feb 5 20:37:29 2018 New Revision: 328901 URL: https://svnweb.freebsd.org/changeset/base/328901 Log: [arswitch] disable ARP copy-to-CPU port for AR9340 for now. I'll have to go double check to see if it does indeed pass ARP frames between switch ports with this disabled, but it seems required for the CPU port to see ARP traffic. I'll dig into this some more. Modified: head/sys/dev/etherswitch/arswitch/arswitch_9340.c Modified: head/sys/dev/etherswitch/arswitch/arswitch_9340.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_9340.c Mon Feb 5 20:30:53 2018 (r328900) +++ head/sys/dev/etherswitch/arswitch/arswitch_9340.c Mon Feb 5 20:37:29 2018 (r328901) @@ -90,9 +90,11 @@ ar9340_atu_learn_default(struct arswitch_softc *sc) arswitch_modifyreg(sc->sc_dev, AR934X_REG_QM_CTRL, AR934X_QM_CTRL_ARP_EN, AR934X_QM_CTRL_ARP_EN); +#if 0 /* Copy frame to CPU port, not just redirect it */ arswitch_modifyreg(sc->sc_dev, AR934X_REG_QM_CTRL, AR934X_QM_CTRL_ARP_COPY_EN, AR934X_QM_CTRL_ARP_COPY_EN); +#endif return (0); } From owner-svn-src-all@freebsd.org Mon Feb 5 21:26:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82E72EF1347; Mon, 5 Feb 2018 21:26:46 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F10668A284; Mon, 5 Feb 2018 21:26:45 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([92.227.81.85]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MgoiC-1eMlC241IG-00M6T2; Mon, 05 Feb 2018 22:26:31 +0100 Date: Mon, 5 Feb 2018 22:25:55 +0100 From: "O. Hartmann" To: Jason Harmening Cc: "O. Hartmann" , David Wolfskill , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328489 - head/sys/conf Message-ID: <20180205222622.43f5d3e7@thor.intern.walstatt.dynvpn.de> In-Reply-To: References: <201801272013.w0RKDaMU098200@repo.freebsd.org> <20180127214755.3c59661e@thor.intern.walstatt.dynvpn.de> <98501f75-1a1b-9221-c52d-24415230a886@gmail.com> <20180129130022.GT1125@albert.catwhisker.org> <20180204133337.3d03f01d@thor.intern.walstatt.dynvpn.de> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/VM=+vVrQKfdJb0xnMWBnlly"; protocol="application/pgp-signature" X-Provags-ID: V03:K0:2W40jUPsBrc9JQVtU+nkZjmqDGrA4oOsO5TzfK09xjse3pr53bx MYDwH/MszrF8AezZfolnHEjacfLyfDvc9hCADE8ZY1K9aKCbZw8nZDuShpLzzTjHRiL11WF KFsLaUaDZZ0onPBvc24h4cX50Vyh38+tUD/xxBFsnSVKWHx5WO/+a4R8VuEbFllzQA9z1di 18xUSP3Va58470G2AWAwQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:tjDhg+ZyQfo=:akX5zXwpvULNfoclX1xYjx GNl/LuvJBVx4gwmehh+P6LU7Q1XskK7rtJTjGCZDupq/uacrIIROD/ccNoOJ+mJLxZSLC8535 HCPCL6lKOaU0TKIbouAmGOvqi6nYBuVpQXICcQpOMRkPoPm7I1LU1wgazS3GymhA9ksQZ1Qo6 ETK1l91Qy0sexn4WyfVGDvVHxPx0dfoENbyl2hz0EAXq/ZMO16k31tWxA+ZKYIqhtzeu2giiB iee2KtGQiPKSgfUBBYxyBRWFcMU67sngXiYeLay15xOy/BgqZJN1M3YVjgK/hAkMrVy3qbj1/ /k0Ot4rYW5YNzRg1j9Hxllql1tgDYx9nOmcf4B5XyQylgPmoI9YQon55f6Nzq4FoQQS1d6UzG M/Ng69CIvbfMJSmZM1Ax68T12dqqG3ju48iC/kxLXrqyGLF4Y3/+zBGW3q3+zrC+C+V63ywkm sUAPKSeO8q7+a6LPY1a2/c4mjWFghW9wO68i9b+vJSaaPsHk4GKkEn4wmr7gBdhmu2oSnWAKs Wrr79Dy7LVaUb4twea4gOUT6w5fuXY11nHBpL1CY0e3Tz3Lmh8RVXEqm193hw7OFzouLVuws5 18NtADD/wMQ0FVITCX8SVWlFvKFrzrGRkKmd3jvvyefgtv+owBet/h2LTLYZOsSsNNO7aii5+ Fx0RFGN4u6ijvLldGQMPGCRVxehfIBDBsF77YKkRbgI90KDPODvIXyVV6H7hCv/BBW2PNOqCa mUs+lExB2gpWUU1kSX9bUR58HUEXcyEauA+edG1KfJukVNby7wDDEoKjXnJjt25pdxPmc15lR 9hWIBCj4XKP2nKWtxiai9R1C6XDBA== X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 21:26:46 -0000 --Sig_/VM=+vVrQKfdJb0xnMWBnlly Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Am Sun, 4 Feb 2018 10:22:31 -0800 Jason Harmening schrieb: > On 02/04/18 04:33, O. Hartmann wrote: > > Am Mon, 29 Jan 2018 05:00:22 -0800 > > David Wolfskill schrieb: > > =20 > >> On Mon, Jan 29, 2018 at 02:10:04AM -0800, Jason Harmening wrote: =20 > >>>> > >>>> This happens now if PORTS_MODULE=3Dx11/nvidia-driver is defined in /= etc/src.conf: > >>>> > >>>> [...] > >>>> --- kernel-install --- > >>>> mkdir -p /boot/kernel > >>>> install -p -m 555 -o root -g wheel kernel /boot/kernel/ > >>>> --- ports-install --- > >>>> Variable OBJTOP is recursive. > >>>> > >>>> make[8]: stopped =20 > >>> ... > >>> > >>> David sent me logs of the failing case; thanks David! =20 > >> > >> Happy to help! :-) > >> =20 > >>> The failure happens when buildkernel and installkernel are run > >>> separately instead of all-up, e.g. 'make kernel'. The installkernel > >>> step is leaving MK_AUTO_OBJ=3Dno in the env passed to the port build.= It > >>> looks like at least one of the install stages of nvidia-driver needs = to > >>> generate temporary output, which leads to confusion when the port isn= 't > >>> built as though it's an in-tree component. > >>> > >>> Can you guys try out the attached patch? =20 > >> > >> I tried it both on my build machine (which does not use kernel modules > >> from ports, and thus did not exhibit the problem -- but I thought that > >> verifying that the patch did not break that case worth checking) and on > >> my laptop (which did exhibit the problem). > >> > >> It worked in both cases with no issues for me. > >> > >> Thanks! :-) > >> > >> Peace, > >> david =20 > >=20 > > The problem still persists! > >=20 > > I'm on CURRENT, FreeBSD 12.0-CURRENT #32: Sun Feb 4 09:41:39 CET 2018 = amd64, the > > source tree is at revision 328839. > >=20 > >=20 > > I use WITH_META_MODE=3DYES in /etc/src.conf. My /etc/make.conf consists= of a .include > > statement which reels in /usr/local/etc/ports.conf in which I define ev= erything > > outside the source tree for ports (in case of the nvidia driver, its DI= STVERSION). > > This worked before and should work again. Today I checked out a complet= ely > > fresh /usr/src and gleanced the /usr/obj folder and rebuilt the system = - and get the > > error again: > >=20 > > [...] =20 > > =3D=3D=3D> Ports module x11/nvidia-driver (install) =20 > > cd ${PORTSDIR:-/usr/ports}/x11/nvidia-driver; env -u CC -u CXX -u CP= P -u > > MAKESYSPATH MAKEFLAGS=3D"-j 4 -J 15,16 .MAKE.LEVEL.ENV=3DMAKELEVEL KERN= EL=3Dkernel > > MK_AUTO_OBJ=3Dno =20 > ^^^^^ > Looks like you haven't applied the patch? MK_AUTO_OBJ being left set in= =20 > MAKEFLAGS by installkernel was part of the problem. >=20 > That said, the fix I have up for review is slightly different: > https://reviews.freebsd.org/D14143 >=20 > > TARGET=3Damd64 TARGET_ARCH=3Damd64" SYSDIR=3D/usr/src/sys > > PATH=3D/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/sbin:/usr/obj/usr/sr= c/amd64.amd64/tmp/legacy/usr/bin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/bi= n:/usr/obj/usr/src/amd64.amd64/tmp/usr/sbin:/usr/obj/usr/src/amd64.amd64/tm= p/usr/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin > > SRC_BASE=3D/usr/src OSVERSION=3D1200056 > > WRKDIRPREFIX=3D/usr/obj/usr/src/amd64.amd64/sys/THOR make -B deinstall = reinstall =3D=3D=3D> > > Deinstalling for nvidia-driver =3D=3D=3D> Deinstalling nvidia-driver-= 387.34 Updating > > database digests format: . done Checking integrity... done (0 conflicti= ng) > > Deinstallation has been requested for the following 1 packages (of 0 pa= ckages in the > > universe): > >=20 > > Installed packages to be REMOVED: > > nvidia-driver-387.34 > >=20 > > Number of packages to be removed: 1 > >=20 > > The operation will free 99 MiB. > > [1/1] Deinstalling nvidia-driver-387.34... > > [1/1] Deleting files for nvidia-driver-387.34: .......... done =20 > > =3D=3D=3D> Staging for nvidia-driver-387.34 > > =3D=3D=3D> nvidia-driver-387.34 depends on file: /usr/local/lib/libGL= .so - found > > =3D=3D=3D> nvidia-driver-387.34 depends on file: /usr/local/libdata/p= kgconfig/x11.pc - > > found =3D=3D=3D> nvidia-driver-387.34 depends on > > file: /usr/local/libdata/pkgconfig/xorg-server.pc =20 > > - found =3D=3D=3D> nvidia-driver-387.34 depends on > > file: /usr/local/libdata/pkgconfig/xext.pc > > - found =3D=3D=3D> Generating temporary packing list =20 > > =3D=3D=3D> src (install) > > =3D=3D=3D> src/nvidia (install) =20 > > Variable OBJTOP is recursive. > >=20 > > make[8]: stopped > > in /usr/obj/usr/src/amd64.amd64/sys/DUMMBOX/usr/ports/x11/nvidia-driver= /work/NVIDIA-FreeBSD-x86_64-387.34/src/nvidia > > *** Error code 2 > >=20 > >=20 > >=20 > > Oliver > > =20 make -jX installkernel with the above mentioned setting of PORTS_MODULE=3D = set in /usr/src.conf doesn't wor even on recent CURRENT r328901. make kernel doesn't fail. oh --=20 O. Hartmann Ich widerspreche der Nutzung oder =C3=9Cbermittlung meiner Daten f=C3=BCr Werbezwecke oder f=C3=BCr die Markt- oder Meinungsforschung (=C2=A7 28 Abs.= 4 BDSG). --Sig_/VM=+vVrQKfdJb0xnMWBnlly Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iLUEARMKAB0WIQQZVZMzAtwC2T/86TrS528fyFhYlAUCWnjL/gAKCRDS528fyFhY lD7RAf9Xd2j2xaDwQ3uzijGFe/YgSD2tW21DJDDUZgvGNE1WMaCyd/ctys4ZSAu7 UBQYAzdXB88tu5FXsYNV9i51eYx9AgCNfJgxbZ9/sVzkrWuqmnkeUF3kwo/IY6gj C/QHiTXsKPNIC2uHK9n6RLEgumnOjsc6MnJjMl7HIpnh+PaS+vbh =MNNn -----END PGP SIGNATURE----- --Sig_/VM=+vVrQKfdJb0xnMWBnlly-- From owner-svn-src-all@freebsd.org Mon Feb 5 21:29:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12530EF1708; Mon, 5 Feb 2018 21:29:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B61288A5DD; Mon, 5 Feb 2018 21:29:27 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B0CDA65D8; Mon, 5 Feb 2018 21:29:27 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w15LTRvE087322; Mon, 5 Feb 2018 21:29:27 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15LTR9f087321; Mon, 5 Feb 2018 21:29:27 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802052129.w15LTR9f087321@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 5 Feb 2018 21:29:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328902 - stable/11/tools/boot X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/tools/boot X-SVN-Commit-Revision: 328902 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 21:29:28 -0000 Author: kevans Date: Mon Feb 5 21:29:27 2018 New Revision: 328902 URL: https://svnweb.freebsd.org/changeset/base/328902 Log: MFC r342882,r324979,r325115: sys/boot test scripts [Note: arm/armv7 has been removed in the interest of not having a failing architecture from the start] MFC r342882: Create a shell script to build sys/boot on all the architectures. MFC r324979: Do a chdir to SRCTOP/sys/boot before starting the run. MFC r325115: Fix parallel build issues and add MK_ZFS=no case Added: stable/11/tools/boot/ - copied from r324882, head/tools/boot/ Modified: stable/11/tools/boot/universe.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/tools/boot/universe.sh ============================================================================== --- head/tools/boot/universe.sh Sun Oct 22 22:52:23 2017 (r324882) +++ stable/11/tools/boot/universe.sh Mon Feb 5 21:29:27 2018 (r328902) @@ -19,9 +19,12 @@ # Output is put into _.boot.$TARGET_ARCH.log in sys.boot. # +top=$(make -V SRCTOP) +cd $top/sys/boot + for i in \ amd64/amd64 \ - arm/arm arm/armeb arm/armv7 \ + arm/arm arm/armeb \ arm64/aarch64 \ i386/i386 \ mips/mips mips/mips64 \ @@ -30,9 +33,33 @@ for i in \ ; do ta=${i##*/} echo -n "Building $ta..." - ( ( make buildenv TARGET_ARCH=$ta BUILDENV_SHELL="make -j 20 clean cleandepend cleandir obj depend all" \ - > _.boot.${ta}.log 2>&1 ) && echo Success ) || echo Fail + if ! make buildenv TARGET_ARCH=$ta BUILDENV_SHELL="make clean cleandepend cleandir obj depend" \ + > _.boot.${ta}.log 2>&1; then + echo "Fail (cleanup)" + continue + fi + if ! make buildenv TARGET_ARCH=$ta BUILDENV_SHELL="make -j 20 all" \ + >> _.boot.${ta}.log 2>&1; then + echo "Fail (build)" + continue + fi + echo "Success" done - - - +for i in \ + amd64/amd64 \ + i386/i386 \ + ; do + ta=${i##*/} + echo -n "Building $ta MK_ZFS=no..." + if ! make buildenv TARGET_ARCH=$ta BUILDENV_SHELL="make clean cleandepend cleandir obj depend" \ + > _.boot.${ta}.noZFS.log 2>&1; then + echo "Fail (cleanup)" + continue + fi + if ! make buildenv TARGET_ARCH=$ta BUILDENV_SHELL="make MK_ZFS=no -j 20 all" \ + >> _.boot.${ta}.noZFS.log 2>&1; then + echo "Fail (build)" + continue + fi + echo "Success" +done From owner-svn-src-all@freebsd.org Mon Feb 5 21:32:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C79BEF1ACF; Mon, 5 Feb 2018 21:32:06 +0000 (UTC) (envelope-from jason.harmening@gmail.com) Received: from mail-it0-x22c.google.com (mail-it0-x22c.google.com [IPv6:2607:f8b0:4001:c0b::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 DA4D18A8B3; Mon, 5 Feb 2018 21:32:05 +0000 (UTC) (envelope-from jason.harmening@gmail.com) Received: by mail-it0-x22c.google.com with SMTP id k6so256881ita.3; Mon, 05 Feb 2018 13:32:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=RzJuzoNnBwCPQfEG5h1GskVDsbU3gF6YUlhuW5V/qmk=; b=nSrqlTvZvM/7RFTHhZ0JfaZd1HfReniUuVOftLPZsfIUeJYUOqRIvEom4LEAdD4//B /+PLGKnbnjmxV2gQ0TRu5m4s7JjK8LiFcdJgfsctW6WpR1pwGiaQ+HVNe8U7Y+EKTSSw lHywk+xKA0E8pcnbS+Ykk2+fk9iVdA7cbcTj3/8W8gIOZIDJW2sd4iG6MQqslv1mXXBh +4KC7saq1Ji+tHxv4XlPmZnZ3QFDbCgnmUV7MLe379HzbZxkfNA1AhxX9BHY/8MNpvyy U14RCDCKuU/Cl1EJXOcunBDJGRqgN9jDxUCojvtS4yM7Av1ztU+6jkGLExuf3Ob3F1L+ f06Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=RzJuzoNnBwCPQfEG5h1GskVDsbU3gF6YUlhuW5V/qmk=; b=hkc4imUNRfjOlFwdmEF4zLy0wGX9EQKkRWYyGnryq9U7d2j4ie+cl2+svdc2iYqQ+X AV6lYs2ellbNFhMV8xvgI03EXC5Pt7t9UIw4OGlB54DNzTiQEXMV3AmqxrHBUIKKGNr7 zJo6hELCA17hEbK84+qqqhtAjGEk8fGhmQ4zJDRGsaQZAE2prVXI0DL6ivR8MRJQzb3G XeFly9gv5toUiSZine0dGhjeBLVnzT1ht1x97sgXU6Iv1J8+q99LnVby4cxMurFk5Ayz 3bE3cwq2wJgTwKUkHAy549L6hCM7rZoZptDARQpqAWNYl5sZ47YwIbu8THl24T0UxEc4 tasg== X-Gm-Message-State: APf1xPAmpPtBuOJAa7AUHlMEaUP7l7V4SRv+3NlQZPqPIh4wZW9lNgna 1yDK5ujhwGXjTkienzTVXm5Rw6hQOe+ExcJ7OjIA X-Google-Smtp-Source: AH8x227dPf19eM1quuyajdFueH4/wCfNBmJuVpu6Sb78C2Jg4hAnp0tJB8GNYzH2pDT3VSnjfm8YOk9rTxFnMEyGCjA= X-Received: by 10.36.2.213 with SMTP id 204mr179660itu.121.1517866324996; Mon, 05 Feb 2018 13:32:04 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.136.103 with HTTP; Mon, 5 Feb 2018 13:32:04 -0800 (PST) In-Reply-To: <20180205222622.43f5d3e7@thor.intern.walstatt.dynvpn.de> References: <201801272013.w0RKDaMU098200@repo.freebsd.org> <20180127214755.3c59661e@thor.intern.walstatt.dynvpn.de> <98501f75-1a1b-9221-c52d-24415230a886@gmail.com> <20180129130022.GT1125@albert.catwhisker.org> <20180204133337.3d03f01d@thor.intern.walstatt.dynvpn.de> <20180205222622.43f5d3e7@thor.intern.walstatt.dynvpn.de> From: Jason Harmening Date: Mon, 5 Feb 2018 13:32:04 -0800 Message-ID: Subject: Re: svn commit: r328489 - head/sys/conf To: "O. Hartmann" Cc: David Wolfskill , 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.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 21:32:06 -0000 On Mon, Feb 5, 2018 at 1:25 PM, O. Hartmann wrote: > Am Sun, 4 Feb 2018 10:22:31 -0800 > Jason Harmening schrieb: > > > On 02/04/18 04:33, O. Hartmann wrote: > > > Am Mon, 29 Jan 2018 05:00:22 -0800 > > > David Wolfskill schrieb: > > > > > >> On Mon, Jan 29, 2018 at 02:10:04AM -0800, Jason Harmening wrote: > > >>>> > > >>>> This happens now if PORTS_MODULE=3Dx11/nvidia-driver is defined in > /etc/src.conf: > > >>>> > > >>>> [...] > > >>>> --- kernel-install --- > > >>>> mkdir -p /boot/kernel > > >>>> install -p -m 555 -o root -g wheel kernel /boot/kernel/ > > >>>> --- ports-install --- > > >>>> Variable OBJTOP is recursive. > > >>>> > > >>>> make[8]: stopped > > >>> ... > > >>> > > >>> David sent me logs of the failing case; thanks David! > > >> > > >> Happy to help! :-) > > >> > > >>> The failure happens when buildkernel and installkernel are run > > >>> separately instead of all-up, e.g. 'make kernel'. The installkerne= l > > >>> step is leaving MK_AUTO_OBJ=3Dno in the env passed to the port buil= d. > It > > >>> looks like at least one of the install stages of nvidia-driver need= s > to > > >>> generate temporary output, which leads to confusion when the port > isn't > > >>> built as though it's an in-tree component. > > >>> > > >>> Can you guys try out the attached patch? > > >> > > >> I tried it both on my build machine (which does not use kernel modul= es > > >> from ports, and thus did not exhibit the problem -- but I thought th= at > > >> verifying that the patch did not break that case worth checking) and > on > > >> my laptop (which did exhibit the problem). > > >> > > >> It worked in both cases with no issues for me. > > >> > > >> Thanks! :-) > > >> > > >> Peace, > > >> david > > > > > > The problem still persists! > > > > > > I'm on CURRENT, FreeBSD 12.0-CURRENT #32: Sun Feb 4 09:41:39 CET 201= 8 > amd64, the > > > source tree is at revision 328839. > > > > > > > > > I use WITH_META_MODE=3DYES in /etc/src.conf. My /etc/make.conf consis= ts > of a .include > > > statement which reels in /usr/local/etc/ports.conf in which I define > everything > > > outside the source tree for ports (in case of the nvidia driver, its > DISTVERSION). > > > This worked before and should work again. Today I checked out a > completely > > > fresh /usr/src and gleanced the /usr/obj folder and rebuilt the syste= m > - and get the > > > error again: > > > > > > [...] > > > =3D=3D=3D> Ports module x11/nvidia-driver (install) > > > cd ${PORTSDIR:-/usr/ports}/x11/nvidia-driver; env -u CC -u CXX -u > CPP -u > > > MAKESYSPATH MAKEFLAGS=3D"-j 4 -J 15,16 .MAKE.LEVEL.ENV=3DMAKELEVEL > KERNEL=3Dkernel > > > MK_AUTO_OBJ=3Dno > > ^^^= ^^ > > Looks like you haven't applied the patch? MK_AUTO_OBJ being left set i= n > > MAKEFLAGS by installkernel was part of the problem. > > > > That said, the fix I have up for review is slightly different: > > https://reviews.freebsd.org/D14143 > > > > > TARGET=3Damd64 TARGET_ARCH=3Damd64" SYSDIR=3D/usr/src/sys > > > PATH=3D/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/sbin:/ > usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/bin:/usr/obj/ > usr/src/amd64.amd64/tmp/legacy/bin:/usr/obj/usr/src/ > amd64.amd64/tmp/usr/sbin:/usr/obj/usr/src/amd64.amd64/tmp/ > usr/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin > > > SRC_BASE=3D/usr/src OSVERSION=3D1200056 > > > WRKDIRPREFIX=3D/usr/obj/usr/src/amd64.amd64/sys/THOR make -B deinstal= l > reinstall =3D=3D=3D> > > > Deinstalling for nvidia-driver =3D=3D=3D> Deinstalling > nvidia-driver-387.34 Updating > > > database digests format: . done Checking integrity... done (0 > conflicting) > > > Deinstallation has been requested for the following 1 packages (of 0 > packages in the > > > universe): > > > > > > Installed packages to be REMOVED: > > > nvidia-driver-387.34 > > > > > > Number of packages to be removed: 1 > > > > > > The operation will free 99 MiB. > > > [1/1] Deinstalling nvidia-driver-387.34... > > > [1/1] Deleting files for nvidia-driver-387.34: .......... done > > > =3D=3D=3D> Staging for nvidia-driver-387.34 > > > =3D=3D=3D> nvidia-driver-387.34 depends on file: /usr/local/lib/lib= GL.so - > found > > > =3D=3D=3D> nvidia-driver-387.34 depends on file: > /usr/local/libdata/pkgconfig/x11.pc - > > > found =3D=3D=3D> nvidia-driver-387.34 depends on > > > file: /usr/local/libdata/pkgconfig/xorg-server.pc > > > - found =3D=3D=3D> nvidia-driver-387.34 depends on > > > file: /usr/local/libdata/pkgconfig/xext.pc > > > - found =3D=3D=3D> Generating temporary packing list > > > =3D=3D=3D> src (install) > > > =3D=3D=3D> src/nvidia (install) > > > Variable OBJTOP is recursive. > > > > > > make[8]: stopped > > > in /usr/obj/usr/src/amd64.amd64/sys/DUMMBOX/usr/ports/x11/ > nvidia-driver/work/NVIDIA-FreeBSD-x86_64-387.34/src/nvidia > > > *** Error code 2 > > > > > > > > > > > > Oliver > > > > > make -jX installkernel with the above mentioned setting of PORTS_MODULE= =3D > set > in /usr/src.conf doesn't wor even on recent CURRENT r328901. > > make kernel doesn't fail. > Yes, that is because there is a patch, included in an earlier email, which fixes this failure and hasn't yet made it into the tree. Based on the fact that I can see MK_AUTO_OBJ=3Dno in your installkernel output, it looks like you haven't applied the patch to your src tree. Can you try downloading the raw diff from https://reviews.freebsd.org/D14143 and applying that to src? > > > oh > > -- > O. Hartmann > > Ich widerspreche der Nutzung oder =C3=9Cbermittlung meiner Daten f=C3=BCr > Werbezwecke oder f=C3=BCr die Markt- oder Meinungsforschung (=C2=A7 28 Ab= s. 4 BDSG). > From owner-svn-src-all@freebsd.org Mon Feb 5 21:37:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5F4CEF2047; Mon, 5 Feb 2018 21:37:42 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x229.google.com (mail-io0-x229.google.com [IPv6:2607:f8b0:4001:c06::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 380A28ACAB; Mon, 5 Feb 2018 21:37:42 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x229.google.com with SMTP id f4so243706ioh.8; Mon, 05 Feb 2018 13:37:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=QW+yJ5iaBtbwQuCYd8sEa7b73RDcT6d6PyUT2jG74/o=; b=Rxf1ZstoBURdpE2L2BVRtY20ETwG+9rsu/qK4OuAjHAklWZzd73Pv+LvJR1WBO/u20 kvDZM7aMHZ5YofNLY1/9UowkY12ekkuzu8sILXNp9RG6Fbr8gcOv9HY3dPX79B0wVX4O Qg5pviOc7dFnBTFPtCRuekN6otRxlGUWSHg9zLdOxyHlAx5ORk1qew7MUuRGPw3tqtdY ndPNl/RFr9zGSfXdOVRBVNeuNH9g7Rq8R0HHvxNb3o7nGYzqGCLt4okJJqaBGTRPnGf6 ae0uaCdr1SPS2NdwZN0PpDeJd0dM2xLNy+WEiGD7zooELmKpYaBXI4kPp7PLMPpov7gC /N+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=QW+yJ5iaBtbwQuCYd8sEa7b73RDcT6d6PyUT2jG74/o=; b=dX/YUiNtBZ1xP8MoZ4foawUWAfQWrny8IcMHAFW6rk2WUinWupIT2pYN0b+IkYMV14 wDUPG+QyYtakTIXdwcwEtzp+mbLFTgGHKLieKyna/l4yvbb3CJwrld/EPua+szv9kovj NVPRWfyP+FqHQaNuoJPwgrMv7JpI0wptufPU7R+cVjtTYrDRqFCooiIFd1uEbe1SYToK 73mv5MCXKQPeaZROXfkqCRj1QQVGIHiq2vAjbzOuHMAwrYEJ0C8dNPJ9GbllZC5IA5/R PHHHIjWl0gC+rF9bGVqmgGBcWNFFVCrDRTzQfqyPOV0hCGOtuHEhkXL9bMjF6kD7gpHT iIVA== X-Gm-Message-State: APf1xPBepzglNxZWzL3zNcVjcGCaloAS7F+9sL2qQEzKEBQgJctWQMyT 5HmPdujXhoqIm9ZPFvZaihJ/NB21yftG4Y4aq/qRUttu X-Google-Smtp-Source: AH8x226PGmXpt1dlLJr6huXP6obTSTcv7HcxJ2kjHWmAh2zboJUjmZWToCI9hVSX3vDgTBy5OmQRCnlt8w1jkoT7oCU= X-Received: by 10.107.173.225 with SMTP id m94mr337674ioo.36.1517866661432; Mon, 05 Feb 2018 13:37:41 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.152.9 with HTTP; Mon, 5 Feb 2018 13:37:20 -0800 (PST) In-Reply-To: <3114578.qyyx4qh6ii@ralph.baldwin.cx> References: <201801302329.w0UNTRHn080138@repo.freebsd.org> <3195814.6PcFLP86qD@ralph.baldwin.cx> <3114578.qyyx4qh6ii@ralph.baldwin.cx> From: Ed Maste Date: Mon, 5 Feb 2018 16:37:20 -0500 X-Google-Sender-Auth: htCGaSOla4NRi3BPQqmLra8JXJ8 Message-ID: Subject: Re: svn commit: r328610 - head/sys/amd64/amd64 To: John Baldwin Cc: Wojciech Macek , 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.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 21:37:42 -0000 On 31 January 2018 at 11:14, John Baldwin wrote: > On Wednesday, January 31, 2018 10:31:36 AM Ed Maste wrote: >> On 30 January 2018 at 21:01, John Baldwin wrote: >> > On Tuesday, January 30, 2018 11:29:27 PM John Baldwin wrote: >> >> Author: jhb >> >> Date: Tue Jan 30 23:29:27 2018 >> >> New Revision: 328610 >> >> URL: https://svnweb.freebsd.org/changeset/base/328610 >> >> >> >> Log: >> >> Ensure 'name' is not NULL before passing to strcmp(). >> >> >> >> This avoids a nested page fault when obtaining a stack trace in DDB if >> >> the address from the first frame does not resolve to a known symbol. >> >> >> >> MFC after: 1 week >> >> Sponsored by: Chelsio Communications >> > >> > This appears to be fallout from lld? After fixing this, the stack trace >> > for my next panic shows no symbols for functions in the kernel, only >> > functions in kernel modules: >> >> It's fallout from loader changes in r328536. I reverted r328536 (and >> r328603) locally and stack traces are fixed. > > Ouch. I'll try to look at this later today unless someone else beats me to > it. I committed a band-aid fix in r328826 but it still needs more investigation / proper fix. From owner-svn-src-all@freebsd.org Mon Feb 5 22:21:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FCA2EF4D50 for ; Mon, 5 Feb 2018 22:21:31 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::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 A5A898C86C for ; Mon, 5 Feb 2018 22:21:30 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x233.google.com with SMTP id 143so135376wma.5 for ; Mon, 05 Feb 2018 14:21:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=NEvD7tUhf/oKLFBSzkEN0h7J64XVyNSI+YSbh58ppsA=; b=rrB6RHARSNQB62HsDa+qD4HJC7Sn8wZ1CzjfrVRChQ+v/2XfSr4kPfD1PPZISEQ0Tf BmxHJVyKJKeFCx1Kep5aAqlU5O3c9MTb3IgDYdJsS9LvqzKXTpyo+y4pWetRoRRSLaQO 40SKGzRVu/7t9GUdVPtUhCQKHeWpA2eMbqYoOuq0Uxzm7KR1Ce1cs3iXo5X+zKOd3SMw tmrh5cFojbIyTlwFC7KIrv9u7qWNd11MRKVe6Kc/9fWM3sxaZqaIFkw+tO6Gqr4nUqH3 o4nXtHraWLL/PM2VaDZD8/KlwMxjsGJzH2bXOvjyoIxS56GkJvnzF7X3DEzH7wyAmRmE EXDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=NEvD7tUhf/oKLFBSzkEN0h7J64XVyNSI+YSbh58ppsA=; b=cERApq9QZLfl/MZtCPMuRGDbZRwTeVJHaZj6+THYUUiuiXq9qLsrAobU5JXRypGWC+ 9/bsbCBNTlwAV46d4wTikXofjtqmB/psCU1pl5mQmzXCSGCkTaV0av4z6BjYfwKpYPsy JKN2Svg/BpswsKXXZpHhWk9LL1e/IIo46qkbAfN4odf7UOfHgYFUWenrfabJ1fg91E/x jUMvvFLHez0Nv/vlyHLI3JGTYZ1NU0UrZDr96Z2w2o68EVnoRGhErx9BtPZuyE6b6P9j rxIoNBLLUCRw+4DrzO47lNpMdfil7rOf0N3QuMlo7U4clAYDikG/Q5u32A1n2/oaBZw6 EdcQ== X-Gm-Message-State: APf1xPCwl/Mf4sWKLXoz8MmJPerPdPETPwb2rytX7JuI9r3/wIx0FnKt SNH+yEjwdsFMH0UjhGkpambpHgr3E18iCWpgebDD6A== X-Google-Smtp-Source: AH8x224NHqSsyuCn+7r+UW/wvuNSV2AE513YTydPIIouSfB4pPPwfpNYGcJaLuHg4BgLhpl5EouTt5GVqxoajuvuCmw= X-Received: by 10.80.183.214 with SMTP id i22mr1005838ede.15.1517869289604; Mon, 05 Feb 2018 14:21:29 -0800 (PST) MIME-Version: 1.0 Received: by 10.80.148.90 with HTTP; Mon, 5 Feb 2018 14:21:29 -0800 (PST) In-Reply-To: <201802022322.w12NMwnq074609@repo.freebsd.org> References: <201802022322.w12NMwnq074609@repo.freebsd.org> From: Oliver Pinter Date: Mon, 5 Feb 2018 23:21:29 +0100 Message-ID: Subject: Re: svn commit: r328820 - in stable/11/sys/cam: . ata nvme scsi To: Alexander Motin Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-stable@freebsd.org" , "svn-src-stable-11@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 22:21:31 -0000 On Saturday, February 3, 2018, Alexander Motin wrote: > Author: mav > Date: Fri Feb 2 23:22:58 2018 > New Revision: 328820 > URL: https://svnweb.freebsd.org/changeset/base/328820 > > Log: > MFC r303468 (by imp): > Move protocol specific stuff into a linker set object that's > per-protocol. This reduces the number scsi symbols references by > cam_xpt significantly, and eliminates all ata / nvme symbols. There's > still some NVME / ATA specific code for dealing with XPT_NVME_IO and > XPT_ATA_IO respectively, and a bunch of scsi-specific code, but this > is progress. > > Hi! Once you finished with the cherry-picking of nvme related commits, could you please bump the __FreeBSD_version and add them to release notes? > Modified: > stable/11/sys/cam/ata/ata_xpt.c > stable/11/sys/cam/cam_xpt.c > stable/11/sys/cam/cam_xpt_internal.h > stable/11/sys/cam/nvme/nvme_xpt.c > stable/11/sys/cam/scsi/scsi_xpt.c > Directory Properties: > stable/11/ (props changed) > > Modified: stable/11/sys/cam/ata/ata_xpt.c > ============================================================ > ================== > --- stable/11/sys/cam/ata/ata_xpt.c Fri Feb 2 23:19:20 2018 > (r328819) > +++ stable/11/sys/cam/ata/ata_xpt.c Fri Feb 2 23:22:58 2018 > (r328820) > @@ -189,6 +189,11 @@ static void ata_dev_async(u_int32_t > async_code, > void *async_arg); > static void ata_action(union ccb *start_ccb); > static void ata_announce_periph(struct cam_periph *periph); > +static void ata_proto_announce(struct cam_ed *device); > +static void ata_proto_denounce(struct cam_ed *device); > +static void ata_proto_debug_out(union ccb *ccb); > +static void semb_proto_announce(struct cam_ed *device); > +static void semb_proto_denounce(struct cam_ed *device); > > static int ata_dma = 1; > static int atapi_dma = 1; > @@ -215,6 +220,43 @@ ATA_XPT_XPORT(sata, SATA); > > #undef ATA_XPORT_XPORT > > +static struct xpt_proto_ops ata_proto_ops_ata = { > + .announce = ata_proto_announce, > + .denounce = ata_proto_denounce, > + .debug_out = ata_proto_debug_out, > +}; > +static struct xpt_proto ata_proto_ata = { > + .proto = PROTO_ATA, > + .name = "ata", > + .ops = &ata_proto_ops_ata, > +}; > + > +static struct xpt_proto_ops ata_proto_ops_satapm = { > + .announce = ata_proto_announce, > + .denounce = ata_proto_denounce, > + .debug_out = ata_proto_debug_out, > +}; > +static struct xpt_proto ata_proto_satapm = { > + .proto = PROTO_SATAPM, > + .name = "satapm", > + .ops = &ata_proto_ops_satapm, > +}; > + > +static struct xpt_proto_ops ata_proto_ops_semb = { > + .announce = semb_proto_announce, > + .denounce = semb_proto_denounce, > + .debug_out = ata_proto_debug_out, > +}; > +static struct xpt_proto ata_proto_semb = { > + .proto = PROTO_SEMB, > + .name = "semb", > + .ops = &ata_proto_ops_semb, > +}; > + > +CAM_XPT_PROTO(ata_proto_ata); > +CAM_XPT_PROTO(ata_proto_satapm); > +CAM_XPT_PROTO(ata_proto_semb); > + > static void > probe_periph_init() > { > @@ -2116,4 +2158,41 @@ ata_announce_periph(struct cam_periph *periph) > printf(")"); > } > printf("\n"); > +} > + > +static void > +ata_proto_announce(struct cam_ed *device) > +{ > + ata_print_ident(&device->ident_data); > +} > + > +static void > +ata_proto_denounce(struct cam_ed *device) > +{ > + ata_print_ident_short(&device->ident_data); > +} > + > +static void > +semb_proto_announce(struct cam_ed *device) > +{ > + semb_print_ident((struct sep_identify_data *)&device->ident_data); > +} > + > +static void > +semb_proto_denounce(struct cam_ed *device) > +{ > + semb_print_ident_short((struct sep_identify_data > *)&device->ident_data); > +} > + > +static void > +ata_proto_debug_out(union ccb *ccb) > +{ > + char cdb_str[(sizeof(struct ata_cmd) * 3) + 1]; > + > + if (ccb->ccb_h.func_code != XPT_ATA_IO) > + return; > + > + CAM_DEBUG(ccb->ccb_h.path, > + CAM_DEBUG_CDB,("%s. ACB: %s\n", ata_op_string(&ccb->ataio.cmd) > , > + ata_cmd_string(&ccb->ataio.cmd, cdb_str, > sizeof(cdb_str)))); > } > > Modified: stable/11/sys/cam/cam_xpt.c > ============================================================ > ================== > --- stable/11/sys/cam/cam_xpt.c Fri Feb 2 23:19:20 2018 (r328819) > +++ stable/11/sys/cam/cam_xpt.c Fri Feb 2 23:22:58 2018 (r328820) > @@ -747,6 +747,19 @@ cam_module_event_handler(module_t mod, int what, void > return 0; > } > > +static struct xpt_proto * > +xpt_proto_find(cam_proto proto) > +{ > + struct xpt_proto **pp; > + > + SET_FOREACH(pp, cam_xpt_proto_set) { > + if ((*pp)->proto == proto) > + return *pp; > + } > + > + return NULL; > +} > + > static void > xpt_rescan_done(struct cam_periph *periph, union ccb *done_ccb) > { > @@ -1013,6 +1026,7 @@ void > xpt_announce_periph(struct cam_periph *periph, char *announce_string) > { > struct cam_path *path = periph->path; > + struct xpt_proto *proto; > > cam_periph_assert(periph, MA_OWNED); > periph->flags |= CAM_PERIPH_ANNOUNCED; > @@ -1026,25 +1040,20 @@ xpt_announce_periph(struct cam_periph *periph, > char *a > path->target->target_id, > (uintmax_t)path->device->lun_id); > printf("%s%d: ", periph->periph_name, periph->unit_number); > - if (path->device->protocol == PROTO_SCSI) > - scsi_print_inquiry(&path->device->inq_data); > - else if (path->device->protocol == PROTO_ATA || > - path->device->protocol == PROTO_SATAPM) > - ata_print_ident(&path->device->ident_data); > - else if (path->device->protocol == PROTO_SEMB) > - semb_print_ident( > - (struct sep_identify_data *)&path->device->ident_data); > - else if (path->device->protocol == PROTO_NVME) > - nvme_print_ident(path->device->nvme_cdata, > path->device->nvme_data); > + proto = xpt_proto_find(path->device->protocol); > + if (proto) > + proto->ops->announce(path->device); > else > - printf("Unknown protocol device\n"); > + printf("%s%d: Unknown protocol device %d\n", > + periph->periph_name, periph->unit_number, > + path->device->protocol); > if (path->device->serial_num_len > 0) { > /* Don't wrap the screen - print only the first 60 chars > */ > printf("%s%d: Serial Number %.60s\n", periph->periph_name, > periph->unit_number, path->device->serial_num); > } > /* Announce transport details. */ > - (*(path->bus->xport->ops->announce))(periph); > + path->bus->xport->ops->announce(periph); > /* Announce command queueing. */ > if (path->device->inq_flags & SID_CmdQue > || path->device->flags & CAM_DEV_TAG_AFTER_COUNT) { > @@ -1070,6 +1079,7 @@ void > xpt_denounce_periph(struct cam_periph *periph) > { > struct cam_path *path = periph->path; > + struct xpt_proto *proto; > > cam_periph_assert(periph, MA_OWNED); > printf("%s%d at %s%d bus %d scbus%d target %d lun %jx\n", > @@ -1081,18 +1091,13 @@ xpt_denounce_periph(struct cam_periph *periph) > path->target->target_id, > (uintmax_t)path->device->lun_id); > printf("%s%d: ", periph->periph_name, periph->unit_number); > - if (path->device->protocol == PROTO_SCSI) > - scsi_print_inquiry_short(&path->device->inq_data); > - else if (path->device->protocol == PROTO_ATA || > - path->device->protocol == PROTO_SATAPM) > - ata_print_ident_short(&path->device->ident_data); > - else if (path->device->protocol == PROTO_SEMB) > - semb_print_ident_short( > - (struct sep_identify_data *)&path->device->ident_data); > - else if (path->device->protocol == PROTO_NVME) > - nvme_print_ident(path->device->nvme_cdata, > path->device->nvme_data); > + proto = xpt_proto_find(path->device->protocol); > + if (proto) > + proto->ops->denounce(path->device); > else > - printf("Unknown protocol device"); > + printf("%s%d: Unknown protocol device %d\n", > + periph->periph_name, periph->unit_number, > + path->device->protocol); > if (path->device->serial_num_len > 0) > printf(" s/n %.60s", path->device->serial_num); > printf(" detached\n"); > @@ -3257,7 +3262,6 @@ restart: > static void > xpt_run_devq(struct cam_devq *devq) > { > - char cdb_str[(SCSI_MAX_CDBLEN * 3) + 1]; > struct mtx *mtx; > > CAM_DEBUG_PRINT(CAM_DEBUG_XPT, ("xpt_run_devq\n")); > @@ -3269,6 +3273,7 @@ xpt_run_devq(struct cam_devq *devq) > struct cam_ed *device; > union ccb *work_ccb; > struct cam_sim *sim; > + struct xpt_proto *proto; > > device = (struct cam_ed *)camq_remove(&devq->send_queue, > CAMQ_HEAD); > @@ -3334,32 +3339,12 @@ xpt_run_devq(struct cam_devq *devq) > work_ccb->ccb_h.flags &= > ~CAM_TAG_ACTION_VALID; > } > > - switch (work_ccb->ccb_h.func_code) { > - case XPT_SCSI_IO: > - CAM_DEBUG(work_ccb->ccb_h.path, > - CAM_DEBUG_CDB,("%s. CDB: %s\n", > - scsi_op_desc(work_ccb->csio. > cdb_io.cdb_bytes[0], > - &device->inq_data), > - scsi_cdb_string(work_ccb-> > csio.cdb_io.cdb_bytes, > - cdb_str, sizeof(cdb_str)))); > - break; > - case XPT_ATA_IO: > - CAM_DEBUG(work_ccb->ccb_h.path, > - CAM_DEBUG_CDB,("%s. ACB: %s\n", > - ata_op_string(&work_ccb->ataio.cmd), > - ata_cmd_string(&work_ccb->ataio.cmd, > - cdb_str, sizeof(cdb_str)))); > - break; > - case XPT_NVME_IO: > - CAM_DEBUG(work_ccb->ccb_h.path, > - CAM_DEBUG_CDB,("%s. NCB: %s\n", > - nvme_op_string(&work_ccb->nvmeio.cmd), > - nvme_cmd_string(&work_ccb->nvmeio.cmd, > - cdb_str, sizeof(cdb_str)))); > - break; > - default: > - break; > - } > + KASSERT(device == work_ccb->ccb_h.path->device, > + ("device (%p) / path->device (%p) mismatch", > + device, work_ccb->ccb_h.path->device)); > + proto = xpt_proto_find(device->protocol); > + if (proto && proto->ops->debug_out) > + proto->ops->debug_out(work_ccb); > > /* > * Device queues can be shared among multiple SIM instances > > Modified: stable/11/sys/cam/cam_xpt_internal.h > ============================================================ > ================== > --- stable/11/sys/cam/cam_xpt_internal.h Fri Feb 2 23:19:20 2018 > (r328819) > +++ stable/11/sys/cam/cam_xpt_internal.h Fri Feb 2 23:22:58 2018 > (r328820) > @@ -66,6 +66,26 @@ SET_DECLARE(cam_xpt_xport_set, struct xpt_xport); > #define CAM_XPT_XPORT(data) \ > DATA_SET(cam_xpt_xport_set, data) > > +typedef void (*xpt_proto_announce_func)(struct cam_ed *); > +typedef void (*xpt_proto_debug_out_func)(union ccb *); > + > +struct xpt_proto_ops { > + xpt_proto_announce_func announce; > + xpt_proto_announce_func denounce; > + xpt_proto_debug_out_func debug_out; > +}; > + > +struct xpt_proto { > + cam_proto proto; > + const char *name; > + struct xpt_proto_ops *ops; > +}; > + > +SET_DECLARE(cam_xpt_proto_set, struct xpt_proto); > +#define CAM_XPT_PROTO(data) \ > + DATA_SET(cam_xpt_proto_set, data) > + > + > /* > * The CAM EDT (Existing Device Table) contains the device information for > * all devices for all busses in the system. The table contains a > > Modified: stable/11/sys/cam/nvme/nvme_xpt.c > ============================================================ > ================== > --- stable/11/sys/cam/nvme/nvme_xpt.c Fri Feb 2 23:19:20 2018 > (r328819) > +++ stable/11/sys/cam/nvme/nvme_xpt.c Fri Feb 2 23:22:58 2018 > (r328820) > @@ -152,6 +152,9 @@ static void nvme_dev_async(u_int32_t async_code, > void *async_arg); > static void nvme_action(union ccb *start_ccb); > static void nvme_announce_periph(struct cam_periph *periph); > +static void nvme_proto_announce(struct cam_ed *device); > +static void nvme_proto_denounce(struct cam_ed *device); > +static void nvme_proto_debug_out(union ccb *ccb); > > static struct xpt_xport_ops nvme_xport_ops = { > .alloc_device = nvme_alloc_device, > @@ -171,6 +174,18 @@ NVME_XPT_XPORT(nvme, NVME); > > #undef NVME_XPT_XPORT > > +static struct xpt_proto_ops nvme_proto_ops = { > + .announce = nvme_proto_announce, > + .denounce = nvme_proto_denounce, > + .debug_out = nvme_proto_debug_out, > +}; > +static struct xpt_proto nvme_proto = { > + .proto = PROTO_NVME, > + .name = "nvme", > + .ops = &nvme_proto_ops, > +}; > +CAM_XPT_PROTO(nvme_proto); > + > static void > nvme_probe_periph_init() > { > @@ -620,3 +635,29 @@ nvme_announce_periph(struct cam_periph *periph) > /* XXX NVME STUFF HERE */ > printf("\n"); > } > + > +static void > +nvme_proto_announce(struct cam_ed *device) > +{ > + nvme_print_ident(device->nvme_cdata, device->nvme_data); > +} > + > +static void > +nvme_proto_denounce(struct cam_ed *device) > +{ > + nvme_print_ident(device->nvme_cdata, device->nvme_data); > +} > + > +static void > +nvme_proto_debug_out(union ccb *ccb) > +{ > + char cdb_str[(sizeof(struct nvme_command) * 3) + 1]; > + > + if (ccb->ccb_h.func_code != XPT_NVME_IO) > + return; > + > + CAM_DEBUG(ccb->ccb_h.path, > + CAM_DEBUG_CDB,("%s. NCB: %s\n", nvme_op_string(&ccb->nvmeio. > cmd), > + nvme_cmd_string(&ccb->nvmeio.cmd, cdb_str, > sizeof(cdb_str)))); > +} > + > > Modified: stable/11/sys/cam/scsi/scsi_xpt.c > ============================================================ > ================== > --- stable/11/sys/cam/scsi/scsi_xpt.c Fri Feb 2 23:19:20 2018 > (r328819) > +++ stable/11/sys/cam/scsi/scsi_xpt.c Fri Feb 2 23:22:58 2018 > (r328820) > @@ -589,6 +589,9 @@ static void scsi_dev_async(u_int32_t async_code, > void *async_arg); > static void scsi_action(union ccb *start_ccb); > static void scsi_announce_periph(struct cam_periph *periph); > +static void scsi_proto_announce(struct cam_ed *device); > +static void scsi_proto_denounce(struct cam_ed *device); > +static void scsi_proto_debug_out(union ccb *ccb); > > static struct xpt_xport_ops scsi_xport_ops = { > .alloc_device = scsi_alloc_device, > @@ -614,6 +617,18 @@ SCSI_XPT_XPORT(ppb, PPB); > > #undef SCSI_XPORT_XPORT > > +static struct xpt_proto_ops scsi_proto_ops = { > + .announce = scsi_proto_announce, > + .denounce = scsi_proto_denounce, > + .debug_out = scsi_proto_debug_out, > +}; > +static struct xpt_proto scsi_proto = { > + .proto = PROTO_SCSI, > + .name = "scsi", > + .ops = &scsi_proto_ops, > +}; > +CAM_XPT_PROTO(scsi_proto); > + > static void > probe_periph_init() > { > @@ -3102,3 +3117,30 @@ scsi_announce_periph(struct cam_periph *periph) > printf("\n"); > } > > +static void > +scsi_proto_announce(struct cam_ed *device) > +{ > + scsi_print_inquiry(&device->inq_data); > +} > + > +static void > +scsi_proto_denounce(struct cam_ed *device) > +{ > + scsi_print_inquiry_short(&device->inq_data); > +} > + > +static void > +scsi_proto_debug_out(union ccb *ccb) > +{ > + char cdb_str[(SCSI_MAX_CDBLEN * 3) + 1]; > + struct cam_ed *device; > + > + if (ccb->ccb_h.func_code != XPT_SCSI_IO) > + return; > + > + device = ccb->ccb_h.path->device; > + CAM_DEBUG(ccb->ccb_h.path, > + CAM_DEBUG_CDB,("%s. CDB: %s\n", > + scsi_op_desc(ccb->csio.cdb_io.cdb_bytes[0], > &device->inq_data), > + scsi_cdb_string(ccb->csio.cdb_io.cdb_bytes, cdb_str, > sizeof(cdb_str)))); > +} > _______________________________________________ > svn-src-stable-11@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-stable-11 > To unsubscribe, send any mail to " > svn-src-stable-11-unsubscribe@freebsd.org" > From owner-svn-src-all@freebsd.org Mon Feb 5 23:27:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B59CED7202; Mon, 5 Feb 2018 23:27:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CE868F307; Mon, 5 Feb 2018 23:27:43 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4391E79B5; Mon, 5 Feb 2018 23:27:43 +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 w15NRh28048723; Mon, 5 Feb 2018 23:27:43 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15NRhpr048722; Mon, 5 Feb 2018 23:27:43 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201802052327.w15NRhpr048722@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 5 Feb 2018 23:27:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328909 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 328909 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 23:27:43 -0000 Author: jhb Date: Mon Feb 5 23:27:42 2018 New Revision: 328909 URL: https://svnweb.freebsd.org/changeset/base/328909 Log: Always give ELF brands a chance to veto a match. If a brand provides a header_supported hook, check it when trying to find a brand based on a matching interpreter as well as in the final loop for the fallback brand. Previously a brand might reject a binary via a header_supported hook in one of the earlier loops, but still be chosen by one of these later loops. Reviewed by: kib Obtained from: CheriBSD MFC after: 2 weeks Sponsored by: DARPA / AFRL Differential Revision: https://reviews.freebsd.org/D13945 Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Mon Feb 5 23:14:20 2018 (r328908) +++ head/sys/kern/imgact_elf.c Mon Feb 5 23:27:42 2018 (r328909) @@ -321,7 +321,7 @@ __elfN(get_brandinfo)(struct image_params *imgp, const strcmp((const char *)&hdr->e_ident[OLD_EI_BRAND], bi->compat_3_brand) == 0))) { /* Looks good, but give brand a chance to veto */ - if (!bi->header_supported || + if (bi->header_supported == NULL || bi->header_supported(imgp)) { /* * Again, prefer strictly matching @@ -369,7 +369,8 @@ __elfN(get_brandinfo)(struct image_params *imgp, const /* ELF image p_filesz includes terminating zero */ strlen(bi->interp_path) + 1 == interp_name_len && strncmp(interp, bi->interp_path, interp_name_len) - == 0) + == 0 && (bi->header_supported == NULL || + bi->header_supported(imgp))) return (bi); } } @@ -381,7 +382,9 @@ __elfN(get_brandinfo)(struct image_params *imgp, const (interp != NULL && (bi->flags & BI_BRAND_ONLY_STATIC) != 0)) continue; if (hdr->e_machine == bi->machine && - __elfN(fallback_brand) == bi->brand) + __elfN(fallback_brand) == bi->brand && + (bi->header_supported == NULL || + bi->header_supported(imgp))) return (bi); } return (NULL); From owner-svn-src-all@freebsd.org Mon Feb 5 23:29:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31295ED7445; Mon, 5 Feb 2018 23:29:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D7ABF8F4B0; Mon, 5 Feb 2018 23:29:50 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CDFE179B9; Mon, 5 Feb 2018 23:29:50 +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 w15NToQA048868; Mon, 5 Feb 2018 23:29:50 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15NTo03048867; Mon, 5 Feb 2018 23:29:50 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201802052329.w15NTo03048867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 5 Feb 2018 23:29:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328910 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 328910 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 23:29:51 -0000 Author: jhb Date: Mon Feb 5 23:29:50 2018 New Revision: 328910 URL: https://svnweb.freebsd.org/changeset/base/328910 Log: Fix a typo. Modified: head/share/man/man7/arch.7 Modified: head/share/man/man7/arch.7 ============================================================================== --- head/share/man/man7/arch.7 Mon Feb 5 23:27:42 2018 (r328909) +++ head/share/man/man7/arch.7 Mon Feb 5 23:29:50 2018 (r328910) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 31, 2018 +.Dd February 5, 2018 .Dt ARCH 7 .Os .Sh NAME @@ -416,7 +416,7 @@ imply little endian. If we ever were to support the so-called x32 ABI (using 32-bit pointers on the amd64 architecture), it would most likely be encoded as amd64-x32. -It is unfortunate that amd64 speifies the 64-bit evolution of the x86 +It is unfortunate that amd64 specifies the 64-bit evolution of the x86 platform (it matches the 'first rule') as everybody else uses x86_64. There is no standard name for the processor: each OS selects its own conventions. From owner-svn-src-all@freebsd.org Mon Feb 5 23:35:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8103ED7C8C; Mon, 5 Feb 2018 23:35:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 77B188F9D5; Mon, 5 Feb 2018 23:35:34 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 68FCE7B56; Mon, 5 Feb 2018 23:35:34 +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 w15NZYBg053649; Mon, 5 Feb 2018 23:35:34 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15NZYpI053647; Mon, 5 Feb 2018 23:35:34 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201802052335.w15NZYpI053647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 5 Feb 2018 23:35:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328911 - in head: stand/common sys/kern X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: stand/common sys/kern X-SVN-Commit-Revision: 328911 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 23:35:35 -0000 Author: jhb Date: Mon Feb 5 23:35:33 2018 New Revision: 328911 URL: https://svnweb.freebsd.org/changeset/base/328911 Log: Ignore relocation tables for non-memory-resident sections. As a followup to r328101, ignore relocation tables for ELF object sections that are not memory resident. For modules loaded by the loader, ignore relocation tables whose associated section was not loaded by the loader (sh_addr is zero). For modules loaded at runtime via kldload(2), ignore relocation tables whose associated section is not marked with SHF_ALLOC. Reported by: Mori Hiroki , adrian Tested on: mips, mips64 MFC after: 1 month Sponsored by: DARPA / AFRL Modified: head/stand/common/load_elf_obj.c head/sys/kern/link_elf_obj.c Modified: head/stand/common/load_elf_obj.c ============================================================================== --- head/stand/common/load_elf_obj.c Mon Feb 5 23:29:50 2018 (r328910) +++ head/stand/common/load_elf_obj.c Mon Feb 5 23:35:33 2018 (r328911) @@ -282,6 +282,8 @@ __elfN(obj_loadimage)(struct preloaded_file *fp, elf_f switch (shdr[i].sh_type) { case SHT_REL: case SHT_RELA: + if ((shdr[shdr[i].sh_info].sh_flags & SHF_ALLOC) == 0) + break; lastaddr = roundup(lastaddr, shdr[i].sh_addralign); shdr[i].sh_addr = (Elf_Addr)lastaddr; lastaddr += shdr[i].sh_size; Modified: head/sys/kern/link_elf_obj.c ============================================================================== --- head/sys/kern/link_elf_obj.c Mon Feb 5 23:29:50 2018 (r328910) +++ head/sys/kern/link_elf_obj.c Mon Feb 5 23:35:33 2018 (r328911) @@ -272,9 +272,17 @@ link_elf_link_preload(linker_class_t cls, const char * symstrindex = shdr[i].sh_link; break; case SHT_REL: + /* + * Ignore relocation tables for sections not + * loaded by the loader. + */ + if (shdr[shdr[i].sh_info].sh_addr == 0) + break; ef->nreltab++; break; case SHT_RELA: + if (shdr[shdr[i].sh_info].sh_addr == 0) + break; ef->nrelatab++; break; } @@ -398,12 +406,16 @@ link_elf_link_preload(linker_class_t cls, const char * pb++; break; case SHT_REL: + if (shdr[shdr[i].sh_info].sh_addr == 0) + break; ef->reltab[rl].rel = (Elf_Rel *)shdr[i].sh_addr; ef->reltab[rl].nrel = shdr[i].sh_size / sizeof(Elf_Rel); ef->reltab[rl].sec = shdr[i].sh_info; rl++; break; case SHT_RELA: + if (shdr[shdr[i].sh_info].sh_addr == 0) + break; ef->relatab[ra].rela = (Elf_Rela *)shdr[i].sh_addr; ef->relatab[ra].nrela = shdr[i].sh_size / sizeof(Elf_Rela); @@ -620,9 +632,17 @@ link_elf_load_file(linker_class_t cls, const char *fil symstrindex = shdr[i].sh_link; break; case SHT_REL: + /* + * Ignore relocation tables for unallocated + * sections. + */ + if ((shdr[shdr[i].sh_info].sh_flags & SHF_ALLOC) == 0) + break; ef->nreltab++; break; case SHT_RELA: + if ((shdr[shdr[i].sh_info].sh_flags & SHF_ALLOC) == 0) + break; ef->nrelatab++; break; case SHT_STRTAB: @@ -880,6 +900,8 @@ link_elf_load_file(linker_class_t cls, const char *fil pb++; break; case SHT_REL: + if ((shdr[shdr[i].sh_info].sh_flags & SHF_ALLOC) == 0) + break; ef->reltab[rl].rel = malloc(shdr[i].sh_size, M_LINKER, M_WAITOK); ef->reltab[rl].nrel = shdr[i].sh_size / sizeof(Elf_Rel); @@ -898,6 +920,8 @@ link_elf_load_file(linker_class_t cls, const char *fil rl++; break; case SHT_RELA: + if ((shdr[shdr[i].sh_info].sh_flags & SHF_ALLOC) == 0) + break; ef->relatab[ra].rela = malloc(shdr[i].sh_size, M_LINKER, M_WAITOK); ef->relatab[ra].nrela = From owner-svn-src-all@freebsd.org Mon Feb 5 23:38:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 983CAED805E; Mon, 5 Feb 2018 23:38:16 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48EB18FBD3; Mon, 5 Feb 2018 23:38:16 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F5E47B5A; Mon, 5 Feb 2018 23:38:16 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w15NcGE9053833; Mon, 5 Feb 2018 23:38:16 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15NcFfD053829; Mon, 5 Feb 2018 23:38:15 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201802052338.w15NcFfD053829@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Mon, 5 Feb 2018 23:38:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328912 - in head: share/man/man4 sys/conf sys/dev/bhnd sys/dev/bwn sys/dev/siba sys/gnu/dev/bwn/phy_n sys/modules sys/modules/bwn sys/modules/bwn_pci sys/modules/siba_bwn X-SVN-Group: head X-SVN-Commit-Author: landonf X-SVN-Commit-Paths: in head: share/man/man4 sys/conf sys/dev/bhnd sys/dev/bwn sys/dev/siba sys/gnu/dev/bwn/phy_n sys/modules sys/modules/bwn sys/modules/bwn_pci sys/modules/siba_bwn X-SVN-Commit-Revision: 328912 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 05 Feb 2018 23:38:17 -0000 Author: landonf Date: Mon Feb 5 23:38:15 2018 New Revision: 328912 URL: https://svnweb.freebsd.org/changeset/base/328912 Log: bwn(4): migrate bwn(4) to the native bhnd(9) interface, and drop siba_bwn. - Remove the shim interface that allowed bwn(4) to use either siba_bwn or bhnd(4), replacing all siba_bwn calls with their bhnd(4) bus equivalents. - Drop the legay, now-unused siba_bwn bus driver. - Clean up bhnd(4) board flag defines referenced by bwn(4). Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D13518 Added: head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_sprom.c (contents, props changed) head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_sprom.h (contents, props changed) Deleted: head/sys/dev/bwn/if_bwn_bhnd.c head/sys/dev/bwn/if_bwn_chipid.h head/sys/dev/bwn/if_bwn_siba.c head/sys/dev/bwn/if_bwn_siba.h head/sys/dev/bwn/if_bwn_siba_compat.c head/sys/dev/bwn/if_bwn_siba_compat.h head/sys/dev/siba/ head/sys/modules/bwn_pci/ head/sys/modules/siba_bwn/ Modified: head/share/man/man4/bwn.4 head/sys/conf/files head/sys/dev/bhnd/bhnd_ids.h head/sys/dev/bwn/if_bwn.c head/sys/dev/bwn/if_bwn_misc.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_common.h head/sys/dev/bwn/if_bwn_phy_g.c head/sys/dev/bwn/if_bwn_phy_lp.c head/sys/dev/bwn/if_bwn_phy_n.c head/sys/dev/bwn/if_bwn_util.c head/sys/dev/bwn/if_bwnreg.h head/sys/dev/bwn/if_bwnvar.h 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.h 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/modules/Makefile head/sys/modules/bwn/Makefile Modified: head/share/man/man4/bwn.4 ============================================================================== --- head/share/man/man4/bwn.4 Mon Feb 5 23:35:33 2018 (r328911) +++ head/share/man/man4/bwn.4 Mon Feb 5 23:38:15 2018 (r328912) @@ -24,26 +24,29 @@ .\" .\" $FreeBSD$ .\" -.Dd June 11, 2015 +.Dd December 16, 2017 .Dt BWN 4 .Os .Sh NAME .Nm bwn -.Nd Broadcom BCM43xx IEEE 802.11b/g wireless network driver +.Nd Broadcom BCM43xx SoftMAC IEEE 802.11 wireless network 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, add the following lines to the kernel +configuration file: .Bd -ragged -offset indent -.Cd "device siba_bwn" .Cd "device bwn" +.Cd "device bhnd" +.Cd "device bhndb" +.Cd "device bhndb_pci" +.Cd "device bcma" +.Cd "device siba" +.Cd "device gpio" .Cd "device wlan" .Cd "device wlan_amrr" .Cd "device firmware" .Ed .Pp -Alternatively, to load the driver as a -module at boot time, place the following line in +To load the driver as a module at boot, add the following lines to .Xr loader.conf 5 : .Bd -literal -offset indent if_bwn_load="YES" @@ -122,9 +125,6 @@ Tunables can be set at the prompt before booting the kernel or stored in .Xr loader.conf 5 . .Bl -tag -width indent -.It Va hw.bwn.msi_disable -This tunable disables MSI support on the hardware. -The default value is 0. .It Va hw.bwn.usedma This tunable enables DMA operations on the hardware. If the value is 0, PIO mode would be used. @@ -132,10 +132,14 @@ The default value is 1. .El .Sh SEE ALSO .Xr arp 4 , +.Xr bcma 4 , +.Xr bhnd 4 , +.Xr bhndb 4 , .Xr bwi 4 , .Xr cardbus 4 , .Xr intro 4 , .Xr pci 4 , +.Xr siba 4 , .Xr wlan 4 , .Xr wlan_amrr 4 , .Xr ifconfig 8 , @@ -145,12 +149,20 @@ The .Nm driver first appeared in .Fx 8.1 . +The driver was updated to support the common Broadcom +.Xr bhnd 4 +bus interface in +.Fx 12.0 . .Sh AUTHORS .An -nosplit The .Nm driver was written by .An Weongyo Jeong Aq Mt weongyo@FreeBSD.org . +Support for +.Xr bhnd 4 +was added by +.An Landon Fuller Aq Mt landonf@FreeBSD.org . .\".Sh BUGS .\"Some card based on the BCM4306 and BCM4309 chips do not work properly .\"on channel 1, 2 and 3. Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Feb 5 23:35:33 2018 (r328911) +++ head/sys/conf/files Mon Feb 5 23:38:15 2018 (r328912) @@ -1250,9 +1250,9 @@ dev/bhnd/bhndb/bhndb.c optional bhndb bhnd dev/bhnd/bhndb/bhndb_bus_if.m optional bhndb bhnd dev/bhnd/bhndb/bhndb_hwdata.c optional bhndb bhnd dev/bhnd/bhndb/bhndb_if.m optional bhndb bhnd -dev/bhnd/bhndb/bhndb_pci.c optional bhndb bhnd pci -dev/bhnd/bhndb/bhndb_pci_hwdata.c optional bhndb bhnd pci -dev/bhnd/bhndb/bhndb_pci_sprom.c optional bhndb bhnd pci +dev/bhnd/bhndb/bhndb_pci.c optional bhndb_pci bhndb bhnd pci +dev/bhnd/bhndb/bhndb_pci_hwdata.c optional bhndb_pci bhndb bhnd pci +dev/bhnd/bhndb/bhndb_pci_sprom.c optional bhndb_pci bhndb bhnd pci dev/bhnd/bhndb/bhndb_subr.c optional bhndb bhnd dev/bhnd/bcma/bcma.c optional bcma bhnd dev/bhnd/bcma/bcma_bhndb.c optional bcma bhnd bhndb @@ -1327,19 +1327,16 @@ dev/bwi/bwirf.c optional bwi dev/bwi/if_bwi.c optional bwi dev/bwi/if_bwi_pci.c optional bwi pci # XXX Work around clang warnings, until maintainer approves fix. -dev/bwn/if_bwn.c optional bwn siba_bwn \ +dev/bwn/if_bwn.c optional bwn bhnd \ compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED}" -dev/bwn/if_bwn_bhnd.c optional bwn bhnd -dev/bwn/if_bwn_pci.c optional bwn pci bhnd bhndb -dev/bwn/if_bwn_phy_common.c optional bwn siba_bwn -dev/bwn/if_bwn_phy_g.c optional bwn siba_bwn \ +dev/bwn/if_bwn_pci.c optional bwn pci bhnd bhndb bhndb_pci +dev/bwn/if_bwn_phy_common.c optional bwn bhnd +dev/bwn/if_bwn_phy_g.c optional bwn bhnd \ compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED} ${NO_WCONSTANT_CONVERSION}" -dev/bwn/if_bwn_phy_lp.c optional bwn siba_bwn \ +dev/bwn/if_bwn_phy_lp.c optional bwn bhnd \ compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED}" -dev/bwn/if_bwn_phy_n.c optional bwn siba_bwn -dev/bwn/if_bwn_siba.c optional bwn siba_bwn -dev/bwn/if_bwn_siba_compat.c optional bwn bhnd !bwn_use_siba -dev/bwn/if_bwn_util.c optional bwn siba_bwn +dev/bwn/if_bwn_phy_n.c optional bwn bhnd +dev/bwn/if_bwn_util.c optional bwn bhnd dev/cardbus/cardbus.c optional cardbus dev/cardbus/cardbus_cis.c optional cardbus dev/cardbus/cardbus_device.c optional cardbus @@ -3020,8 +3017,6 @@ dev/sdhci/sdhci_acpi.c optional sdhci acpi dev/sdhci/sdhci_pci.c optional sdhci pci dev/sf/if_sf.c optional sf pci dev/sge/if_sge.c optional sge pci -dev/siba/siba_bwn.c optional siba_bwn pci -dev/siba/siba_core.c optional siba_bwn pci dev/siis/siis.c optional siis pci dev/sis/if_sis.c optional sis pci dev/sk/if_sk.c optional sk pci Modified: head/sys/dev/bhnd/bhnd_ids.h ============================================================================== --- head/sys/dev/bhnd/bhnd_ids.h Mon Feb 5 23:35:33 2018 (r328911) +++ head/sys/dev/bhnd/bhnd_ids.h Mon Feb 5 23:38:15 2018 (r328912) @@ -69,6 +69,7 @@ /* PCI vendor IDs */ +#define PCI_VENDOR_ASUSTEK 0x1043 #define PCI_VENDOR_EPIGRAM 0xfeda #define PCI_VENDOR_BROADCOM 0x14e4 #define PCI_VENDOR_3COM 0x10b7 @@ -78,6 +79,8 @@ #define PCI_VENDOR_DELL 0x1028 #define PCI_VENDOR_HP 0x103c #define PCI_VENDOR_HP_COMPAQ 0x0e11 +#define PCI_VENDOR_LINKSYS 0x1737 +#define PCI_VENDOR_MOTOROLA 0x1057 #define PCI_VENDOR_APPLE 0x106b #define PCI_VENDOR_SI_IMAGE 0x1095 /* Silicon Image, used by Arasan SDIO Host */ #define PCI_VENDOR_BUFFALO 0x1154 /* Buffalo vendor id */ @@ -581,10 +584,10 @@ #define BHND_BFL_LNLDO2_2P5 0x04000000 /* Select 2.5V as LNLDO2 output voltage */ #define BHND_BFL_FASTPWR 0x08000000 #define BHND_BFL_UCPWRCTL_MININDX 0x08000000 /* Enforce min power index to avoid FEM damage */ -#define BHND_BFL_EXTLNA_5GHz 0x10000000 /* Board has an external LNA in 5GHz band */ -#define BHND_BFL_TRSW_1by2 0x20000000 /* Board has 2 TRSW's in 1by2 designs */ +#define BHND_BFL_EXTLNA_5GHZ 0x10000000 /* Board has an external LNA in 5GHz band */ +#define BHND_BFL_TRSW_1BY2 0x20000000 /* Board has 2 TRSW's in 1by2 designs */ #define BHND_BFL_GAINBOOSTA01 0x20000000 /* 5g Gainboost for core0 and core1 */ -#define BHND_BFL_LO_TRSW_R_5GHz 0x40000000 /* In 5G do not throw TRSW to T for clipLO gain */ +#define BHND_BFL_LO_TRSW_R_5GHZ 0x40000000 /* In 5G do not throw TRSW to T for clipLO gain */ #define BHND_BFL_ELNA_GAINDEF 0x80000000 /* Backoff InitGain based on elna_2g/5g field * when this flag is set */ @@ -644,7 +647,7 @@ #define BHND_BFL_SROM11_BTCOEX 0x00000001 /* Board supports BTCOEX */ #define BHND_BFL_SROM11_WLAN_BT_SH_XTL 0x00000002 /* bluetooth and wlan share same crystal */ #define BHND_BFL_SROM11_EXTLNA 0x00001000 /* Board has an external LNA in 2.4GHz band */ -#define BHND_BFL_SROM11_EXTLNA_5GHz 0x10000000 /* Board has an external LNA in 5GHz band */ +#define BHND_BFL_SROM11_EXTLNA_5GHZ 0x10000000 /* Board has an external LNA in 5GHz band */ #define BHND_BFL_SROM11_GAINBOOSTA01 0x20000000 /* 5g Gainboost for core0 and core1 */ #define BHND_BFL2_SROM11_APLL_WAR 0x00000002 /* Flag to implement alternative A-band PLL settings */ #define BHND_BFL2_SROM11_ANAPACTRL_2G 0x00100000 /* 2G ext PAs are ctrl-ed by analog PA ctrl lines */ Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Mon Feb 5 23:35:33 2018 (r328911) +++ head/sys/dev/bwn/if_bwn.c Mon Feb 5 23:38:15 2018 (r328912) @@ -2,7 +2,12 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2009-2010 Weongyo Jeong + * Copyright (c) 2016 Landon Fuller + * Copyright (c) 2017 The FreeBSD Foundation * All rights reserved. + * + * Portions of this software were developed by Landon Fuller + * 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 @@ -42,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -65,17 +71,18 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include - #include #include #include #include #include -#include +#include +#include +#include +#include + #include #include @@ -87,6 +94,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include "bhnd_nvram_map.h" + +#include "gpio_if.h" + static SYSCTL_NODE(_hw, OID_AUTO, bwn, CTLFLAG_RD, 0, "Broadcom driver parameters"); @@ -109,8 +120,6 @@ SYSCTL_INT(_hw_bwn, OID_AUTO, bluetooth, CTLFLAG_RW, & static int bwn_hwpctl = 0; SYSCTL_INT(_hw_bwn, OID_AUTO, hwpctl, CTLFLAG_RW, &bwn_hwpctl, 0, "uses H/W power control"); -static int bwn_msi_disable = 0; /* MSI disabled */ -TUNABLE_INT("hw.bwn.msi_disable", &bwn_msi_disable); static int bwn_usedma = 1; SYSCTL_INT(_hw_bwn, OID_AUTO, usedma, CTLFLAG_RD, &bwn_usedma, 0, "uses DMA"); @@ -121,6 +130,8 @@ SYSCTL_INT(_hw_bwn, OID_AUTO, wme, CTLFLAG_RW, &bwn_wm static void bwn_attach_pre(struct bwn_softc *); static int bwn_attach_post(struct bwn_softc *); +static int bwn_retain_bus_providers(struct bwn_softc *sc); +static void bwn_release_bus_providers(struct bwn_softc *sc); static void bwn_sprom_bugfixes(device_t); static int bwn_init(struct bwn_softc *); static void bwn_parent(struct ieee80211com *); @@ -153,6 +164,7 @@ static struct ieee80211vap *bwn_vap_create(struct ieee const uint8_t [IEEE80211_ADDR_LEN]); static void bwn_vap_delete(struct ieee80211vap *); static void bwn_stop(struct bwn_softc *); +static int bwn_core_forceclk(struct bwn_mac *, bool); static int bwn_core_init(struct bwn_mac *); static void bwn_core_start(struct bwn_mac *); static void bwn_core_exit(struct bwn_mac *); @@ -211,8 +223,6 @@ static struct bwn_pio_txqueue *bwn_pio_parse_cookie(st uint16_t, struct bwn_pio_txpkt **); static void bwn_dma_init(struct bwn_mac *); static void bwn_dma_rxdirectfifo(struct bwn_mac *, int, uint8_t); -static int bwn_dma_mask2type(uint64_t); -static uint64_t bwn_dma_mask(struct bwn_mac *); static uint16_t bwn_dma_base(int, int); static void bwn_dma_ringfree(struct bwn_dma_ring **); static void bwn_dma_32_getdesc(struct bwn_dma_ring *, @@ -248,7 +258,6 @@ static int bwn_dma_rx_reset(struct bwn_mac *, uint16_t static void bwn_dma_free_descbuf(struct bwn_dma_ring *, struct bwn_dmadesc_meta *); static void bwn_dma_set_redzone(struct bwn_dma_ring *, struct mbuf *); -static int bwn_dma_gettype(struct bwn_mac *); static void bwn_dma_ring_addr(void *, bus_dma_segment_t *, int, int); static int bwn_dma_freeslot(struct bwn_dma_ring *); static int bwn_dma_nextslot(struct bwn_dma_ring *, int); @@ -270,7 +279,7 @@ static struct bwn_dma_ring *bwn_dma_select(struct bwn_ uint8_t); static int bwn_dma_attach(struct bwn_mac *); static struct bwn_dma_ring *bwn_dma_ringsetup(struct bwn_mac *, - int, int, int); + int, int); static struct bwn_dma_ring *bwn_dma_parse_cookie(struct bwn_mac *, const struct bwn_txstatus *, uint16_t, int *); static void bwn_dma_free(struct bwn_mac *); @@ -296,7 +305,7 @@ static void bwn_phy_exit(struct bwn_mac *); static void bwn_core_stop(struct bwn_mac *); static int bwn_switch_band(struct bwn_softc *, struct ieee80211_channel *); -static void bwn_phy_reset(struct bwn_mac *); +static int bwn_phy_reset(struct bwn_mac *); static int bwn_newstate(struct ieee80211vap *, enum ieee80211_state, int); static void bwn_set_pretbtt(struct bwn_mac *); static int bwn_intr(void *); @@ -346,7 +355,7 @@ static void bwn_watchdog(void *); static void bwn_dma_stop(struct bwn_mac *); static void bwn_pio_stop(struct bwn_mac *); static void bwn_dma_ringstop(struct bwn_dma_ring **); -static void bwn_led_attach(struct bwn_mac *); +static int bwn_led_attach(struct bwn_mac *); static void bwn_led_newstate(struct bwn_mac *, enum ieee80211_state); static void bwn_led_event(struct bwn_mac *, int); static void bwn_led_blink_start(struct bwn_mac *, int, int); @@ -357,16 +366,6 @@ static void bwn_rf_turnon(struct bwn_mac *); static void bwn_rf_turnoff(struct bwn_mac *); static void bwn_sysctl_node(struct bwn_softc *); -static struct resource_spec bwn_res_spec_legacy[] = { - { SYS_RES_IRQ, 0, RF_ACTIVE | RF_SHAREABLE }, - { -1, 0, 0 } -}; - -static struct resource_spec bwn_res_spec_msi[] = { - { SYS_RES_IRQ, 1, RF_ACTIVE }, - { -1, 0, 0 } -}; - static const struct bwn_channelinfo bwn_chantable_bg = { .channels = { { 2412, 1, 30 }, { 2417, 2, 30 }, { 2422, 3, 30 }, @@ -449,7 +448,7 @@ static const struct { uint16_t vid; uint8_t led_act[BWN_LED_MAX]; } bwn_vendor_led_act[] = { - VENDOR_LED_ACT(COMPAQ), + VENDOR_LED_ACT(HP_COMPAQ), VENDOR_LED_ACT(ASUSTEK) }; @@ -458,6 +457,13 @@ static const uint8_t bwn_default_led_act[BWN_LED_MAX] #undef VENDOR_LED_ACT +static const char *bwn_led_vars[] = { + BHND_NVAR_LEDBH0, + BHND_NVAR_LEDBH1, + BHND_NVAR_LEDBH2, + BHND_NVAR_LEDBH3 +}; + static const struct { int on_dur; int off_dur; @@ -484,89 +490,130 @@ static const uint16_t bwn_wme_shm_offsets[] = { [3] = BWN_WME_VIDEO, }; -static const struct siba_devid bwn_devs[] = { - SIBA_DEV(BROADCOM, 80211, 5, "Revision 5"), - SIBA_DEV(BROADCOM, 80211, 6, "Revision 6"), - SIBA_DEV(BROADCOM, 80211, 7, "Revision 7"), - SIBA_DEV(BROADCOM, 80211, 9, "Revision 9"), - SIBA_DEV(BROADCOM, 80211, 10, "Revision 10"), - SIBA_DEV(BROADCOM, 80211, 11, "Revision 11"), - SIBA_DEV(BROADCOM, 80211, 12, "Revision 12"), - SIBA_DEV(BROADCOM, 80211, 13, "Revision 13"), - SIBA_DEV(BROADCOM, 80211, 15, "Revision 15"), - SIBA_DEV(BROADCOM, 80211, 16, "Revision 16") +/* Supported D11 core revisions */ +#define BWN_DEV(_hwrev) {{ \ + BHND_MATCH_CORE(BHND_MFGID_BCM, BHND_COREID_D11), \ + BHND_MATCH_CORE_REV(_hwrev), \ +}} +static const struct bhnd_device bwn_devices[] = { + BWN_DEV(HWREV_RANGE(5, 16)), + BWN_DEV(HWREV_EQ(23)), + BHND_DEVICE_END }; -static const struct bwn_bus_ops * -bwn_get_bus_ops(device_t dev) -{ -#if BWN_USE_SIBA - return (NULL); -#else - devclass_t bus_cls; +/* D11 quirks when bridged via a PCI host bridge core */ +static const struct bhnd_device_quirk pci_bridge_quirks[] = { + BHND_CORE_QUIRK (HWREV_LTE(10), BWN_QUIRK_UCODE_SLOWCLOCK_WAR), + BHND_DEVICE_QUIRK_END +}; - bus_cls = device_get_devclass(device_get_parent(dev)); - if (bus_cls == devclass_find("bhnd")) - return (&bwn_bhnd_bus_ops); - else - return (&bwn_siba_bus_ops); -#endif -} +/* D11 quirks when bridged via a PCMCIA host bridge core */ +static const struct bhnd_device_quirk pcmcia_bridge_quirks[] = { + BHND_CORE_QUIRK (HWREV_ANY, BWN_QUIRK_NODMA), + BHND_DEVICE_QUIRK_END +}; +/* Host bridge cores for which D11 quirk flags should be applied */ +static const struct bhnd_device bridge_devices[] = { + BHND_DEVICE(BCM, PCI, NULL, pci_bridge_quirks), + BHND_DEVICE(BCM, PCMCIA, NULL, pcmcia_bridge_quirks), + BHND_DEVICE_END +}; + static int bwn_probe(device_t dev) { - struct bwn_softc *sc; - int i; + const struct bhnd_device *id; - sc = device_get_softc(dev); - sc->sc_bus_ops = bwn_get_bus_ops(dev); + id = bhnd_device_lookup(dev, bwn_devices, sizeof(bwn_devices[0])); + if (id == NULL) + return (ENXIO); - for (i = 0; i < nitems(bwn_devs); i++) { - if (siba_get_vendor(dev) == bwn_devs[i].sd_vendor && - siba_get_device(dev) == bwn_devs[i].sd_device && - siba_get_revid(dev) == bwn_devs[i].sd_rev) - return (BUS_PROBE_DEFAULT); - } - - return (ENXIO); + bhnd_set_default_core_desc(dev); + return (BUS_PROBE_DEFAULT); } -int +static int bwn_attach(device_t dev) { - struct bwn_mac *mac; - struct bwn_softc *sc = device_get_softc(dev); - int error, i, msic, reg; + struct bwn_mac *mac; + struct bwn_softc *sc; + device_t parent, hostb; + char chip_name[BHND_CHIPID_MAX_NAMELEN]; + int error; + sc = device_get_softc(dev); sc->sc_dev = dev; #ifdef BWN_DEBUG sc->sc_debug = bwn_debug; #endif - sc->sc_bus_ops = bwn_get_bus_ops(dev); - if ((error = BWN_BUS_OPS_ATTACH(dev))) { - device_printf(sc->sc_dev, - "bus-specific initialization failed (%d)\n", error); + mac = NULL; + + /* Determine the driver quirks applicable to this device, including any + * quirks specific to the bus host bridge core (if any) */ + sc->sc_quirks = bhnd_device_quirks(dev, bwn_devices, + sizeof(bwn_devices[0])); + + parent = device_get_parent(dev); + if ((hostb = bhnd_bus_find_hostb_device(parent)) != NULL) { + sc->sc_quirks |= bhnd_device_quirks(hostb, bridge_devices, + sizeof(bridge_devices[0])); + } + + /* DMA explicitly disabled? */ + if (!bwn_usedma) + sc->sc_quirks |= BWN_QUIRK_NODMA; + + /* Fetch our chip identification and board info */ + sc->sc_cid = *bhnd_get_chipid(dev); + if ((error = bhnd_read_board_info(dev, &sc->sc_board_info))) { + device_printf(sc->sc_dev, "couldn't read board info\n"); return (error); } + /* Allocate our D11 register block and PMU state */ + sc->sc_mem_rid = 0; + sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->sc_mem_rid, RF_ACTIVE); + if (sc->sc_mem_res == NULL) { + device_printf(sc->sc_dev, "couldn't allocate registers\n"); + return (error); + } + + if ((error = bhnd_alloc_pmu(sc->sc_dev))) { + bus_release_resource(sc->sc_dev, SYS_RES_MEMORY, + sc->sc_mem_rid, sc->sc_mem_res); + return (error); + } + + /* Retain references to all required bus service providers */ + if ((error = bwn_retain_bus_providers(sc))) + goto fail; + + /* Fetch mask of available antennas */ + error = bhnd_nvram_getvar_uint8(sc->sc_dev, BHND_NVAR_AA2G, + &sc->sc_ant2g); + if (error) { + device_printf(sc->sc_dev, "error determining 2GHz antenna " + "availability from NVRAM: %d\n", error); + goto fail; + } + + error = bhnd_nvram_getvar_uint8(sc->sc_dev, BHND_NVAR_AA5G, + &sc->sc_ant5g); + if (error) { + device_printf(sc->sc_dev, "error determining 5GHz antenna " + "availability from NVRAM: %d\n", error); + goto fail; + } + if ((sc->sc_flags & BWN_FLAG_ATTACHED) == 0) { bwn_attach_pre(sc); bwn_sprom_bugfixes(dev); sc->sc_flags |= BWN_FLAG_ATTACHED; } - if (!TAILQ_EMPTY(&sc->sc_maclist)) { - if (siba_get_pci_device(dev) != 0x4313 && - siba_get_pci_device(dev) != 0x431a && - siba_get_pci_device(dev) != 0x4321) { - device_printf(sc->sc_dev, - "skip 802.11 cores\n"); - return (ENODEV); - } - } - mac = malloc(sizeof(*mac), M_DEVBUF, M_WAITOK | M_ZERO); mac->mac_sc = sc; mac->mac_status = BWN_MAC_STATUS_UNINIT; @@ -579,18 +626,19 @@ bwn_attach(device_t dev) error = bwn_attach_core(mac); if (error) - goto fail0; - bwn_led_attach(mac); + goto fail; + error = bwn_led_attach(mac); + if (error) + goto fail; - device_printf(sc->sc_dev, "WLAN (chipid %#x rev %u) " + bhnd_format_chip_id(chip_name, sizeof(chip_name), sc->sc_cid.chip_id); + device_printf(sc->sc_dev, "WLAN (%s rev %u) " "PHY (analog %d type %d rev %d) RADIO (manuf %#x ver %#x rev %d)\n", - siba_get_chipid(sc->sc_dev), siba_get_revid(sc->sc_dev), - mac->mac_phy.analog, mac->mac_phy.type, mac->mac_phy.rev, - mac->mac_phy.rf_manuf, mac->mac_phy.rf_ver, - mac->mac_phy.rf_rev); + chip_name, bhnd_get_hwrev(sc->sc_dev), mac->mac_phy.analog, + mac->mac_phy.type, mac->mac_phy.rev, mac->mac_phy.rf_manuf, + mac->mac_phy.rf_ver, mac->mac_phy.rf_rev); if (mac->mac_flags & BWN_MAC_FLAG_DMA) - device_printf(sc->sc_dev, "DMA (%d bits)\n", - mac->mac_method.dma.dmatype); + device_printf(sc->sc_dev, "DMA (%d bits)\n", mac->mac_dmatype); else device_printf(sc->sc_dev, "PIO\n"); @@ -599,51 +647,25 @@ bwn_attach(device_t dev) "Note: compiled with BWN_GPL_PHY; includes GPLv2 code\n"); #endif - /* - * setup PCI resources and interrupt. - */ - if (pci_find_cap(dev, PCIY_EXPRESS, ®) == 0) { - msic = pci_msi_count(dev); - if (bootverbose) - device_printf(sc->sc_dev, "MSI count : %d\n", msic); - } else - msic = 0; + mac->mac_rid_irq = 0; + mac->mac_res_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &mac->mac_rid_irq, RF_ACTIVE | RF_SHAREABLE); - mac->mac_intr_spec = bwn_res_spec_legacy; - if (msic == BWN_MSI_MESSAGES && bwn_msi_disable == 0) { - if (pci_alloc_msi(dev, &msic) == 0) { - device_printf(sc->sc_dev, - "Using %d MSI messages\n", msic); - mac->mac_intr_spec = bwn_res_spec_msi; - mac->mac_msi = 1; - } + if (mac->mac_res_irq == NULL) { + device_printf(sc->sc_dev, "couldn't allocate IRQ resource\n"); + error = ENXIO; + goto fail; } - error = bus_alloc_resources(dev, mac->mac_intr_spec, - mac->mac_res_irq); - if (error) { - device_printf(sc->sc_dev, - "couldn't allocate IRQ resources (%d)\n", error); - goto fail1; + error = bus_setup_intr(dev, mac->mac_res_irq, + INTR_TYPE_NET | INTR_MPSAFE, bwn_intr, NULL, mac, + &mac->mac_intrhand); + if (error != 0) { + device_printf(sc->sc_dev, "couldn't setup interrupt (%d)\n", + error); + goto fail; } - if (mac->mac_msi == 0) - error = bus_setup_intr(dev, mac->mac_res_irq[0], - INTR_TYPE_NET | INTR_MPSAFE, bwn_intr, NULL, mac, - &mac->mac_intrhand[0]); - else { - for (i = 0; i < BWN_MSI_MESSAGES; i++) { - error = bus_setup_intr(dev, mac->mac_res_irq[i], - INTR_TYPE_NET | INTR_MPSAFE, bwn_intr, NULL, mac, - &mac->mac_intrhand[i]); - if (error != 0) { - device_printf(sc->sc_dev, - "couldn't setup interrupt (%d)\n", error); - break; - } - } - } - TAILQ_INSERT_TAIL(&sc->sc_maclist, mac, mac_list); /* @@ -653,31 +675,86 @@ bwn_attach(device_t dev) bwn_attach_post(sc); return (0); -fail1: - if (msic == BWN_MSI_MESSAGES && bwn_msi_disable == 0) - pci_release_msi(dev); -fail0: - BWN_BUS_OPS_DETACH(dev); +fail: + if (mac != NULL && mac->mac_res_irq != NULL) { + bus_release_resource(dev, SYS_RES_IRQ, mac->mac_rid_irq, + mac->mac_res_irq); + } + free(mac, M_DEVBUF); + bhnd_release_pmu(dev); + bwn_release_bus_providers(sc); + + if (sc->sc_mem_res != NULL) { + bus_release_resource(sc->sc_dev, SYS_RES_MEMORY, + sc->sc_mem_rid, sc->sc_mem_res); + } + return (error); } static int -bwn_is_valid_ether_addr(uint8_t *addr) +bwn_retain_bus_providers(struct bwn_softc *sc) { - char zero_addr[6] = { 0, 0, 0, 0, 0, 0 }; + struct chipc_caps *ccaps; - if ((addr[0] & 1) || (!bcmp(addr, zero_addr, ETHER_ADDR_LEN))) - return (FALSE); + sc->sc_chipc = bhnd_retain_provider(sc->sc_dev, BHND_SERVICE_CHIPC); + if (sc->sc_chipc == NULL) { + device_printf(sc->sc_dev, "ChipCommon device not found\n"); + goto failed; + } - return (TRUE); + ccaps = BHND_CHIPC_GET_CAPS(sc->sc_chipc); + + sc->sc_gpio = bhnd_retain_provider(sc->sc_dev, BHND_SERVICE_GPIO); + if (sc->sc_gpio == NULL) { + device_printf(sc->sc_dev, "GPIO device not found\n"); + goto failed; + } + + if (ccaps->pmu) { + sc->sc_pmu = bhnd_retain_provider(sc->sc_dev, BHND_SERVICE_PMU); + if (sc->sc_pmu == NULL) { + device_printf(sc->sc_dev, "PMU device not found\n"); + goto failed; + } + } + + return (0); + +failed: + bwn_release_bus_providers(sc); + return (ENXIO); } +static void +bwn_release_bus_providers(struct bwn_softc *sc) +{ +#define BWN_RELEASE_PROV(_sc, _prov, _service) do { \ + if ((_sc)-> _prov != NULL) { \ + bhnd_release_provider((_sc)->sc_dev, (_sc)-> _prov, \ + (_service)); \ + (_sc)-> _prov = NULL; \ + } \ +} while (0) + + BWN_RELEASE_PROV(sc, sc_chipc, BHND_SERVICE_CHIPC); + BWN_RELEASE_PROV(sc, sc_gpio, BHND_SERVICE_GPIO); + BWN_RELEASE_PROV(sc, sc_pmu, BHND_SERVICE_PMU); + +#undef BWN_RELEASE_PROV +} + static int bwn_attach_post(struct bwn_softc *sc) { - struct ieee80211com *ic = &sc->sc_ic; + struct ieee80211com *ic; + const char *mac_varname; + u_int core_unit; + int error; + ic = &sc->sc_ic; + ic->ic_softc = sc; ic->ic_name = device_get_nameunit(sc->sc_dev); /* XXX not right but it's not used anywhere important */ @@ -699,11 +776,36 @@ bwn_attach_post(struct bwn_softc *sc) ic->ic_flags_ext |= IEEE80211_FEXT_SWBMISS; /* s/w bmiss */ - IEEE80211_ADDR_COPY(ic->ic_macaddr, - bwn_is_valid_ether_addr(siba_sprom_get_mac_80211a(sc->sc_dev)) ? - siba_sprom_get_mac_80211a(sc->sc_dev) : - siba_sprom_get_mac_80211bg(sc->sc_dev)); + /* Determine the NVRAM variable containing our MAC address */ + core_unit = bhnd_get_core_unit(sc->sc_dev); + mac_varname = NULL; + if (sc->sc_board_info.board_srom_rev <= 2) { + if (core_unit == 0) { + mac_varname = BHND_NVAR_IL0MACADDR; + } else if (core_unit == 1) { + mac_varname = BHND_NVAR_ET1MACADDR; + } + } else { + if (core_unit == 0) { + mac_varname = BHND_NVAR_MACADDR; + } + } + if (mac_varname == NULL) { + device_printf(sc->sc_dev, "missing MAC address variable for " + "D11 core %u", core_unit); + return (ENXIO); + } + + /* Read the MAC address from NVRAM */ + error = bhnd_nvram_getvar_array(sc->sc_dev, mac_varname, ic->ic_macaddr, + sizeof(ic->ic_macaddr), BHND_NVRAM_TYPE_UINT8_ARRAY); + if (error) { + device_printf(sc->sc_dev, "error reading %s: %d\n", mac_varname, + error); + return (error); + } + /* call MI attach routine. */ ieee80211_ifattach(ic); @@ -743,13 +845,12 @@ bwn_phy_detach(struct bwn_mac *mac) mac->mac_phy.detach(mac); } -int +static int bwn_detach(device_t dev) { struct bwn_softc *sc = device_get_softc(dev); struct bwn_mac *mac = sc->sc_curmac; struct ieee80211com *ic = &sc->sc_ic; - int i; sc->sc_flags |= BWN_FLAG_INVALID; @@ -770,20 +871,22 @@ bwn_detach(device_t dev) taskqueue_drain(sc->sc_tq, &mac->mac_intrtask); taskqueue_free(sc->sc_tq); - for (i = 0; i < BWN_MSI_MESSAGES; i++) { - if (mac->mac_intrhand[i] != NULL) { - bus_teardown_intr(dev, mac->mac_res_irq[i], - mac->mac_intrhand[i]); - mac->mac_intrhand[i] = NULL; - } + if (mac->mac_intrhand != NULL) { + bus_teardown_intr(dev, mac->mac_res_irq, mac->mac_intrhand); + mac->mac_intrhand = NULL; } - bus_release_resources(dev, mac->mac_intr_spec, mac->mac_res_irq); - if (mac->mac_msi != 0) - pci_release_msi(dev); + + bhnd_release_pmu(dev); + bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_mem_rid, + sc->sc_mem_res); + bus_release_resource(dev, SYS_RES_IRQ, mac->mac_rid_irq, + mac->mac_res_irq); mbufq_drain(&sc->sc_snd); bwn_release_firmware(mac); BWN_LOCK_DESTROY(sc); - BWN_BUS_OPS_DETACH(dev); + + bwn_release_bus_providers(sc); + return (0); } @@ -806,32 +909,28 @@ bwn_attach_pre(struct bwn_softc *sc) static void bwn_sprom_bugfixes(device_t dev) { -#define BWN_ISDEV(_vendor, _device, _subvendor, _subdevice) \ - ((siba_get_pci_vendor(dev) == PCI_VENDOR_##_vendor) && \ - (siba_get_pci_device(dev) == _device) && \ - (siba_get_pci_subvendor(dev) == PCI_VENDOR_##_subvendor) && \ - (siba_get_pci_subdevice(dev) == _subdevice)) + struct bwn_softc *sc = device_get_softc(dev); - if (siba_get_pci_subvendor(dev) == PCI_VENDOR_APPLE && - siba_get_pci_subdevice(dev) == 0x4e && - siba_get_pci_revid(dev) > 0x40) - siba_sprom_set_bf_lo(dev, - siba_sprom_get_bf_lo(dev) | BWN_BFL_PACTRL); - if (siba_get_pci_subvendor(dev) == SIBA_BOARDVENDOR_DELL && - siba_get_chipid(dev) == 0x4301 && siba_get_pci_revid(dev) == 0x74) - siba_sprom_set_bf_lo(dev, - siba_sprom_get_bf_lo(dev) | BWN_BFL_BTCOEXIST); - if (siba_get_type(dev) == SIBA_TYPE_PCI) { - if (BWN_ISDEV(BROADCOM, 0x4318, ASUSTEK, 0x100f) || - BWN_ISDEV(BROADCOM, 0x4320, DELL, 0x0003) || - BWN_ISDEV(BROADCOM, 0x4320, HP, 0x12f8) || - BWN_ISDEV(BROADCOM, 0x4320, LINKSYS, 0x0013) || - BWN_ISDEV(BROADCOM, 0x4320, LINKSYS, 0x0014) || - BWN_ISDEV(BROADCOM, 0x4320, LINKSYS, 0x0015) || - BWN_ISDEV(BROADCOM, 0x4320, MOTOROLA, 0x7010)) - siba_sprom_set_bf_lo(dev, - siba_sprom_get_bf_lo(dev) & ~BWN_BFL_BTCOEXIST); - } +#define BWN_ISDEV(_device, _subvendor, _subdevice) \ + ((sc->sc_board_info.board_devid == PCI_DEVID_##_device) && \ + (sc->sc_board_info.board_vendor == PCI_VENDOR_##_subvendor) && \ + (sc->sc_board_info.board_type == _subdevice)) + + /* A subset of Apple Airport Extreme (BCM4306 rev 2) devices + * were programmed with a missing PACTRL boardflag */ + if (sc->sc_board_info.board_vendor == PCI_VENDOR_APPLE && + sc->sc_board_info.board_type == 0x4e && + sc->sc_board_info.board_rev > 0x40) + sc->sc_board_info.board_flags |= BHND_BFL_PACTRL; + + if (BWN_ISDEV(BCM4318_D11G, ASUSTEK, 0x100f) || + BWN_ISDEV(BCM4306_D11G, DELL, 0x0003) || + BWN_ISDEV(BCM4306_D11G, HP, 0x12f8) || + BWN_ISDEV(BCM4306_D11G, LINKSYS, 0x0013) || + BWN_ISDEV(BCM4306_D11G, LINKSYS, 0x0014) || + BWN_ISDEV(BCM4306_D11G, LINKSYS, 0x0015) || + BWN_ISDEV(BCM4306_D11G, MOTOROLA, 0x7010)) + sc->sc_board_info.board_flags &= ~BHND_BFL_BTCOEX; #undef BWN_ISDEV } @@ -1008,7 +1107,7 @@ bwn_pio_tx_start(struct bwn_mac *mac, struct ieee80211 tq->tq_used += roundup(m->m_pkthdr.len + BWN_HDRSIZE(mac), 4); tq->tq_free--; - if (siba_get_revid(sc->sc_dev) >= 8) { + if (bhnd_get_hwrev(sc->sc_dev) >= 8) { /* * XXX please removes m_defrag(9) */ @@ -1181,29 +1280,37 @@ bwn_attach_core(struct bwn_mac *mac) { struct bwn_softc *sc = mac->mac_sc; int error, have_bg = 0, have_a = 0; - uint32_t high; + uint16_t iost; - KASSERT(siba_get_revid(sc->sc_dev) >= 5, - ("unsupported revision %d", siba_get_revid(sc->sc_dev))); + KASSERT(bhnd_get_hwrev(sc->sc_dev) >= 5, + ("unsupported revision %d", bhnd_get_hwrev(sc->sc_dev))); - siba_powerup(sc->sc_dev, 0); - high = siba_read_4(sc->sc_dev, SIBA_TGSHIGH); - have_a = (high & BWN_TGSHIGH_HAVE_5GHZ) ? 1 : 0; - have_bg = (high & BWN_TGSHIGH_HAVE_2GHZ) ? 1 : 0; - if (high & BWN_TGSHIGH_DUALPHY) { + if ((error = bwn_core_forceclk(mac, true))) + return (error); + + if ((error = bhnd_read_iost(sc->sc_dev, &iost))) { + device_printf(sc->sc_dev, "error reading I/O status flags: " + "%d\n", error); + return (error); + } + + have_a = (iost & BWN_IOST_HAVE_5GHZ) ? 1 : 0; + have_bg = (iost & BWN_IOST_HAVE_2GHZ) ? 1 : 0; + if (iost & BWN_IOST_DUALPHY) { have_bg = 1; have_a = 1; } + #if 0 - device_printf(sc->sc_dev, "%s: high=0x%08x, have_a=%d, have_bg=%d," + device_printf(sc->sc_dev, "%s: iost=0x%04hx, have_a=%d, have_bg=%d," " deviceid=0x%04x, siba_deviceid=0x%04x\n", __func__, - high, + iost, have_a, have_bg, - siba_get_pci_device(sc->sc_dev), - siba_get_chipid(sc->sc_dev)); + sc->sc_board_info.board_devid, + sc->sc_cid.chip_id); #endif /* @@ -1211,9 +1318,31 @@ bwn_attach_core(struct bwn_mac *mac) * This is just used for resetting the core to probe things; * we will re-guess once it's all up and working. */ - bwn_reset_core(mac, have_bg); + error = bwn_reset_core(mac, have_bg); + if (error) + goto fail; /* + * Determine the DMA engine type + */ + if (iost & BHND_IOST_DMA64) { + mac->mac_dmatype = BHND_DMA_ADDR_64BIT; + } else { + uint32_t tmp; + uint16_t base; + + base = bwn_dma_base(0, 0); + BWN_WRITE_4(mac, base + BWN_DMA32_TXCTL, + BWN_DMA32_TXADDREXT_MASK); + tmp = BWN_READ_4(mac, base + BWN_DMA32_TXCTL); + if (tmp & BWN_DMA32_TXADDREXT_MASK) { + mac->mac_dmatype = BHND_DMA_ADDR_32BIT; + } else { + mac->mac_dmatype = BHND_DMA_ADDR_30BIT; + } + } + + /* * Get the PHY version. */ error = bwn_phy_getinfo(mac, have_bg); @@ -1224,12 +1353,12 @@ bwn_attach_core(struct bwn_mac *mac) * This is the whitelist of devices which we "believe" * the SPROM PHY config from. The rest are "guessed". */ - if (siba_get_pci_device(sc->sc_dev) != 0x4312 && - siba_get_pci_device(sc->sc_dev) != 0x4315 && - 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) != 0x432b) { + if (sc->sc_board_info.board_devid != PCI_DEVID_BCM4311_D11DUAL && + sc->sc_board_info.board_devid != PCI_DEVID_BCM4328_D11G && + sc->sc_board_info.board_devid != PCI_DEVID_BCM4318_D11DUAL && + sc->sc_board_info.board_devid != PCI_DEVID_BCM4306_D11DUAL && + sc->sc_board_info.board_devid != PCI_DEVID_BCM4321_D11N && + sc->sc_board_info.board_devid != PCI_DEVID_BCM4322_D11N) { have_a = have_bg = 0; if (mac->mac_phy.type == BWN_PHYTYPE_A) have_a = 1; @@ -1330,7 +1459,9 @@ bwn_attach_core(struct bwn_mac *mac) } } - bwn_reset_core(mac, have_bg); + error = bwn_reset_core(mac, have_bg); + if (error) + goto fail; error = bwn_chiptest(mac); if (error) @@ -1352,46 +1483,64 @@ bwn_attach_core(struct bwn_mac *mac) mac->mac_phy.switch_analog(mac, 0); - siba_dev_down(sc->sc_dev, 0); fail: - siba_powerdown(sc->sc_dev); + bhnd_suspend_hw(sc->sc_dev, 0); bwn_release_firmware(mac); return (error); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Feb 6 00:02:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A158AEDA07E; Tue, 6 Feb 2018 00:02:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 53E4B68D92; Tue, 6 Feb 2018 00:02:31 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4EC071002F; Tue, 6 Feb 2018 00:02:31 +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 w1602V0w070702; Tue, 6 Feb 2018 00:02:31 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1602VMP070699; Tue, 6 Feb 2018 00:02:31 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201802060002.w1602VMP070699@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 6 Feb 2018 00:02:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328913 - in head/sys: conf i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: conf i386/i386 X-SVN-Commit-Revision: 328913 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 00:02:31 -0000 Author: kib Date: Tue Feb 6 00:02:30 2018 New Revision: 328913 URL: https://svnweb.freebsd.org/changeset/base/328913 Log: Move signal trampolines out of locore.s into separate source file. Similar to other arches, the move makes the subject of locore.s only the kernel startup. Sponsored by: The FreeBSD Foundation MFC after: 1 week Added: head/sys/i386/i386/sigtramp.s - copied, changed from r328903, head/sys/i386/i386/locore.s Modified: head/sys/conf/files.i386 head/sys/i386/i386/locore.s Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Mon Feb 5 23:38:15 2018 (r328912) +++ head/sys/conf/files.i386 Tue Feb 6 00:02:30 2018 (r328913) @@ -494,6 +494,7 @@ i386/i386/perfmon.c optional perfmon i386/i386/pmap.c standard i386/i386/prof_machdep.c optional profiling-routine i386/i386/ptrace_machdep.c standard +i386/i386/sigtramp.s standard i386/i386/support.s standard i386/i386/swtch.s standard i386/i386/sys_machdep.c standard Modified: head/sys/i386/i386/locore.s ============================================================================== --- head/sys/i386/i386/locore.s Mon Feb 5 23:38:15 2018 (r328912) +++ head/sys/i386/i386/locore.s Tue Feb 6 00:02:30 2018 (r328913) @@ -44,7 +44,6 @@ #include "opt_nfsroot.h" #include "opt_pmap.h" -#include #include #include @@ -292,77 +291,6 @@ begin: call mi_startup /* autoconfiguration, mountroot etc */ /* NOTREACHED */ addl $0,%esp /* for db_numargs() again */ - -/* - * Signal trampoline, copied to top of user stack - */ -NON_GPROF_ENTRY(sigcode) - calll *SIGF_HANDLER(%esp) - leal SIGF_UC(%esp),%eax /* get ucontext */ - pushl %eax - testl $PSL_VM,UC_EFLAGS(%eax) - jne 1f - mov UC_GS(%eax),%gs /* restore %gs */ -1: - movl $SYS_sigreturn,%eax - pushl %eax /* junk to fake return addr. */ - int $0x80 /* enter kernel with args */ - /* on stack */ -1: - jmp 1b - -#ifdef COMPAT_FREEBSD4 - ALIGN_TEXT -freebsd4_sigcode: - calll *SIGF_HANDLER(%esp) - leal SIGF_UC4(%esp),%eax /* get ucontext */ - pushl %eax - testl $PSL_VM,UC4_EFLAGS(%eax) - jne 1f - mov UC4_GS(%eax),%gs /* restore %gs */ -1: - movl $344,%eax /* 4.x SYS_sigreturn */ - pushl %eax /* junk to fake return addr. */ - int $0x80 /* enter kernel with args */ - /* on stack */ -1: - jmp 1b -#endif - -#ifdef COMPAT_43 - ALIGN_TEXT -osigcode: - call *SIGF_HANDLER(%esp) /* call signal handler */ - lea SIGF_SC(%esp),%eax /* get sigcontext */ - pushl %eax - testl $PSL_VM,SC_PS(%eax) - jne 9f - mov SC_GS(%eax),%gs /* restore %gs */ -9: - movl $103,%eax /* 3.x SYS_sigreturn */ - pushl %eax /* junk to fake return addr. */ - int $0x80 /* enter kernel with args */ -0: jmp 0b -#endif /* COMPAT_43 */ - - ALIGN_TEXT -esigcode: - - .data - .globl szsigcode -szsigcode: - .long esigcode-sigcode -#ifdef COMPAT_FREEBSD4 - .globl szfreebsd4_sigcode -szfreebsd4_sigcode: - .long esigcode-freebsd4_sigcode -#endif -#ifdef COMPAT_43 - .globl szosigcode -szosigcode: - .long esigcode-osigcode -#endif - .text /********************************************************************** * Copied and modified: head/sys/i386/i386/sigtramp.s (from r328903, head/sys/i386/i386/locore.s) ============================================================================== --- head/sys/i386/i386/locore.s Mon Feb 5 22:21:51 2018 (r328903, copy source) +++ head/sys/i386/i386/sigtramp.s Tue Feb 6 00:02:30 2018 (r328913) @@ -39,261 +39,15 @@ * and many others. */ -#include "opt_bootp.h" #include "opt_compat.h" -#include "opt_nfsroot.h" -#include "opt_pmap.h" #include -#include - #include -#include #include -#include -#include #include "assym.s" /* - * XXX - * - * Note: This version greatly munged to avoid various assembler errors - * that may be fixed in newer versions of gas. Perhaps newer versions - * will have more pleasant appearance. - */ - -/* - * PTmap is recursive pagemap at top of virtual address space. - * Within PTmap, the page directory can be found (third indirection). - */ - .globl PTmap,PTD,PTDpde - .set PTmap,(PTDPTDI << PDRSHIFT) - .set PTD,PTmap + (PTDPTDI * PAGE_SIZE) - .set PTDpde,PTD + (PTDPTDI * PDESIZE) - -/* - * Compiled KERNBASE location and the kernel load address - */ - .globl kernbase - .set kernbase,KERNBASE - .globl kernload - .set kernload,KERNLOAD - -/* - * Globals - */ - .data - ALIGN_DATA /* just to be sure */ - - .space 0x2000 /* space for tmpstk - temporary stack */ -tmpstk: - - .globl bootinfo -bootinfo: .space BOOTINFO_SIZE /* bootinfo that we can handle */ - - .globl KERNend -KERNend: .long 0 /* phys addr end of kernel (just after bss) */ -physfree: .long 0 /* phys addr of next free page */ - - .globl IdlePTD -IdlePTD: .long 0 /* phys addr of kernel PTD */ - -#if defined(PAE) || defined(PAE_TABLES) - .globl IdlePDPT -IdlePDPT: .long 0 /* phys addr of kernel PDPT */ -#endif - - .globl KPTmap -KPTmap: .long 0 /* address of kernel page tables */ - - .globl KPTphys -KPTphys: .long 0 /* phys addr of kernel page tables */ - - .globl proc0kstack -proc0kstack: .long 0 /* address of proc 0 kstack space */ -p0kpa: .long 0 /* phys addr of proc0's STACK */ - -vm86phystk: .long 0 /* PA of vm86/bios stack */ - - .globl vm86paddr, vm86pa -vm86paddr: .long 0 /* address of vm86 region */ -vm86pa: .long 0 /* phys addr of vm86 region */ - -/********************************************************************** - * - * Some handy macros - * - */ - -#define R(foo) ((foo)-KERNBASE) - -#define ALLOCPAGES(foo) \ - movl R(physfree), %esi ; \ - movl $((foo)*PAGE_SIZE), %eax ; \ - addl %esi, %eax ; \ - movl %eax, R(physfree) ; \ - movl %esi, %edi ; \ - movl $((foo)*PAGE_SIZE),%ecx ; \ - xorl %eax,%eax ; \ - cld ; \ - rep ; \ - stosb - -/* - * fillkpt - * eax = page frame address - * ebx = index into page table - * ecx = how many pages to map - * base = base address of page dir/table - * prot = protection bits - */ -#define fillkpt(base, prot) \ - shll $PTESHIFT,%ebx ; \ - addl base,%ebx ; \ - orl $PG_V,%eax ; \ - orl prot,%eax ; \ -1: movl %eax,(%ebx) ; \ - addl $PAGE_SIZE,%eax ; /* increment physical address */ \ - addl $PTESIZE,%ebx ; /* next pte */ \ - loop 1b - -/* - * fillkptphys(prot) - * eax = physical address - * ecx = how many pages to map - * prot = protection bits - */ -#define fillkptphys(prot) \ - movl %eax, %ebx ; \ - shrl $PAGE_SHIFT, %ebx ; \ - fillkpt(R(KPTphys), prot) - - .text -/********************************************************************** - * - * This is where the bootblocks start us, set the ball rolling... - * - */ -NON_GPROF_ENTRY(btext) - -/* Tell the bios to warmboot next time */ - movw $0x1234,0x472 - -/* Set up a real frame in case the double return in newboot is executed. */ - pushl %ebp - movl %esp, %ebp - -/* Don't trust what the BIOS gives for eflags. */ - pushl $PSL_KERNEL - popfl - -/* - * Don't trust what the BIOS gives for %fs and %gs. Trust the bootstrap - * to set %cs, %ds, %es and %ss. - */ - mov %ds, %ax - mov %ax, %fs - mov %ax, %gs - -/* - * Clear the bss. Not all boot programs do it, and it is our job anyway. - * - * XXX we don't check that there is memory for our bss and page tables - * before using it. - * - * Note: we must be careful to not overwrite an active gdt or idt. They - * inactive from now until we switch to new ones, since we don't load any - * more segment registers or permit interrupts until after the switch. - */ - movl $R(end),%ecx - movl $R(edata),%edi - subl %edi,%ecx - xorl %eax,%eax - cld - rep - stosb - - call recover_bootinfo - -/* Get onto a stack that we can trust. */ -/* - * XXX this step is delayed in case recover_bootinfo needs to return via - * the old stack, but it need not be, since recover_bootinfo actually - * returns via the old frame. - */ - movl $R(tmpstk),%esp - - call identify_cpu - call create_pagetables - -/* - * If the CPU has support for VME, turn it on. - */ - testl $CPUID_VME, R(cpu_feature) - jz 1f - movl %cr4, %eax - orl $CR4_VME, %eax - movl %eax, %cr4 -1: - -/* Now enable paging */ -#if defined(PAE) || defined(PAE_TABLES) - movl R(IdlePDPT), %eax - movl %eax, %cr3 - movl %cr4, %edx - orl $CR4_PAE, %edx - movl %edx, %cr4 -#else - movl R(IdlePTD), %eax - movl %eax,%cr3 /* load ptd addr into mmu */ -#endif - movl %cr0,%edx /* get control word */ - orl $CR0_PE|CR0_PG,%edx /* enable paging */ - movl %edx,%cr0 /* and let's page NOW! */ - - pushl $begin /* jump to high virtualized address */ - ret - -begin: - /* - * Now running relocated at KERNBASE where the system is linked to run. - * - * Remove the lowest part of the double mapping of low memory to get - * some null pointer checks. - */ - movl $0,PTD - movl %eax,%cr3 /* invalidate TLB */ - - /* set up bootstrap stack */ - movl proc0kstack,%eax /* location of in-kernel stack */ - - /* - * Only use bottom page for init386(). init386() calculates the - * PCB + FPU save area size and returns the true top of stack. - */ - leal PAGE_SIZE(%eax),%esp - - xorl %ebp,%ebp /* mark end of frames */ - - pushl physfree /* value of first for init386(first) */ - call init386 /* wire 386 chip for unix operation */ - - /* - * Clean up the stack in a way that db_numargs() understands, so - * that backtraces in ddb don't underrun the stack. Traps for - * inaccessible memory are more fatal than usual this early. - */ - addl $4,%esp - - /* Switch to true top of stack. */ - movl %eax,%esp - - call mi_startup /* autoconfiguration, mountroot etc */ - /* NOTREACHED */ - addl $0,%esp /* for db_numargs() again */ - -/* * Signal trampoline, copied to top of user stack */ NON_GPROF_ENTRY(sigcode) @@ -361,500 +115,4 @@ szfreebsd4_sigcode: .globl szosigcode szosigcode: .long esigcode-osigcode -#endif - .text - -/********************************************************************** - * - * Recover the bootinfo passed to us from the boot program - * - */ -recover_bootinfo: - /* - * This code is called in different ways depending on what loaded - * and started the kernel. This is used to detect how we get the - * arguments from the other code and what we do with them. - * - * Old disk boot blocks: - * (*btext)(howto, bootdev, cyloffset, esym); - * [return address == 0, and can NOT be returned to] - * [cyloffset was not supported by the FreeBSD boot code - * and always passed in as 0] - * [esym is also known as total in the boot code, and - * was never properly supported by the FreeBSD boot code] - * - * Old diskless netboot code: - * (*btext)(0,0,0,0,&nfsdiskless,0,0,0); - * [return address != 0, and can NOT be returned to] - * If we are being booted by this code it will NOT work, - * so we are just going to halt if we find this case. - * - * New uniform boot code: - * (*btext)(howto, bootdev, 0, 0, 0, &bootinfo) - * [return address != 0, and can be returned to] - * - * There may seem to be a lot of wasted arguments in here, but - * that is so the newer boot code can still load very old kernels - * and old boot code can load new kernels. - */ - - /* - * The old style disk boot blocks fake a frame on the stack and - * did an lret to get here. The frame on the stack has a return - * address of 0. - */ - cmpl $0,4(%ebp) - je olddiskboot - - /* - * We have some form of return address, so this is either the - * old diskless netboot code, or the new uniform code. That can - * be detected by looking at the 5th argument, if it is 0 - * we are being booted by the new uniform boot code. - */ - cmpl $0,24(%ebp) - je newboot - - /* - * Seems we have been loaded by the old diskless boot code, we - * don't stand a chance of running as the diskless structure - * changed considerably between the two, so just halt. - */ - hlt - - /* - * We have been loaded by the new uniform boot code. - * Let's check the bootinfo version, and if we do not understand - * it we return to the loader with a status of 1 to indicate this error - */ -newboot: - movl 28(%ebp),%ebx /* &bootinfo.version */ - movl BI_VERSION(%ebx),%eax - cmpl $1,%eax /* We only understand version 1 */ - je 1f - movl $1,%eax /* Return status */ - leave - /* - * XXX this returns to our caller's caller (as is required) since - * we didn't set up a frame and our caller did. - */ - ret - -1: - /* - * If we have a kernelname copy it in - */ - movl BI_KERNELNAME(%ebx),%esi - cmpl $0,%esi - je 2f /* No kernelname */ - movl $MAXPATHLEN,%ecx /* Brute force!!! */ - movl $R(kernelname),%edi - cmpb $'/',(%esi) /* Make sure it starts with a slash */ - je 1f - movb $'/',(%edi) - incl %edi - decl %ecx -1: - cld - rep - movsb - -2: - /* - * Determine the size of the boot loader's copy of the bootinfo - * struct. This is impossible to do properly because old versions - * of the struct don't contain a size field and there are 2 old - * versions with the same version number. - */ - movl $BI_ENDCOMMON,%ecx /* prepare for sizeless version */ - testl $RB_BOOTINFO,8(%ebp) /* bi_size (and bootinfo) valid? */ - je got_bi_size /* no, sizeless version */ - movl BI_SIZE(%ebx),%ecx -got_bi_size: - - /* - * Copy the common part of the bootinfo struct - */ - movl %ebx,%esi - movl $R(bootinfo),%edi - cmpl $BOOTINFO_SIZE,%ecx - jbe got_common_bi_size - movl $BOOTINFO_SIZE,%ecx -got_common_bi_size: - cld - rep - movsb - -#ifdef NFS_ROOT -#ifndef BOOTP_NFSV3 - /* - * If we have a nfs_diskless structure copy it in - */ - movl BI_NFS_DISKLESS(%ebx),%esi - cmpl $0,%esi - je olddiskboot - movl $R(nfs_diskless),%edi - movl $NFSDISKLESS_SIZE,%ecx - cld - rep - movsb - movl $R(nfs_diskless_valid),%edi - movl $1,(%edi) -#endif -#endif - - /* - * The old style disk boot. - * (*btext)(howto, bootdev, cyloffset, esym); - * Note that the newer boot code just falls into here to pick - * up howto and bootdev, cyloffset and esym are no longer used - */ -olddiskboot: - movl 8(%ebp),%eax - movl %eax,R(boothowto) - movl 12(%ebp),%eax - movl %eax,R(bootdev) - - ret - - -/********************************************************************** - * - * Identify the CPU and initialize anything special about it - * - */ -identify_cpu: - - /* Try to toggle alignment check flag; does not exist on 386. */ - pushfl - popl %eax - movl %eax,%ecx - orl $PSL_AC,%eax - pushl %eax - popfl - pushfl - popl %eax - xorl %ecx,%eax - andl $PSL_AC,%eax - pushl %ecx - popfl - - testl %eax,%eax - jnz try486 - - /* NexGen CPU does not have aligment check flag. */ - pushfl - movl $0x5555, %eax - xorl %edx, %edx - movl $2, %ecx - clc - divl %ecx - jz trynexgen - popfl - movl $CPU_386,R(cpu) - jmp 3f - -trynexgen: - popfl - movl $CPU_NX586,R(cpu) - movl $0x4778654e,R(cpu_vendor) # store vendor string - movl $0x72446e65,R(cpu_vendor+4) - movl $0x6e657669,R(cpu_vendor+8) - movl $0,R(cpu_vendor+12) - jmp 3f - -try486: /* Try to toggle identification flag; does not exist on early 486s. */ - pushfl - popl %eax - movl %eax,%ecx - xorl $PSL_ID,%eax - pushl %eax - popfl - pushfl - popl %eax - xorl %ecx,%eax - andl $PSL_ID,%eax - pushl %ecx - popfl - - testl %eax,%eax - jnz trycpuid - movl $CPU_486,R(cpu) - - /* - * Check Cyrix CPU - * Cyrix CPUs do not change the undefined flags following - * execution of the divide instruction which divides 5 by 2. - * - * Note: CPUID is enabled on M2, so it passes another way. - */ - pushfl - movl $0x5555, %eax - xorl %edx, %edx - movl $2, %ecx - clc - divl %ecx - jnc trycyrix - popfl - jmp 3f /* You may use Intel CPU. */ - -trycyrix: - popfl - /* - * IBM Bluelighting CPU also doesn't change the undefined flags. - * Because IBM doesn't disclose the information for Bluelighting - * CPU, we couldn't distinguish it from Cyrix's (including IBM - * brand of Cyrix CPUs). - */ - movl $0x69727943,R(cpu_vendor) # store vendor string - movl $0x736e4978,R(cpu_vendor+4) - movl $0x64616574,R(cpu_vendor+8) - jmp 3f - -trycpuid: /* Use the `cpuid' instruction. */ - xorl %eax,%eax - cpuid # cpuid 0 - movl %eax,R(cpu_high) # highest capability - movl %ebx,R(cpu_vendor) # store vendor string - movl %edx,R(cpu_vendor+4) - movl %ecx,R(cpu_vendor+8) - movb $0,R(cpu_vendor+12) - - movl $1,%eax - cpuid # cpuid 1 - movl %eax,R(cpu_id) # store cpu_id - movl %ebx,R(cpu_procinfo) # store cpu_procinfo - movl %edx,R(cpu_feature) # store cpu_feature - movl %ecx,R(cpu_feature2) # store cpu_feature2 - rorl $8,%eax # extract family type - andl $15,%eax - cmpl $5,%eax - jae 1f - - /* less than Pentium; must be 486 */ - movl $CPU_486,R(cpu) - jmp 3f -1: - /* a Pentium? */ - cmpl $5,%eax - jne 2f - movl $CPU_586,R(cpu) - jmp 3f -2: - /* Greater than Pentium...call it a Pentium Pro */ - movl $CPU_686,R(cpu) -3: - ret - - -/********************************************************************** - * - * Create the first page directory and its page tables. - * - */ - -create_pagetables: - -/* Find end of kernel image (rounded up to a page boundary). */ - movl $R(_end),%esi - -/* Include symbols, if any. */ - movl R(bootinfo+BI_ESYMTAB),%edi - testl %edi,%edi - je over_symalloc - movl %edi,%esi - movl $KERNBASE,%edi - addl %edi,R(bootinfo+BI_SYMTAB) - addl %edi,R(bootinfo+BI_ESYMTAB) -over_symalloc: - -/* If we are told where the end of the kernel space is, believe it. */ - movl R(bootinfo+BI_KERNEND),%edi - testl %edi,%edi - je no_kernend - movl %edi,%esi -no_kernend: - - addl $PDRMASK,%esi /* Play conservative for now, and */ - andl $~PDRMASK,%esi /* ... round up to PDR boundary */ - movl %esi,R(KERNend) /* save end of kernel */ - movl %esi,R(physfree) /* next free page is at end of kernel */ - -/* Allocate Kernel Page Tables */ - ALLOCPAGES(NKPT) - movl %esi,R(KPTphys) - addl $(KERNBASE-(KPTDI<<(PDRSHIFT-PAGE_SHIFT+PTESHIFT))),%esi - movl %esi,R(KPTmap) - -/* Allocate Page Table Directory */ -#if defined(PAE) || defined(PAE_TABLES) - /* XXX only need 32 bytes (easier for now) */ - ALLOCPAGES(1) - movl %esi,R(IdlePDPT) -#endif - ALLOCPAGES(NPGPTD) - movl %esi,R(IdlePTD) - -/* Allocate KSTACK */ - ALLOCPAGES(TD0_KSTACK_PAGES) - movl %esi,R(p0kpa) - addl $KERNBASE, %esi - movl %esi, R(proc0kstack) - - ALLOCPAGES(1) /* vm86/bios stack */ - movl %esi,R(vm86phystk) - - ALLOCPAGES(3) /* pgtable + ext + IOPAGES */ - movl %esi,R(vm86pa) - addl $KERNBASE, %esi - movl %esi, R(vm86paddr) - -/* - * Enable PSE and PGE. - */ -#ifndef DISABLE_PSE - testl $CPUID_PSE, R(cpu_feature) - jz 1f - movl $PG_PS, R(pseflag) - movl %cr4, %eax - orl $CR4_PSE, %eax - movl %eax, %cr4 -1: -#endif -#ifndef DISABLE_PG_G - testl $CPUID_PGE, R(cpu_feature) - jz 2f - movl $PG_G, R(pgeflag) - movl %cr4, %eax - orl $CR4_PGE, %eax - movl %eax, %cr4 -2: -#endif - -/* - * Initialize page table pages mapping physical address zero through the - * (physical) end of the kernel. Many of these pages must be reserved, - * and we reserve them all and map them linearly for convenience. We do - * this even if we've enabled PSE above; we'll just switch the corresponding - * kernel PDEs before we turn on paging. - * - * XXX: We waste some pages here in the PSE case! - * - * This and all other page table entries allow read and write access for - * various reasons. Kernel mappings never have any access restrictions. - */ - xorl %eax, %eax - movl R(KERNend),%ecx - shrl $PAGE_SHIFT,%ecx - fillkptphys($PG_RW) - -/* Map page table pages. */ - movl R(KPTphys),%eax - movl $NKPT,%ecx - fillkptphys($PG_RW) - -/* Map page directory. */ -#if defined(PAE) || defined(PAE_TABLES) - movl R(IdlePDPT), %eax - movl $1, %ecx - fillkptphys($PG_RW) -#endif - - movl R(IdlePTD), %eax - movl $NPGPTD, %ecx - fillkptphys($PG_RW) - -/* Map proc0's KSTACK in the physical way ... */ - movl R(p0kpa), %eax - movl $(TD0_KSTACK_PAGES), %ecx - fillkptphys($PG_RW) - -/* Map ISA hole */ - movl $ISA_HOLE_START, %eax - movl $ISA_HOLE_LENGTH>>PAGE_SHIFT, %ecx - fillkptphys($PG_RW) - -/* Map space for the vm86 region */ - movl R(vm86phystk), %eax - movl $4, %ecx - fillkptphys($PG_RW) - -/* Map page 0 into the vm86 page table */ - movl $0, %eax - movl $0, %ebx - movl $1, %ecx - fillkpt(R(vm86pa), $PG_RW|PG_U) - -/* ...likewise for the ISA hole */ - movl $ISA_HOLE_START, %eax - movl $ISA_HOLE_START>>PAGE_SHIFT, %ebx - movl $ISA_HOLE_LENGTH>>PAGE_SHIFT, %ecx - fillkpt(R(vm86pa), $PG_RW|PG_U) - -/* - * Create an identity mapping for low physical memory, including the kernel. - * This is only used to map the 2 instructions for jumping to 'begin' in - * locore (we map everything to avoid having to determine where these - * instructions are). ACPI resume will transiently restore the first PDE in - * this mapping (and depend on this PDE's page table created here not being - * destroyed). See pmap_bootstrap() for more details. - * - * Note: There are errata concerning large pages and physical address zero, - * so a PG_PS mapping should not be used for PDE 0. Our double mapping - * avoids this automatically by not using PG_PS for PDE #KPDI so that PAT - * bits can be set at the page level for i/o pages below 1 MB. - */ - movl R(KPTphys), %eax - xorl %ebx, %ebx - movl $NKPT, %ecx - fillkpt(R(IdlePTD), $PG_RW) - -/* - * Install PDEs for PTs covering enough kva to bootstrap. Then for the PSE - * case, replace the PDEs whose coverage is strictly within the kernel - * (between KERNLOAD (rounded up) and KERNend) by large-page PDEs. - */ - movl R(KPTphys), %eax - movl $KPTDI, %ebx - movl $NKPT, %ecx - fillkpt(R(IdlePTD), $PG_RW) - cmpl $0,R(pseflag) - je done_pde - - movl R(KERNend), %ecx - movl $(KERNLOAD + PDRMASK) & ~PDRMASK, %eax - subl %eax, %ecx - shrl $PDRSHIFT, %ecx - movl $KPTDI + ((KERNLOAD + PDRMASK) >> PDRSHIFT), %ebx - shll $PDESHIFT, %ebx - addl R(IdlePTD), %ebx - orl $(PG_V|PG_RW|PG_PS), %eax -1: movl %eax, (%ebx) - addl $(1 << PDRSHIFT), %eax - addl $PDESIZE, %ebx - loop 1b - -done_pde: -/* install a pde recursively mapping page directory as a page table */ - movl R(IdlePTD), %eax - movl $PTDPTDI, %ebx - movl $NPGPTD,%ecx - fillkpt(R(IdlePTD), $PG_RW) - -#if defined(PAE) || defined(PAE_TABLES) - movl R(IdlePTD), %eax - xorl %ebx, %ebx - movl $NPGPTD, %ecx - fillkpt(R(IdlePDPT), $0x0) -#endif - - ret - -#ifdef XENHVM -/* Xen Hypercall page */ - .text -.p2align PAGE_SHIFT, 0x90 /* Hypercall_page needs to be PAGE aligned */ - -NON_GPROF_ENTRY(hypercall_page) - .skip 0x1000, 0x90 /* Fill with "nop"s */ #endif From owner-svn-src-all@freebsd.org Tue Feb 6 00:19:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D425DEDB462; Tue, 6 Feb 2018 00:19:47 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 883626962A; Tue, 6 Feb 2018 00:19:47 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6284B101C1; Tue, 6 Feb 2018 00:19:47 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w160Jlhb076254; Tue, 6 Feb 2018 00:19:47 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w160Jl1W076251; Tue, 6 Feb 2018 00:19:47 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201802060019.w160Jl1W076251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Tue, 6 Feb 2018 00:19:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328914 - in head/sys: kern ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in head/sys: kern ufs/ffs X-SVN-Commit-Revision: 328914 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 00:19:48 -0000 Author: mckusick Date: Tue Feb 6 00:19:46 2018 New Revision: 328914 URL: https://svnweb.freebsd.org/changeset/base/328914 Log: Occasional cylinder-group check-hash errors were being reported on systems running with a heavy filesystem load. Tracking down this bug was elusive because there were actually two problems. Sometimes the in-memory check hash was wrong and sometimes the check hash computed when doing the read was wrong. The occurrence of either error caused a check-hash mismatch to be reported. The first error was that the check hash in the in-memory cylinder group was incorrect. This error was caused by the following sequence of events: - We read a cylinder-group buffer and the check hash is valid. - We update its cg_time and cg_old_time which makes the in-memory check-hash value invalid but we do not mark the cylinder group dirty. - We do not make any other changes to the cylinder group, so we never mark it dirty, thus do not write it out, and hence never update the incorrect check hash for the in-memory buffer. - Later, the buffer gets freed, but the page with the old incorrect check hash is still in the VM cache. - Later, we read the cylinder group again, and the first page with the old check hash is still in the VM cache, but some other pages are not, so we have to do a read. - The read does not actually get the first page from disk, but rather from the VM cache, resulting in the old check hash in the buffer. - The value computed after doing the read does not match causing the error to be printed. The fix for this problem is to only set cg_time and cg_old_time as the cylinder group is being written to disk. This keeps the in-memory check-hash valid unless the cylinder group has had other modifications which will require it to be written with a new check hash calculated. It also requires that the check hash be recalculated in the in-memory cylinder group when it is marked clean after doing a background write. The second problem was that the check hash computed at the end of the read was incorrect because the calculation of the check hash on completion of the read was being done too soon. - When a read completes we had the following sequence: - bufdone() -- b_ckhashcalc (calculates check hash) -- bufdone_finish() --- vfs_vmio_iodone() (replaces bogus pages with the cached ones) - When we are reading a buffer where one or more pages are already in memory (but not all pages, or we wouldn't be doing the read), the I/O is done with bogus_page mapped in for the pages that exist in the VM cache. This mapping is done to avoid corrupting the cached pages if there is any I/O overrun. The vfs_vmio_iodone() function is responsible for replacing the bogus_page(s) with the cached ones. But we were calculating the check hash before the bogus_page(s) were replaced. Hence, when we were calculating the check hash, we were partly reading from bogus_page, which means we calculated a bad check hash (e.g., because multiple pages have been mapped to bogus_page, so its contents are indeterminate). The second fix is to move the check-hash calculation from bufdone() to bufdone_finish() after the call to vfs_vmio_iodone() so that it computes the check hash over the correct set of pages. With these two changes, the occasional cylinder-group check-hash errors are gone. Submitted by: David Pfitzner Reviewed by: kib Tested by: David Pfitzner Modified: head/sys/kern/vfs_bio.c head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Tue Feb 6 00:02:30 2018 (r328913) +++ head/sys/kern/vfs_bio.c Tue Feb 6 00:19:46 2018 (r328914) @@ -4075,10 +4075,6 @@ bufdone(struct buf *bp) runningbufwakeup(bp); if (bp->b_iocmd == BIO_WRITE) dropobj = bp->b_bufobj; - else if ((bp->b_flags & B_CKHASH) != 0) { - KASSERT(buf_mapped(bp), ("biodone: bp %p not mapped", bp)); - (*bp->b_ckhashcalc)(bp); - } /* call optional completion function if requested */ if (bp->b_iodone != NULL) { biodone = bp->b_iodone; @@ -4114,6 +4110,13 @@ bufdone_finish(struct buf *bp) !(bp->b_ioflags & BIO_ERROR)) bp->b_flags |= B_CACHE; vfs_vmio_iodone(bp); + } + if ((bp->b_flags & B_CKHASH) != 0) { + KASSERT(bp->b_iocmd == BIO_READ, + ("bufdone_finish: b_iocmd %d not BIO_READ", bp->b_iocmd)); + KASSERT(buf_mapped(bp), + ("bufdone_finish: bp %p not mapped", bp)); + (*bp->b_ckhashcalc)(bp); } /* Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Tue Feb 6 00:02:30 2018 (r328913) +++ head/sys/ufs/ffs/ffs_alloc.c Tue Feb 6 00:19:46 2018 (r328914) @@ -2667,9 +2667,18 @@ ffs_getcg(fs, devvp, cg, bpp, cgpp) } bp->b_flags &= ~B_CKHASH; bp->b_xflags |= BX_BKGRDWRITE; + /* + * If we are using check hashes on the cylinder group then we want + * to limit changing the cylinder group time to when we are actually + * going to write it to disk so that its check hash remains correct + * in memory. If the CK_CYLGRP flag is set the time is updated in + * ffs_bufwrite() as the buffer is queued for writing. Otherwise we + * update the time here as we have done historically. + */ if ((fs->fs_metackhash & CK_CYLGRP) != 0) bp->b_xflags |= BX_CYLGRP; - cgp->cg_old_time = cgp->cg_time = time_second; + else + cgp->cg_old_time = cgp->cg_time = time_second; *bpp = bp; *cgpp = cgp; return (0); Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Tue Feb 6 00:02:30 2018 (r328913) +++ head/sys/ufs/ffs/ffs_vfsops.c Tue Feb 6 00:19:46 2018 (r328914) @@ -2082,6 +2082,7 @@ static int ffs_bufwrite(struct buf *bp) { struct buf *newbp; + struct cg *cgp; CTR3(KTR_BUF, "bufwrite(%p) vp %p flags %X", bp, bp->b_vp, bp->b_flags); if (bp->b_flags & B_INVAL) { @@ -2163,8 +2164,16 @@ ffs_bufwrite(struct buf *bp) /* * Initiate write on the copy, release the original. The * BKGRDINPROG flag prevents it from going away until - * the background write completes. + * the background write completes. We have to recalculate + * its check hash in case the buffer gets freed and then + * reconstituted from the buffer cache during a later read. */ + if ((bp->b_xflags & BX_CYLGRP) != 0) { + cgp = (struct cg *)bp->b_data; + cgp->cg_ckhash = 0; + cgp->cg_ckhash = + calculate_crc32c(~0L, bp->b_data, bp->b_bcount); + } bqrelse(bp); bp = newbp; } else @@ -2174,6 +2183,13 @@ ffs_bufwrite(struct buf *bp) /* Let the normal bufwrite do the rest for us */ normal_write: + /* + * If we are writing a cylinder group, update its time. + */ + if ((bp->b_xflags & BX_CYLGRP) != 0) { + cgp = (struct cg *)bp->b_data; + cgp->cg_old_time = cgp->cg_time = time_second; + } return (bufwrite(bp)); } From owner-svn-src-all@freebsd.org Tue Feb 6 04:16:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B04C1EF0FBE; Tue, 6 Feb 2018 04:16:01 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5379A73B18; Tue, 6 Feb 2018 04:16:01 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4E56312CB6; Tue, 6 Feb 2018 04:16:01 +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 w164G15d096975; Tue, 6 Feb 2018 04:16:01 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w164G0va096970; Tue, 6 Feb 2018 04:16:00 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201802060416.w164G0va096970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 6 Feb 2018 04:16:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328916 - in head/sys: kern vm X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys: kern vm X-SVN-Commit-Revision: 328916 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 04:16:02 -0000 Author: glebius Date: Tue Feb 6 04:16:00 2018 New Revision: 328916 URL: https://svnweb.freebsd.org/changeset/base/328916 Log: Followup on r302393 by cperciva, improving calculation of boot pages required for UMA startup. o Introduce another stage of UMA startup, which is entered after vm_page_startup() finishes. After this stage we don't yet enable buckets, but we can ask VM for pages. Rename stages to meaningful names while here. New list of stages: BOOT_COLD, BOOT_STRAPPED, BOOT_PAGEALLOC, BOOT_BUCKETS, BOOT_RUNNING. Enabling page alloc earlier allows us to dramatically reduce number of boot pages required. What is more important number of zones becomes consistent across different machines, as no MD allocations are done before the BOOT_PAGEALLOC stage. Now only UMA internal zones actually need to use startup_alloc(), however that may change, so vm_page_startup() provides its need for early zones as argument. o Introduce uma_startup_count() function, to avoid code duplication. The functions calculates sizes of zones zone and kegs zone, and calculates how many pages UMA will need to bootstrap. It counts not only of zone structures, but also of kegs, slabs and hashes. o Hide uma_startup_foo() declarations from public file. o Provide several DIAGNOSTIC printfs on boot_pages usage. o Bugfix: when calculating zone of zones size use (mp_maxid + 1) instead of mp_ncpus. Use resulting number not only in the size argument to zone_ctor() but also as args.size. Reviewed by: imp, gallatin (earlier version) Differential Revision: https://reviews.freebsd.org/D14054 Modified: head/sys/kern/kern_malloc.c head/sys/vm/uma.h head/sys/vm/uma_core.c head/sys/vm/uma_int.h head/sys/vm/vm_page.c Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Tue Feb 6 02:13:44 2018 (r328915) +++ head/sys/kern/kern_malloc.c Tue Feb 6 04:16:00 2018 (r328916) @@ -96,6 +96,8 @@ __FBSDID("$FreeBSD$"); dtrace_malloc_probe_func_t dtrace_malloc_probe; #endif +extern void uma_startup2(void); + #if defined(INVARIANTS) || defined(MALLOC_MAKE_FAILURES) || \ defined(DEBUG_MEMGUARD) || defined(DEBUG_REDZONE) #define MALLOC_DEBUG 1 Modified: head/sys/vm/uma.h ============================================================================== --- head/sys/vm/uma.h Tue Feb 6 02:13:44 2018 (r328915) +++ head/sys/vm/uma.h Tue Feb 6 04:16:00 2018 (r328916) @@ -431,40 +431,6 @@ typedef void *(*uma_alloc)(uma_zone_t zone, vm_size_t typedef void (*uma_free)(void *item, vm_size_t size, uint8_t pflag); /* - * Sets up the uma allocator. (Called by vm_mem_init) - * - * Arguments: - * bootmem A pointer to memory used to bootstrap the system. - * - * Returns: - * Nothing - * - * Discussion: - * This memory is used for zones which allocate things before the - * backend page supplier can give us pages. It should be - * UMA_SLAB_SIZE * boot_pages bytes. (see uma_int.h) - * - */ - -void uma_startup(void *bootmem, int boot_pages); - -/* - * Finishes starting up the allocator. This should - * be called when kva is ready for normal allocs. - * - * Arguments: - * None - * - * Returns: - * Nothing - * - * Discussion: - * uma_startup2 is called by kmeminit() to enable us of uma for malloc. - */ - -void uma_startup2(void); - -/* * Reclaims unused memory for all zones * * Arguments: Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Feb 6 02:13:44 2018 (r328915) +++ head/sys/vm/uma_core.c Tue Feb 6 04:16:00 2018 (r328916) @@ -149,9 +149,8 @@ static unsigned long uma_kmem_limit = LONG_MAX; static volatile unsigned long uma_kmem_total; /* Is the VM done starting up? */ -static int booted = 0; -#define UMA_STARTUP 1 -#define UMA_STARTUP2 2 +static enum { BOOT_COLD = 0, BOOT_STRAPPED, BOOT_PAGEALLOC, BOOT_BUCKETS, + BOOT_RUNNING } booted = BOOT_COLD; /* * This is the handle used to schedule events that need to happen @@ -226,6 +225,11 @@ enum zfreeskip { SKIP_NONE = 0, SKIP_DTOR, SKIP_FINI } /* Prototypes.. */ +int uma_startup_count(int); +void uma_startup(void *, int); +void uma_startup1(void); +void uma_startup2(void); + static void *noobj_alloc(uma_zone_t, vm_size_t, int, uint8_t *, int); static void *page_alloc(uma_zone_t, vm_size_t, int, uint8_t *, int); static void *startup_alloc(uma_zone_t, vm_size_t, int, uint8_t *, int); @@ -1084,6 +1088,11 @@ startup_alloc(uma_zone_t zone, vm_size_t bytes, int do * Check our small startup cache to see if it has pages remaining. */ mtx_lock(&uma_boot_pages_mtx); +#ifdef DIAGNOSTIC + if (booted < BOOT_PAGEALLOC) + printf("%s from \"%s\", %d boot pages left\n", __func__, + zone->uz_name, boot_pages); +#endif if (pages <= boot_pages) { mem = bootmem; boot_pages -= pages; @@ -1093,7 +1102,7 @@ startup_alloc(uma_zone_t zone, vm_size_t bytes, int do return (mem); } mtx_unlock(&uma_boot_pages_mtx); - if (booted < UMA_STARTUP2) + if (booted < BOOT_PAGEALLOC) panic("UMA: Increase vm.boot_pages"); /* * Now that we've booted reset these users to their real allocator. @@ -1472,7 +1481,7 @@ keg_ctor(void *mem, int size, void *udata, int flags) * If we haven't booted yet we need allocations to go through the * startup cache until the vm is ready. */ - if (booted < UMA_STARTUP2) + if (booted < BOOT_PAGEALLOC) keg->uk_allocf = startup_alloc; #ifdef UMA_MD_SMALL_ALLOC else if (keg->uk_ppera == 1) @@ -1770,25 +1779,63 @@ zone_foreach(void (*zfunc)(uma_zone_t)) rw_runlock(&uma_rwlock); } -/* Public functions */ -/* See uma.h */ +/* + * Count how many pages do we need to bootstrap. VM supplies + * its need in early zones in the argument, we add up our zones, + * which consist of: UMA Slabs, UMA Hash and 9 Bucket zones. The + * zone of zones and zone of kegs are accounted separately. + */ +#define UMA_BOOT_ZONES 11 +static int zsize, ksize; +int +uma_startup_count(int zones) +{ + int pages; + + ksize = sizeof(struct uma_keg) + + (sizeof(struct uma_domain) * vm_ndomains); + zsize = sizeof(struct uma_zone) + + (sizeof(struct uma_cache) * (mp_maxid + 1)) + + (sizeof(struct uma_zone_domain) * vm_ndomains); + + /* Memory for the zone of zones and zone of kegs. */ + pages = howmany(roundup(zsize, CACHE_LINE_SIZE) * 2 + + roundup(ksize, CACHE_LINE_SIZE), PAGE_SIZE); + + zones += UMA_BOOT_ZONES; + + /* Memory for startup zones, UMA and VM, ... */ + if (zsize > UMA_SLAB_SIZE) + pages += zones * howmany(zsize, UMA_SLAB_SIZE); + else + pages += howmany(zones, UMA_SLAB_SIZE / zsize); + + /* ... and their kegs. */ + pages += howmany(ksize * zones, UMA_SLAB_SIZE); + + /* + * Take conservative approach that every zone + * is going to allocate hash. + */ + pages += howmany(sizeof(struct slabhead *) * UMA_HASH_SIZE_INIT * + zones, UMA_SLAB_SIZE); + + return (pages); +} + void uma_startup(void *mem, int npages) { struct uma_zctor_args args; uma_keg_t masterkeg; uintptr_t m; - int zsize; - int ksize; +#ifdef DIAGNOSTIC + printf("Entering %s with %d boot pages configured\n", __func__, npages); +#endif + rw_init(&uma_rwlock, "UMA lock"); - ksize = sizeof(struct uma_keg) + - (sizeof(struct uma_domain) * vm_ndomains); - zsize = sizeof(struct uma_zone) + - (sizeof(struct uma_cache) * mp_ncpus) + - (sizeof(struct uma_zone_domain) * vm_ndomains); - /* Use bootpages memory for the zone of zones and zone of kegs. */ m = (uintptr_t)mem; zones = (uma_zone_t)m; @@ -1819,9 +1866,7 @@ uma_startup(void *mem, int npages) boot_pages = npages; args.name = "UMA Zones"; - args.size = sizeof(struct uma_zone) + - (sizeof(struct uma_cache) * (mp_maxid + 1)) + - (sizeof(struct uma_zone_domain) * vm_ndomains); + args.size = zsize; args.ctor = zone_ctor; args.dtor = zone_dtor; args.uminit = zero_init; @@ -1844,27 +1889,37 @@ uma_startup(void *mem, int npages) bucket_init(); - booted = UMA_STARTUP; + booted = BOOT_STRAPPED; } -/* see uma.h */ void +uma_startup1(void) +{ + +#ifdef DIAGNOSTIC + printf("Entering %s with %d boot pages left\n", __func__, boot_pages); +#endif + booted = BOOT_PAGEALLOC; +} + +void uma_startup2(void) { - booted = UMA_STARTUP2; - bucket_enable(); + + booted = BOOT_BUCKETS; sx_init(&uma_drain_lock, "umadrain"); + bucket_enable(); } /* * Initialize our callout handle * */ - static void uma_startup3(void) { + booted = BOOT_RUNNING; callout_init(&uma_callout, 1); callout_reset(&uma_callout, UMA_TIMEOUT * hz, uma_timeout, NULL); } @@ -1884,6 +1939,7 @@ uma_kcreate(uma_zone_t zone, size_t size, uma_init umi return (zone_alloc_item(kegs, &args, UMA_ANYDOMAIN, M_WAITOK)); } +/* Public functions */ /* See uma.h */ void uma_set_align(int align) @@ -1932,7 +1988,7 @@ uma_zcreate(const char *name, size_t size, uma_ctor ct args.flags = flags; args.keg = NULL; - if (booted < UMA_STARTUP2) { + if (booted < BOOT_BUCKETS) { locked = false; } else { sx_slock(&uma_drain_lock); @@ -1966,7 +2022,7 @@ uma_zsecond_create(char *name, uma_ctor ctor, uma_dtor args.flags = keg->uk_flags | UMA_ZONE_SECONDARY; args.keg = keg; - if (booted < UMA_STARTUP2) { + if (booted < BOOT_BUCKETS) { locked = false; } else { sx_slock(&uma_drain_lock); Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Tue Feb 6 02:13:44 2018 (r328915) +++ head/sys/vm/uma_int.h Tue Feb 6 04:16:00 2018 (r328916) @@ -134,10 +134,6 @@ #define UMA_SLAB_MASK (PAGE_SIZE - 1) /* Mask to get back to the page */ #define UMA_SLAB_SHIFT PAGE_SHIFT /* Number of bits PAGE_MASK */ -#define UMA_BOOT_PAGES 64 /* Pages allocated for startup */ -#define UMA_BOOT_PAGES_ZONES 32 /* Multiplier for pages to reserve */ - /* if uma_zone > PAGE_SIZE */ - /* Max waste percentage before going to off page slab management */ #define UMA_MAX_WASTE 10 Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Tue Feb 6 02:13:44 2018 (r328915) +++ head/sys/vm/vm_page.c Tue Feb 6 04:16:00 2018 (r328916) @@ -125,6 +125,10 @@ __FBSDID("$FreeBSD$"); #include +extern int uma_startup_count(int); +extern void uma_startup(void *, int); +extern void uma_startup1(void); + /* * Associated with page of user-allocatable memory is a * page structure. @@ -145,7 +149,7 @@ vm_page_t vm_page_array; long vm_page_array_size; long first_page; -static int boot_pages = UMA_BOOT_PAGES; +static int boot_pages; SYSCTL_INT(_vm, OID_AUTO, boot_pages, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &boot_pages, 0, "number of pages allocated for bootstrapping the VM system"); @@ -466,7 +470,7 @@ vm_page_startup(vm_offset_t vaddr) vm_paddr_t end, high_avail, low_avail, new_end, page_range, size; vm_paddr_t biggestsize, last_pa, pa; u_long pagecount; - int biggestone, i, pages_per_zone, segind; + int biggestone, i, segind; biggestsize = 0; biggestone = 0; @@ -496,26 +500,13 @@ vm_page_startup(vm_offset_t vaddr) vm_page_domain_init(&vm_dom[i]); /* - * Almost all of the pages needed for bootstrapping UMA are used - * for zone structures, so if the number of CPUs results in those - * structures taking more than one page each, we set aside more pages - * in proportion to the zone structure size. - */ - pages_per_zone = howmany(sizeof(struct uma_zone) + - sizeof(struct uma_cache) * (mp_maxid + 1) + - roundup2(sizeof(struct uma_slab), sizeof(void *)), UMA_SLAB_SIZE); - if (pages_per_zone > 1) { - /* Reserve more pages so that we don't run out. */ - boot_pages = UMA_BOOT_PAGES_ZONES * pages_per_zone; - } - - /* * Allocate memory for use when boot strapping the kernel memory * allocator. * * CTFLAG_RDTUN doesn't work during the early boot process, so we must * manually fetch the value. */ + boot_pages = uma_startup_count(0); TUNABLE_INT_FETCH("vm.boot_pages", &boot_pages); new_end = end - (boot_pages * UMA_SLAB_SIZE); new_end = trunc_page(new_end); @@ -748,6 +739,9 @@ vm_page_startup(vm_offset_t vaddr) * can work. */ domainset_zero(); + + /* Announce page availability to UMA. */ + uma_startup1(); return (vaddr); } From owner-svn-src-all@freebsd.org Tue Feb 6 04:28:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFB31EF1F14; Tue, 6 Feb 2018 04:28:22 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6378C74460; Tue, 6 Feb 2018 04:28:22 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E1D612E67; Tue, 6 Feb 2018 04:28:22 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w164SMQt002359; Tue, 6 Feb 2018 04:28:22 GMT (envelope-from bryanv@FreeBSD.org) Received: (from bryanv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w164SMRj002358; Tue, 6 Feb 2018 04:28:22 GMT (envelope-from bryanv@FreeBSD.org) Message-Id: <201802060428.w164SMRj002358@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bryanv set sender to bryanv@FreeBSD.org using -f From: Bryan Venteicher Date: Tue, 6 Feb 2018 04:28:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328917 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: bryanv X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 328917 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 04:28:22 -0000 Author: bryanv Date: Tue Feb 6 04:28:21 2018 New Revision: 328917 URL: https://svnweb.freebsd.org/changeset/base/328917 Log: Correct structure name used in bus_map_resource(9) example Reviewed by: jhb MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D14188 Modified: head/share/man/man9/bus_map_resource.9 Modified: head/share/man/man9/bus_map_resource.9 ============================================================================== --- head/share/man/man9/bus_map_resource.9 Tue Feb 6 04:16:00 2018 (r328916) +++ head/share/man/man9/bus_map_resource.9 Tue Feb 6 04:28:21 2018 (r328917) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 20, 2016 +.Dd February 5, 2018 .Dt BUS_MAP_RESOURCE 9 .Os .Sh NAME @@ -143,16 +143,16 @@ reads the first 32-bit word: .Bd -literal struct resource *r; struct resource_map map; - struct resource_map_args args; + struct resource_map_request req; 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); + resource_init_map_request(&req); + req.memattr = VM_MEMATTR_WRITE_COMBINING; + bus_map_resource(dev, SYS_RES_MEMORY, r, &req, &map); val = bus_read_4(&map, 0); .Ed .Sh SEE ALSO From owner-svn-src-all@freebsd.org Tue Feb 6 06:42:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DFDFED76BE; Tue, 6 Feb 2018 06:42:27 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 046B178FF2; Tue, 6 Feb 2018 06:42:27 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F37191456C; Tue, 6 Feb 2018 06:42:26 +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 w166gQYk071139; Tue, 6 Feb 2018 06:42:26 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w166gP3S071121; Tue, 6 Feb 2018 06:42:25 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201802060642.w166gP3S071121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Tue, 6 Feb 2018 06:42:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328918 - in head/sys/cam: . ata ctl mmc nvme scsi X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: in head/sys/cam: . ata ctl mmc nvme scsi X-SVN-Commit-Revision: 328918 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 06:42:27 -0000 Author: scottl Date: Tue Feb 6 06:42:25 2018 New Revision: 328918 URL: https://svnweb.freebsd.org/changeset/base/328918 Log: Return a C errno for cam_periph_acquire(). There's no compelling reason to return a cam_status type for this function and doing so only creates confusion with normal C coding practices. It's technically an API change, but the periph API isn't widely used. No efffective change to operation. Reviewed by: imp, mav, ken Sponsored by: Netflix Differential Revision: D14063 Modified: head/sys/cam/ata/ata_da.c head/sys/cam/ata/ata_pmp.c head/sys/cam/ata/ata_xpt.c head/sys/cam/cam_periph.c head/sys/cam/cam_periph.h head/sys/cam/ctl/scsi_ctl.c head/sys/cam/mmc/mmc_da.c head/sys/cam/mmc/mmc_xpt.c head/sys/cam/nvme/nvme_da.c head/sys/cam/nvme/nvme_xpt.c head/sys/cam/scsi/scsi_cd.c head/sys/cam/scsi/scsi_da.c head/sys/cam/scsi/scsi_enc.c head/sys/cam/scsi/scsi_pass.c head/sys/cam/scsi/scsi_pt.c head/sys/cam/scsi/scsi_sa.c head/sys/cam/scsi/scsi_sg.c head/sys/cam/scsi/scsi_xpt.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Tue Feb 6 04:28:21 2018 (r328917) +++ head/sys/cam/ata/ata_da.c Tue Feb 6 06:42:25 2018 (r328918) @@ -911,7 +911,7 @@ adaopen(struct disk *dp) int error; periph = (struct cam_periph *)dp->d_drv1; - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + if (cam_periph_acquire(periph) != 0) { return(ENXIO); } @@ -1328,7 +1328,7 @@ adaasync(void *callback_arg, u_int32_t code, softc->state = ADA_STATE_LOGDIR; else break; - if (cam_periph_acquire(periph) != CAM_REQ_CMP) + if (cam_periph_acquire(periph) != 0) softc->state = ADA_STATE_NORMAL; else xpt_schedule(periph, CAM_PRIORITY_DEV); @@ -1841,7 +1841,7 @@ adaregister(struct cam_periph *periph, void *arg) * We'll release this reference once GEOM calls us back (via * adadiskgonecb()) telling us that our provider has been freed. */ - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + if (cam_periph_acquire(periph) != 0) { xpt_print(periph->path, "%s: lost periph during " "registration!\n", __func__); cam_periph_lock(periph); @@ -1866,7 +1866,7 @@ adaregister(struct cam_periph *periph, void *arg) * Create our sysctl variables, now that we know * we have successfully attached. */ - if (cam_periph_acquire(periph) == CAM_REQ_CMP) + if (cam_periph_acquire(periph) == 0) taskqueue_enqueue(taskqueue_thread, &softc->sysctl_task); /* Modified: head/sys/cam/ata/ata_pmp.c ============================================================================== --- head/sys/cam/ata/ata_pmp.c Tue Feb 6 04:28:21 2018 (r328917) +++ head/sys/cam/ata/ata_pmp.c Tue Feb 6 06:42:25 2018 (r328918) @@ -315,7 +315,7 @@ pmpasync(void *callback_arg, u_int32_t code, if (code == AC_SENT_BDR || code == AC_BUS_RESET) softc->found = 0; /* We have to reset everything. */ if (softc->state == PMP_STATE_NORMAL) { - if (cam_periph_acquire(periph) == CAM_REQ_CMP) { + if (cam_periph_acquire(periph) == 0) { if (softc->pm_pid == 0x37261095 || softc->pm_pid == 0x38261095) softc->state = PMP_STATE_PM_QUIRKS_1; @@ -343,7 +343,7 @@ pmpsysctlinit(void *context, int pending) char tmpstr[32], tmpstr2[16]; periph = (struct cam_periph *)context; - if (cam_periph_acquire(periph) != CAM_REQ_CMP) + if (cam_periph_acquire(periph) != 0) return; softc = (struct pmp_softc *)periph->softc; Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Tue Feb 6 04:28:21 2018 (r328917) +++ head/sys/cam/ata/ata_xpt.c Tue Feb 6 06:42:25 2018 (r328918) @@ -280,7 +280,6 @@ static cam_status proberegister(struct cam_periph *periph, void *arg) { union ccb *request_ccb; /* CCB representing the probe request */ - cam_status status; probe_softc *softc; request_ccb = (union ccb *)arg; @@ -304,10 +303,9 @@ proberegister(struct cam_periph *periph, void *arg) periph->softc = softc; softc->periph = periph; softc->action = PROBE_INVALID; - status = cam_periph_acquire(periph); - if (status != CAM_REQ_CMP) { - return (status); - } + if (cam_periph_acquire(periph) != 0) + return (CAM_REQ_CMP_ERR); + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Probe started\n")); ata_device_transport(periph->path); probeschedule(periph); Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Tue Feb 6 04:28:21 2018 (r328917) +++ head/sys/cam/cam_periph.c Tue Feb 6 06:42:25 2018 (r328918) @@ -403,19 +403,19 @@ retry: return (count); } -cam_status +int cam_periph_acquire(struct cam_periph *periph) { - cam_status status; + int status; - status = CAM_REQ_CMP_ERR; if (periph == NULL) - return (status); + return (EINVAL); + status = ENOENT; xpt_lock_buses(); if ((periph->flags & CAM_PERIPH_INVALID) == 0) { periph->refcount++; - status = CAM_REQ_CMP; + status = 0; } xpt_unlock_buses(); @@ -482,7 +482,7 @@ cam_periph_hold(struct cam_periph *periph, int priorit * from user us while we sleep. */ - if (cam_periph_acquire(periph) != CAM_REQ_CMP) + if (cam_periph_acquire(periph) != 0) return (ENXIO); cam_periph_assert(periph, MA_OWNED); Modified: head/sys/cam/cam_periph.h ============================================================================== --- head/sys/cam/cam_periph.h Tue Feb 6 04:28:21 2018 (r328917) +++ head/sys/cam/cam_periph.h Tue Feb 6 06:42:25 2018 (r328918) @@ -159,7 +159,7 @@ cam_status cam_periph_alloc(periph_ctor_t *periph_ctor ac_callback_t *, ac_code, void *arg); struct cam_periph *cam_periph_find(struct cam_path *path, char *name); int cam_periph_list(struct cam_path *, struct sbuf *); -cam_status cam_periph_acquire(struct cam_periph *periph); +int cam_periph_acquire(struct cam_periph *periph); void cam_periph_doacquire(struct cam_periph *periph); void cam_periph_release(struct cam_periph *periph); void cam_periph_release_locked(struct cam_periph *periph); Modified: head/sys/cam/ctl/scsi_ctl.c ============================================================================== --- head/sys/cam/ctl/scsi_ctl.c Tue Feb 6 04:28:21 2018 (r328917) +++ head/sys/cam/ctl/scsi_ctl.c Tue Feb 6 06:42:25 2018 (r328918) @@ -459,7 +459,7 @@ ctlferegister(struct cam_periph *periph, void *arg) struct ctlfe_lun_softc *softc; union ccb ccb; cam_status status; - int i; + int i, acstatus; softc = (struct ctlfe_lun_softc *)arg; bus_softc = softc->parent_softc; @@ -539,11 +539,11 @@ ctlferegister(struct cam_periph *periph, void *arg) } } - status = cam_periph_acquire(periph); - if ((status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + acstatus = cam_periph_acquire(periph); + if (acstatus != 0) { xpt_print(periph->path, "%s: could not acquire reference " - "count, status = %#x\n", __func__, status); - return (status); + "count, status = %#x\n", __func__, acstatus); + return (CAM_REQ_CMP_ERR); } if (i == 0) { Modified: head/sys/cam/mmc/mmc_da.c ============================================================================== --- head/sys/cam/mmc/mmc_da.c Tue Feb 6 04:28:21 2018 (r328917) +++ head/sys/cam/mmc/mmc_da.c Tue Feb 6 06:42:25 2018 (r328918) @@ -369,7 +369,7 @@ sddaopen(struct disk *dp) int error; periph = (struct cam_periph *)dp->d_drv1; - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + if (cam_periph_acquire(periph) != 0) { return(ENXIO); } @@ -744,7 +744,7 @@ sdda_hook_into_geom(struct cam_periph *periph) * We'll release this reference once GEOM calls us back (via * sddadiskgonecb()) telling us that our provider has been freed. */ - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + if (cam_periph_acquire(periph) != 0) { xpt_print(periph->path, "%s: lost periph during " "registration!\n", __func__); cam_periph_lock(periph); Modified: head/sys/cam/mmc/mmc_xpt.c ============================================================================== --- head/sys/cam/mmc/mmc_xpt.c Tue Feb 6 04:28:21 2018 (r328917) +++ head/sys/cam/mmc/mmc_xpt.c Tue Feb 6 06:42:25 2018 (r328918) @@ -471,9 +471,9 @@ probe_periph_init() static cam_status mmcprobe_register(struct cam_periph *periph, void *arg) { - union ccb *request_ccb; /* CCB representing the probe request */ - cam_status status; mmcprobe_softc *softc; + union ccb *request_ccb; /* CCB representing the probe request */ + int status; CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("mmcprobe_register\n")); @@ -501,10 +501,10 @@ mmcprobe_register(struct cam_periph *periph, void *arg status = cam_periph_acquire(periph); memset(&periph->path->device->mmc_ident_data, 0, sizeof(struct mmc_params)); - if (status != CAM_REQ_CMP) { + if (status != 0) { printf("proberegister: cam_periph_acquire failed (status=%d)\n", status); - return (status); + return (CAM_REQ_CMP_ERR); } CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Probe started\n")); Modified: head/sys/cam/nvme/nvme_da.c ============================================================================== --- head/sys/cam/nvme/nvme_da.c Tue Feb 6 04:28:21 2018 (r328917) +++ head/sys/cam/nvme/nvme_da.c Tue Feb 6 06:42:25 2018 (r328918) @@ -260,7 +260,7 @@ ndaopen(struct disk *dp) int error; periph = (struct cam_periph *)dp->d_drv1; - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + if (cam_periph_acquire(periph) != 0) { return(ENXIO); } @@ -785,7 +785,7 @@ ndaregister(struct cam_periph *periph, void *arg) * We'll release this reference once GEOM calls us back (via * ndadiskgonecb()) telling us that our provider has been freed. */ - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + if (cam_periph_acquire(periph) != 0) { xpt_print(periph->path, "%s: lost periph during " "registration!\n", __func__); cam_periph_lock(periph); @@ -807,7 +807,7 @@ ndaregister(struct cam_periph *periph, void *arg) * Create our sysctl variables, now that we know * we have successfully attached. */ - if (cam_periph_acquire(periph) == CAM_REQ_CMP) + if (cam_periph_acquire(periph) == 0) taskqueue_enqueue(taskqueue_thread, &softc->sysctl_task); /* Modified: head/sys/cam/nvme/nvme_xpt.c ============================================================================== --- head/sys/cam/nvme/nvme_xpt.c Tue Feb 6 04:28:21 2018 (r328917) +++ head/sys/cam/nvme/nvme_xpt.c Tue Feb 6 06:42:25 2018 (r328918) @@ -198,7 +198,6 @@ static cam_status nvme_probe_register(struct cam_periph *periph, void *arg) { union ccb *request_ccb; /* CCB representing the probe request */ - cam_status status; nvme_probe_softc *softc; request_ccb = (union ccb *)arg; @@ -222,10 +221,9 @@ nvme_probe_register(struct cam_periph *periph, void *a periph->softc = softc; softc->periph = periph; softc->action = NVME_PROBE_INVALID; - status = cam_periph_acquire(periph); - if (status != CAM_REQ_CMP) { - return (status); - } + if (cam_periph_acquire(periph) != 0) + return (CAM_REQ_CMP_ERR); + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Probe started\n")); // nvme_device_transport(periph->path); Modified: head/sys/cam/scsi/scsi_cd.c ============================================================================== --- head/sys/cam/scsi/scsi_cd.c Tue Feb 6 04:28:21 2018 (r328917) +++ head/sys/cam/scsi/scsi_cd.c Tue Feb 6 06:42:25 2018 (r328918) @@ -445,7 +445,7 @@ cdasync(void *callback_arg, u_int32_t code, case AC_SCSI_AEN: softc = (struct cd_softc *)periph->softc; if (softc->state == CD_STATE_NORMAL && !softc->tur) { - if (cam_periph_acquire(periph) == CAM_REQ_CMP) { + if (cam_periph_acquire(periph) == 0) { softc->tur = 1; xpt_schedule(periph, CAM_PRIORITY_NORMAL); } @@ -480,7 +480,7 @@ cdsysctlinit(void *context, int pending) char tmpstr[32], tmpstr2[16]; periph = (struct cam_periph *)context; - if (cam_periph_acquire(periph) != CAM_REQ_CMP) + if (cam_periph_acquire(periph) != 0) return; softc = (struct cd_softc *)periph->softc; @@ -676,7 +676,7 @@ cdregister(struct cam_periph *periph, void *arg) * We'll release this reference once GEOM calls us back (via * dadiskgonecb()) telling us that our provider has been freed. */ - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + if (cam_periph_acquire(periph) != 0) { xpt_print(periph->path, "%s: lost periph during " "registration!\n", __func__); cam_periph_lock(periph); @@ -717,7 +717,7 @@ cdopen(struct disk *dp) periph = (struct cam_periph *)dp->d_drv1; softc = (struct cd_softc *)periph->softc; - if (cam_periph_acquire(periph) != CAM_REQ_CMP) + if (cam_periph_acquire(periph) != 0) return(ENXIO); cam_periph_lock(periph); @@ -2601,7 +2601,7 @@ cdmediapoll(void *arg) if (softc->state == CD_STATE_NORMAL && !softc->tur && softc->outstanding_cmds == 0) { - if (cam_periph_acquire(periph) == CAM_REQ_CMP) { + if (cam_periph_acquire(periph) == 0) { softc->tur = 1; xpt_schedule(periph, CAM_PRIORITY_NORMAL); } Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Tue Feb 6 04:28:21 2018 (r328917) +++ head/sys/cam/scsi/scsi_da.c Tue Feb 6 06:42:25 2018 (r328918) @@ -1565,7 +1565,7 @@ da_periph_acquire(struct cam_periph *periph, da_ref_to token_sanity(token); DA_PERIPH_PRINT(periph, "acquiring device %s (%d): %d\n", da_ref_text[token], token, err); - if (err == CAM_REQ_CMP) { + if (err == 0) { int cnt; struct da_softc *softc = periph->softc; @@ -1628,7 +1628,7 @@ daopen(struct disk *dp) int error; periph = (struct cam_periph *)dp->d_drv1; - if (da_periph_acquire(periph, DA_REF_OPEN) != CAM_REQ_CMP) { + if (da_periph_acquire(periph, DA_REF_OPEN) != 0) { return (ENXIO); } @@ -2061,7 +2061,7 @@ daasync(void *callback_arg, u_int32_t code, case AC_SCSI_AEN: softc = (struct da_softc *)periph->softc; if (!cam_iosched_has_work_flags(softc->cam_iosched, DA_WORK_TUR)) { - if (da_periph_acquire(periph, DA_REF_TUR) == CAM_REQ_CMP) { + if (da_periph_acquire(periph, DA_REF_TUR) == 0) { cam_iosched_set_work_flags(softc->cam_iosched, DA_WORK_TUR); daschedule(periph); } @@ -2732,7 +2732,7 @@ daregister(struct cam_periph *periph, void *arg) * We'll release this reference once GEOM calls us back (via * dadiskgonecb()) telling us that our provider has been freed. */ - if (da_periph_acquire(periph, DA_REF_GEOM) != CAM_REQ_CMP) { + if (da_periph_acquire(periph, DA_REF_GEOM) != 0) { xpt_print(periph->path, "%s: lost periph during " "registration!\n", __func__); cam_periph_lock(periph); @@ -4700,7 +4700,7 @@ dadone(struct cam_periph *periph, union ccb *done_ccb) * we have successfully attached. */ /* increase the refcount */ - if (da_periph_acquire(periph, DA_REF_SYSCTL) == CAM_REQ_CMP) { + if (da_periph_acquire(periph, DA_REF_SYSCTL) == 0) { taskqueue_enqueue(taskqueue_thread, &softc->sysctl_task); @@ -5558,7 +5558,7 @@ static void dareprobe(struct cam_periph *periph) { struct da_softc *softc; - cam_status status; + int status; softc = (struct da_softc *)periph->softc; @@ -5567,8 +5567,7 @@ dareprobe(struct cam_periph *periph) return; status = da_periph_acquire(periph, DA_REF_REPROBE); - KASSERT(status == CAM_REQ_CMP, - ("dareprobe: cam_periph_acquire failed")); + KASSERT(status == 0, ("dareprobe: cam_periph_acquire failed")); softc->state = DA_STATE_PROBE_WP; xpt_schedule(periph, CAM_PRIORITY_DEV); @@ -5666,7 +5665,7 @@ damediapoll(void *arg) if (!cam_iosched_has_work_flags(softc->cam_iosched, DA_WORK_TUR) && LIST_EMPTY(&softc->pending_ccbs)) { - if (da_periph_acquire(periph, DA_REF_TUR) == CAM_REQ_CMP) { + if (da_periph_acquire(periph, DA_REF_TUR) == 0) { cam_iosched_set_work_flags(softc->cam_iosched, DA_WORK_TUR); daschedule(periph); } Modified: head/sys/cam/scsi/scsi_enc.c ============================================================================== --- head/sys/cam/scsi/scsi_enc.c Tue Feb 6 04:28:21 2018 (r328917) +++ head/sys/cam/scsi/scsi_enc.c Tue Feb 6 06:42:25 2018 (r328918) @@ -267,7 +267,7 @@ enc_open(struct cdev *dev, int flags, int fmt, struct int error = 0; periph = (struct cam_periph *)dev->si_drv1; - if (cam_periph_acquire(periph) != CAM_REQ_CMP) + if (cam_periph_acquire(periph) != 0) return (ENXIO); cam_periph_lock(periph); @@ -859,7 +859,7 @@ enc_kproc_init(enc_softc_t *enc) callout_init_mtx(&enc->status_updater, cam_periph_mtx(enc->periph), 0); - if (cam_periph_acquire(enc->periph) != CAM_REQ_CMP) + if (cam_periph_acquire(enc->periph) != 0) return (ENXIO); result = kproc_create(enc_daemon, enc, &enc->enc_daemon, /*flags*/0, @@ -975,7 +975,7 @@ enc_ctor(struct cam_periph *periph, void *arg) * instance for it. We'll release this reference once the devfs * instance has been freed. */ - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + if (cam_periph_acquire(periph) != 0) { xpt_print(periph->path, "%s: lost periph during " "registration!\n", __func__); cam_periph_lock(periph); Modified: head/sys/cam/scsi/scsi_pass.c ============================================================================== --- head/sys/cam/scsi/scsi_pass.c Tue Feb 6 04:28:21 2018 (r328917) +++ head/sys/cam/scsi/scsi_pass.c Tue Feb 6 06:42:25 2018 (r328918) @@ -518,7 +518,6 @@ passasync(void *callback_arg, u_int32_t code, buftype = (uintptr_t)arg; if (buftype == CDAI_TYPE_PHYS_PATH) { struct pass_softc *softc; - cam_status status; softc = (struct pass_softc *)periph->softc; /* @@ -527,8 +526,7 @@ passasync(void *callback_arg, u_int32_t code, * a situation where the periph goes away before * the task queue has a chance to run. */ - status = cam_periph_acquire(periph); - if (status != CAM_REQ_CMP) + if (cam_periph_acquire(periph) != 0) break; taskqueue_enqueue(taskqueue_thread, @@ -626,7 +624,7 @@ passregister(struct cam_periph *periph, void *arg) * Acquire a reference to the periph that we can release once we've * cleaned up the kqueue. */ - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + if (cam_periph_acquire(periph) != 0) { xpt_print(periph->path, "%s: lost periph during " "registration!\n", __func__); cam_periph_lock(periph); @@ -638,7 +636,7 @@ passregister(struct cam_periph *periph, void *arg) * instance for it. We'll release this reference once the devfs * instance has been freed. */ - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + if (cam_periph_acquire(periph) != 0) { xpt_print(periph->path, "%s: lost periph during " "registration!\n", __func__); cam_periph_lock(periph); @@ -665,7 +663,7 @@ passregister(struct cam_periph *periph, void *arg) * Hold a reference to the periph before we create the physical * path alias so it can't go away. */ - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + if (cam_periph_acquire(periph) != 0) { xpt_print(periph->path, "%s: lost periph during " "registration!\n", __func__); cam_periph_lock(periph); @@ -705,7 +703,7 @@ passopen(struct cdev *dev, int flags, int fmt, struct int error; periph = (struct cam_periph *)dev->si_drv1; - if (cam_periph_acquire(periph) != CAM_REQ_CMP) + if (cam_periph_acquire(periph) != 0) return (ENXIO); cam_periph_lock(periph); Modified: head/sys/cam/scsi/scsi_pt.c ============================================================================== --- head/sys/cam/scsi/scsi_pt.c Tue Feb 6 04:28:21 2018 (r328917) +++ head/sys/cam/scsi/scsi_pt.c Tue Feb 6 06:42:25 2018 (r328918) @@ -142,7 +142,7 @@ ptopen(struct cdev *dev, int flags, int fmt, struct th int error = 0; periph = (struct cam_periph *)dev->si_drv1; - if (cam_periph_acquire(periph) != CAM_REQ_CMP) + if (cam_periph_acquire(periph) != 0) return (ENXIO); softc = (struct pt_softc *)periph->softc; Modified: head/sys/cam/scsi/scsi_sa.c ============================================================================== --- head/sys/cam/scsi/scsi_sa.c Tue Feb 6 04:28:21 2018 (r328917) +++ head/sys/cam/scsi/scsi_sa.c Tue Feb 6 06:42:25 2018 (r328918) @@ -657,7 +657,7 @@ saopen(struct cdev *dev, int flags, int fmt, struct th int error; periph = (struct cam_periph *)dev->si_drv1; - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + if (cam_periph_acquire(periph) != 0) { return (ENXIO); } @@ -2495,7 +2495,7 @@ saregister(struct cam_periph *periph, void *arg) * instances for it. We'll release this reference once the devfs * instances have been freed. */ - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + if (cam_periph_acquire(periph) != 0) { xpt_print(periph->path, "%s: lost periph during " "registration!\n", __func__); cam_periph_lock(periph); Modified: head/sys/cam/scsi/scsi_sg.c ============================================================================== --- head/sys/cam/scsi/scsi_sg.c Tue Feb 6 04:28:21 2018 (r328917) +++ head/sys/cam/scsi/scsi_sg.c Tue Feb 6 06:42:25 2018 (r328918) @@ -353,7 +353,7 @@ sgregister(struct cam_periph *periph, void *arg) * instance for it. We'll release this reference once the devfs * instance has been freed. */ - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + if (cam_periph_acquire(periph) != 0) { xpt_print(periph->path, "%s: lost periph during " "registration!\n", __func__); cam_periph_lock(periph); @@ -439,7 +439,7 @@ sgopen(struct cdev *dev, int flags, int fmt, struct th int error = 0; periph = (struct cam_periph *)dev->si_drv1; - if (cam_periph_acquire(periph) != CAM_REQ_CMP) + if (cam_periph_acquire(periph) != 0) return (ENXIO); /* Modified: head/sys/cam/scsi/scsi_xpt.c ============================================================================== --- head/sys/cam/scsi/scsi_xpt.c Tue Feb 6 04:28:21 2018 (r328917) +++ head/sys/cam/scsi/scsi_xpt.c Tue Feb 6 06:42:25 2018 (r328918) @@ -657,7 +657,6 @@ static cam_status proberegister(struct cam_periph *periph, void *arg) { union ccb *request_ccb; /* CCB representing the probe request */ - cam_status status; probe_softc *softc; request_ccb = (union ccb *)arg; @@ -681,10 +680,9 @@ proberegister(struct cam_periph *periph, void *arg) periph->softc = softc; softc->periph = periph; softc->action = PROBE_INVALID; - status = cam_periph_acquire(periph); - if (status != CAM_REQ_CMP) { - return (status); - } + if (cam_periph_acquire(periph) != 0) + return (CAM_REQ_CMP_ERR); + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Probe started\n")); scsi_devise_transport(periph->path); From owner-svn-src-all@freebsd.org Tue Feb 6 06:55:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7442ED91A0; Tue, 6 Feb 2018 06:55:55 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8E14E79635; Tue, 6 Feb 2018 06:55:55 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 88DD71471C; Tue, 6 Feb 2018 06:55:55 +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 w166ttea076106; Tue, 6 Feb 2018 06:55:55 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w166ttPw076105; Tue, 6 Feb 2018 06:55:55 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201802060655.w166ttPw076105@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Tue, 6 Feb 2018 06:55:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328919 - head/sys/dev/mps X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: head/sys/dev/mps X-SVN-Commit-Revision: 328919 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 06:55:56 -0000 Author: scottl Date: Tue Feb 6 06:55:55 2018 New Revision: 328919 URL: https://svnweb.freebsd.org/changeset/base/328919 Log: Fix a case where a request frame can be composed that requires 2 or more SGList elements, but there's only enough space in the request frame for either 1 element or a chain frame pointer. Previously, the code would hit the wrong case, add the SGList element, but then fail to add the chain frame due to lack of space. Re-arrange the code to catch this case earlier and handle it. Sponsored by: Netflix Modified: head/sys/dev/mps/mps.c Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Tue Feb 6 06:42:25 2018 (r328918) +++ head/sys/dev/mps/mps.c Tue Feb 6 06:55:55 2018 (r328919) @@ -2609,6 +2609,17 @@ mps_push_sge(struct mps_command *cm, void *sgep, size_ if (cm->cm_sglsize < MPS_SGC_SIZE) panic("MPS: Need SGE Error Code\n"); + if (segsleft >= 1 && cm->cm_sglsize < len + MPS_SGC_SIZE) { + /* + * 1 or more segment, enough room for only a chain. + * Hope the previous element wasn't a Simple entry + * that needed to be marked with + * MPI2_SGE_FLAGS_LAST_ELEMENT. Case (4). + */ + if ((error = mps_add_chain(cm)) != 0) + return (error); + } + if (segsleft >= 2 && cm->cm_sglsize < len + MPS_SGC_SIZE + MPS_SGE64_SIZE) { /* @@ -2631,17 +2642,6 @@ mps_push_sge(struct mps_command *cm, void *sgep, size_ bcopy(sgep, cm->cm_sge, len); cm->cm_sge = (MPI2_SGE_IO_UNION *)((uintptr_t)cm->cm_sge + len); return (mps_add_chain(cm)); - } - - if (segsleft >= 1 && cm->cm_sglsize < len + MPS_SGC_SIZE) { - /* - * 1 or more segment, enough room for only a chain. - * Hope the previous element wasn't a Simple entry - * that needed to be marked with - * MPI2_SGE_FLAGS_LAST_ELEMENT. Case (4). - */ - if ((error = mps_add_chain(cm)) != 0) - return (error); } #ifdef INVARIANTS From owner-svn-src-all@freebsd.org Tue Feb 6 07:47:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4415CEDED17; Tue, 6 Feb 2018 07:47:23 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ECC707B2E8; Tue, 6 Feb 2018 07:47:22 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E7BF214F2A; Tue, 6 Feb 2018 07:47:22 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w167lMVc001118; Tue, 6 Feb 2018 07:47:22 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w167lMgh001117; Tue, 6 Feb 2018 07:47:22 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201802060747.w167lMgh001117@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 6 Feb 2018 07:47:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328920 - stable/11/share/man/man4 X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/11/share/man/man4 X-SVN-Commit-Revision: 328920 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 07:47:23 -0000 Author: delphij Date: Tue Feb 6 07:47:22 2018 New Revision: 328920 URL: https://svnweb.freebsd.org/changeset/base/328920 Log: MFC r328273 (kevlo): Document how to load nmdm(4) from a kernel module. Modified: stable/11/share/man/man4/nmdm.4 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/nmdm.4 ============================================================================== --- stable/11/share/man/man4/nmdm.4 Tue Feb 6 06:55:55 2018 (r328919) +++ stable/11/share/man/man4/nmdm.4 Tue Feb 6 07:47:22 2018 (r328920) @@ -21,14 +21,26 @@ .\" .\" $FreeBSD$ .\" -.Dd January 27, 2005 +.Dd January 23, 2018 .Dt NMDM 4 .Os .Sh NAME .Nm nmdm .Nd nullmodem terminal driver .Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent .Cd "device nmdm" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +nmdm_load="YES" +.Ed .Sh DESCRIPTION The .Nm From owner-svn-src-all@freebsd.org Tue Feb 6 07:50:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A13F0EDF360; Tue, 6 Feb 2018 07:50:31 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 530DE7B52B; Tue, 6 Feb 2018 07:50:31 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4E09314F35; Tue, 6 Feb 2018 07:50:31 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w167oVP1001291; Tue, 6 Feb 2018 07:50:31 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w167oVPi001290; Tue, 6 Feb 2018 07:50:31 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201802060750.w167oVPi001290@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 6 Feb 2018 07:50:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r328921 - stable/10/share/man/man4 X-SVN-Group: stable-10 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/10/share/man/man4 X-SVN-Commit-Revision: 328921 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 07:50:31 -0000 Author: delphij Date: Tue Feb 6 07:50:30 2018 New Revision: 328921 URL: https://svnweb.freebsd.org/changeset/base/328921 Log: MFC r328273 (kevlo): Document how to load nmdm(4) from a kernel module. Modified: stable/10/share/man/man4/nmdm.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/nmdm.4 ============================================================================== --- stable/10/share/man/man4/nmdm.4 Tue Feb 6 07:47:22 2018 (r328920) +++ stable/10/share/man/man4/nmdm.4 Tue Feb 6 07:50:30 2018 (r328921) @@ -21,14 +21,26 @@ .\" .\" $FreeBSD$ .\" -.Dd January 27, 2005 +.Dd January 23, 2018 .Dt NMDM 4 .Os .Sh NAME .Nm nmdm .Nd nullmodem terminal driver .Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent .Cd "device nmdm" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +nmdm_load="YES" +.Ed .Sh DESCRIPTION The .Nm From owner-svn-src-all@freebsd.org Tue Feb 6 08:15:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07D5DEE17A3; Tue, 6 Feb 2018 08:15:05 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f43.google.com (mail-it0-f43.google.com [209.85.214.43]) (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 9950D7C694; Tue, 6 Feb 2018 08:15:04 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f43.google.com with SMTP id x128so1497048ite.0; Tue, 06 Feb 2018 00:15:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=k9MRwf+VyRTYDtwfJUbsI+jyVKyAWOKthwYkJUTmcjM=; b=IxAsLhzL4g9Iz3RQWUWmwAOlCFp/8OsFwkbZ2jFfjrwWe/vO6GhvbWGrycBsgFkIeK gIghRojaA/pjL8D0TiT7G3RtB/+gv39tRyAJJa+l4D6Q6pM4oJTt24OS3g7pdBhDYvvV e1ow1dPmsasNfGvznjEQnDWxmJ383d9WORXGzGH0UPSxk9m+0xA/4ybljphSNXHT8hBm 91XDhoG6BmPd43ncHKOPeZYRpdojDoutoAEG6/SRgkQ/pL1r1WOagR1483jhUQoXpqjB /X400TmelAOAUn2tMIIVncyRHGqiK7JgubLrzhME5H4XazhkNqzPPxnh6AUNxDfSvlyR QN+w== X-Gm-Message-State: APf1xPA1mnDOm/Dt1AmgNdOOT+Fi9TRt/mnB77aWF4G1WmOkuPjV/DkC zEUyAqANWZD7aLjzIS99fTWBnWqc X-Google-Smtp-Source: AH8x227cLPcUjj4+ArjpnIpQmZlgO7f+8q1PhqgmzDwoBXmIC7Ti7LVKjxXnUZKB2DioGWGD7LJ+fA== X-Received: by 10.36.146.196 with SMTP id l187mr2036733itd.115.1517904544534; Tue, 06 Feb 2018 00:09:04 -0800 (PST) Received: from mail-io0-f170.google.com (mail-io0-f170.google.com. [209.85.223.170]) by smtp.gmail.com with ESMTPSA id u128sm6598213itb.1.2018.02.06.00.09.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Feb 2018 00:09:04 -0800 (PST) Received: by mail-io0-f170.google.com with SMTP id p188so1549084ioe.12; Tue, 06 Feb 2018 00:09:04 -0800 (PST) X-Received: by 10.107.15.89 with SMTP id x86mr2049858ioi.38.1517904543916; Tue, 06 Feb 2018 00:09:03 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.141.86 with HTTP; Tue, 6 Feb 2018 00:09:03 -0800 (PST) In-Reply-To: <201802060019.w160Jl1W076251@repo.freebsd.org> References: <201802060019.w160Jl1W076251@repo.freebsd.org> From: Conrad Meyer Date: Tue, 6 Feb 2018 00:09:03 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r328914 - in head/sys: kern ufs/ffs To: Kirk McKusick 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.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 08:15:05 -0000 Hi Kirk, On Mon, Feb 5, 2018 at 4:19 PM, Kirk McKusick wrote: > Author: mckusick > Date: Tue Feb 6 00:19:46 2018 > New Revision: 328914 > URL: https://svnweb.freebsd.org/changeset/base/328914 > > Log: > ... > The second problem was that the check hash computed at the end of the > read was incorrect because the calculation of the check hash on > completion of the read was being done too soon. > > - When a read completes we had the following sequence: > > - bufdone() > -- b_ckhashcalc (calculates check hash) > -- bufdone_finish() > --- vfs_vmio_iodone() (replaces bogus pages with the cached ones) > > - When we are reading a buffer where one or more pages are already > in memory (but not all pages, or we wouldn't be doing the read), > the I/O is done with bogus_page mapped in for the pages that exist > in the VM cache. This mapping is done to avoid corrupting the > cached pages if there is any I/O overrun. The vfs_vmio_iodone() > function is responsible for replacing the bogus_page(s) with the > cached ones. But we were calculating the check hash before the > bogus_page(s) were replaced. Hence, when we were calculating the > check hash, we were partly reading from bogus_page, which means > we calculated a bad check hash (e.g., because multiple pages have > been mapped to bogus_page, so its contents are indeterminate). > > The second fix is to move the check-hash calculation from bufdone() > to bufdone_finish() after the call to vfs_vmio_iodone() so that it > computes the check hash over the correct set of pages. Does the b_iodone callback have a very similar potential problem? It is invoked in bufdone(), before bufdone_finish() and vfs_vmio_iodone(). One example b_iodone is the bdone() callback. It seems that b_iodone -> bdone() can then wake bwait()ers before any VMIO cached content has been filled in. I don't know that any specific consumers of b_iodone are currently broken, but it seems like maybe the b_iodone callback should really be in the later location as well. Best, Conrad From owner-svn-src-all@freebsd.org Tue Feb 6 08:34:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7422EE33B2; Tue, 6 Feb 2018 08:34:50 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 692327D537; Tue, 6 Feb 2018 08:34: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 63F8E15766; Tue, 6 Feb 2018 08:34: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 w168YoKu025638; Tue, 6 Feb 2018 08:34:50 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w168YooN025637; Tue, 6 Feb 2018 08:34:50 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201802060834.w168YooN025637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 6 Feb 2018 08:34:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328922 - head/sys/dev/etherswitch X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/etherswitch X-SVN-Commit-Revision: 328922 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 08:34:50 -0000 Author: adrian Date: Tue Feb 6 08:34:50 2018 New Revision: 328922 URL: https://svnweb.freebsd.org/changeset/base/328922 Log: [etherswitch] add initial support for potentially configuring and fetching the switch MAC address. Switches that originate their own frames (eg obvious ones like Pause frames) need a MAC address to use to send those frames from. This API will hopefully begin to allow that to be configurable. Modified: head/sys/dev/etherswitch/etherswitch.h Modified: head/sys/dev/etherswitch/etherswitch.h ============================================================================== --- head/sys/dev/etherswitch/etherswitch.h Tue Feb 6 07:50:30 2018 (r328921) +++ head/sys/dev/etherswitch/etherswitch.h Tue Feb 6 08:34:50 2018 (r328922) @@ -48,10 +48,12 @@ typedef struct etherswitch_info etherswitch_info_t; #define ETHERSWITCH_CONF_FLAGS (1 << 0) #define ETHERSWITCH_CONF_MIRROR (1 << 1) #define ETHERSWITCH_CONF_VLAN_MODE (1 << 2) +#define ETHERSWITCH_CONF_SWITCH_MACADDR (1 << 3) struct etherswitch_conf { uint32_t cmd; /* What to configure */ uint32_t vlan_mode; /* Switch VLAN mode */ + struct ether_addr switch_macaddr; /* Switch MAC address */ }; typedef struct etherswitch_conf etherswitch_conf_t; From owner-svn-src-all@freebsd.org Tue Feb 6 08:35:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1143BEE342B; Tue, 6 Feb 2018 08:35:10 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B8FA97D664; Tue, 6 Feb 2018 08:35:09 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B3EB215767; Tue, 6 Feb 2018 08:35:09 +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 w168Z9fX025707; Tue, 6 Feb 2018 08:35:09 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w168Z9dP025706; Tue, 6 Feb 2018 08:35:09 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201802060835.w168Z9dP025706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 6 Feb 2018 08:35:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328923 - head/sbin/etherswitchcfg X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sbin/etherswitchcfg X-SVN-Commit-Revision: 328923 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 08:35:10 -0000 Author: adrian Date: Tue Feb 6 08:35:09 2018 New Revision: 328923 URL: https://svnweb.freebsd.org/changeset/base/328923 Log: [etherswitchcfg] print the switch MAC address if provided. Modified: head/sbin/etherswitchcfg/etherswitchcfg.c Modified: head/sbin/etherswitchcfg/etherswitchcfg.c ============================================================================== --- head/sbin/etherswitchcfg/etherswitchcfg.c Tue Feb 6 08:34:50 2018 (r328922) +++ head/sbin/etherswitchcfg/etherswitchcfg.c Tue Feb 6 08:35:09 2018 (r328923) @@ -556,6 +556,13 @@ print_config(struct cfg *cfg) printf("none\n"); } } + + /* Print switch MAC address. */ + if (cfg->conf.cmd & ETHERSWITCH_CONF_SWITCH_MACADDR) { + printf("%s: Switch MAC address: %s\n", + c, + ether_ntoa(&cfg->conf.switch_macaddr)); + } } static void From owner-svn-src-all@freebsd.org Tue Feb 6 08:35:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A83DEE355C; Tue, 6 Feb 2018 08:35:50 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C1B3D7D7B6; Tue, 6 Feb 2018 08:35: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BCBE31576B; Tue, 6 Feb 2018 08:35: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 w168Zndw025775; Tue, 6 Feb 2018 08:35:49 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w168ZnBa025771; Tue, 6 Feb 2018 08:35:49 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201802060835.w168ZnBa025771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 6 Feb 2018 08:35:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328924 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/etherswitch/arswitch X-SVN-Commit-Revision: 328924 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 08:35:50 -0000 Author: adrian Date: Tue Feb 6 08:35:49 2018 New Revision: 328924 URL: https://svnweb.freebsd.org/changeset/base/328924 Log: [arswitch] Implement the switch MAC address fetch API. The placeholders are here for some future "set" MAC address API. Tested: * AR9340 switch * AR8327 switch Modified: head/sys/dev/etherswitch/arswitch/arswitch.c head/sys/dev/etherswitch/arswitch/arswitchreg.h head/sys/dev/etherswitch/arswitch/arswitchvar.h Modified: head/sys/dev/etherswitch/arswitch/arswitch.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch.c Tue Feb 6 08:35:09 2018 (r328923) +++ head/sys/dev/etherswitch/arswitch/arswitch.c Tue Feb 6 08:35:49 2018 (r328924) @@ -484,6 +484,41 @@ ar8xxx_atu_learn_default(struct arswitch_softc *sc) */ /* + * Fetch the configured switch MAC address. + */ +static int +ar8xxx_hw_get_switch_macaddr(struct arswitch_softc *sc, struct ether_addr *ea) +{ + uint32_t ret0, ret1; + char *s; + + s = (void *) ea; + + ret0 = arswitch_readreg(sc->sc_dev, AR8X16_REG_SW_MAC_ADDR0); + ret1 = arswitch_readreg(sc->sc_dev, AR8X16_REG_SW_MAC_ADDR1); + + s[5] = MS(ret0, AR8X16_REG_SW_MAC_ADDR0_BYTE5); + s[4] = MS(ret0, AR8X16_REG_SW_MAC_ADDR0_BYTE4); + s[3] = MS(ret1, AR8X16_REG_SW_MAC_ADDR1_BYTE3); + s[2] = MS(ret1, AR8X16_REG_SW_MAC_ADDR1_BYTE2); + s[1] = MS(ret1, AR8X16_REG_SW_MAC_ADDR1_BYTE1); + s[0] = MS(ret1, AR8X16_REG_SW_MAC_ADDR1_BYTE0); + + return (0); +} + +/* + * Set the switch mac address. + */ +static int +ar8xxx_hw_set_switch_macaddr(struct arswitch_softc *sc, + const struct ether_addr *ea) +{ + + return (ENXIO); +} + +/* * XXX TODO: this attach routine does NOT free all memory, resources * upon failure! */ @@ -527,6 +562,8 @@ arswitch_attach(device_t dev) sc->hal.arswitch_port_vlan_setup = ar8xxx_port_vlan_setup; sc->hal.arswitch_port_vlan_get = ar8xxx_port_vlan_get; sc->hal.arswitch_vlan_init_hw = ar8xxx_reset_vlans; + sc->hal.arswitch_hw_get_switch_macaddr = ar8xxx_hw_get_switch_macaddr; + sc->hal.arswitch_hw_set_switch_macaddr = ar8xxx_hw_set_switch_macaddr; sc->hal.arswitch_vlan_getvgroup = ar8xxx_getvgroup; sc->hal.arswitch_vlan_setvgroup = ar8xxx_setvgroup; @@ -1115,6 +1152,7 @@ static int arswitch_getconf(device_t dev, etherswitch_conf_t *conf) { struct arswitch_softc *sc; + int ret; sc = device_get_softc(dev); @@ -1122,6 +1160,13 @@ arswitch_getconf(device_t dev, etherswitch_conf_t *con conf->cmd = ETHERSWITCH_CONF_VLAN_MODE; conf->vlan_mode = sc->vlan_mode; + /* Return the switch ethernet address. */ + ret = sc->hal.arswitch_hw_get_switch_macaddr(sc, + &conf->switch_macaddr); + if (ret == 0) { + conf->cmd |= ETHERSWITCH_CONF_SWITCH_MACADDR; + } + return (0); } @@ -1139,6 +1184,8 @@ arswitch_setconf(device_t dev, etherswitch_conf_t *con if (err != 0) return (err); } + + /* TODO: Set the switch ethernet address. */ return (0); } Modified: head/sys/dev/etherswitch/arswitch/arswitchreg.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitchreg.h Tue Feb 6 08:35:09 2018 (r328923) +++ head/sys/dev/etherswitch/arswitch/arswitchreg.h Tue Feb 6 08:35:49 2018 (r328924) @@ -88,7 +88,20 @@ #define AR8X16_REG_IMR 0x0014 #define AR8X16_REG_SW_MAC_ADDR0 0x0020 +#define AR8X16_REG_SW_MAC_ADDR0_BYTE4 BITS(8, 8) +#define AR8X16_REG_SW_MAC_ADDR0_BYTE4_S 8 +#define AR8X16_REG_SW_MAC_ADDR0_BYTE5 BITS(0, 8) +#define AR8X16_REG_SW_MAC_ADDR0_BYTE5_S 0 + #define AR8X16_REG_SW_MAC_ADDR1 0x0024 +#define AR8X16_REG_SW_MAC_ADDR1_BYTE0 BITS(24, 8) +#define AR8X16_REG_SW_MAC_ADDR1_BYTE0_S 24 +#define AR8X16_REG_SW_MAC_ADDR1_BYTE1 BITS(16, 8) +#define AR8X16_REG_SW_MAC_ADDR1_BYTE1_S 16 +#define AR8X16_REG_SW_MAC_ADDR1_BYTE2 BITS(8, 8) +#define AR8X16_REG_SW_MAC_ADDR1_BYTE2_S 8 +#define AR8X16_REG_SW_MAC_ADDR1_BYTE3 BITS(0, 8) +#define AR8X16_REG_SW_MAC_ADDR1_BYTE3_S 0 #define AR8X16_REG_FLOOD_MASK 0x002c #define AR8X16_FLOOD_MASK_BCAST_TO_CPU (1 << 26) Modified: head/sys/dev/etherswitch/arswitch/arswitchvar.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitchvar.h Tue Feb 6 08:35:09 2018 (r328923) +++ head/sys/dev/etherswitch/arswitch/arswitchvar.h Tue Feb 6 08:35:49 2018 (r328924) @@ -99,6 +99,11 @@ struct arswitch_softc { int (* arswitch_hw_setup) (struct arswitch_softc *); int (* arswitch_hw_global_setup) (struct arswitch_softc *); + int (* arswitch_hw_get_switch_macaddr) (struct arswitch_softc *, + struct ether_addr *sa); + int (* arswitch_hw_set_switch_macaddr) (struct arswitch_softc *, + const struct ether_addr *sa); + /* Port functions */ void (* arswitch_port_init) (struct arswitch_softc *, int); From owner-svn-src-all@freebsd.org Tue Feb 6 10:54:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3526EEDF01; Tue, 6 Feb 2018 10:54:46 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from fry.fubar.geek.nz (fry.fubar.geek.nz [139.59.165.16]) by mx1.freebsd.org (Postfix) with ESMTP id 3FB7682830; Tue, 6 Feb 2018 10:54:45 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from [IPv6:2a02:c7f:1e13:cf00:258a:a641:4133:b7aa] (unknown [IPv6:2a02:c7f:1e13:cf00:258a:a641:4133:b7aa]) by fry.fubar.geek.nz (Postfix) with ESMTPSA id C0D434EBDB; Tue, 6 Feb 2018 10:54:06 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) Subject: Re: svn commit: r328916 - in head/sys: kern vm From: Andrew Turner In-Reply-To: <201802060416.w164G0va096970@repo.freebsd.org> Date: Tue, 6 Feb 2018 10:54:05 +0000 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <6675B0B0-A582-4D5A-832B-A0E0E13B9E6C@fubar.geek.nz> References: <201802060416.w164G0va096970@repo.freebsd.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.3445.5.20) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 10:54:46 -0000 > On 6 Feb 2018, at 04:16, Gleb Smirnoff wrote: >=20 > Author: glebius > Date: Tue Feb 6 04:16:00 2018 > New Revision: 328916 > URL: https://svnweb.freebsd.org/changeset/base/328916 >=20 > Log: > Followup on r302393 by cperciva, improving calculation of boot pages = required > for UMA startup. >=20 > o Introduce another stage of UMA startup, which is entered after > vm_page_startup() finishes. After this stage we don't yet enable = buckets, > but we can ask VM for pages. Rename stages to meaningful names = while here. > New list of stages: BOOT_COLD, BOOT_STRAPPED, BOOT_PAGEALLOC, = BOOT_BUCKETS, > BOOT_RUNNING. > Enabling page alloc earlier allows us to dramatically reduce number = of > boot pages required. What is more important number of zones becomes > consistent across different machines, as no MD allocations are done = before > the BOOT_PAGEALLOC stage. Now only UMA internal zones actually need = to use > startup_alloc(), however that may change, so vm_page_startup() = provides > its need for early zones as argument. > o Introduce uma_startup_count() function, to avoid code duplication. = The > functions calculates sizes of zones zone and kegs zone, and = calculates how > many pages UMA will need to bootstrap. > It counts not only of zone structures, but also of kegs, slabs and = hashes. > o Hide uma_startup_foo() declarations from public file. > o Provide several DIAGNOSTIC printfs on boot_pages usage. > o Bugfix: when calculating zone of zones size use (mp_maxid + 1) = instead of > mp_ncpus. Use resulting number not only in the size argument to = zone_ctor() > but also as args.size. With this I=E2=80=99m getting "panic: UMA: Increase vm.boot_pages=E2=80=9D= on an arm64 simulator with 4GB of memory. I can increase vm.boot_pages = manually, however this isn=E2=80=99t useful in the long term. Andrew From owner-svn-src-all@freebsd.org Tue Feb 6 11:30:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89220EF0942; Tue, 6 Feb 2018 11:30:21 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay01.pair.com (relay01.pair.com [209.68.5.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 38F7783D9E; Tue, 6 Feb 2018 11:30:20 +0000 (UTC) (envelope-from pho@holm.cc) Received: from x2.osted.lan (87-58-223-204-dynamic.dk.customer.tdc.net [87.58.223.204]) by relay01.pair.com (Postfix) with ESMTP id D1D57D010AD; Tue, 6 Feb 2018 06:30:19 -0500 (EST) Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.14.9/8.14.9) with ESMTP id w16BUHPE026271 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 6 Feb 2018 12:30:17 +0100 (CET) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.14.9/8.14.9/Submit) id w16BUH9I026270; Tue, 6 Feb 2018 12:30:17 +0100 (CET) (envelope-from pho) Date: Tue, 6 Feb 2018 12:30:17 +0100 From: Peter Holm To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328916 - in head/sys: kern vm Message-ID: <20180206113017.GA25428@x2.osted.lan> References: <201802060416.w164G0va096970@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201802060416.w164G0va096970@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 11:30:21 -0000 On Tue, Feb 06, 2018 at 04:16:00AM +0000, Gleb Smirnoff wrote: > Author: glebius > Date: Tue Feb 6 04:16:00 2018 > New Revision: 328916 > URL: https://svnweb.freebsd.org/changeset/base/328916 > > Log: > Followup on r302393 by cperciva, improving calculation of boot pages required > for UMA startup. > > o Introduce another stage of UMA startup, which is entered after > vm_page_startup() finishes. After this stage we don't yet enable buckets, > but we can ask VM for pages. Rename stages to meaningful names while here. > New list of stages: BOOT_COLD, BOOT_STRAPPED, BOOT_PAGEALLOC, BOOT_BUCKETS, > BOOT_RUNNING. > Enabling page alloc earlier allows us to dramatically reduce number of > boot pages required. What is more important number of zones becomes > consistent across different machines, as no MD allocations are done before > the BOOT_PAGEALLOC stage. Now only UMA internal zones actually need to use > startup_alloc(), however that may change, so vm_page_startup() provides > its need for early zones as argument. > o Introduce uma_startup_count() function, to avoid code duplication. The > functions calculates sizes of zones zone and kegs zone, and calculates how > many pages UMA will need to bootstrap. > It counts not only of zone structures, but also of kegs, slabs and hashes. > o Hide uma_startup_foo() declarations from public file. > o Provide several DIAGNOSTIC printfs on boot_pages usage. > o Bugfix: when calculating zone of zones size use (mp_maxid + 1) instead of > mp_ncpus. Use resulting number not only in the size argument to zone_ctor() > but also as args.size. > > Reviewed by: imp, gallatin (earlier version) > Differential Revision: https://reviews.freebsd.org/D14054 > > Modified: > head/sys/kern/kern_malloc.c > head/sys/vm/uma.h > head/sys/vm/uma_core.c > head/sys/vm/uma_int.h > head/sys/vm/vm_page.c > > Modified: head/sys/kern/kern_malloc.c > ============================================================================== > --- head/sys/kern/kern_malloc.c Tue Feb 6 02:13:44 2018 (r328915) i386 also doesn't boot: FreeBSD 12.0-CURRENT #1 r328924: Tue Feb 6 11:51:17 CET 2018 pho@x4.osted.lan:/usr/src/sys/i386/compile/PHO i386 FreeBSD clang version 6.0.0 (branches/release_60 321788) (based on LLVM 6.0.0) WARNING: WITNESS option enabled, expect reduced performance. WARNING: DIAGNOSTIC option enabled, expect reduced performance. Entering uma_startup with 4 boot pages configured startup_alloc from "UMA Kegs", 3 boot pages left startup_alloc from "UMA Zones", 2 boot pages left startup_alloc from "UMA Hash", 1 boot pages left Entering uma_startup1 with 0 boot pages left kernel trap 12 with interrupts disabled Fatal trap 12: page fault while in kernel mode cpuid = 0; apic id = 00 fault virtual address = 0x19c fault code = supervisor read, page not present instruction pointer = 0x20:0xc0cda3f8 stack pointer = 0x28:0xc2022aac frame pointer = 0x28:0xc2022adc code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, def32 1, gran 1 processor eflags = resume, IOPL = 0 current process = 0 () [ thread pid 0 tid 0 ] Stopped at vmem_alloc+0x88: cmpl %esi,0x19c(%edi) db> x/s version version: FreeBSD 12.0-CURRENT #1 r328924: Tue Feb 6 11:51:17 CET 2018\012 pho@x4.osted.lan:/usr/src/sys/i386/compile/PHO\012 db> show registers cs 0x20 ds 0x28 es 0x28 fs 0x8 gs 0x28 ss 0x28 eax 0xc2022af8 ecx 0xc2022af8 edx 0xc23b5000 ebx 0x2002 esp 0xc2022aac ebp 0xc2022adc esi 0x1000 edi 0 eip 0xc0cda3f8 vmem_alloc+0x88 efl 0x10002 vmem_alloc+0x88: cmpl %esi,0x19c(%edi) db> bt Tracing pid 0 tid 0 td 0xc1be3f40 vmem_alloc(0,1000,2102,c2022af8,450,...) at vmem_alloc+0x88/frame 0xc2022adc kmem_malloc_domain(0,1000,102,450,c23b5000,...) at kmem_malloc_domain+0x44/frame 0xc2022b08 startup_alloc(c23b4000,1000,0,c2022b63,102,...) at startup_alloc+0xeb/frame 0xc2022b30 keg_alloc_slab(0,2,c169eb10,984,c169eb10,...) at keg_alloc_slab+0xf6/frame 0xc2022b78 keg_fetch_slab(ffffffff,2,c169eb10,9e6,c23b4000,...) at keg_fetch_slab+0x10e/frame 0xc2022bd0 zone_fetch_slab(c23b4000,0,ffffffff,2,ef0,...) at zone_fetch_slab+0x61/frame 0xc2022bf4 zone_import(c23b4000,c2022c50,1,ffffffff,2,...) at zone_import+0x3b/frame 0xc2022c2c zone_alloc_item(ffffffff,2,c1655850,c2022c94,c165585f,...) at zone_alloc_item+0x3d/frame 0xc2022c60 uma_zcreate(c165585f,1c,0,0,0,...) at uma_zcreate+0xce/frame 0xc2022cbc vmem_startup(c2157000,c0cc49fb,c12afc4b,c2022d0c,c2022d0c,...) at vmem_startup+0xb7/frame 0xc2022ce4 vm_mem_init(0,0,0,0,c18689c0,...) at vm_mem_init+0x24/frame 0xc2022d10 mi_startup() at mi_startup+0xf7/frame 0xc2022d38 begin() at begin+0x2f db> r328915 boots OK. - Peter From owner-svn-src-all@freebsd.org Tue Feb 6 11:54:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F5EEEF282B; Tue, 6 Feb 2018 11:54:21 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3173684F0C; Tue, 6 Feb 2018 11:54:21 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 284F21784C; Tue, 6 Feb 2018 11:54:21 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w16BsKY2024235; Tue, 6 Feb 2018 11:54:20 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16BsK8k024231; Tue, 6 Feb 2018 11:54:20 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201802061154.w16BsK8k024231@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 6 Feb 2018 11:54:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328925 - in head: . gnu/usr.bin/gdb gnu/usr.bin/gdb/gdbtui targets/pseudo/userland/gnu tools/build/mk X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in head: . gnu/usr.bin/gdb gnu/usr.bin/gdb/gdbtui targets/pseudo/userland/gnu tools/build/mk X-SVN-Commit-Revision: 328925 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 11:54:21 -0000 Author: bapt Date: Tue Feb 6 11:54:20 2018 New Revision: 328925 URL: https://svnweb.freebsd.org/changeset/base/328925 Log: Remove gdbtui, it was already not installed on every arches only installed on arm and sparc64. It is the only bits that keeps us having libreadline in base The rest of gdb can be switched to libedit and will be in another commit Deleted: head/gnu/usr.bin/gdb/gdbtui/ Modified: head/ObsoleteFiles.inc head/gnu/usr.bin/gdb/Makefile head/targets/pseudo/userland/gnu/Makefile.depend head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Feb 6 08:35:49 2018 (r328924) +++ head/ObsoleteFiles.inc Tue Feb 6 11:54:20 2018 (r328925) @@ -38,10 +38,11 @@ # xargs -n1 | sort | uniq -d; # done +# 20180206: remove gdbtui +OLD_FILES+=usr/bin/gdbtui # 20180201: Obsolete forth files OLD_FILES+=boot/efi.4th OLD_FILES+=boot/pcibios.4th - # 20180114: new clang import which bumps version from 5.0.1 to 6.0.0. OLD_FILES+=usr/lib/clang/5.0.1/include/sanitizer/allocator_interface.h OLD_FILES+=usr/lib/clang/5.0.1/include/sanitizer/asan_interface.h Modified: head/gnu/usr.bin/gdb/Makefile ============================================================================== --- head/gnu/usr.bin/gdb/Makefile Tue Feb 6 08:35:49 2018 (r328924) +++ head/gnu/usr.bin/gdb/Makefile Tue Feb 6 11:54:20 2018 (r328925) @@ -5,8 +5,6 @@ SUBDIR= libgdb gdb kgdb .if ${MK_GDB_LIBEXEC} == "no" -SUBDIR+= gdbtui - .if exists(${.CURDIR}/gdbserver/reg-${MACHINE_CPUARCH}.c) SUBDIR+=gdbserver .endif Modified: head/targets/pseudo/userland/gnu/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/gnu/Makefile.depend Tue Feb 6 08:35:49 2018 (r328924) +++ head/targets/pseudo/userland/gnu/Makefile.depend Tue Feb 6 11:54:20 2018 (r328925) @@ -32,7 +32,6 @@ DIRDEPS = \ gnu/usr.bin/gdb/doc \ gnu/usr.bin/gdb/gdb \ gnu/usr.bin/gdb/gdbserver \ - gnu/usr.bin/gdb/gdbtui \ gnu/usr.bin/gdb/kgdb \ gnu/usr.bin/gdb/libgdb \ gnu/usr.bin/gperf \ Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Tue Feb 6 08:35:49 2018 (r328924) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Tue Feb 6 11:54:20 2018 (r328925) @@ -2460,7 +2460,6 @@ OLD_FILES+=usr/share/man/man1/gcov.1.gz .if ${MK_GDB} == no || ${MK_GDB_LIBEXEC} == yes OLD_FILES+=usr/bin/gdb OLD_FILES+=usr/bin/gdbserver -OLD_FILES+=usr/bin/gdbtui OLD_FILES+=usr/bin/kgdb OLD_FILES+=usr/share/man/man1/gdb.1.gz OLD_FILES+=usr/share/man/man1/gdbserver.1.gz From owner-svn-src-all@freebsd.org Tue Feb 6 12:12:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C3A7EF40B2; Tue, 6 Feb 2018 12:12:45 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 28C8085D73; Tue, 6 Feb 2018 12:12:45 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 239A017B8B; Tue, 6 Feb 2018 12:12:45 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w16CCiH7033845; Tue, 6 Feb 2018 12:12:44 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16CCicW033842; Tue, 6 Feb 2018 12:12:44 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201802061212.w16CCicW033842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 6 Feb 2018 12:12:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328926 - in head/gnu/usr.bin/gdb: . gdb kgdb X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in head/gnu/usr.bin/gdb: . gdb kgdb X-SVN-Commit-Revision: 328926 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 12:12:45 -0000 Author: bapt Date: Tue Feb 6 12:12:44 2018 New Revision: 328926 URL: https://svnweb.freebsd.org/changeset/base/328926 Log: Switch to use libedit instead of readline Modified: head/gnu/usr.bin/gdb/Makefile.inc head/gnu/usr.bin/gdb/gdb/Makefile head/gnu/usr.bin/gdb/kgdb/Makefile Modified: head/gnu/usr.bin/gdb/Makefile.inc ============================================================================== --- head/gnu/usr.bin/gdb/Makefile.inc Tue Feb 6 11:54:20 2018 (r328925) +++ head/gnu/usr.bin/gdb/Makefile.inc Tue Feb 6 12:12:44 2018 (r328926) @@ -13,11 +13,9 @@ BMAKE_BU= ${BMAKE_ROOT}/binutils CNTRB_BU= ${SRCTOP}/contrib/binutils CNTRB_GDB= ${SRCTOP}/contrib/gdb -CNTRB_RL= ${SRCTOP}/contrib/libreadline OBJ_BU= ${OBJTOP}/gnu/usr.bin/binutils OBJ_GDB= ${OBJTOP}/gnu/usr.bin/gdb -OBJ_RL= ${OBJTOP}/gnu/lib/libreadline/readline # These assignments duplicate much of the functionality of # MACHINE_CPUARCH, but there's no easy way to export make functions... @@ -37,7 +35,7 @@ GDB_CROSS_DEBUGGER= .PATH: ${CNTRB_GDB}/gdb ${CNTRB_GDB}/gdb/cli ${CNTRB_GDB}/gdb/mi \ ${CNTRB_GDB}/gdb/signals ${CNTRB_GDB}/gdb/tui ${TARGET_SUBDIR} -CFLAGS+= -DHAVE_CONFIG_H -DRL_NO_COMPAT -DMI_OUT=1 -DTUI=1 +CFLAGS+= -DHAVE_CONFIG_H -DRL_NO_COMPAT -DMI_OUT=1 CFLAGS+= -DDEBUGDIR=\"${DEBUGDIR}\" CFLAGS+= -I. CFLAGS+= -I${TARGET_SUBDIR} @@ -47,7 +45,7 @@ CFLAGS+= -I${CNTRB_GDB}/gdb/config CFLAGS+= -I${CNTRB_BU}/include CFLAGS+= -I${CNTRB_GDB}/include CFLAGS+= -I${CNTRB_BU}/bfd -CFLAGS+= -I${OBJ_RL:H} +CFLAGS+= -I${SRCTOP}/lib/libedit/edit GENSRCS+= nm.h tm.h Modified: head/gnu/usr.bin/gdb/gdb/Makefile ============================================================================== --- head/gnu/usr.bin/gdb/gdb/Makefile Tue Feb 6 11:54:20 2018 (r328925) +++ head/gnu/usr.bin/gdb/gdb/Makefile Tue Feb 6 12:12:44 2018 (r328926) @@ -13,7 +13,7 @@ LDFLAGS+= -Wl,-E DPADD= ${GDBLIBS} ${BULIBS} LDADD= ${GDBLIBS} ${BULIBS} -LIBADD+= m readline ncursesw gnuregex +LIBADD+= m edit ncursesw gnuregex .include CFLAGS+= -DDEBUGDIR=\"${DEBUGDIR}\" Modified: head/gnu/usr.bin/gdb/kgdb/Makefile ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/Makefile Tue Feb 6 11:54:20 2018 (r328925) +++ head/gnu/usr.bin/gdb/kgdb/Makefile Tue Feb 6 12:12:44 2018 (r328926) @@ -10,6 +10,6 @@ GDBLIBS= ${OBJ_GDB}/libgdb/libgdb.a DPADD= ${GDBLIBS} ${BULIBS} LDADD= ${GDBLIBS} ${BULIBS} -LIBADD+= m readline ncursesw gnuregex kvm +LIBADD+= m edit ncursesw gnuregex kvm .include From owner-svn-src-all@freebsd.org Tue Feb 6 12:14:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 360B1EF42B9; Tue, 6 Feb 2018 12:14:41 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from mx.catwhisker.org (mx.catwhisker.org [198.144.209.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B1BA85F43; Tue, 6 Feb 2018 12:14:40 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from albert.catwhisker.org (localhost [127.0.0.1]) by albert.catwhisker.org (8.15.2/8.15.2) with ESMTP id w16CEWkr030491; Tue, 6 Feb 2018 12:14:32 GMT (envelope-from david@albert.catwhisker.org) Received: (from david@localhost) by albert.catwhisker.org (8.15.2/8.15.2/Submit) id w16CEVHY030490; Tue, 6 Feb 2018 04:14:31 -0800 (PST) (envelope-from david) Date: Tue, 6 Feb 2018 04:14:31 -0800 From: David Wolfskill To: Jason Harmening Cc: "O. Hartmann" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328489 - head/sys/conf Message-ID: <20180206121431.GX1178@albert.catwhisker.org> References: <201801272013.w0RKDaMU098200@repo.freebsd.org> <20180127214755.3c59661e@thor.intern.walstatt.dynvpn.de> <98501f75-1a1b-9221-c52d-24415230a886@gmail.com> <20180129130022.GT1125@albert.catwhisker.org> <20180204133337.3d03f01d@thor.intern.walstatt.dynvpn.de> <20180205222622.43f5d3e7@thor.intern.walstatt.dynvpn.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="9YbheLRFzEnE0aGp" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.3 (2018-01-21) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 12:14:41 -0000 --9YbheLRFzEnE0aGp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 05, 2018 at 01:32:04PM -0800, Jason Harmening wrote: > .... > Can you try downloading the raw diff from > https://reviews.freebsd.org/D14143 and > applying that to src? > .... For this morning's update of head (from r328876 to r328924), I reverted an earlier patch to src/sys/conf/kern.post.mk and applied the above-cited D14143 -- both on my laptop (which has PORTS_MODULES=3Dx11/nvidia-driver-340 in /etc/src.conf) and my build machine (which runs mostly-headless, and has no ports modules). No issues; everything Just Worked. Peace, david --=20 David H. Wolfskill david@catwhisker.org The circus around that memo helps confirm that Mr. Trump is unfit for offic= e. See http://www.catwhisker.org/~david/publickey.gpg for my public key. --9YbheLRFzEnE0aGp Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEEzLfO+ReoAfQwZNd7FTnMQKBJ7hcFAlp5nCdfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEND QjdDRUY5MTdBODAxRjQzMDY0RDc3QjE1MzlDQzQwQTA0OUVFMTcACgkQFTnMQKBJ 7hexrwf/aQKm9j/aSJOa3JfTrb+WiAeg16gfR4m+NdLmvnSv0C7c3sdkUU3SKFB3 vHbfXKeCY5vT+VAIexXnNgBgbrMWPGy2L2YApyz+OCHfwaa3we8RXF7huZOjpht/ wKGrzmtA2sHLahrXcyjRKvRoJVYcQWseuBM4X9Z6dfDWZVwXdaXBh3XlYJwHeaoa +8LzLXt7MVEXHVA1WsfcvdpB7a7qBG0T2n4s49AOo6JCEkNdmVRKNGV0GeEEifT1 GQ5+eAybyBFlq1ul4yGK1R+542DJuB7bXk+3+h4fNTwKN8vhbKJiTTdqR/iub6Ba gCeBG/BPKGStRbf+qJP0tc2IleWueQ== =Rk+f -----END PGP SIGNATURE----- --9YbheLRFzEnE0aGp-- From owner-svn-src-all@freebsd.org Tue Feb 6 12:17:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4E75EF44FE; Tue, 6 Feb 2018 12:17:03 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7CB5B8611E; Tue, 6 Feb 2018 12:17:03 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7305417B8D; Tue, 6 Feb 2018 12:17:03 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w16CH3uf034023; Tue, 6 Feb 2018 12:17:03 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16CH3wv034022; Tue, 6 Feb 2018 12:17:03 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201802061217.w16CH3wv034022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 6 Feb 2018 12:17:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328927 - head/contrib/gdb/gdb/tui X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/contrib/gdb/gdb/tui X-SVN-Commit-Revision: 328927 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 12:17:03 -0000 Author: bapt Date: Tue Feb 6 12:17:03 2018 New Revision: 328927 URL: https://svnweb.freebsd.org/changeset/base/328927 Log: Commit forgotten change in gdb allowing to use libedit Modified: head/contrib/gdb/gdb/tui/tui-io.c Modified: head/contrib/gdb/gdb/tui/tui-io.c ============================================================================== --- head/contrib/gdb/gdb/tui/tui-io.c Tue Feb 6 12:12:44 2018 (r328926) +++ head/contrib/gdb/gdb/tui/tui-io.c Tue Feb 6 12:17:03 2018 (r328927) @@ -397,7 +397,7 @@ static void tui_rl_display_match_list (char **matches, int len, int max) { typedef int QSFUNC (const void *, const void *); - extern int _rl_qsort_string_compare (const void*, const void*); + extern int _rl_qsort_string_compare (char **, char **); extern int _rl_print_completions_horizontally; int count, limit, printed_len; From owner-svn-src-all@freebsd.org Tue Feb 6 12:22:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FAEAEF4CBE; Tue, 6 Feb 2018 12:22:43 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E19D866C2; Tue, 6 Feb 2018 12:22:43 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4906C17D24; Tue, 6 Feb 2018 12:22:43 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w16CMhgv039147; Tue, 6 Feb 2018 12:22:43 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16CMgvs039144; Tue, 6 Feb 2018 12:22:42 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201802061222.w16CMgvs039144@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 6 Feb 2018 12:22:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328928 - in head: contrib/libreadline gnu/lib gnu/lib/libreadline share/mk targets/pseudo/userland/gnu X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in head: contrib/libreadline gnu/lib gnu/lib/libreadline share/mk targets/pseudo/userland/gnu X-SVN-Commit-Revision: 328928 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 12:22:43 -0000 Author: bapt Date: Tue Feb 6 12:22:42 2018 New Revision: 328928 URL: https://svnweb.freebsd.org/changeset/base/328928 Log: Remove libreadline from the source tree, all consumers but gdb has been switched to libedit long ago, libreadline was built as an internallib for a while and kept only for gdbtui which was broken using libreadline. Since gdb has been mostly deorbitted in all arches, gdbtui was only installed on arm and sparc64, given it has been removed, gdb has been switched to use libedit, no consumers are left for libreadline. Thus this removal Deleted: head/contrib/libreadline/ head/gnu/lib/libreadline/ Modified: head/gnu/lib/Makefile head/share/mk/src.libnames.mk head/targets/pseudo/userland/gnu/Makefile.depend Modified: head/gnu/lib/Makefile ============================================================================== --- head/gnu/lib/Makefile Tue Feb 6 12:17:03 2018 (r328927) +++ head/gnu/lib/Makefile Tue Feb 6 12:22:42 2018 (r328928) @@ -7,7 +7,6 @@ SUBDIR.${MK_DIALOG}+= libdialog SUBDIR.${MK_GCC}+= libgcov libgomp SUBDIR.${MK_SSP}+= libssp SUBDIR.${MK_TESTS}+= tests -SUBDIR.${MK_GDB}+= libreadline .if ${MK_GNU_GREP} != "no" || ${MK_GNU_GREP_COMPAT} != "no" || \ ${MK_GDB} != "no" Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Tue Feb 6 12:17:03 2018 (r328927) +++ head/share/mk/src.libnames.mk Tue Feb 6 12:22:42 2018 (r328928) @@ -44,7 +44,6 @@ _INTERNALLIBS= \ parse \ pe \ pmcstat \ - readline \ sl \ sm \ smdb \ @@ -147,7 +146,6 @@ _LIBRARIES= \ procstat \ pthread \ radius \ - readline \ regex \ roken \ rpcsec_gss \ @@ -290,7 +288,6 @@ _DP_pam+= ssh .if ${MK_NIS} != "no" _DP_pam+= ypclnt .endif -_DP_readline= ncursesw _DP_roken= crypt _DP_kadm5clnt= com_err krb5 roken _DP_kadm5srv= com_err hdb krb5 roken @@ -413,9 +410,6 @@ LIBELFTC?= ${LIBELFTCDIR}/libelftc.a LIBPEDIR= ${OBJTOP}/lib/libpe LIBPE?= ${LIBPEDIR}/libpe.a - -LIBREADLINEDIR= ${OBJTOP}/gnu/lib/libreadline/readline -LIBREADLINE?= ${LIBREADLINEDIR}/libreadline.a LIBOPENBSDDIR= ${OBJTOP}/lib/libopenbsd LIBOPENBSD?= ${LIBOPENBSDDIR}/libopenbsd.a Modified: head/targets/pseudo/userland/gnu/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/gnu/Makefile.depend Tue Feb 6 12:17:03 2018 (r328927) +++ head/targets/pseudo/userland/gnu/Makefile.depend Tue Feb 6 12:22:42 2018 (r328928) @@ -11,8 +11,6 @@ DIRDEPS = \ gnu/lib/libdialog \ gnu/lib/libgcov \ gnu/lib/libgomp \ - gnu/lib/libreadline/history/doc \ - gnu/lib/libreadline/readline/doc \ gnu/lib/libregex/doc \ gnu/lib/libssp \ gnu/lib/libssp/libssp_nonshared \ From owner-svn-src-all@freebsd.org Tue Feb 6 14:04:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D03AED8797; Tue, 6 Feb 2018 14:04:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3B9E06A9A9; Tue, 6 Feb 2018 14:04:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 366E918D8F; Tue, 6 Feb 2018 14:04:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w16E4drB089449; Tue, 6 Feb 2018 14:04:39 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16E4dPl089448; Tue, 6 Feb 2018 14:04:39 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802061404.w16E4dPl089448@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 6 Feb 2018 14:04:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328929 - stable/11 X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11 X-SVN-Commit-Revision: 328929 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 14:04:40 -0000 Author: kevans Date: Tue Feb 6 14:04:39 2018 New Revision: 328929 URL: https://svnweb.freebsd.org/changeset/base/328929 Log: MFC r325116,r325515: Stop masking errors during buildenv MFC r325116(imp): Return proper status from buildenv. make buildenv BUILDENV_SHELL= more useful. Remove '|| true' from the command line so that errors are properly returned. There appears to be no reason for it, and it dates back to the original commit by ru@. MFC r325515 (imp): Note interactive shell errors for make buildenv and add a warning for people tempted to add back the || true to get rid of them. Modified: stable/11/Makefile.inc1 Directory Properties: stable/11/ (props changed) Modified: stable/11/Makefile.inc1 ============================================================================== --- stable/11/Makefile.inc1 Tue Feb 6 12:22:42 2018 (r328928) +++ stable/11/Makefile.inc1 Tue Feb 6 14:04:39 2018 (r328929) @@ -853,13 +853,20 @@ buildenvvars: .PHONY .endif .endif BUILDENV_DIR?= ${.CURDIR} +# +# Note: make will report any errors the shell reports. This can +# be odd if the last command in an interactive shell generates an +# error or is terminated by SIGINT. These reported errors look bad, +# but are harmless. Allowing them also allows BUIDLENV_SHELL to +# be a complex command whose status will be returned to the caller. +# Some scripts in tools rely on this behavior to report build errors. +# buildenv: .PHONY @echo Entering world for ${TARGET_ARCH}:${TARGET} .if ${BUILDENV_SHELL:M*zsh*} @echo For ZSH you must run: export CPUTYPE=${TARGET_CPUTYPE} .endif - @cd ${BUILDENV_DIR} && env ${WMAKEENV} BUILDENV=1 ${BUILDENV_SHELL} \ - || true + @cd ${BUILDENV_DIR} && env ${WMAKEENV} BUILDENV=1 ${BUILDENV_SHELL} TOOLCHAIN_TGTS= ${WMAKE_TGTS:Neverything:Nbuild${libcompat}} toolchain: ${TOOLCHAIN_TGTS} .PHONY From owner-svn-src-all@freebsd.org Tue Feb 6 14:57:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B96EDEDD9A3; Tue, 6 Feb 2018 14:57:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C3926D290; Tue, 6 Feb 2018 14:57:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 63323195CF; Tue, 6 Feb 2018 14:57:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w16Ev37u015671; Tue, 6 Feb 2018 14:57:03 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16Ev3KM015670; Tue, 6 Feb 2018 14:57:03 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802061457.w16Ev3KM015670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 6 Feb 2018 14:57:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328930 - head/sys/modules/dtb/allwinner X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/modules/dtb/allwinner X-SVN-Commit-Revision: 328930 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 14:57:03 -0000 Author: kevans Date: Tue Feb 6 14:57:03 2018 New Revision: 328930 URL: https://svnweb.freebsd.org/changeset/base/328930 Log: dtb/allwinner: Add sun7i-a20-lamobo-r1.dts (Banana Pi R1) FreeBSD boots on this board, but the ethernet switch is not currently supported, resulting in no ethernet. A U-Boot port will be added once the ethernet switch is at least basically supported, but we add its DTS to the build here to lower the barrier-to-boot while work is underway. Modified: head/sys/modules/dtb/allwinner/Makefile Modified: head/sys/modules/dtb/allwinner/Makefile ============================================================================== --- head/sys/modules/dtb/allwinner/Makefile Tue Feb 6 14:04:39 2018 (r328929) +++ head/sys/modules/dtb/allwinner/Makefile Tue Feb 6 14:57:03 2018 (r328930) @@ -8,6 +8,7 @@ DTS= \ sun5i-r8-chip.dts \ sun7i-a20-bananapi.dts \ sun7i-a20-cubieboard2.dts \ + sun7i-a20-lamobo-r1.dts \ sun7i-a20-olimex-som-evb.dts \ sun7i-a20-pcduino3.dts \ sun8i-a83t-bananapi-m3.dts \ From owner-svn-src-all@freebsd.org Tue Feb 6 14:58:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6DE6EDDBBC for ; Tue, 6 Feb 2018 14:58:13 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22a.google.com (mail-it0-x22a.google.com [IPv6:2607:f8b0:4001:c0b::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 6F01E6D40F for ; Tue, 6 Feb 2018 14:58:13 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22a.google.com with SMTP id n206so2750609itg.1 for ; Tue, 06 Feb 2018 06:58:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=+CNBAoupRAy5xNRH3OC821/IO4NTadjStzTGyUHHiSU=; b=buVWSYaRt3SjNypr3zsx1WGtDjkjeOXT+Td0WK+yY7Ff7rFkL4GnGWNUN7M9BSZhpV ZDaPxGtM2WqgQqZ4Hmnexij8ZbFqubXEa7wq6hE3M6USqu0e6g5B8G3VRQ2zcrSgH2E6 GealFwPrpiDVszcdNHMG/TJdvO6w1+3HJcbCLNSX8DF5pWOwZ2b4YctwTRjhQkk+ar0y hqaFRYjgcxWABkgfCnz6hCphuB4F/tQe3B9yZlKfdhVsaMnTVrbKVtBd1neaFkPYTX8f g/hp0MVV6SyqOj7i6duotTja0Gm3/cODPbSMdaxG1uAOToY5xBWjFcT7NZ8DXD5An8wd wWDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=+CNBAoupRAy5xNRH3OC821/IO4NTadjStzTGyUHHiSU=; b=Mywx8NjQjSjpNznCJakUQItd6ULqSa+w015Y1XX7Ptd3z4nw5W2rMTLrjm28MVKi5d mt598u/KjFBRt1O8ZyNyBG1mvIS741kulj9DoE3WPUHrzLMcXTlL2X7OyG3U2L2c2TAY cRhmENisjlzKrg5doQNOoQBpvGz2fD8bN/dIq8d6ajOTt6SEhti3yxFS/f6uZglEjPD3 UgB9Jb4obR1sPLsg0CRnOr/hoeBpPkJi2c9gdGQlDqj13QyXBTVZJ1GkYUmXotBV/3FY aQPyBiBQIdNoPCF1nmGtz34d6MWCSEyc23vRs9P33qvzgglkHbKf0PTIc26pH/EJ2N24 rfAQ== X-Gm-Message-State: APf1xPBTDMMlBKnxO3TMANmY4mQoNKhQoJ777d1p5WixaQ65pYQTw+LI e1mpFd7acWwEo+0oXfjsb8aqo5t3PaOElAm/LvkuvA== X-Google-Smtp-Source: AH8x225Lztp4wY0RCxMFqy0Ctr5RSyIswMlmbiDWzBw3FVTHn6ywkHxx0hZqBBVvoDorHX6NT8pOdn9/MTfYxYSfAks= X-Received: by 10.36.74.200 with SMTP id k191mr3645141itb.69.1517929092627; Tue, 06 Feb 2018 06:58:12 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Tue, 6 Feb 2018 06:58:12 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: References: <201802060019.w160Jl1W076251@repo.freebsd.org> From: Warner Losh Date: Tue, 6 Feb 2018 07:58:12 -0700 X-Google-Sender-Auth: irW2HbRmWJ3hsj4jfrAf_GD1qzc Message-ID: Subject: Re: svn commit: r328914 - in head/sys: kern ufs/ffs To: "Conrad E. Meyer" Cc: Kirk McKusick , 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.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 14:58:14 -0000 On Tue, Feb 6, 2018 at 1:09 AM, Conrad Meyer wrote: > Hi Kirk, > > On Mon, Feb 5, 2018 at 4:19 PM, Kirk McKusick > wrote: > > Author: mckusick > > Date: Tue Feb 6 00:19:46 2018 > > New Revision: 328914 > > URL: https://svnweb.freebsd.org/changeset/base/328914 > > > > Log: > > ... > > The second problem was that the check hash computed at the end of the > > read was incorrect because the calculation of the check hash on > > completion of the read was being done too soon. > > > > - When a read completes we had the following sequence: > > > > - bufdone() > > -- b_ckhashcalc (calculates check hash) > > -- bufdone_finish() > > --- vfs_vmio_iodone() (replaces bogus pages with the cached ones) > > > > - When we are reading a buffer where one or more pages are already > > in memory (but not all pages, or we wouldn't be doing the read), > > the I/O is done with bogus_page mapped in for the pages that exist > > in the VM cache. This mapping is done to avoid corrupting the > > cached pages if there is any I/O overrun. The vfs_vmio_iodone() > > function is responsible for replacing the bogus_page(s) with the > > cached ones. But we were calculating the check hash before the > > bogus_page(s) were replaced. Hence, when we were calculating the > > check hash, we were partly reading from bogus_page, which means > > we calculated a bad check hash (e.g., because multiple pages have > > been mapped to bogus_page, so its contents are indeterminate). > > > > The second fix is to move the check-hash calculation from bufdone() > > to bufdone_finish() after the call to vfs_vmio_iodone() so that it > > computes the check hash over the correct set of pages. > > Does the b_iodone callback have a very similar potential problem? It > is invoked in bufdone(), before bufdone_finish() and > vfs_vmio_iodone(). > > One example b_iodone is the bdone() callback. It seems that b_iodone > -> bdone() can then wake bwait()ers before any VMIO cached content has > been filled in. > > I don't know that any specific consumers of b_iodone are currently > broken, but it seems like maybe the b_iodone callback should really be > in the later location as well. > It looks to me like this part of bufdone_finish() if (bp->b_flags & B_VMIO) { /* * Set B_CACHE if the op was a normal read and no error * occurred. B_CACHE is set for writes in the b*write() * routines. */ if (bp->b_iocmd == BIO_READ && !(bp->b_flags & (B_INVAL|B_NOCACHE)) && !(bp->b_ioflags & BIO_ERROR)) bp->b_flags |= B_CACHE; vfs_vmio_iodone(bp); } belongs before the callback to b_iodone() rather than in bufdone_finish(). It appears that bufdone_finish() isn't called elsewhere, despite being non-static. I'm curious why this is... Warner From owner-svn-src-all@freebsd.org Tue Feb 6 15:30:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAF44EE0D05; Tue, 6 Feb 2018 15:30:17 +0000 (UTC) (envelope-from amdmi3@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7E5D66F084; Tue, 6 Feb 2018 15:30:17 +0000 (UTC) (envelope-from amdmi3@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 754CF19AD1; Tue, 6 Feb 2018 15:30:17 +0000 (UTC) (envelope-from amdmi3@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w16FUHEn031750; Tue, 6 Feb 2018 15:30:17 GMT (envelope-from amdmi3@FreeBSD.org) Received: (from amdmi3@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16FUHRM031749; Tue, 6 Feb 2018 15:30:17 GMT (envelope-from amdmi3@FreeBSD.org) Message-Id: <201802061530.w16FUHRM031749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: amdmi3 set sender to amdmi3@FreeBSD.org using -f From: Dmitry Marakasov Date: Tue, 6 Feb 2018 15:30:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328931 - head/share/man/man8 X-SVN-Group: head X-SVN-Commit-Author: amdmi3 X-SVN-Commit-Paths: head/share/man/man8 X-SVN-Commit-Revision: 328931 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 15:30:18 -0000 Author: amdmi3 (ports committer) Date: Tue Feb 6 15:30:17 2018 New Revision: 328931 URL: https://svnweb.freebsd.org/changeset/base/328931 Log: - Document new ${name}_limits rc.conf option Approved by: cy MFC after: 2 weeks (along with 328331 which introduced this option) Differential Revision: https://reviews.freebsd.org/D14028 Modified: head/share/man/man8/rc.subr.8 Modified: head/share/man/man8/rc.subr.8 ============================================================================== --- head/share/man/man8/rc.subr.8 Tue Feb 6 14:57:03 2018 (r328930) +++ head/share/man/man8/rc.subr.8 Tue Feb 6 15:30:17 2018 (r328931) @@ -551,7 +551,7 @@ is mounted. A list of environment variables to run .Va command with. -This will be passed as arguments to +This will be passed as arguments to the .Xr env 1 utility. .It Va ${name}_fib @@ -583,6 +583,13 @@ as. Only supported after .Pa /usr is mounted. +.It Va ${name}_limits +.Xr limits 1 +to apply to +.Va command . +This will be passed as arguments to the +.Xr limits 1 +utility. .It Va ${name}_oomprotect .Xr protect 1 .Va command From owner-svn-src-all@freebsd.org Tue Feb 6 15:41:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DB92EE1D85; Tue, 6 Feb 2018 15:41:16 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A69566F86D; Tue, 6 Feb 2018 15:41:15 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A17B819CC5; Tue, 6 Feb 2018 15:41:15 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w16FfF5Y038496; Tue, 6 Feb 2018 15:41:15 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16FfFsE038495; Tue, 6 Feb 2018 15:41:15 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <201802061541.w16FfFsE038495@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Tue, 6 Feb 2018 15:41:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328932 - head/sys/mips/mips X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/sys/mips/mips X-SVN-Commit-Revision: 328932 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 15:41:16 -0000 Author: arichardson Date: Tue Feb 6 15:41:15 2018 New Revision: 328932 URL: https://svnweb.freebsd.org/changeset/base/328932 Log: Make mips_postboot_fixup work when building the kernel with clang+lld The compiler/linker can align fake_preload anyway it would like. When building the kernel with gcc+bfd this always happened to be a multiple of 8. When I built the kernel with clang and linked with lld fake_preload happened to only be aligned to 4 bytes which caused a an ADDRS trap because the compiler will emit sd instructions to store to this buffer. Reviewed By: jhb, imp Approved By: jhb (mentor) Differential Revision: https://reviews.freebsd.org/D14018 Modified: head/sys/mips/mips/machdep.c Modified: head/sys/mips/mips/machdep.c ============================================================================== --- head/sys/mips/mips/machdep.c Tue Feb 6 15:30:17 2018 (r328931) +++ head/sys/mips/mips/machdep.c Tue Feb 6 15:41:15 2018 (r328932) @@ -383,7 +383,11 @@ mips_vector_init(void) void mips_postboot_fixup(void) { - static char fake_preload[256]; + /* + * We store u_long sized objects into the reload area, so the array + * must be so aligned. The standard allows any alignment for char data. + */ + static char fake_preload[256] _Alignas(_Alignof(u_long)); caddr_t preload_ptr = (caddr_t)&fake_preload[0]; size_t size = 0; From owner-svn-src-all@freebsd.org Tue Feb 6 15:41:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33804EE1DD8; Tue, 6 Feb 2018 15:41:27 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D958D6FA9E; Tue, 6 Feb 2018 15:41:26 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D426A19DDA; Tue, 6 Feb 2018 15:41:26 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w16FfQea040376; Tue, 6 Feb 2018 15:41:26 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16FfQ1x039394; Tue, 6 Feb 2018 15:41:26 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <201802061541.w16FfQ1x039394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Tue, 6 Feb 2018 15:41:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328933 - head/usr.bin/find X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/usr.bin/find X-SVN-Commit-Revision: 328933 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 15:41:27 -0000 Author: arichardson Date: Tue Feb 6 15:41:26 2018 New Revision: 328933 URL: https://svnweb.freebsd.org/changeset/base/328933 Log: Allow compiling usr.bin/find on Linux and Mac When building FreeBSD the makefiles invoke find with various flags such as `-s` that aren't supported in the native /usr/bin/find. To fix this I build the FreeBSD version of find and use that when crossbuilding. Inserting lots if #ifdefs in the code is rather ugly but I don't see a better solution. Reviewed By: brooks (mentor) Approved By: jhb (mentor) Differential Revision: https://reviews.freebsd.org/D13306 Modified: head/usr.bin/find/Makefile head/usr.bin/find/find.h head/usr.bin/find/function.c head/usr.bin/find/ls.c head/usr.bin/find/operator.c head/usr.bin/find/option.c Modified: head/usr.bin/find/Makefile ============================================================================== --- head/usr.bin/find/Makefile Tue Feb 6 15:41:15 2018 (r328932) +++ head/usr.bin/find/Makefile Tue Feb 6 15:41:26 2018 (r328933) @@ -7,6 +7,7 @@ PROG= find SRCS= find.c function.c ls.c main.c misc.c operator.c option.c \ getdate.y YFLAGS= +CFLAGS.clang+= -Werror=undef NO_WMISSING_VARIABLE_DECLARATIONS= Modified: head/usr.bin/find/find.h ============================================================================== --- head/usr.bin/find/find.h Tue Feb 6 15:41:15 2018 (r328932) +++ head/usr.bin/find/find.h Tue Feb 6 15:41:26 2018 (r328933) @@ -36,7 +36,32 @@ */ #include +#include +#include +/* + * We need to build find during the bootstrap stage when building on a + * non-FreeBSD system. Linux does not have the st_flags and st_birthtime + * members in struct stat so we need to omit support for tests that depend + * on these members. This works fine since none of these flags are used + * during the build of world and kernel. + */ +#ifdef UF_SETTABLE +#define HAVE_STRUCT_STAT_ST_FLAGS 1 +#else +#define HAVE_STRUCT_STAT_ST_FLAGS 0 +#endif +#if defined(st_birthtime) || defined(st_birthtimespec) +#define HAVE_STRUCT_STAT_ST_BIRTHTIME 1 +#else +#define HAVE_STRUCT_STAT_ST_BIRTHTIME 0 +#endif +#if defined(MFSNAMELEN) || defined(MFSTYPENAMELEN) +#define HAVE_STRUCT_STATFS_F_FSTYPENAME 1 +#else +#define HAVE_STRUCT_STATFS_F_FSTYPENAME 0 +#endif + /* forward declarations */ struct _plandata; struct _option; @@ -70,8 +95,10 @@ typedef struct _plandata *creat_f(struct _option *, ch #define F_IGNCASE 0x00010000 /* iname ipath iregex */ #define F_EXACTTIME F_IGNCASE /* -[acm]time units syntax */ #define F_EXECPLUS 0x00020000 /* -exec ... {} + */ +#if HAVE_STRUCT_STAT_ST_BIRTHTIME #define F_TIME_B 0x00040000 /* one of -Btime, -Bnewer, -newerB* */ #define F_TIME2_B 0x00080000 /* one of -newer?B */ +#endif #define F_LINK 0x00100000 /* lname or ilname */ /* node definition */ Modified: head/usr.bin/find/function.c ============================================================================== --- head/usr.bin/find/function.c Tue Feb 6 15:41:15 2018 (r328932) +++ head/usr.bin/find/function.c Tue Feb 6 15:41:26 2018 (r328933) @@ -261,9 +261,11 @@ f_Xmin(PLAN *plan, FTSENT *entry) } else if (plan->flags & F_TIME_A) { COMPARE((now - entry->fts_statp->st_atime + 60 - 1) / 60, plan->t_data.tv_sec); +#if HAVE_STRUCT_STAT_ST_BIRTHTIME } else if (plan->flags & F_TIME_B) { COMPARE((now - entry->fts_statp->st_birthtime + 60 - 1) / 60, plan->t_data.tv_sec); +#endif } else { COMPARE((now - entry->fts_statp->st_mtime + 60 - 1) / 60, plan->t_data.tv_sec); @@ -304,8 +306,10 @@ f_Xtime(PLAN *plan, FTSENT *entry) if (plan->flags & F_TIME_A) xtime = entry->fts_statp->st_atime; +#if HAVE_STRUCT_STAT_ST_BIRTHTIME else if (plan->flags & F_TIME_B) xtime = entry->fts_statp->st_birthtime; +#endif else if (plan->flags & F_TIME_C) xtime = entry->fts_statp->st_ctime; else @@ -362,6 +366,7 @@ c_mXXdepth(OPTION *option, char ***argvp) return new; } +#ifdef ACL_TYPE_NFS4 /* * -acl function -- * @@ -412,6 +417,7 @@ f_acl(PLAN *plan __unused, FTSENT *entry) return (0); return (1); } +#endif PLAN * c_acl(OPTION *option, char ***argvp __unused) @@ -448,12 +454,14 @@ f_delete(PLAN *plan __unused, FTSENT *entry) errx(1, "-delete: %s: relative path potentially not safe", entry->fts_accpath); +#if HAVE_STRUCT_STAT_ST_FLAGS /* Turn off user immutable bits if running as root */ if ((entry->fts_statp->st_flags & (UF_APPEND|UF_IMMUTABLE)) && !(entry->fts_statp->st_flags & (SF_APPEND|SF_IMMUTABLE)) && geteuid() == 0) lchflags(entry->fts_accpath, entry->fts_statp->st_flags &= ~(UF_APPEND|UF_IMMUTABLE)); +#endif /* rmdir directories, unlink everything else */ if (S_ISDIR(entry->fts_statp->st_mode)) { @@ -806,6 +814,7 @@ finish_execplus(void) } } +#if HAVE_STRUCT_STAT_ST_FLAGS int f_flags(PLAN *plan, FTSENT *entry) { @@ -849,6 +858,7 @@ c_flags(OPTION *option, char ***argvp) new->fl_notflags = notflags; return new; } +#endif /* * -follow functions -- @@ -865,6 +875,7 @@ c_follow(OPTION *option, char ***argvp __unused) return palloc(option); } +#if HAVE_STRUCT_STATFS_F_FSTYPENAME /* * -fstype functions -- * @@ -967,6 +978,7 @@ c_fstype(OPTION *option, char ***argvp) new->c_data = fsname; return new; } +#endif /* * -group gname functions -- @@ -1189,10 +1201,12 @@ f_newer(PLAN *plan, FTSENT *entry) if (plan->flags & F_TIME_C) ft = entry->fts_statp->st_ctim; +#if HAVE_STRUCT_STAT_ST_BIRTHTIME else if (plan->flags & F_TIME_A) ft = entry->fts_statp->st_atim; else if (plan->flags & F_TIME_B) ft = entry->fts_statp->st_birthtim; +#endif else ft = entry->fts_statp->st_mtim; return (ft.tv_sec > plan->t_data.tv_sec || @@ -1230,8 +1244,10 @@ c_newer(OPTION *option, char ***argvp) new->t_data = sb.st_ctim; else if (option->flags & F_TIME2_A) new->t_data = sb.st_atim; +#if HAVE_STRUCT_STAT_ST_BIRTHTIME else if (option->flags & F_TIME2_B) new->t_data = sb.st_birthtim; +#endif else new->t_data = sb.st_mtim; } @@ -1615,7 +1631,7 @@ c_type(OPTION *option, char ***argvp) case 's': mask = S_IFSOCK; break; -#ifdef FTS_WHITEOUT +#if defined(FTS_WHITEOUT) && defined(S_IFWHT) case 'w': mask = S_IFWHT; ftsoptions |= FTS_WHITEOUT; Modified: head/usr.bin/find/ls.c ============================================================================== --- head/usr.bin/find/ls.c Tue Feb 6 15:41:15 2018 (r328932) +++ head/usr.bin/find/ls.c Tue Feb 6 15:41:26 2018 (r328933) @@ -91,8 +91,10 @@ printtime(time_t ftime) const char *format; static int d_first = -1; +#ifdef D_MD_ORDER if (d_first < 0) d_first = (*nl_langinfo(D_MD_ORDER) == 'd'); +#endif if (lnow == 0) lnow = time(NULL); Modified: head/usr.bin/find/operator.c ============================================================================== --- head/usr.bin/find/operator.c Tue Feb 6 15:41:15 2018 (r328932) +++ head/usr.bin/find/operator.c Tue Feb 6 15:41:26 2018 (r328933) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "find.h" Modified: head/usr.bin/find/option.c ============================================================================== --- head/usr.bin/find/option.c Tue Feb 6 15:41:15 2018 (r328932) +++ head/usr.bin/find/option.c Tue Feb 6 15:41:26 2018 (r328933) @@ -61,11 +61,15 @@ static OPTION const options[] = { { "!", c_simple, f_not, 0 }, { "(", c_simple, f_openparen, 0 }, { ")", c_simple, f_closeparen, 0 }, +#if HAVE_STRUCT_STAT_ST_BIRTHTIME { "-Bmin", c_Xmin, f_Xmin, F_TIME_B }, { "-Bnewer", c_newer, f_newer, F_TIME_B }, { "-Btime", c_Xtime, f_Xtime, F_TIME_B }, +#endif { "-a", c_and, NULL, 0 }, +#ifdef ACL_TYPE_NFS4 { "-acl", c_acl, f_acl, 0 }, +#endif { "-amin", c_Xmin, f_Xmin, F_TIME_A }, { "-and", c_and, NULL, 0 }, { "-anewer", c_newer, f_newer, F_TIME_A }, @@ -81,13 +85,17 @@ static OPTION const options[] = { { "-exec", c_exec, f_exec, 0 }, { "-execdir", c_exec, f_exec, F_EXECDIR }, { "-false", c_simple, f_false, 0 }, +#if HAVE_STRUCT_STAT_ST_FLAGS { "-flags", c_flags, f_flags, 0 }, +#endif // -fls { "-follow", c_follow, f_always_true, 0 }, // -fprint // -fprint0 // -fprintf +#if HAVE_STRUCT_STATFS_F_FSTYPENAME { "-fstype", c_fstype, f_fstype, 0 }, +#endif { "-gid", c_group, f_group, 0 }, { "-group", c_group, f_group, 0 }, { "-ignore_readdir_race",c_ignore_readdir_race, f_always_true,0 }, @@ -108,22 +116,28 @@ static OPTION const options[] = { { "-mtime", c_Xtime, f_Xtime, 0 }, { "-name", c_name, f_name, 0 }, { "-newer", c_newer, f_newer, 0 }, +#if HAVE_STRUCT_STAT_ST_BIRTHTIME { "-newerBB", c_newer, f_newer, F_TIME_B | F_TIME2_B }, { "-newerBa", c_newer, f_newer, F_TIME_B | F_TIME2_A }, { "-newerBc", c_newer, f_newer, F_TIME_B | F_TIME2_C }, { "-newerBm", c_newer, f_newer, F_TIME_B }, { "-newerBt", c_newer, f_newer, F_TIME_B | F_TIME2_T }, { "-neweraB", c_newer, f_newer, F_TIME_A | F_TIME2_B }, +#endif { "-neweraa", c_newer, f_newer, F_TIME_A | F_TIME2_A }, { "-newerac", c_newer, f_newer, F_TIME_A | F_TIME2_C }, { "-neweram", c_newer, f_newer, F_TIME_A }, { "-newerat", c_newer, f_newer, F_TIME_A | F_TIME2_T }, +#if HAVE_STRUCT_STAT_ST_BIRTHTIME { "-newercB", c_newer, f_newer, F_TIME_C | F_TIME2_B }, +#endif { "-newerca", c_newer, f_newer, F_TIME_C | F_TIME2_A }, { "-newercc", c_newer, f_newer, F_TIME_C | F_TIME2_C }, { "-newercm", c_newer, f_newer, F_TIME_C }, { "-newerct", c_newer, f_newer, F_TIME_C | F_TIME2_T }, +#if HAVE_STRUCT_STAT_ST_BIRTHTIME { "-newermB", c_newer, f_newer, F_TIME2_B }, +#endif { "-newerma", c_newer, f_newer, F_TIME2_A }, { "-newermc", c_newer, f_newer, F_TIME2_C }, { "-newermm", c_newer, f_newer, 0 }, From owner-svn-src-all@freebsd.org Tue Feb 6 15:41:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADDEEEE1E68; Tue, 6 Feb 2018 15:41:36 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F7736FBC4; Tue, 6 Feb 2018 15:41:36 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A86D19DEF; Tue, 6 Feb 2018 15:41:36 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w16FfaCo041472; Tue, 6 Feb 2018 15:41:36 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16FfadO041469; Tue, 6 Feb 2018 15:41:36 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <201802061541.w16FfadO041469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Tue, 6 Feb 2018 15:41:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328934 - in head: . bin/sh X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: in head: . bin/sh X-SVN-Commit-Revision: 328934 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 15:41:36 -0000 Author: arichardson Date: Tue Feb 6 15:41:35 2018 New Revision: 328934 URL: https://svnweb.freebsd.org/changeset/base/328934 Log: Don't hardcode /usr/bin as the path for mktemp in build tools It won't work e.g. when crossbuilding from Ubuntu Linux as mktemp is in /bin there. Reviewed By: bdrewery Approved By: jhb (mentor) Differential Revision: https://reviews.freebsd.org/D13937 Modified: head/Makefile.inc1 head/bin/sh/mkbuiltins head/bin/sh/mktokens Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Feb 6 15:41:26 2018 (r328933) +++ head/Makefile.inc1 Tue Feb 6 15:41:35 2018 (r328934) @@ -463,7 +463,7 @@ TMPPATH= ${STRICTTMPPATH}:${PATH} # when in the middle of installing over this system. # .if make(distributeworld) || make(installworld) || make(stageworld) -INSTALLTMP!= /usr/bin/mktemp -d -u -t install +INSTALLTMP!= mktemp -d -u -t install .endif .if make(stagekernel) || make(distributekernel) Modified: head/bin/sh/mkbuiltins ============================================================================== --- head/bin/sh/mkbuiltins Tue Feb 6 15:41:26 2018 (r328933) +++ head/bin/sh/mkbuiltins Tue Feb 6 15:41:35 2018 (r328934) @@ -34,7 +34,7 @@ # @(#)mkbuiltins 8.2 (Berkeley) 5/4/95 # $FreeBSD$ -temp=`/usr/bin/mktemp -t ka` +temp=`mktemp -t ka` havehist=1 if [ "X$1" = "X-h" ]; then havehist=0 Modified: head/bin/sh/mktokens ============================================================================== --- head/bin/sh/mktokens Tue Feb 6 15:41:26 2018 (r328933) +++ head/bin/sh/mktokens Tue Feb 6 15:41:35 2018 (r328934) @@ -38,7 +38,7 @@ # token marks the end of a list. The third column is the name to print in # error messages. -temp=`/usr/bin/mktemp -t ka` +temp=`mktemp -t ka` cat > $temp <<\! TEOF 1 end of file TNL 0 newline From owner-svn-src-all@freebsd.org Tue Feb 6 15:41:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2140EE1FAA; Tue, 6 Feb 2018 15:41:45 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 668816FCF8; Tue, 6 Feb 2018 15:41:45 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6172019E08; Tue, 6 Feb 2018 15:41:45 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w16Ffj3T041526; Tue, 6 Feb 2018 15:41:45 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16FfjuJ041525; Tue, 6 Feb 2018 15:41:45 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <201802061541.w16FfjuJ041525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Tue, 6 Feb 2018 15:41:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328935 - head X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 328935 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 15:41:45 -0000 Author: arichardson Date: Tue Feb 6 15:41:45 2018 New Revision: 328935 URL: https://svnweb.freebsd.org/changeset/base/328935 Log: crossbuild: Make the CHECK_TIME variable work on Linux Linux /usr/bin/find doesn't understand the -mtime -0s flag. Instead create a temporary file and compare that file's mtime to sys/sys/param.h to check whether the clock is correct. Reviewed By: jhb, imp Approved By: jhb (mentor) Differential Revision: https://reviews.freebsd.org/D14157 Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Tue Feb 6 15:41:35 2018 (r328934) +++ head/Makefile Tue Feb 6 15:41:45 2018 (r328935) @@ -352,7 +352,7 @@ _guard: .PHONY @false STARTTIME!= LC_ALL=C date -CHECK_TIME!= find ${.CURDIR}/sys/sys/param.h -mtime -0s ; echo +CHECK_TIME!= cmp=`mktemp`; find ${.CURDIR}/sys/sys/param.h -newer "$$cmp" && rm "$$cmp"; echo .if !empty(CHECK_TIME) .error check your date/time: ${STARTTIME} .endif From owner-svn-src-all@freebsd.org Tue Feb 6 15:58:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7C8AEE3974; Tue, 6 Feb 2018 15:58:23 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7BFBC7098B; Tue, 6 Feb 2018 15:58:23 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 76CE219FF5; Tue, 6 Feb 2018 15:58:23 +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 w16FwNnb046852; Tue, 6 Feb 2018 15:58:23 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16FwMcS046846; Tue, 6 Feb 2018 15:58:22 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201802061558.w16FwMcS046846@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Tue, 6 Feb 2018 15:58:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328936 - in head/sys/dev: mpr mps X-SVN-Group: head X-SVN-Commit-Author: ken X-SVN-Commit-Paths: in head/sys/dev: mpr mps X-SVN-Commit-Revision: 328936 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 15:58:24 -0000 Author: ken Date: Tue Feb 6 15:58:22 2018 New Revision: 328936 URL: https://svnweb.freebsd.org/changeset/base/328936 Log: Diagnostic buffer fixes for the mps(4) and mpr(4) drivers. In mp{r,s}_diag_register(), which is used to register diagnostic buffers with the mp{r,s}(4) firmware, we allocate DMAable memory. There were several issues here: o No checking of the bus_dmamap_load() return value. If the load failed or got deferred, mp{r,s}_diag_register() continued on as if nothing had happened. We now check the return value and bail out if it fails. o No waiting for a deferred load callback. bus_dmamap_load() calls a supplied callback when the mapping is done. This is generally done immediately, but it can be deferred. mp{r,s}_diag_register() did not check to see whether the callback was already done before proceeding on. We now sleep until the callback is done if it is deferred. o No call to bus_dmamap_sync(... BUS_DMASYNC_PREREAD) after the memory is allocated and loaded. This is necessary on some platforms to synchronize host memory that is going to be updated by a device. Both drivers would also panic if the firmware was reinitialized while a diagnostic buffer operation was in progress. This fixes that problem as well. (The driver will reinitialize the firmware in various circumstances, but the problem I ran into was that the firmware would generate an IOC Fault due to a PCIe error.) mp{r,s}var.h: Add a new structure, struct mpr_busdma_context, that is used for deferred busdma load callbacks. Add a prototype for mp{r,s}_memaddr_wait_cb(). mp{r,s}.c: Add a new busdma callback function, mp{r,s}_memaddr_wait_cb(). This provides synchronization for callers that want to wait on a deferred bus_dmamap_load() callback. mp{r,s}_user.c: In bus_dmamap_register(), add a call to bus_dmamap_sync() with the BUS_DMASYNC_PREREAD flag set after an allocation is loaded. Also, check the return value of bus_dmamap_load(). If it fails, bail out. If it is EINPROGRESS, wait for the callback to happen. We use an interruptible sleep (msleep with PCATCH) and let the callback clean things up if we get interrupted. In mpr_diag_read_buffer() and mps_diag_read_buffer(), call bus_dmamap_sync(..., BUS_DMASYNC_POSTREAD) before copying the data out to make sure the data is in stable storage. In mp{r,s}_post_fw_diag_buffer() and mp{r,s}_release_fw_diag_buffer(), check the reply to see whether it is NULL. It can be NULL (and the command non-NULL) if the controller gets reinitialized while we're waiting for the command to complete but the driver structures aren't reallocated. The driver structures generally won't be reallocated unless there is a firmware upgrade that changes one of the IOCFacts. When freeing diagnostic buffers in mp{r,s}_diag_register() and mp{r,s}_diag_unregister(), zero/NULL out the buffer after freeing it. This will prevent a duplicate free in some situations. Sponsored by: Spectra Logic Reviewed by: mav, scottl MFC after: 1 week Differential Revision: D13453 Modified: head/sys/dev/mpr/mpr.c head/sys/dev/mpr/mpr_user.c head/sys/dev/mpr/mprvar.h head/sys/dev/mps/mps.c head/sys/dev/mps/mps_user.c head/sys/dev/mps/mpsvar.h Modified: head/sys/dev/mpr/mpr.c ============================================================================== --- head/sys/dev/mpr/mpr.c Tue Feb 6 15:41:45 2018 (r328935) +++ head/sys/dev/mpr/mpr.c Tue Feb 6 15:58:22 2018 (r328936) @@ -1183,6 +1183,42 @@ mpr_memaddr_cb(void *arg, bus_dma_segment_t *segs, int *addr = segs[0].ds_addr; } +void +mpr_memaddr_wait_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +{ + struct mpr_busdma_context *ctx; + int need_unload, need_free; + + ctx = (struct mpr_busdma_context *)arg; + need_unload = 0; + need_free = 0; + + mpr_lock(ctx->softc); + ctx->error = error; + ctx->completed = 1; + if ((error == 0) && (ctx->abandoned == 0)) { + *ctx->addr = segs[0].ds_addr; + } else { + if (nsegs != 0) + need_unload = 1; + if (ctx->abandoned != 0) + need_free = 1; + } + if (need_free == 0) + wakeup(ctx); + + mpr_unlock(ctx->softc); + + if (need_unload != 0) { + bus_dmamap_unload(ctx->buffer_dmat, + ctx->buffer_dmamap); + *ctx->addr = 0; + } + + if (need_free != 0) + free(ctx, M_MPR); +} + static int mpr_alloc_queues(struct mpr_softc *sc) { Modified: head/sys/dev/mpr/mpr_user.c ============================================================================== --- head/sys/dev/mpr/mpr_user.c Tue Feb 6 15:41:45 2018 (r328935) +++ head/sys/dev/mpr/mpr_user.c Tue Feb 6 15:58:22 2018 (r328936) @@ -1314,6 +1314,13 @@ mpr_post_fw_diag_buffer(struct mpr_softc *sc, * Process POST reply. */ reply = (MPI2_DIAG_BUFFER_POST_REPLY *)cm->cm_reply; + if (reply == NULL) { + mpr_printf(sc, "%s: reply is NULL, probably due to " + "reinitialization", __func__); + status = MPR_DIAG_FAILURE; + goto done; + } + if ((le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK) != MPI2_IOCSTATUS_SUCCESS) { status = MPR_DIAG_FAILURE; @@ -1401,6 +1408,12 @@ mpr_release_fw_diag_buffer(struct mpr_softc *sc, * Process RELEASE reply. */ reply = (MPI2_DIAG_RELEASE_REPLY *)cm->cm_reply; + if (reply == NULL) { + mpr_printf(sc, "%s: reply is NULL, probably due to " + "reinitialization", __func__); + status = MPR_DIAG_FAILURE; + goto done; + } if (((le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK) != MPI2_IOCSTATUS_SUCCESS) || pBuffer->owned_by_firmware) { status = MPR_DIAG_FAILURE; @@ -1436,15 +1449,19 @@ mpr_diag_register(struct mpr_softc *sc, mpr_fw_diag_re uint32_t *return_code) { mpr_fw_diagnostic_buffer_t *pBuffer; + struct mpr_busdma_context *ctx; uint8_t extended_type, buffer_type, i; uint32_t buffer_size; uint32_t unique_id; int status; + int error; extended_type = diag_register->ExtendedType; buffer_type = diag_register->BufferType; buffer_size = diag_register->RequestedBufferSize; unique_id = diag_register->UniqueId; + ctx = NULL; + error = 0; /* * Check for valid buffer type @@ -1493,7 +1510,7 @@ mpr_diag_register(struct mpr_softc *sc, mpr_fw_diag_re *return_code = MPR_FW_DIAG_ERROR_NO_BUFFER; return (MPR_DIAG_FAILURE); } - if (bus_dma_tag_create( sc->mpr_parent_dmat, /* parent */ + if (bus_dma_tag_create( sc->mpr_parent_dmat, /* parent */ 1, 0, /* algnmnt, boundary */ BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ @@ -1506,17 +1523,83 @@ mpr_diag_register(struct mpr_softc *sc, mpr_fw_diag_re &sc->fw_diag_dmat)) { mpr_dprint(sc, MPR_ERROR, "Cannot allocate FW diag buffer DMA tag\n"); - return (ENOMEM); - } + *return_code = MPR_FW_DIAG_ERROR_NO_BUFFER; + status = MPR_DIAG_FAILURE; + goto bailout; + } if (bus_dmamem_alloc(sc->fw_diag_dmat, (void **)&sc->fw_diag_buffer, BUS_DMA_NOWAIT, &sc->fw_diag_map)) { mpr_dprint(sc, MPR_ERROR, "Cannot allocate FW diag buffer memory\n"); - return (ENOMEM); - } - bzero(sc->fw_diag_buffer, buffer_size); - bus_dmamap_load(sc->fw_diag_dmat, sc->fw_diag_map, sc->fw_diag_buffer, - buffer_size, mpr_memaddr_cb, &sc->fw_diag_busaddr, 0); + *return_code = MPR_FW_DIAG_ERROR_NO_BUFFER; + status = MPR_DIAG_FAILURE; + goto bailout; + } + bzero(sc->fw_diag_buffer, buffer_size); + + ctx = malloc(sizeof(*ctx), M_MPR, M_WAITOK | M_ZERO); + if (ctx == NULL) { + device_printf(sc->mpr_dev, "%s: context malloc failed\n", + __func__); + *return_code = MPR_FW_DIAG_ERROR_NO_BUFFER; + status = MPR_DIAG_FAILURE; + goto bailout; + } + ctx->addr = &sc->fw_diag_busaddr; + ctx->buffer_dmat = sc->fw_diag_dmat; + ctx->buffer_dmamap = sc->fw_diag_map; + ctx->softc = sc; + error = bus_dmamap_load(sc->fw_diag_dmat, sc->fw_diag_map, + sc->fw_diag_buffer, buffer_size, mpr_memaddr_wait_cb, + ctx, 0); + if (error == EINPROGRESS) { + + /* XXX KDM */ + device_printf(sc->mpr_dev, "%s: Deferred bus_dmamap_load\n", + __func__); + /* + * Wait for the load to complete. If we're interrupted, + * bail out. + */ + mpr_lock(sc); + if (ctx->completed == 0) { + error = msleep(ctx, &sc->mpr_mtx, PCATCH, "mprwait", 0); + if (error != 0) { + /* + * We got an error from msleep(9). This is + * most likely due to a signal. Tell + * mpr_memaddr_wait_cb() that we've abandoned + * the context, so it needs to clean up when + * it is called. + */ + ctx->abandoned = 1; + + /* The callback will free this memory */ + ctx = NULL; + mpr_unlock(sc); + + device_printf(sc->mpr_dev, "Cannot " + "bus_dmamap_load FW diag buffer, error = " + "%d returned from msleep\n", error); + *return_code = MPR_FW_DIAG_ERROR_NO_BUFFER; + status = MPR_DIAG_FAILURE; + goto bailout; + } + } + mpr_unlock(sc); + } + + if ((error != 0) || (ctx->error != 0)) { + device_printf(sc->mpr_dev, "Cannot bus_dmamap_load FW diag " + "buffer, %serror = %d\n", error ? "" : "callback ", + error ? error : ctx->error); + *return_code = MPR_FW_DIAG_ERROR_NO_BUFFER; + status = MPR_DIAG_FAILURE; + goto bailout; + } + + bus_dmamap_sync(sc->fw_diag_dmat, sc->fw_diag_map, BUS_DMASYNC_PREREAD); + pBuffer->size = buffer_size; /* @@ -1535,19 +1618,30 @@ mpr_diag_register(struct mpr_softc *sc, mpr_fw_diag_re pBuffer->unique_id = unique_id; status = mpr_post_fw_diag_buffer(sc, pBuffer, return_code); +bailout: + /* * In case there was a failure, free the DMA buffer. */ if (status == MPR_DIAG_FAILURE) { - if (sc->fw_diag_busaddr != 0) + if (sc->fw_diag_busaddr != 0) { bus_dmamap_unload(sc->fw_diag_dmat, sc->fw_diag_map); - if (sc->fw_diag_buffer != NULL) + sc->fw_diag_busaddr = 0; + } + if (sc->fw_diag_buffer != NULL) { bus_dmamem_free(sc->fw_diag_dmat, sc->fw_diag_buffer, sc->fw_diag_map); - if (sc->fw_diag_dmat != NULL) + sc->fw_diag_buffer = NULL; + } + if (sc->fw_diag_dmat != NULL) { bus_dma_tag_destroy(sc->fw_diag_dmat); + sc->fw_diag_dmat = NULL; + } } + if (ctx != NULL) + free(ctx, M_MPR); + return (status); } @@ -1592,13 +1686,19 @@ mpr_diag_unregister(struct mpr_softc *sc, */ pBuffer->unique_id = MPR_FW_DIAG_INVALID_UID; if (status == MPR_DIAG_SUCCESS) { - if (sc->fw_diag_busaddr != 0) + if (sc->fw_diag_busaddr != 0) { bus_dmamap_unload(sc->fw_diag_dmat, sc->fw_diag_map); - if (sc->fw_diag_buffer != NULL) + sc->fw_diag_busaddr = 0; + } + if (sc->fw_diag_buffer != NULL) { bus_dmamem_free(sc->fw_diag_dmat, sc->fw_diag_buffer, sc->fw_diag_map); - if (sc->fw_diag_dmat != NULL) + sc->fw_diag_buffer = NULL; + } + if (sc->fw_diag_dmat != NULL) { bus_dma_tag_destroy(sc->fw_diag_dmat); + sc->fw_diag_dmat = NULL; + } } return (status); @@ -1707,6 +1807,10 @@ mpr_diag_read_buffer(struct mpr_softc *sc, *return_code = MPR_FW_DIAG_ERROR_INVALID_PARAMETER; return (MPR_DIAG_FAILURE); } + + /* Sync the DMA map before we copy to userland. */ + bus_dmamap_sync(sc->fw_diag_dmat, sc->fw_diag_map, + BUS_DMASYNC_POSTREAD); /* * Copy the requested data from DMA to the diag_read_buffer. The DMA Modified: head/sys/dev/mpr/mprvar.h ============================================================================== --- head/sys/dev/mpr/mprvar.h Tue Feb 6 15:41:45 2018 (r328935) +++ head/sys/dev/mpr/mprvar.h Tue Feb 6 15:58:22 2018 (r328936) @@ -265,6 +265,16 @@ struct mpr_event_handle { uint8_t mask[16]; }; +struct mpr_busdma_context { + int completed; + int abandoned; + int error; + bus_addr_t *addr; + struct mpr_softc *softc; + bus_dmamap_t buffer_dmamap; + bus_dma_tag_t buffer_dmat; +}; + struct mpr_queue { struct mpr_softc *sc; int qnum; @@ -752,6 +762,7 @@ int mpr_detach_sas(struct mpr_softc *sc); int mpr_read_config_page(struct mpr_softc *, struct mpr_config_params *); int mpr_write_config_page(struct mpr_softc *, struct mpr_config_params *); void mpr_memaddr_cb(void *, bus_dma_segment_t *, int , int ); +void mpr_memaddr_wait_cb(void *, bus_dma_segment_t *, int , int ); void mpr_init_sge(struct mpr_command *cm, void *req, void *sge); int mpr_attach_user(struct mpr_softc *); void mpr_detach_user(struct mpr_softc *); Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Tue Feb 6 15:41:45 2018 (r328935) +++ head/sys/dev/mps/mps.c Tue Feb 6 15:58:22 2018 (r328936) @@ -111,6 +111,7 @@ static void mps_parse_debug(struct mps_softc *sc, char SYSCTL_NODE(_hw, OID_AUTO, mps, CTLFLAG_RD, 0, "MPS Driver Parameters"); MALLOC_DEFINE(M_MPT2, "mps", "mpt2 driver memory"); +MALLOC_DECLARE(M_MPSUSER); /* * Do a "Diagnostic Reset" aka a hard reset. This should get the chip out of @@ -1158,6 +1159,42 @@ mps_memaddr_cb(void *arg, bus_dma_segment_t *segs, int addr = arg; *addr = segs[0].ds_addr; +} + +void +mps_memaddr_wait_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +{ + struct mps_busdma_context *ctx; + int need_unload, need_free; + + ctx = (struct mps_busdma_context *)arg; + need_unload = 0; + need_free = 0; + + mps_lock(ctx->softc); + ctx->error = error; + ctx->completed = 1; + if ((error == 0) && (ctx->abandoned == 0)) { + *ctx->addr = segs[0].ds_addr; + } else { + if (nsegs != 0) + need_unload = 1; + if (ctx->abandoned != 0) + need_free = 1; + } + if (need_free == 0) + wakeup(ctx); + + mps_unlock(ctx->softc); + + if (need_unload != 0) { + bus_dmamap_unload(ctx->buffer_dmat, + ctx->buffer_dmamap); + *ctx->addr = 0; + } + + if (need_free != 0) + free(ctx, M_MPSUSER); } static int Modified: head/sys/dev/mps/mps_user.c ============================================================================== --- head/sys/dev/mps/mps_user.c Tue Feb 6 15:41:45 2018 (r328935) +++ head/sys/dev/mps/mps_user.c Tue Feb 6 15:58:22 2018 (r328936) @@ -180,7 +180,7 @@ static int mps_user_event_report(struct mps_softc *sc, static int mps_user_reg_access(struct mps_softc *sc, mps_reg_access_t *data); static int mps_user_btdh(struct mps_softc *sc, mps_btdh_mapping_t *data); -static MALLOC_DEFINE(M_MPSUSER, "mps_user", "Buffers for mps(4) ioctls"); +MALLOC_DEFINE(M_MPSUSER, "mps_user", "Buffers for mps(4) ioctls"); /* Macros from compat/freebsd32/freebsd32.h */ #define PTRIN(v) (void *)(uintptr_t)(v) @@ -1222,6 +1222,12 @@ mps_post_fw_diag_buffer(struct mps_softc *sc, * Process POST reply. */ reply = (MPI2_DIAG_BUFFER_POST_REPLY *)cm->cm_reply; + if (reply == NULL) { + mps_printf(sc, "%s: reply is NULL, probably due to " + "reinitialization\n", __func__); + status = MPS_DIAG_FAILURE; + goto done; + } if ((le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK) != MPI2_IOCSTATUS_SUCCESS) { status = MPS_DIAG_FAILURE; @@ -1309,6 +1315,12 @@ mps_release_fw_diag_buffer(struct mps_softc *sc, * Process RELEASE reply. */ reply = (MPI2_DIAG_RELEASE_REPLY *)cm->cm_reply; + if (reply == NULL) { + mps_printf(sc, "%s: reply is NULL, probably due to " + "reinitialization\n", __func__); + status = MPS_DIAG_FAILURE; + goto done; + } if (((le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK) != MPI2_IOCSTATUS_SUCCESS) || pBuffer->owned_by_firmware) { status = MPS_DIAG_FAILURE; @@ -1344,15 +1356,19 @@ mps_diag_register(struct mps_softc *sc, mps_fw_diag_re uint32_t *return_code) { mps_fw_diagnostic_buffer_t *pBuffer; + struct mps_busdma_context *ctx; uint8_t extended_type, buffer_type, i; uint32_t buffer_size; uint32_t unique_id; int status; + int error; extended_type = diag_register->ExtendedType; buffer_type = diag_register->BufferType; buffer_size = diag_register->RequestedBufferSize; unique_id = diag_register->UniqueId; + ctx = NULL; + error = 0; /* * Check for valid buffer type @@ -1401,7 +1417,7 @@ mps_diag_register(struct mps_softc *sc, mps_fw_diag_re *return_code = MPS_FW_DIAG_ERROR_NO_BUFFER; return (MPS_DIAG_FAILURE); } - if (bus_dma_tag_create( sc->mps_parent_dmat, /* parent */ + if (bus_dma_tag_create( sc->mps_parent_dmat, /* parent */ 1, 0, /* algnmnt, boundary */ BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ @@ -1414,17 +1430,84 @@ mps_diag_register(struct mps_softc *sc, mps_fw_diag_re &sc->fw_diag_dmat)) { mps_dprint(sc, MPS_ERROR, "Cannot allocate FW diag buffer DMA tag\n"); - return (ENOMEM); - } - if (bus_dmamem_alloc(sc->fw_diag_dmat, (void **)&sc->fw_diag_buffer, + *return_code = MPS_FW_DIAG_ERROR_NO_BUFFER; + status = MPS_DIAG_FAILURE; + goto bailout; + } + if (bus_dmamem_alloc(sc->fw_diag_dmat, (void **)&sc->fw_diag_buffer, BUS_DMA_NOWAIT, &sc->fw_diag_map)) { mps_dprint(sc, MPS_ERROR, "Cannot allocate FW diag buffer memory\n"); - return (ENOMEM); + *return_code = MPS_FW_DIAG_ERROR_NO_BUFFER; + status = MPS_DIAG_FAILURE; + goto bailout; } bzero(sc->fw_diag_buffer, buffer_size); - bus_dmamap_load(sc->fw_diag_dmat, sc->fw_diag_map, sc->fw_diag_buffer, - buffer_size, mps_memaddr_cb, &sc->fw_diag_busaddr, 0); + + ctx = malloc(sizeof(*ctx), M_MPSUSER, M_WAITOK | M_ZERO); + if (ctx == NULL) { + device_printf(sc->mps_dev, "%s: context malloc failed\n", + __func__); + *return_code = MPS_FW_DIAG_ERROR_NO_BUFFER; + status = MPS_DIAG_FAILURE; + goto bailout; + } + ctx->addr = &sc->fw_diag_busaddr; + ctx->buffer_dmat = sc->fw_diag_dmat; + ctx->buffer_dmamap = sc->fw_diag_map; + ctx->softc = sc; + error = bus_dmamap_load(sc->fw_diag_dmat, sc->fw_diag_map, + sc->fw_diag_buffer, buffer_size, mps_memaddr_wait_cb, + ctx, 0); + + if (error == EINPROGRESS) { + + /* XXX KDM */ + device_printf(sc->mps_dev, "%s: Deferred bus_dmamap_load\n", + __func__); + /* + * Wait for the load to complete. If we're interrupted, + * bail out. + */ + mps_lock(sc); + if (ctx->completed == 0) { + error = msleep(ctx, &sc->mps_mtx, PCATCH, "mpswait", 0); + if (error != 0) { + /* + * We got an error from msleep(9). This is + * most likely due to a signal. Tell + * mpr_memaddr_wait_cb() that we've abandoned + * the context, so it needs to clean up when + * it is called. + */ + ctx->abandoned = 1; + + /* The callback will free this memory */ + ctx = NULL; + mps_unlock(sc); + + device_printf(sc->mps_dev, "Cannot " + "bus_dmamap_load FW diag buffer, error = " + "%d returned from msleep\n", error); + *return_code = MPS_FW_DIAG_ERROR_NO_BUFFER; + status = MPS_DIAG_FAILURE; + goto bailout; + } + } + mps_unlock(sc); + } + + if ((error != 0) || (ctx->error != 0)) { + device_printf(sc->mps_dev, "Cannot bus_dmamap_load FW diag " + "buffer, %serror = %d\n", error ? "" : "callback ", + error ? error : ctx->error); + *return_code = MPS_FW_DIAG_ERROR_NO_BUFFER; + status = MPS_DIAG_FAILURE; + goto bailout; + } + + bus_dmamap_sync(sc->fw_diag_dmat, sc->fw_diag_map, BUS_DMASYNC_PREREAD); + pBuffer->size = buffer_size; /* @@ -1443,19 +1526,29 @@ mps_diag_register(struct mps_softc *sc, mps_fw_diag_re pBuffer->unique_id = unique_id; status = mps_post_fw_diag_buffer(sc, pBuffer, return_code); +bailout: /* * In case there was a failure, free the DMA buffer. */ if (status == MPS_DIAG_FAILURE) { - if (sc->fw_diag_busaddr != 0) + if (sc->fw_diag_busaddr != 0) { bus_dmamap_unload(sc->fw_diag_dmat, sc->fw_diag_map); - if (sc->fw_diag_buffer != NULL) + sc->fw_diag_busaddr = 0; + } + if (sc->fw_diag_buffer != NULL) { bus_dmamem_free(sc->fw_diag_dmat, sc->fw_diag_buffer, sc->fw_diag_map); - if (sc->fw_diag_dmat != NULL) + sc->fw_diag_buffer = NULL; + } + if (sc->fw_diag_dmat != NULL) { bus_dma_tag_destroy(sc->fw_diag_dmat); + sc->fw_diag_dmat = NULL; + } } + if (ctx != NULL) + free(ctx, M_MPSUSER); + return (status); } @@ -1500,13 +1593,19 @@ mps_diag_unregister(struct mps_softc *sc, */ pBuffer->unique_id = MPS_FW_DIAG_INVALID_UID; if (status == MPS_DIAG_SUCCESS) { - if (sc->fw_diag_busaddr != 0) + if (sc->fw_diag_busaddr != 0) { bus_dmamap_unload(sc->fw_diag_dmat, sc->fw_diag_map); - if (sc->fw_diag_buffer != NULL) + sc->fw_diag_busaddr = 0; + } + if (sc->fw_diag_buffer != NULL) { bus_dmamem_free(sc->fw_diag_dmat, sc->fw_diag_buffer, sc->fw_diag_map); - if (sc->fw_diag_dmat != NULL) + sc->fw_diag_buffer = NULL; + } + if (sc->fw_diag_dmat != NULL) { bus_dma_tag_destroy(sc->fw_diag_dmat); + sc->fw_diag_dmat = NULL; + } } return (status); @@ -1615,6 +1714,10 @@ mps_diag_read_buffer(struct mps_softc *sc, *return_code = MPS_FW_DIAG_ERROR_INVALID_PARAMETER; return (MPS_DIAG_FAILURE); } + + /* Sync the DMA map before we copy to userland. */ + bus_dmamap_sync(sc->fw_diag_dmat, sc->fw_diag_map, + BUS_DMASYNC_POSTREAD); /* * Copy the requested data from DMA to the diag_read_buffer. The DMA Modified: head/sys/dev/mps/mpsvar.h ============================================================================== --- head/sys/dev/mps/mpsvar.h Tue Feb 6 15:41:45 2018 (r328935) +++ head/sys/dev/mps/mpsvar.h Tue Feb 6 15:58:22 2018 (r328936) @@ -263,6 +263,16 @@ struct mps_event_handle { u32 mask[MPI2_EVENT_NOTIFY_EVENTMASK_WORDS]; }; +struct mps_busdma_context { + int completed; + int abandoned; + int error; + bus_addr_t *addr; + struct mps_softc *softc; + bus_dmamap_t buffer_dmamap; + bus_dma_tag_t buffer_dmat; +}; + struct mps_queue { struct mps_softc *sc; int qnum; @@ -719,6 +729,7 @@ int mps_detach_sas(struct mps_softc *sc); int mps_read_config_page(struct mps_softc *, struct mps_config_params *); int mps_write_config_page(struct mps_softc *, struct mps_config_params *); void mps_memaddr_cb(void *, bus_dma_segment_t *, int , int ); +void mps_memaddr_wait_cb(void *, bus_dma_segment_t *, int , int ); void mpi_init_sge(struct mps_command *cm, void *req, void *sge); int mps_attach_user(struct mps_softc *); void mps_detach_user(struct mps_softc *); From owner-svn-src-all@freebsd.org Tue Feb 6 16:02:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34609EE40A9; Tue, 6 Feb 2018 16:02:26 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA7CB70E93; Tue, 6 Feb 2018 16:02:25 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D56D61A184; Tue, 6 Feb 2018 16:02:25 +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 w16G2PaL051431; Tue, 6 Feb 2018 16:02:25 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16G2PRV051425; Tue, 6 Feb 2018 16:02:25 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201802061602.w16G2PRV051425@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 6 Feb 2018 16:02:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328937 - in head/sys/dev: mpr mps X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head/sys/dev: mpr mps X-SVN-Commit-Revision: 328937 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 16:02:26 -0000 Author: mav Date: Tue Feb 6 16:02:25 2018 New Revision: 328937 URL: https://svnweb.freebsd.org/changeset/base/328937 Log: Fix queue length reporting in mps(4) and mpr(4). Both drivers were found to report CAM bigger queue depth then they really can handle. It made them later under high load with many disks return some of submitted requests back with CAM_REQUEUE_REQ status for later resubmission. Reviewed by: scottl MFC after: 1 week Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D14215 Modified: head/sys/dev/mpr/mpr.c head/sys/dev/mpr/mpr_sas.c head/sys/dev/mpr/mprvar.h head/sys/dev/mps/mps.c head/sys/dev/mps/mps_sas.c head/sys/dev/mps/mpsvar.h Modified: head/sys/dev/mpr/mpr.c ============================================================================== --- head/sys/dev/mpr/mpr.c Tue Feb 6 15:58:22 2018 (r328936) +++ head/sys/dev/mpr/mpr.c Tue Feb 6 16:02:25 2018 (r328937) @@ -397,6 +397,7 @@ mpr_resize_queues(struct mpr_softc *sc) reqcr = MIN(reqcr, sc->facts->RequestCredit); sc->num_reqs = prireqcr + reqcr; + sc->num_prireqs = prireqcr; sc->num_replies = MIN(sc->max_replyframes + sc->max_evtframes, sc->facts->MaxReplyDescriptorPostQueueDepth) - 1; @@ -1507,7 +1508,7 @@ mpr_alloc_requests(struct mpr_softc *sc) /* XXX Is a failure here a critical problem? */ if (bus_dmamap_create(sc->buffer_dmat, 0, &cm->cm_dmamap) == 0) { - if (i <= sc->facts->HighPriorityCredit) + if (i <= sc->num_prireqs) mpr_free_high_priority_command(sc, cm); else mpr_free_command(sc, cm); Modified: head/sys/dev/mpr/mpr_sas.c ============================================================================== --- head/sys/dev/mpr/mpr_sas.c Tue Feb 6 15:58:22 2018 (r328936) +++ head/sys/dev/mpr/mpr_sas.c Tue Feb 6 16:02:25 2018 (r328937) @@ -728,7 +728,7 @@ mpr_attach_sas(struct mpr_softc *sc) { struct mprsas_softc *sassc; cam_status status; - int unit, error = 0; + int unit, error = 0, reqs; MPR_FUNCTRACE(sc); mpr_dprint(sc, MPR_INIT, "%s entered\n", __func__); @@ -758,7 +758,8 @@ mpr_attach_sas(struct mpr_softc *sc) sc->sassc = sassc; sassc->sc = sc; - if ((sassc->devq = cam_simq_alloc(sc->num_reqs)) == NULL) { + reqs = sc->num_reqs - sc->num_prireqs - 1; + if ((sassc->devq = cam_simq_alloc(reqs)) == NULL) { mpr_dprint(sc, MPR_INIT|MPR_ERROR, "Cannot allocate SIMQ\n"); error = ENOMEM; goto out; @@ -766,7 +767,7 @@ mpr_attach_sas(struct mpr_softc *sc) unit = device_get_unit(sc->mpr_dev); sassc->sim = cam_sim_alloc(mprsas_action, mprsas_poll, "mpr", sassc, - unit, &sc->mpr_mtx, sc->num_reqs, sc->num_reqs, sassc->devq); + unit, &sc->mpr_mtx, reqs, reqs, sassc->devq); if (sassc->sim == NULL) { mpr_dprint(sc, MPR_INIT|MPR_ERROR, "Cannot allocate SIM\n"); error = EINVAL; Modified: head/sys/dev/mpr/mprvar.h ============================================================================== --- head/sys/dev/mpr/mprvar.h Tue Feb 6 15:58:22 2018 (r328936) +++ head/sys/dev/mpr/mprvar.h Tue Feb 6 16:02:25 2018 (r328937) @@ -357,6 +357,7 @@ struct mpr_softc { MPI2_IOC_FACTS_REPLY *facts; int num_reqs; + int num_prireqs; int num_replies; int fqdepth; /* Free queue */ int pqdepth; /* Post queue */ Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Tue Feb 6 15:58:22 2018 (r328936) +++ head/sys/dev/mps/mps.c Tue Feb 6 16:02:25 2018 (r328937) @@ -394,6 +394,7 @@ mps_resize_queues(struct mps_softc *sc) reqcr = MIN(reqcr, sc->facts->RequestCredit); sc->num_reqs = prireqcr + reqcr; + sc->num_prireqs = prireqcr; sc->num_replies = MIN(sc->max_replyframes + sc->max_evtframes, sc->facts->MaxReplyDescriptorPostQueueDepth) - 1; @@ -1453,7 +1454,7 @@ mps_alloc_requests(struct mps_softc *sc) /* XXX Is a failure here a critical problem? */ if (bus_dmamap_create(sc->buffer_dmat, 0, &cm->cm_dmamap) == 0) - if (i <= sc->facts->HighPriorityCredit) + if (i <= sc->num_prireqs) mps_free_high_priority_command(sc, cm); else mps_free_command(sc, cm); Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Tue Feb 6 15:58:22 2018 (r328936) +++ head/sys/dev/mps/mps_sas.c Tue Feb 6 16:02:25 2018 (r328937) @@ -718,7 +718,7 @@ mps_attach_sas(struct mps_softc *sc) { struct mpssas_softc *sassc; cam_status status; - int unit, error = 0; + int unit, error = 0, reqs; MPS_FUNCTRACE(sc); mps_dprint(sc, MPS_INIT, "%s entered\n", __func__); @@ -748,7 +748,8 @@ mps_attach_sas(struct mps_softc *sc) sc->sassc = sassc; sassc->sc = sc; - if ((sassc->devq = cam_simq_alloc(sc->num_reqs)) == NULL) { + reqs = sc->num_reqs - sc->num_prireqs - 1; + if ((sassc->devq = cam_simq_alloc(reqs)) == NULL) { mps_dprint(sc, MPS_ERROR, "Cannot allocate SIMQ\n"); error = ENOMEM; goto out; @@ -756,7 +757,7 @@ mps_attach_sas(struct mps_softc *sc) unit = device_get_unit(sc->mps_dev); sassc->sim = cam_sim_alloc(mpssas_action, mpssas_poll, "mps", sassc, - unit, &sc->mps_mtx, sc->num_reqs, sc->num_reqs, sassc->devq); + unit, &sc->mps_mtx, reqs, reqs, sassc->devq); if (sassc->sim == NULL) { mps_dprint(sc, MPS_INIT|MPS_ERROR, "Cannot allocate SIM\n"); error = EINVAL; Modified: head/sys/dev/mps/mpsvar.h ============================================================================== --- head/sys/dev/mps/mpsvar.h Tue Feb 6 15:58:22 2018 (r328936) +++ head/sys/dev/mps/mpsvar.h Tue Feb 6 16:02:25 2018 (r328937) @@ -345,6 +345,7 @@ struct mps_softc { MPI2_IOC_FACTS_REPLY *facts; int num_reqs; + int num_prireqs; int num_replies; int fqdepth; /* Free queue */ int pqdepth; /* Post queue */ From owner-svn-src-all@freebsd.org Tue Feb 6 16:02:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BCD3EE4129; Tue, 6 Feb 2018 16:02:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B212870F78; Tue, 6 Feb 2018 16:02:33 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 91E441A18E; Tue, 6 Feb 2018 16:02:33 +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 w16G2XBA051481; Tue, 6 Feb 2018 16:02:33 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16G2XlZ051480; Tue, 6 Feb 2018 16:02:33 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201802061602.w16G2XlZ051480@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 6 Feb 2018 16:02:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328938 - head/sys/geom/mirror X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/geom/mirror X-SVN-Commit-Revision: 328938 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 16:02:34 -0000 Author: markj Date: Tue Feb 6 16:02:33 2018 New Revision: 328938 URL: https://svnweb.freebsd.org/changeset/base/328938 Log: Simplify synchronization read error handling. Since synchronization reads are performed by submitting a request to the external mirror provider, we know that the request returns with an error only when gmirror was unable to read a copy of the block from any mirror. Thus, there is no need to retry the request from the synchronization error handler. Tested by: pho MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/sys/geom/mirror/g_mirror.c Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Tue Feb 6 16:02:25 2018 (r328937) +++ head/sys/geom/mirror/g_mirror.c Tue Feb 6 16:02:33 2018 (r328938) @@ -1336,9 +1336,7 @@ g_mirror_sync_request(struct g_mirror_softc *sc, struc */ switch (bp->bio_cmd) { case BIO_READ: { - struct g_mirror_disk *d; struct g_consumer *cp; - int readable; KFAIL_POINT_ERROR(DEBUG_FP, g_mirror_sync_request_read, bp->bio_error); @@ -1349,31 +1347,17 @@ g_mirror_sync_request(struct g_mirror_softc *sc, struc bp->bio_error); /* - * If there's at least one other disk from which we can - * read the block, retry the request. - */ - readable = 0; - LIST_FOREACH(d, &sc->sc_disks, d_next) - if (d->d_state == G_MIRROR_DISK_STATE_ACTIVE && - !(d->d_flags & G_MIRROR_DISK_FLAG_BROKEN)) - readable++; - - /* * The read error will trigger a syncid bump, so there's * no need to do that here. * - * If we can retry the read from another disk, do so. - * Otherwise, all we can do is kick out the new disk. + * The read error handling for regular requests will + * retry the read from all active mirrors before passing + * the error back up, so there's no need to retry here. */ - if (readable == 0) { - g_mirror_sync_request_free(disk, bp); - g_mirror_event_send(disk, - G_MIRROR_DISK_STATE_DISCONNECTED, - G_MIRROR_EVENT_DONTWAIT); - } else { - g_mirror_sync_reinit(disk, bp, bp->bio_offset); - goto retry_read; - } + g_mirror_sync_request_free(disk, bp); + g_mirror_event_send(disk, + G_MIRROR_DISK_STATE_DISCONNECTED, + G_MIRROR_EVENT_DONTWAIT); return; } G_MIRROR_LOGREQ(3, bp, @@ -1429,7 +1413,6 @@ g_mirror_sync_request(struct g_mirror_softc *sc, struc g_mirror_sync_reinit(disk, bp, sync->ds_offset); sync->ds_offset += bp->bio_length; -retry_read: G_MIRROR_LOGREQ(3, bp, "Sending synchronization request."); sync->ds_consumer->index++; From owner-svn-src-all@freebsd.org Tue Feb 6 16:17:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1773EE541A; Tue, 6 Feb 2018 16:17:03 +0000 (UTC) (envelope-from eric@vangyzen.net) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [199.48.133.146]) by mx1.freebsd.org (Postfix) with ESMTP id 5793B7194F; Tue, 6 Feb 2018 16:17:02 +0000 (UTC) (envelope-from eric@vangyzen.net) Received: from sweettea.beer.town (unknown [76.164.8.130]) by smtp.vangyzen.net (Postfix) with ESMTPSA id 42B7B5646B; Tue, 6 Feb 2018 10:09:54 -0600 (CST) Subject: Re: svn commit: r328933 - head/usr.bin/find To: Alex Richardson , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201802061541.w16FfQ1x039394@repo.freebsd.org> From: Eric van Gyzen Message-ID: <66d6d137-d89c-6f73-93eb-423721f99561@vangyzen.net> Date: Tue, 6 Feb 2018 10:09:51 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <201802061541.w16FfQ1x039394@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 16:17:03 -0000 On 02/06/2018 09:41, Alex Richardson wrote: > +#if HAVE_STRUCT_STAT_ST_BIRTHTIME > else if (plan->flags & F_TIME_A) > ft = entry->fts_statp->st_atim; > else if (plan->flags & F_TIME_B) > ft = entry->fts_statp->st_birthtim; > +#endif Did you intend to put st_atim inside the #if? Eric From owner-svn-src-all@freebsd.org Tue Feb 6 17:01:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64881EE9068; Tue, 6 Feb 2018 17:01:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E012573BAD; Tue, 6 Feb 2018 17:01:10 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DAFCA1AB23; Tue, 6 Feb 2018 17:01:10 +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 w16H1Aaj079604; Tue, 6 Feb 2018 17:01:10 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16H1Akh079603; Tue, 6 Feb 2018 17:01:10 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201802061701.w16H1Akh079603@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 6 Feb 2018 17:01:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328939 - head/contrib/gcc/config/mips X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/contrib/gcc/config/mips X-SVN-Commit-Revision: 328939 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 17:01:11 -0000 Author: jhb Date: Tue Feb 6 17:01:10 2018 New Revision: 328939 URL: https://svnweb.freebsd.org/changeset/base/328939 Log: Use a workaround to compile the crt init functions correctly with clang. The MIPS assembly parser treats forward-declared local symbols as global symbols. This results in CALL16 relocations being used against local (private) symbols which then fail to resolve when linking binaries. Add .local to force the init and fini functions to be treated as local as a workaround. Submitted by: sbruno Sponsored by: DARPA / AFRL Modified: head/contrib/gcc/config/mips/mips.h Modified: head/contrib/gcc/config/mips/mips.h ============================================================================== --- head/contrib/gcc/config/mips/mips.h Tue Feb 6 16:02:33 2018 (r328938) +++ head/contrib/gcc/config/mips/mips.h Tue Feb 6 17:01:10 2018 (r328939) @@ -2721,6 +2721,7 @@ while (0) nop\n\ 1: .cpload $31\n\ .set reorder\n\ + .local " USER_LABEL_PREFIX #FUNC "\n\ jal " USER_LABEL_PREFIX #FUNC "\n\ " TEXT_SECTION_ASM_OP); #endif /* Switch to #elif when we're no longer limited by K&R C. */ @@ -2733,6 +2734,7 @@ while (0) nop\n\ 1: .set reorder\n\ .cpsetup $31, $2, 1b\n\ + .local " USER_LABEL_PREFIX #FUNC "\n\ jal " USER_LABEL_PREFIX #FUNC "\n\ " TEXT_SECTION_ASM_OP); #endif From owner-svn-src-all@freebsd.org Tue Feb 6 17:26:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8562EEB793; Tue, 6 Feb 2018 17:26:11 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7DE6D7512F; Tue, 6 Feb 2018 17:26:11 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 785E51AEDD; Tue, 6 Feb 2018 17:26:11 +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 w16HQBsg092222; Tue, 6 Feb 2018 17:26:11 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16HQBsS092221; Tue, 6 Feb 2018 17:26:11 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201802061726.w16HQBsS092221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 6 Feb 2018 17:26:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328940 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 328940 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 17:26:11 -0000 Author: markj Date: Tue Feb 6 17:26:11 2018 New Revision: 328940 URL: https://svnweb.freebsd.org/changeset/base/328940 Log: Delete a declaration for a variable removed in r305362. Modified: head/sys/vm/vm_page.h Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Tue Feb 6 17:01:10 2018 (r328939) +++ head/sys/vm/vm_page.h Tue Feb 6 17:26:11 2018 (r328940) @@ -379,8 +379,6 @@ extern struct mtx_padalign pa_lock[]; * */ -extern int vm_page_zero_count; - extern vm_page_t vm_page_array; /* First resident page in table */ extern long vm_page_array_size; /* number of vm_page_t's */ extern long first_page; /* first physical page number */ From owner-svn-src-all@freebsd.org Tue Feb 6 18:01:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59639EEE328; Tue, 6 Feb 2018 18:01:42 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0ECC376892; Tue, 6 Feb 2018 18:01:42 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 094BF1B52C; Tue, 6 Feb 2018 18:01:42 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w16I1fiC009962; Tue, 6 Feb 2018 18:01:41 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16I1fvp009942; Tue, 6 Feb 2018 18:01:41 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802061801.w16I1fvp009942@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 6 Feb 2018 18:01:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328941 - stable/11/sys/boot/mips/beri/loader X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/sys/boot/mips/beri/loader X-SVN-Commit-Revision: 328941 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 18:01:42 -0000 Author: kevans Date: Tue Feb 6 18:01:41 2018 New Revision: 328941 URL: https://svnweb.freebsd.org/changeset/base/328941 Log: MFC r308774: loader: beri_sdcard_disk_print() needs to return int. r308434 did change the return type for dv_print callbacks, but the return type for beri_sdcard_disk_print() was left unchanged, causing compile errors. Modified: stable/11/sys/boot/mips/beri/loader/beri_disk_sdcard.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/mips/beri/loader/beri_disk_sdcard.c ============================================================================== --- stable/11/sys/boot/mips/beri/loader/beri_disk_sdcard.c Tue Feb 6 17:26:11 2018 (r328940) +++ stable/11/sys/boot/mips/beri/loader/beri_disk_sdcard.c Tue Feb 6 18:01:41 2018 (r328941) @@ -118,7 +118,7 @@ beri_sdcard_disk_close(struct open_file *f) return (disk_close(dev)); } -static void +static int beri_sdcard_disk_print(int verbose) { struct disk_devdesc dev; From owner-svn-src-all@freebsd.org Tue Feb 6 18:18:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8167EEF7C6; Tue, 6 Feb 2018 18:18:10 +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 516AD7759F; Tue, 6 Feb 2018 18:18:09 +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 w16II2il001409 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 6 Feb 2018 10:18:02 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w16II13a001408; Tue, 6 Feb 2018 10:18:01 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 6 Feb 2018 10:18:01 -0800 From: Gleb Smirnoff To: Andrew Turner Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328916 - in head/sys: kern vm Message-ID: <20180206181801.GA1063@FreeBSD.org> References: <201802060416.w164G0va096970@repo.freebsd.org> <6675B0B0-A582-4D5A-832B-A0E0E13B9E6C@fubar.geek.nz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <6675B0B0-A582-4D5A-832B-A0E0E13B9E6C@fubar.geek.nz> User-Agent: Mutt/1.9.3 (2018-01-21) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 18:18:11 -0000 On Tue, Feb 06, 2018 at 10:54:05AM +0000, Andrew Turner wrote: A> > Author: glebius A> > Date: Tue Feb 6 04:16:00 2018 A> > New Revision: 328916 A> > URL: https://svnweb.freebsd.org/changeset/base/328916 A> > A> > Log: A> > Followup on r302393 by cperciva, improving calculation of boot pages required A> > for UMA startup. A> > A> > o Introduce another stage of UMA startup, which is entered after A> > vm_page_startup() finishes. After this stage we don't yet enable buckets, A> > but we can ask VM for pages. Rename stages to meaningful names while here. A> > New list of stages: BOOT_COLD, BOOT_STRAPPED, BOOT_PAGEALLOC, BOOT_BUCKETS, A> > BOOT_RUNNING. A> > Enabling page alloc earlier allows us to dramatically reduce number of A> > boot pages required. What is more important number of zones becomes A> > consistent across different machines, as no MD allocations are done before A> > the BOOT_PAGEALLOC stage. Now only UMA internal zones actually need to use A> > startup_alloc(), however that may change, so vm_page_startup() provides A> > its need for early zones as argument. A> > o Introduce uma_startup_count() function, to avoid code duplication. The A> > functions calculates sizes of zones zone and kegs zone, and calculates how A> > many pages UMA will need to bootstrap. A> > It counts not only of zone structures, but also of kegs, slabs and hashes. A> > o Hide uma_startup_foo() declarations from public file. A> > o Provide several DIAGNOSTIC printfs on boot_pages usage. A> > o Bugfix: when calculating zone of zones size use (mp_maxid + 1) instead of A> > mp_ncpus. Use resulting number not only in the size argument to zone_ctor() A> > but also as args.size. A> A> With this I’m getting "panic: UMA: Increase vm.boot_pages†on an arm64 simulator with 4GB of memory. I can increase vm.boot_pages manually, however this isn’t useful in the long term. Sorry for problems. Can you please put DIAGNOSTIC into beginning of uma_core.c, and boot with vm.boot_pages bumped, and provide the dmesg to me? -- Gleb Smirnoff From owner-svn-src-all@freebsd.org Tue Feb 6 18:28:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BFEBEF069A; Tue, 6 Feb 2018 18:28:42 +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 2621577EB3; Tue, 6 Feb 2018 18:28:41 +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 w16ISekg001455 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 6 Feb 2018 10:28:40 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w16ISdMf001454; Tue, 6 Feb 2018 10:28:39 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 6 Feb 2018 10:28:39 -0800 From: Gleb Smirnoff To: Peter Holm Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328916 - in head/sys: kern vm Message-ID: <20180206182839.GB1063@FreeBSD.org> References: <201802060416.w164G0va096970@repo.freebsd.org> <20180206113017.GA25428@x2.osted.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180206113017.GA25428@x2.osted.lan> User-Agent: Mutt/1.9.3 (2018-01-21) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 18:28:42 -0000 Peter, On Tue, Feb 06, 2018 at 12:30:17PM +0100, Peter Holm wrote: P> i386 also doesn't boot: P> P> FreeBSD 12.0-CURRENT #1 r328924: Tue Feb 6 11:51:17 CET 2018 P> pho@x4.osted.lan:/usr/src/sys/i386/compile/PHO i386 P> FreeBSD clang version 6.0.0 (branches/release_60 321788) (based on LLVM 6.0.0) P> WARNING: WITNESS option enabled, expect reduced performance. P> WARNING: DIAGNOSTIC option enabled, expect reduced performance. P> Entering uma_startup with 4 boot pages configured P> startup_alloc from "UMA Kegs", 3 boot pages left P> startup_alloc from "UMA Zones", 2 boot pages left P> startup_alloc from "UMA Hash", 1 boot pages left P> Entering uma_startup1 with 0 boot pages left P> kernel trap 12 with interrupts disabled Sorry for problems, I'm working on this. How do you think, is it a good idea to quickly add a one line change to subversion that would bump boot_pages value to arbitrary +100, to fixup the head while I'm working on a proper fix? -- Gleb Smirnoff From owner-svn-src-all@freebsd.org Tue Feb 6 19:09:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAFCCEF3BA5; Tue, 6 Feb 2018 19:09:03 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B07479FF9; Tue, 6 Feb 2018 19:09:03 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 82A3C1BFD6; Tue, 6 Feb 2018 19:09:03 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w16J93Lu042669; Tue, 6 Feb 2018 19:09:03 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16J93KW042667; Tue, 6 Feb 2018 19:09:03 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201802061909.w16J93KW042667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Tue, 6 Feb 2018 19:09:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328942 - in stable/11/lib/libc: gen sys X-SVN-Group: stable-11 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in stable/11/lib/libc: gen sys X-SVN-Commit-Revision: 328942 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 19:09:04 -0000 Author: mckusick Date: Tue Feb 6 19:09:03 2018 New Revision: 328942 URL: https://svnweb.freebsd.org/changeset/base/328942 Log: MFC of 328304 and 328382. Do not dedup egid (group entry 0) Modified: stable/11/lib/libc/gen/getgrent.c stable/11/lib/libc/sys/setgroups.2 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/gen/getgrent.c ============================================================================== --- stable/11/lib/libc/gen/getgrent.c Tue Feb 6 18:01:41 2018 (r328941) +++ stable/11/lib/libc/gen/getgrent.c Tue Feb 6 19:09:03 2018 (r328942) @@ -434,7 +434,7 @@ gr_addgid(gid_t gid, gid_t *groups, int maxgrp, int *g { int ret, dupc; - for (dupc = 0; dupc < MIN(maxgrp, *grpcnt); dupc++) { + for (dupc = 1; dupc < MIN(maxgrp, *grpcnt); dupc++) { if (groups[dupc] == gid) return 1; } Modified: stable/11/lib/libc/sys/setgroups.2 ============================================================================== --- stable/11/lib/libc/sys/setgroups.2 Tue Feb 6 18:01:41 2018 (r328941) +++ stable/11/lib/libc/sys/setgroups.2 Tue Feb 6 19:09:03 2018 (r328942) @@ -28,7 +28,7 @@ .\" @(#)setgroups.2 8.2 (Berkeley) 4/16/94 .\" $FreeBSD$ .\" -.Dd April 16, 1994 +.Dd January 19, 2018 .Dt SETGROUPS 2 .Os .Sh NAME @@ -56,6 +56,23 @@ more than .Dv {NGROUPS_MAX}+1 . .Pp Only the super-user may set a new group list. +.Pp +The first entry of the group array +.Pq Va gidset[0] +is used as the effective group-ID for the process. +This entry is over-written when a setgid program is run. +To avoid losing access to the privileges of the +.Va gidset[0] +entry, it should be duplicated later in the group array. +By convention, +this happens because the group value indicated +in the password file also appears in +.Pa /etc/group . +The group value in the password file is placed in +.Va gidset[0] +and that value then gets added a second time when the +.Pa /etc/group +file is scanned to create the group set. .Sh RETURN VALUES .Rv -std setgroups .Sh ERRORS From owner-svn-src-all@freebsd.org Tue Feb 6 19:09:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE0ACEF3C76; Tue, 6 Feb 2018 19:09:49 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7035F7A136; Tue, 6 Feb 2018 19:09:49 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B24D1BFDA; Tue, 6 Feb 2018 19:09:49 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w16J9nXr042754; Tue, 6 Feb 2018 19:09:49 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16J9nOi042752; Tue, 6 Feb 2018 19:09:49 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201802061909.w16J9nOi042752@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Tue, 6 Feb 2018 19:09: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: r328943 - in stable/10/lib/libc: gen sys X-SVN-Group: stable-10 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in stable/10/lib/libc: gen sys X-SVN-Commit-Revision: 328943 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 19:09:50 -0000 Author: mckusick Date: Tue Feb 6 19:09:49 2018 New Revision: 328943 URL: https://svnweb.freebsd.org/changeset/base/328943 Log: MFC of 328304 and 328382. Do not dedup egid (group entry 0) Modified: stable/10/lib/libc/gen/getgrent.c stable/10/lib/libc/sys/setgroups.2 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/gen/getgrent.c ============================================================================== --- stable/10/lib/libc/gen/getgrent.c Tue Feb 6 19:09:03 2018 (r328942) +++ stable/10/lib/libc/gen/getgrent.c Tue Feb 6 19:09:49 2018 (r328943) @@ -433,7 +433,7 @@ gr_addgid(gid_t gid, gid_t *groups, int maxgrp, int *g { int ret, dupc; - for (dupc = 0; dupc < MIN(maxgrp, *grpcnt); dupc++) { + for (dupc = 1; dupc < MIN(maxgrp, *grpcnt); dupc++) { if (groups[dupc] == gid) return 1; } Modified: stable/10/lib/libc/sys/setgroups.2 ============================================================================== --- stable/10/lib/libc/sys/setgroups.2 Tue Feb 6 19:09:03 2018 (r328942) +++ stable/10/lib/libc/sys/setgroups.2 Tue Feb 6 19:09:49 2018 (r328943) @@ -28,7 +28,7 @@ .\" @(#)setgroups.2 8.2 (Berkeley) 4/16/94 .\" $FreeBSD$ .\" -.Dd April 16, 1994 +.Dd January 19, 2018 .Dt SETGROUPS 2 .Os .Sh NAME @@ -56,6 +56,23 @@ more than .Dv {NGROUPS_MAX}+1 . .Pp Only the super-user may set a new group list. +.Pp +The first entry of the group array +.Pq Va gidset[0] +is used as the effective group-ID for the process. +This entry is over-written when a setgid program is run. +To avoid losing access to the privileges of the +.Va gidset[0] +entry, it should be duplicated later in the group array. +By convention, +this happens because the group value indicated +in the password file also appears in +.Pa /etc/group . +The group value in the password file is placed in +.Va gidset[0] +and that value then gets added a second time when the +.Pa /etc/group +file is scanned to create the group set. .Sh RETURN VALUES .Rv -std setgroups .Sh ERRORS From owner-svn-src-all@freebsd.org Tue Feb 6 19:13:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F278DEF4207; Tue, 6 Feb 2018 19:13:44 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A3C217A617; Tue, 6 Feb 2018 19:13:44 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9EB6B1C16E; Tue, 6 Feb 2018 19:13:44 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w16JDi9X047548; Tue, 6 Feb 2018 19:13:44 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16JDiP8047547; Tue, 6 Feb 2018 19:13:44 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201802061913.w16JDiP8047547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Tue, 6 Feb 2018 19:13:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328944 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 328944 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 19:13:45 -0000 Author: mckusick Date: Tue Feb 6 19:13:44 2018 New Revision: 328944 URL: https://svnweb.freebsd.org/changeset/base/328944 Log: MFC of 328643. fix vn_printf listing of its union Modified: stable/11/sys/kern/vfs_subr.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/vfs_subr.c ============================================================================== --- stable/11/sys/kern/vfs_subr.c Tue Feb 6 19:09:49 2018 (r328943) +++ stable/11/sys/kern/vfs_subr.c Tue Feb 6 19:13:44 2018 (r328944) @@ -3355,8 +3355,25 @@ vn_printf(struct vnode *vp, const char *fmt, ...) va_end(ap); printf("%p: ", (void *)vp); printf("tag %s, type %s\n", vp->v_tag, typename[vp->v_type]); - printf(" usecount %d, writecount %d, refcount %d mountedhere %p\n", - vp->v_usecount, vp->v_writecount, vp->v_holdcnt, vp->v_mountedhere); + printf(" usecount %d, writecount %d, refcount %d", + vp->v_usecount, vp->v_writecount, vp->v_holdcnt); + switch (vp->v_type) { + case VDIR: + printf(" mountedhere %p\n", vp->v_mountedhere); + break; + case VCHR: + printf(" rdev %p\n", vp->v_rdev); + break; + case VSOCK: + printf(" socket %p\n", vp->v_unpcb); + break; + case VFIFO: + printf(" fifoinfo %p\n", vp->v_fifoinfo); + break; + default: + printf("\n"); + break; + } buf[0] = '\0'; buf[1] = '\0'; if (vp->v_vflag & VV_ROOT) From owner-svn-src-all@freebsd.org Tue Feb 6 19:14:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B20A1EF42D8; Tue, 6 Feb 2018 19:14:15 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6809F7A768; Tue, 6 Feb 2018 19:14:15 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 630E51C180; Tue, 6 Feb 2018 19:14:15 +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 w16JEFD8047616; Tue, 6 Feb 2018 19:14:15 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16JEFt6047615; Tue, 6 Feb 2018 19:14:15 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201802061914.w16JEFt6047615@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 6 Feb 2018 19:14:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328945 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 328945 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 19:14:15 -0000 Author: bz Date: Tue Feb 6 19:14:15 2018 New Revision: 328945 URL: https://svnweb.freebsd.org/changeset/base/328945 Log: Remove a trailing whitspace. Modified: head/sys/sys/bus_dma.h Modified: head/sys/sys/bus_dma.h ============================================================================== --- head/sys/sys/bus_dma.h Tue Feb 6 19:13:44 2018 (r328944) +++ head/sys/sys/bus_dma.h Tue Feb 6 19:14:15 2018 (r328945) @@ -178,7 +178,7 @@ int bus_dma_tag_create(bus_dma_tag_t parent, bus_size_ /* * Set the memory domain to be used for allocations. - * + * * Automatic for PCI devices. Must be set prior to creating maps or * allocating memory. */ From owner-svn-src-all@freebsd.org Tue Feb 6 19:14:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24F1DEF4418; Tue, 6 Feb 2018 19:14:54 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C53167A8DD; Tue, 6 Feb 2018 19:14:53 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C03BF1C185; Tue, 6 Feb 2018 19:14:53 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w16JEroh047680; Tue, 6 Feb 2018 19:14:53 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16JEr5K047679; Tue, 6 Feb 2018 19:14:53 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201802061914.w16JEr5K047679@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Tue, 6 Feb 2018 19:14: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: r328946 - stable/10/sys/kern X-SVN-Group: stable-10 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: stable/10/sys/kern X-SVN-Commit-Revision: 328946 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 19:14:54 -0000 Author: mckusick Date: Tue Feb 6 19:14:53 2018 New Revision: 328946 URL: https://svnweb.freebsd.org/changeset/base/328946 Log: MFC of 328643. fix vn_printf listing of its union 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 Tue Feb 6 19:14:15 2018 (r328945) +++ stable/10/sys/kern/vfs_subr.c Tue Feb 6 19:14:53 2018 (r328946) @@ -3020,8 +3020,25 @@ vn_printf(struct vnode *vp, const char *fmt, ...) va_end(ap); printf("%p: ", (void *)vp); printf("tag %s, type %s\n", vp->v_tag, typename[vp->v_type]); - printf(" usecount %d, writecount %d, refcount %d mountedhere %p\n", - vp->v_usecount, vp->v_writecount, vp->v_holdcnt, vp->v_mountedhere); + printf(" usecount %d, writecount %d, refcount %d", + vp->v_usecount, vp->v_writecount, vp->v_holdcnt); + switch (vp->v_type) { + case VDIR: + printf(" mountedhere %p\n", vp->v_mountedhere); + break; + case VCHR: + printf(" rdev %p\n", vp->v_rdev); + break; + case VSOCK: + printf(" socket %p\n", vp->v_unpcb); + break; + case VFIFO: + printf(" fifoinfo %p\n", vp->v_fifoinfo); + break; + default: + printf("\n"); + break; + } buf[0] = '\0'; buf[1] = '\0'; if (vp->v_vflag & VV_ROOT) From owner-svn-src-all@freebsd.org Tue Feb 6 19:17:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25DD1EF4784; Tue, 6 Feb 2018 19:17:06 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CC0577AB5D; Tue, 6 Feb 2018 19:17:05 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C70CA1C18E; Tue, 6 Feb 2018 19:17:05 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w16JH5WA047823; Tue, 6 Feb 2018 19:17:05 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16JH5XX047822; Tue, 6 Feb 2018 19:17:05 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201802061917.w16JH5XX047822@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Tue, 6 Feb 2018 19:17:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328947 - stable/11/sys/geom/journal X-SVN-Group: stable-11 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: stable/11/sys/geom/journal X-SVN-Commit-Revision: 328947 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 19:17:06 -0000 Author: mckusick Date: Tue Feb 6 19:17:05 2018 New Revision: 328947 URL: https://svnweb.freebsd.org/changeset/base/328947 Log: MFC of 328647. avoid segment fault in g_journal Modified: stable/11/sys/geom/journal/g_journal.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/geom/journal/g_journal.c ============================================================================== --- stable/11/sys/geom/journal/g_journal.c Tue Feb 6 19:14:53 2018 (r328946) +++ stable/11/sys/geom/journal/g_journal.c Tue Feb 6 19:17:05 2018 (r328947) @@ -2430,6 +2430,7 @@ g_journal_destroy(struct g_journal_softc *sc) sc->sc_current_count); } + gp->softc = NULL; LIST_FOREACH(cp, &gp->consumer, consumer) { if (cp->acr + cp->acw + cp->ace > 0) g_access(cp, -1, -1, -1); @@ -2441,7 +2442,6 @@ g_journal_destroy(struct g_journal_softc *sc) */ g_post_event(g_journal_destroy_consumer, cp, M_WAITOK, NULL); } - gp->softc = NULL; g_wither_geom(gp, ENXIO); free(sc, M_JOURNAL); return (0); From owner-svn-src-all@freebsd.org Tue Feb 6 19:17:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7842BEF4832; Tue, 6 Feb 2018 19:17:41 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2B9447AC97; Tue, 6 Feb 2018 19:17:41 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 268881C191; Tue, 6 Feb 2018 19:17:41 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w16JHfAa047886; Tue, 6 Feb 2018 19:17:41 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16JHf0t047885; Tue, 6 Feb 2018 19:17:41 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201802061917.w16JHf0t047885@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Tue, 6 Feb 2018 19:17:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r328948 - stable/10/sys/geom/journal X-SVN-Group: stable-10 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: stable/10/sys/geom/journal X-SVN-Commit-Revision: 328948 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 19:17:41 -0000 Author: mckusick Date: Tue Feb 6 19:17:40 2018 New Revision: 328948 URL: https://svnweb.freebsd.org/changeset/base/328948 Log: MFC of 328647. avoid segment fault in g_journal Modified: stable/10/sys/geom/journal/g_journal.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/journal/g_journal.c ============================================================================== --- stable/10/sys/geom/journal/g_journal.c Tue Feb 6 19:17:05 2018 (r328947) +++ stable/10/sys/geom/journal/g_journal.c Tue Feb 6 19:17:40 2018 (r328948) @@ -2433,6 +2433,7 @@ g_journal_destroy(struct g_journal_softc *sc) sc->sc_current_count); } + gp->softc = NULL; LIST_FOREACH(cp, &gp->consumer, consumer) { if (cp->acr + cp->acw + cp->ace > 0) g_access(cp, -1, -1, -1); @@ -2444,7 +2445,6 @@ g_journal_destroy(struct g_journal_softc *sc) */ g_post_event(g_journal_destroy_consumer, cp, M_WAITOK, NULL); } - gp->softc = NULL; g_wither_geom(gp, ENXIO); free(sc, M_JOURNAL); return (0); From owner-svn-src-all@freebsd.org Tue Feb 6 19:25:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B183EF5494; Tue, 6 Feb 2018 19:25:15 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0EC7A7BD2D; Tue, 6 Feb 2018 19:25:13 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w16JP4n1017962; Tue, 6 Feb 2018 11:25:04 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w16JP4aq017961; Tue, 6 Feb 2018 11:25:04 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201802061925.w16JP4aq017961@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r328934 - in head: . bin/sh In-Reply-To: <201802061541.w16FfadO041469@repo.freebsd.org> To: Alex Richardson Date: Tue, 6 Feb 2018 11:25:04 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 19:25:15 -0000 > Author: arichardson > Date: Tue Feb 6 15:41:35 2018 > New Revision: 328934 > URL: https://svnweb.freebsd.org/changeset/base/328934 > > Log: > Don't hardcode /usr/bin as the path for mktemp in build tools > > It won't work e.g. when crossbuilding from Ubuntu Linux as mktemp is in > /bin there. > > Reviewed By: bdrewery > Approved By: jhb (mentor) > Differential Revision: https://reviews.freebsd.org/D13937 Would it be better to create the variable MKTEMP to point at either /bin/mktemp or /usr/bin/mktemp dependent on platform, there are reasons we use full paths in Makefiles, mostly to stop /usr/local/bin/foo contimaton, which I believe this change now opens up, though very slight as I dont know of a third party mktemp binary. > Modified: > head/Makefile.inc1 > head/bin/sh/mkbuiltins > head/bin/sh/mktokens > > Modified: head/Makefile.inc1 > ============================================================================== > --- head/Makefile.inc1 Tue Feb 6 15:41:26 2018 (r328933) > +++ head/Makefile.inc1 Tue Feb 6 15:41:35 2018 (r328934) > @@ -463,7 +463,7 @@ TMPPATH= ${STRICTTMPPATH}:${PATH} > # when in the middle of installing over this system. > # > .if make(distributeworld) || make(installworld) || make(stageworld) > -INSTALLTMP!= /usr/bin/mktemp -d -u -t install > +INSTALLTMP!= mktemp -d -u -t install > .endif > > .if make(stagekernel) || make(distributekernel) > > Modified: head/bin/sh/mkbuiltins > ============================================================================== > --- head/bin/sh/mkbuiltins Tue Feb 6 15:41:26 2018 (r328933) > +++ head/bin/sh/mkbuiltins Tue Feb 6 15:41:35 2018 (r328934) > @@ -34,7 +34,7 @@ > # @(#)mkbuiltins 8.2 (Berkeley) 5/4/95 > # $FreeBSD$ > > -temp=`/usr/bin/mktemp -t ka` > +temp=`mktemp -t ka` > havehist=1 > if [ "X$1" = "X-h" ]; then > havehist=0 > > Modified: head/bin/sh/mktokens > ============================================================================== > --- head/bin/sh/mktokens Tue Feb 6 15:41:26 2018 (r328933) > +++ head/bin/sh/mktokens Tue Feb 6 15:41:35 2018 (r328934) > @@ -38,7 +38,7 @@ > # token marks the end of a list. The third column is the name to print in > # error messages. > > -temp=`/usr/bin/mktemp -t ka` > +temp=`mktemp -t ka` > cat > $temp <<\! > TEOF 1 end of file > TNL 0 newline > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue Feb 6 19:34:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44911EF645A; Tue, 6 Feb 2018 19:34:34 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay01.pair.com (relay01.pair.com [209.68.5.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D744F7C783; Tue, 6 Feb 2018 19:34:33 +0000 (UTC) (envelope-from pho@holm.cc) Received: from x2.osted.lan (87-58-223-204-dynamic.dk.customer.tdc.net [87.58.223.204]) by relay01.pair.com (Postfix) with ESMTP id 432B8D00B7D; Tue, 6 Feb 2018 14:34:32 -0500 (EST) Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.14.9/8.14.9) with ESMTP id w16JYUC7036314 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 6 Feb 2018 20:34:30 +0100 (CET) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.14.9/8.14.9/Submit) id w16JYUds036313; Tue, 6 Feb 2018 20:34:30 +0100 (CET) (envelope-from pho) Date: Tue, 6 Feb 2018 20:34:30 +0100 From: Peter Holm To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328916 - in head/sys: kern vm Message-ID: <20180206193430.GA36054@x2.osted.lan> References: <201802060416.w164G0va096970@repo.freebsd.org> <20180206113017.GA25428@x2.osted.lan> <20180206182839.GB1063@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180206182839.GB1063@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 19:34:34 -0000 On Tue, Feb 06, 2018 at 10:28:39AM -0800, Gleb Smirnoff wrote: > Peter, > > On Tue, Feb 06, 2018 at 12:30:17PM +0100, Peter Holm wrote: > P> i386 also doesn't boot: > P> > P> FreeBSD 12.0-CURRENT #1 r328924: Tue Feb 6 11:51:17 CET 2018 > P> pho@x4.osted.lan:/usr/src/sys/i386/compile/PHO i386 > P> FreeBSD clang version 6.0.0 (branches/release_60 321788) (based on LLVM 6.0.0) > P> WARNING: WITNESS option enabled, expect reduced performance. > P> WARNING: DIAGNOSTIC option enabled, expect reduced performance. > P> Entering uma_startup with 4 boot pages configured > P> startup_alloc from "UMA Kegs", 3 boot pages left > P> startup_alloc from "UMA Zones", 2 boot pages left > P> startup_alloc from "UMA Hash", 1 boot pages left > P> Entering uma_startup1 with 0 boot pages left > P> kernel trap 12 with interrupts disabled > > Sorry for problems, I'm working on this. > > How do you think, is it a good idea to quickly add a one line change > to subversion that would bump boot_pages value to arbitrary +100, > to fixup the head while I'm working on a proper fix? > Oh, this is not a problem for me. Increasing boot_pages does however not seem to change anything: OK set vm.boot_pages=164 OK boot /boot/kernel/kernel text=0x146eead data=0xf0da0+0x2aa460 syms=[0x4+0xf0420+0x4+0x1865f5] /boot/entropy size=0x1000 /boot/kernel/amdtemp.ko text=0x2154 data=0x164+0x4 syms=[0x4+0x600+0x4+0x6d9] loading required module 'amdsmn' /boot/kernel/amdsmn.ko text=0xe1c data=0x124+0x4 syms=[0x4+0x4a0+0x4+0x4fd] Booting... GDB: no debug ports present KDB: debugger backends: ddb KDB: current backend: ddb Copyright (c) 1992-2018 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 12.0-CURRENT #3 r328941: Tue Feb 6 20:20:12 CET 2018 pho@x4.osted.lan:/usr/src/sys/i386/compile/PHO i386 FreeBSD clang version 6.0.0 (branches/release_60 321788) (based on LLVM 6.0.0) WARNING: WITNESS option enabled, expect reduced performance. WARNING: DIAGNOSTIC option enabled, expect reduced performance. Entering uma_startup with 164 boot pages configured startup_alloc from "UMA Kegs", 163 boot pages left startup_alloc from "UMA Zones", 162 boot pages left startup_alloc from "UMA Hash", 161 boot pages left Entering uma_startup1 with 160 boot pages left kernel trap 12 with interrupts disabled Fatal trap 12: page fault while in kernel mode cpuid = 0; apic id = 00 fault virtual address = 0x19c fault code = supervisor read, page not present instruction pointer = 0x20:0xc0cdac38 stack pointer = 0x28:0xc2022bd0 frame pointer = 0x28:0xc2022c00 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, def32 1, gran 1 processor eflags = resume, IOPL = 0 current process = 0 () [ thread pid 0 tid 0 ] Stopped at vmem_alloc+0x88: cmpl %esi,0x19c(%edi) db> bt Tracing pid 0 tid 0 td 0xc1be3a40 vmem_alloc(0,1000,2102,c2022c1c,c169f490,...) at vmem_alloc+0x88/frame 0xc2022c00 kmem_malloc_domain(0,1000,102) at kmem_malloc_domain+0x44/frame 0xc2022c2c page_alloc(c2318000,1000,0,c2022c77,102,...) at page_alloc+0x26/frame 0xc2022c44 keg_alloc_slab(0,2,c169f490,d19,c2315b70,...) at keg_alloc_slab+0xf6/frame 0xc2022c8c uma_prealloc(c2318000,4,0,0,0,...) at uma_prealloc+0x95/frame 0xc2022cbc vmem_startup(c2157000,c0cc523b,c12b048b,c2022d0c,c2022d0c,...) at vmem_startup+0xf5/frame 0xc2022ce4 vm_mem_init(0,0,0,0,c1869340,...) at vm_mem_init+0x24/frame 0xc2022d10 mi_startup() at mi_startup+0xf7/frame 0xc2022d38 begin() at begin+0x2f db> - Peter From owner-svn-src-all@freebsd.org Tue Feb 6 19:35:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB4B0EF654D for ; Tue, 6 Feb 2018 19:35:20 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 74DD67C8F2 for ; Tue, 6 Feb 2018 19:35:20 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: da42dac0-0b74-11e8-91c6-33ffc249f3e8 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id da42dac0-0b74-11e8-91c6-33ffc249f3e8; Tue, 06 Feb 2018 19:35:15 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w16JZDeu019260; Tue, 6 Feb 2018 12:35:13 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1517945713.1366.108.camel@freebsd.org> Subject: Re: svn commit: r328934 - in head: . bin/sh From: Ian Lepore To: rgrimes@freebsd.org, Alex Richardson Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 06 Feb 2018 12:35:13 -0700 In-Reply-To: <201802061925.w16JP4aq017961@pdx.rh.CN85.dnsmgr.net> References: <201802061925.w16JP4aq017961@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 19:35:21 -0000 On Tue, 2018-02-06 at 11:25 -0800, Rodney W. Grimes wrote: > > > > Author: arichardson > > Date: Tue Feb  6 15:41:35 2018 > > New Revision: 328934 > > URL: https://svnweb.freebsd.org/changeset/base/328934 > > > > Log: > >   Don't hardcode /usr/bin as the path for mktemp in build tools > >    > >   It won't work e.g. when crossbuilding from Ubuntu Linux as mktemp > > is in > >   /bin there. > >    > >   Reviewed By: bdrewery > >   Approved By: jhb (mentor) > >   Differential Revision: https://reviews.freebsd.org/D13937 > Would it be better to create the variable MKTEMP to point at > either /bin/mktemp or /usr/bin/mktemp dependent on platform, > there are reasons we use full paths in Makefiles, mostly to > stop /usr/local/bin/foo contimaton, which I believe this > change now opens up, though very slight as I dont know of > a third party mktemp binary. > I don't understand this idea of /usr/local "polluting" a system.  It seems to me exactly the opposite would be the case... if I have found some 3rd party version of mktemp that I like better, it would be installed in /usr/local.  If I went out of my way to install that, then naturally I WANT it to be used.  To me, it's insane that the /usr/local paths are not in front of the base system paths by default, and it's even more insane that the base system works so hard to NOT use the replacements I've installed (even if I've arranged PATH so that the right versions should be used) so that I have to track down why it's using the wrong thing and apply ad-hoc fixes. -- Ian From owner-svn-src-all@freebsd.org Tue Feb 6 20:12:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 930A7F020EE; Tue, 6 Feb 2018 20:12:06 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E34E7E4CF; Tue, 6 Feb 2018 20:12:06 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 313E61CBC5; Tue, 6 Feb 2018 20:12:06 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w16KC62f074952; Tue, 6 Feb 2018 20:12:06 GMT (envelope-from feld@FreeBSD.org) Received: (from feld@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16KC64l074951; Tue, 6 Feb 2018 20:12:06 GMT (envelope-from feld@FreeBSD.org) Message-Id: <201802062012.w16KC64l074951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: feld set sender to feld@FreeBSD.org using -f From: Mark Felder Date: Tue, 6 Feb 2018 20:12:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328949 - head/etc X-SVN-Group: head X-SVN-Commit-Author: feld X-SVN-Commit-Paths: head/etc X-SVN-Commit-Revision: 328949 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 20:12:06 -0000 Author: feld (ports committer) Date: Tue Feb 6 20:12:05 2018 New Revision: 328949 URL: https://svnweb.freebsd.org/changeset/base/328949 Log: Fix firstboot fs mount logic The firstboot logic has an error which causes the filesystem to be mounted readonly even though root_rw_mount=YES. This fixes the error to ensure that the root filesystem is mounted rw as expected after the run of the firstboot scripts. Reviewed by: imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D14226 Modified: head/etc/rc Modified: head/etc/rc ============================================================================== --- head/etc/rc Tue Feb 6 19:17:40 2018 (r328948) +++ head/etc/rc Tue Feb 6 20:12:05 2018 (r328949) @@ -141,10 +141,10 @@ if [ -e ${firstboot_sentinel} ]; then if [ -e ${firstboot_sentinel}-reboot ]; then chflags -R 0 ${firstboot_sentinel}-reboot rm -rf ${firstboot_sentinel}-reboot - checkyesno root_rw_mount && mount -ur / + checkyesno root_rw_mount || mount -ur / kill -INT 1 fi - checkyesno root_rw_mount && mount -ur / + checkyesno root_rw_mount || mount -ur / fi echo '' From owner-svn-src-all@freebsd.org Tue Feb 6 21:01:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB747F0617F; Tue, 6 Feb 2018 21:01:39 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A0ECA80FBC; Tue, 6 Feb 2018 21:01:39 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 818991D443; Tue, 6 Feb 2018 21:01:39 +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 w16L1dAf003735; Tue, 6 Feb 2018 21:01:39 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16L1cdR003728; Tue, 6 Feb 2018 21:01:38 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201802062101.w16L1cdR003728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Tue, 6 Feb 2018 21:01:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328950 - in head/sys/dev: mpr mps X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: in head/sys/dev: mpr mps X-SVN-Commit-Revision: 328950 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 21:01:40 -0000 Author: scottl Date: Tue Feb 6 21:01:38 2018 New Revision: 328950 URL: https://svnweb.freebsd.org/changeset/base/328950 Log: Cache the value of the request and reply frame size since it's used quite a bit in the normal operation of the driver. Covert it to represent bytes instead of 32bit words. Fix what I believe to be is a bug in this respect with the Tri-mode cards. Sponsored by: Netflix Modified: head/sys/dev/mpr/mpr.c head/sys/dev/mpr/mpr_user.c head/sys/dev/mpr/mprvar.h head/sys/dev/mps/mps.c head/sys/dev/mps/mps_sas.c head/sys/dev/mps/mps_user.c head/sys/dev/mps/mpsvar.h Modified: head/sys/dev/mpr/mpr.c ============================================================================== --- head/sys/dev/mpr/mpr.c Tue Feb 6 20:12:05 2018 (r328949) +++ head/sys/dev/mpr/mpr.c Tue Feb 6 21:01:38 2018 (r328950) @@ -1133,6 +1133,14 @@ mpr_send_iocinit(struct mpr_softc *sc) MPR_FUNCTRACE(sc); mpr_dprint(sc, MPR_INIT, "%s entered\n", __func__); + /* Do a quick sanity check on proper initialization */ + if ((sc->pqdepth == 0) || (sc->fqdepth == 0) || (sc->reqframesz == 0) + || (sc->replyframesz == 0)) { + mpr_dprint(sc, MPR_INIT|MPR_ERROR, + "Driver not fully initialized for IOCInit\n"); + return (EINVAL); + } + req_sz = sizeof(MPI2_IOC_INIT_REQUEST); reply_sz = sizeof(MPI2_IOC_INIT_REPLY); bzero(&init, req_sz); @@ -1147,7 +1155,7 @@ mpr_send_iocinit(struct mpr_softc *sc) init.WhoInit = MPI2_WHOINIT_HOST_DRIVER; init.MsgVersion = htole16(MPI2_VERSION); init.HeaderVersion = htole16(MPI2_HEADER_VERSION); - init.SystemRequestFrameSize = htole16(sc->facts->IOCRequestFrameSize); + init.SystemRequestFrameSize = htole16((uint16_t)(sc->reqframesz / 4)); init.ReplyDescriptorPostQueueDepth = htole16(sc->pqdepth); init.ReplyFreeQueueDepth = htole16(sc->fqdepth); init.SenseBufferAddressHigh = 0; @@ -1303,6 +1311,9 @@ mpr_alloc_replies(struct mpr_softc *sc) { int rsize, num_replies; + /* Store the reply frame size in bytes rather than as 32bit words */ + sc->replyframesz = sc->facts->ReplyFrameSize * 4; + /* * sc->num_replies should be one less than sc->fqdepth. We need to * allocate space for sc->fqdepth replies, but only sc->num_replies @@ -1310,7 +1321,7 @@ mpr_alloc_replies(struct mpr_softc *sc) */ num_replies = max(sc->fqdepth, sc->num_replies); - rsize = sc->facts->ReplyFrameSize * num_replies * 4; + rsize = sc->replyframesz * num_replies; if (bus_dma_tag_create( sc->mpr_parent_dmat, /* parent */ 4, 0, /* algnmnt, boundary */ BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ @@ -1344,7 +1355,10 @@ mpr_alloc_requests(struct mpr_softc *sc) struct mpr_chain *chain; int i, rsize, nsegs; - rsize = sc->facts->IOCRequestFrameSize * sc->num_reqs * 4; + /* Store the request frame size in bytes rather than as 32bit words */ + sc->reqframesz = sc->facts->IOCRequestFrameSize * 4; + + rsize = sc->reqframesz * sc->num_reqs; if (bus_dma_tag_create( sc->mpr_parent_dmat, /* parent */ 16, 0, /* algnmnt, boundary */ BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ @@ -1387,7 +1401,7 @@ mpr_alloc_requests(struct mpr_softc *sc) MPR_MAX_CHAIN_ELEMENT_SIZE; } } else { - sc->chain_frame_size = sc->facts->IOCRequestFrameSize * 4; + sc->chain_frame_size = sc->reqframesz; } rsize = sc->chain_frame_size * sc->max_chains; if (bus_dma_tag_create( sc->mpr_parent_dmat, /* parent */ @@ -1493,10 +1507,8 @@ mpr_alloc_requests(struct mpr_softc *sc) } for (i = 1; i < sc->num_reqs; i++) { cm = &sc->commands[i]; - cm->cm_req = sc->req_frames + - i * sc->facts->IOCRequestFrameSize * 4; - cm->cm_req_busaddr = sc->req_busaddr + - i * sc->facts->IOCRequestFrameSize * 4; + cm->cm_req = sc->req_frames + i * sc->reqframesz; + cm->cm_req_busaddr = sc->req_busaddr + i * sc->reqframesz; cm->cm_sense = &sc->sense_frames[i]; cm->cm_sense_busaddr = sc->sense_busaddr + i * MPR_SENSE_LEN; cm->cm_desc.Default.SMID = i; @@ -1621,8 +1633,7 @@ mpr_init_queues(struct mpr_softc *sc) * Initialize all of the free queue entries. */ for (i = 0; i < sc->fqdepth; i++) { - sc->free_queue[i] = sc->reply_busaddr + - (i * sc->facts->ReplyFrameSize * 4); + sc->free_queue[i] = sc->reply_busaddr + (i * sc->replyframesz); } sc->replyfreeindex = sc->num_replies; @@ -2419,13 +2430,13 @@ mpr_intr_locked(void *data) */ if ((reply < sc->reply_frames) || (reply > (sc->reply_frames + - (sc->fqdepth * sc->facts->ReplyFrameSize * 4)))) { + (sc->fqdepth * sc->replyframesz)))) { printf("%s: WARNING: reply %p out of range!\n", __func__, reply); printf("%s: reply_frames %p, fqdepth %d, " "frame size %d\n", __func__, sc->reply_frames, sc->fqdepth, - sc->facts->ReplyFrameSize * 4); + sc->replyframesz); printf("%s: baddr %#x,\n", __func__, baddr); /* LSI-TODO. See Linux Code for Graceful exit */ panic("Reply address out of range"); @@ -2963,7 +2974,7 @@ mpr_check_pcie_native_sgl(struct mpr_softc *sc, struct * put in the main message frame (H/W can only translate an SGL that * is contained entirely in the main message frame). */ - sges_in_segment = (sc->facts->IOCRequestFrameSize - + sges_in_segment = (sc->reqframesz - offsetof(Mpi25SCSIIORequest_t, SGL)) / sizeof(MPI25_SGE_IO_UNION); if (segs_left > sges_in_segment) build_native_sgl = 1; Modified: head/sys/dev/mpr/mpr_user.c ============================================================================== --- head/sys/dev/mpr/mpr_user.c Tue Feb 6 20:12:05 2018 (r328949) +++ head/sys/dev/mpr/mpr_user.c Tue Feb 6 21:01:38 2018 (r328950) @@ -433,7 +433,7 @@ mpr_init_sge(struct mpr_command *cm, void *req, void * { int off, space; - space = (int)cm->cm_sc->facts->IOCRequestFrameSize * 4; + space = (int)cm->cm_sc->reqframesz; off = (uintptr_t)sge - (uintptr_t)req; KASSERT(off < space, ("bad pointers %p %p, off %d, space %d", @@ -673,7 +673,7 @@ mpr_user_command(struct mpr_softc *sc, struct mpr_usr_ mpr_dprint(sc, MPR_USER, "%s: req %p %d rpl %p %d\n", __func__, cmd->req, cmd->req_len, cmd->rpl, cmd->rpl_len); - if (cmd->req_len > (int)sc->facts->IOCRequestFrameSize * 4) { + if (cmd->req_len > (int)sc->reqframesz) { err = EINVAL; goto RetFreeUnlocked; } @@ -809,7 +809,7 @@ mpr_user_pass_thru(struct mpr_softc *sc, mpr_pass_thru if (err != 0) goto RetFreeUnlocked; - if (data->RequestSize > (int)sc->facts->IOCRequestFrameSize * 4) { + if (data->RequestSize > (int)sc->reqframesz) { err = EINVAL; goto RetFreeUnlocked; } Modified: head/sys/dev/mpr/mprvar.h ============================================================================== --- head/sys/dev/mpr/mprvar.h Tue Feb 6 20:12:05 2018 (r328949) +++ head/sys/dev/mpr/mprvar.h Tue Feb 6 21:01:38 2018 (r328950) @@ -309,6 +309,8 @@ struct mpr_softc { #define MPR_FLAGS_REALLOCATED (1 << 7) u_int mpr_debug; int msi_msgs; + u_int reqframesz; + u_int replyframesz; u_int atomic_desc_capable; int tm_cmds_active; int io_cmds_active; Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Tue Feb 6 20:12:05 2018 (r328949) +++ head/sys/dev/mps/mps.c Tue Feb 6 21:01:38 2018 (r328950) @@ -1114,6 +1114,14 @@ mps_send_iocinit(struct mps_softc *sc) MPS_FUNCTRACE(sc); mps_dprint(sc, MPS_INIT, "%s entered\n", __func__); + /* Do a quick sanity check on proper initialization */ + if ((sc->pqdepth == 0) || (sc->fqdepth == 0) || (sc->reqframesz == 0) + || (sc->replyframesz == 0)) { + mps_dprint(sc, MPS_INIT|MPS_ERROR, + "Driver not fully initialized for IOCInit\n"); + return (EINVAL); + } + req_sz = sizeof(MPI2_IOC_INIT_REQUEST); reply_sz = sizeof(MPI2_IOC_INIT_REPLY); bzero(&init, req_sz); @@ -1128,7 +1136,7 @@ mps_send_iocinit(struct mps_softc *sc) init.WhoInit = MPI2_WHOINIT_HOST_DRIVER; init.MsgVersion = htole16(MPI2_VERSION); init.HeaderVersion = htole16(MPI2_HEADER_VERSION); - init.SystemRequestFrameSize = htole16(sc->facts->IOCRequestFrameSize); + init.SystemRequestFrameSize = htole16((uint16_t)(sc->reqframesz / 4)); init.ReplyDescriptorPostQueueDepth = htole16(sc->pqdepth); init.ReplyFreeQueueDepth = htole16(sc->fqdepth); init.SenseBufferAddressHigh = 0; @@ -1282,6 +1290,9 @@ mps_alloc_replies(struct mps_softc *sc) { int rsize, num_replies; + /* Store the reply frame size in bytes rather than as 32bit words */ + sc->replyframesz = sc->facts->ReplyFrameSize * 4; + /* * sc->num_replies should be one less than sc->fqdepth. We need to * allocate space for sc->fqdepth replies, but only sc->num_replies @@ -1289,7 +1300,7 @@ mps_alloc_replies(struct mps_softc *sc) */ num_replies = max(sc->fqdepth, sc->num_replies); - rsize = sc->facts->ReplyFrameSize * num_replies * 4; + rsize = sc->replyframesz * num_replies; if (bus_dma_tag_create( sc->mps_parent_dmat, /* parent */ 4, 0, /* algnmnt, boundary */ BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ @@ -1323,7 +1334,10 @@ mps_alloc_requests(struct mps_softc *sc) struct mps_chain *chain; int i, rsize, nsegs; - rsize = sc->facts->IOCRequestFrameSize * sc->num_reqs * 4; + /* Store the request frame size in bytes rather than as 32bit words */ + sc->reqframesz = sc->facts->IOCRequestFrameSize * 4; + + rsize = sc->reqframesz * sc->num_reqs; if (bus_dma_tag_create( sc->mps_parent_dmat, /* parent */ 16, 0, /* algnmnt, boundary */ BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ @@ -1347,7 +1361,7 @@ mps_alloc_requests(struct mps_softc *sc) bus_dmamap_load(sc->req_dmat, sc->req_map, sc->req_frames, rsize, mps_memaddr_cb, &sc->req_busaddr, 0); - rsize = sc->facts->IOCRequestFrameSize * sc->max_chains * 4; + rsize = sc->reqframesz * sc->max_chains; if (bus_dma_tag_create( sc->mps_parent_dmat, /* parent */ 16, 0, /* algnmnt, boundary */ BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ @@ -1404,9 +1418,9 @@ mps_alloc_requests(struct mps_softc *sc) for (i = 0; i < sc->max_chains; i++) { chain = &sc->chains[i]; chain->chain = (MPI2_SGE_IO_UNION *)(sc->chain_frames + - i * sc->facts->IOCRequestFrameSize * 4); + i * sc->reqframesz); chain->chain_busaddr = sc->chain_busaddr + - i * sc->facts->IOCRequestFrameSize * 4; + i * sc->reqframesz; mps_free_chain(sc, chain); sc->chain_free_lowwater++; } @@ -1441,10 +1455,8 @@ mps_alloc_requests(struct mps_softc *sc) } for (i = 1; i < sc->num_reqs; i++) { cm = &sc->commands[i]; - cm->cm_req = sc->req_frames + - i * sc->facts->IOCRequestFrameSize * 4; - cm->cm_req_busaddr = sc->req_busaddr + - i * sc->facts->IOCRequestFrameSize * 4; + cm->cm_req = sc->req_frames + i * sc->reqframesz; + cm->cm_req_busaddr = sc->req_busaddr + i * sc->reqframesz; cm->cm_sense = &sc->sense_frames[i]; cm->cm_sense_busaddr = sc->sense_busaddr + i * MPS_SENSE_LEN; cm->cm_desc.Default.SMID = i; @@ -1487,7 +1499,7 @@ mps_init_queues(struct mps_softc *sc) * Initialize all of the free queue entries. */ for (i = 0; i < sc->fqdepth; i++) - sc->free_queue[i] = sc->reply_busaddr + (i * sc->facts->ReplyFrameSize * 4); + sc->free_queue[i] = sc->reply_busaddr + (i * sc->replyframesz); sc->replyfreeindex = sc->num_replies; return (0); @@ -2279,13 +2291,13 @@ mps_intr_locked(void *data) */ if ((reply < sc->reply_frames) || (reply > (sc->reply_frames + - (sc->fqdepth * sc->facts->ReplyFrameSize * 4)))) { + (sc->fqdepth * sc->replyframesz)))) { printf("%s: WARNING: reply %p out of range!\n", __func__, reply); printf("%s: reply_frames %p, fqdepth %d, " "frame size %d\n", __func__, sc->reply_frames, sc->fqdepth, - sc->facts->ReplyFrameSize * 4); + sc->replyframesz); printf("%s: baddr %#x,\n", __func__, baddr); /* LSI-TODO. See Linux Code. Need Graceful exit*/ panic("Reply address out of range"); @@ -2553,7 +2565,7 @@ mps_add_chain(struct mps_command *cm) { MPI2_SGE_CHAIN32 *sgc; struct mps_chain *chain; - int space; + u_int space; if (cm->cm_sglsize < MPS_SGC_SIZE) panic("MPS: Need SGE Error Code\n"); @@ -2562,7 +2574,7 @@ mps_add_chain(struct mps_command *cm) if (chain == NULL) return (ENOBUFS); - space = (int)cm->cm_sc->facts->IOCRequestFrameSize * 4; + space = cm->cm_sc->reqframesz; /* * Note: a double-linked list is used to make it easier to Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Tue Feb 6 20:12:05 2018 (r328949) +++ head/sys/dev/mps/mps_sas.c Tue Feb 6 21:01:38 2018 (r328950) @@ -997,7 +997,7 @@ mpssas_action(struct cam_sim *sim, union ccb *ccb) * user's value and the calculated value as long as the user's * value is larger than 0. The user's value is in pages. */ - sges_per_frame = ((sc->facts->IOCRequestFrameSize * 4) / + sges_per_frame = ((sc->reqframesz) / sizeof(MPI2_SGE_SIMPLE64)) - 1; cpi->maxio = (sges_per_frame * sc->facts->MaxChainDepth) + 1; cpi->maxio *= PAGE_SIZE; Modified: head/sys/dev/mps/mps_user.c ============================================================================== --- head/sys/dev/mps/mps_user.c Tue Feb 6 20:12:05 2018 (r328949) +++ head/sys/dev/mps/mps_user.c Tue Feb 6 21:01:38 2018 (r328950) @@ -420,7 +420,7 @@ mpi_init_sge(struct mps_command *cm, void *req, void * { int off, space; - space = (int)cm->cm_sc->facts->IOCRequestFrameSize * 4; + space = (int)cm->cm_sc->reqframesz; off = (uintptr_t)sge - (uintptr_t)req; KASSERT(off < space, ("bad pointers %p %p, off %d, space %d", @@ -688,7 +688,7 @@ mps_user_command(struct mps_softc *sc, struct mps_usr_ mps_dprint(sc, MPS_USER, "%s: req %p %d rpl %p %d\n", __func__, cmd->req, cmd->req_len, cmd->rpl, cmd->rpl_len); - if (cmd->req_len > (int)sc->facts->IOCRequestFrameSize * 4) { + if (cmd->req_len > (int)sc->reqframesz) { err = EINVAL; goto RetFreeUnlocked; } @@ -821,7 +821,7 @@ mps_user_pass_thru(struct mps_softc *sc, mps_pass_thru if (err != 0) goto RetFreeUnlocked; - if (data->RequestSize > (int)sc->facts->IOCRequestFrameSize * 4) { + if (data->RequestSize > (int)sc->reqframesz) { err = EINVAL; goto RetFreeUnlocked; } Modified: head/sys/dev/mps/mpsvar.h ============================================================================== --- head/sys/dev/mps/mpsvar.h Tue Feb 6 20:12:05 2018 (r328949) +++ head/sys/dev/mps/mpsvar.h Tue Feb 6 21:01:38 2018 (r328950) @@ -307,6 +307,8 @@ struct mps_softc { #define MPS_FLAGS_REALLOCATED (1 << 7) u_int mps_debug; u_int msi_msgs; + u_int reqframesz; + u_int replyframesz; int tm_cmds_active; int io_cmds_active; int io_cmds_highwater; From owner-svn-src-all@freebsd.org Tue Feb 6 21:35:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19963F08BD9; Tue, 6 Feb 2018 21:35:42 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BC55C82BD6; Tue, 6 Feb 2018 21:35:41 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6B691D9A1; Tue, 6 Feb 2018 21:35:41 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w16LZfSH020198; Tue, 6 Feb 2018 21:35:41 GMT (envelope-from feld@FreeBSD.org) Received: (from feld@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16LZfLD020197; Tue, 6 Feb 2018 21:35:41 GMT (envelope-from feld@FreeBSD.org) Message-Id: <201802062135.w16LZfLD020197@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: feld set sender to feld@FreeBSD.org using -f From: Mark Felder Date: Tue, 6 Feb 2018 21:35:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328951 - head/etc/rc.d X-SVN-Group: head X-SVN-Commit-Author: feld X-SVN-Commit-Paths: head/etc/rc.d X-SVN-Commit-Revision: 328951 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 21:35:42 -0000 Author: feld (ports committer) Date: Tue Feb 6 21:35:41 2018 New Revision: 328951 URL: https://svnweb.freebsd.org/changeset/base/328951 Log: Refactor cleanvar to remove shell expansion vulnerability If any process creates a directory named "-P" in /var/run or /var/spool/lock it will cause the purgedir function to start to rm -r /. Simplify a lot of complicated shell logic by leveraging find(1). Reviewed by: allanjude MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D13778 Modified: head/etc/rc.d/cleanvar Modified: head/etc/rc.d/cleanvar ============================================================================== --- head/etc/rc.d/cleanvar Tue Feb 6 21:01:38 2018 (r328950) +++ head/etc/rc.d/cleanvar Tue Feb 6 21:35:41 2018 (r328951) @@ -19,34 +19,6 @@ stop_cmd=":" extra_commands="reload" reload_cmd="${name}_start" -purgedir() -{ - local dir file - - if [ $# -eq 0 ]; then - purgedir . - else - for dir - do - ( - cd "$dir" && for file in .* * - do - # Skip over logging sockets - [ -S "$file" -a "$file" = "log" ] && continue - [ -S "$file" -a "$file" = "logpriv" ] && continue - [ ."$file" = .. -o ."$file" = ... ] && continue - if [ -d "$file" -a ! -L "$file" ] - then - purgedir "$file" - else - rm -f -- "$file" - fi - done - ) - done - fi -} - cleanvar_prestart() { # These files must be removed only the first time this script is run @@ -58,14 +30,17 @@ cleanvar_prestart() cleanvar_start() { if [ -d /var/run -a ! -f /var/run/clean_var ]; then - purgedir /var/run + # Skip over logging sockets + find /var/run \( -type f -or -type s ! -name log -and ! -name logpriv \) -delete >/var/run/clean_var fi if [ -d /var/spool/lock -a ! -f /var/spool/lock/clean_var ]; then - purgedir /var/spool/lock + find /var/spool/lock -type f -delete >/var/spool/lock/clean_var fi - rm -rf /var/spool/uucp/.Temp/* + if [ -d /var/spool/uucp/.Temp ]; then + find /var/spool/uucp/.Temp -delete + fi } load_rc_config $name From owner-svn-src-all@freebsd.org Tue Feb 6 21:42:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E5CDF09639; Tue, 6 Feb 2018 21:42:50 +0000 (UTC) (envelope-from mike@sentex.net) Received: from smarthost2.sentex.ca (smarthost2.sentex.ca [IPv6:2607:f3e0:80:80::2]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "smarthost.sentex.ca", Issuer "smarthost.sentex.ca" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0C39783479; Tue, 6 Feb 2018 21:42:49 +0000 (UTC) (envelope-from mike@sentex.net) Received: from lava.sentex.ca (lava.sentex.ca [IPv6:2607:f3e0:0:5::11]) by smarthost2.sentex.ca (8.15.2/8.15.2) with ESMTPS id w16Lgm3l082814 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 6 Feb 2018 16:42:49 -0500 (EST) (envelope-from mike@sentex.net) Received: from [192.168.43.26] (saphire3.sentex.ca [192.168.43.26]) by lava.sentex.ca (8.15.2/8.15.2) with ESMTP id w16LgjlU060794; Tue, 6 Feb 2018 16:42:46 -0500 (EST) (envelope-from mike@sentex.net) Subject: Re: svn commit: r328944 - stable/11/sys/kern To: Kirk McKusick , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org References: <201802061913.w16JDiP8047547@repo.freebsd.org> From: Mike Tancsa Organization: Sentex Communications Message-ID: <3c1f7e72-364b-f08a-7b25-d2e7177b41c2@sentex.net> Date: Tue, 6 Feb 2018 16:42:46 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <201802061913.w16JDiP8047547@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 21:42:50 -0000 On 2/6/2018 2:13 PM, Kirk McKusick wrote: > Author: mckusick > Date: Tue Feb 6 19:13:44 2018 > New Revision: 328944 > URL: https://svnweb.freebsd.org/changeset/base/328944 > > Log: > MFC of 328643. > > fix vn_printf listing of its union Hi, I am getting a buildfailure with this commit, I think -------------------------------------------------------------- >>> stage 3.1: building everything -------------------------------------------------------------- cd /usr/obj/usr/src/sys/server; COMPILER_VERSION=50001 COMPILER_FEATURES=c++11 COMPILER_TYPE=clang COMPILER_FREEBSD_VERSION=1100505 MAKEOBJDIRPREFIX=/usr/obj MACHINE_ARCH=amd64 MACHINE=amd64 CPUTYPE= GROFF_BIN_PATH=/usr/obj/usr/src/tmp/legacy/usr/bin GROFF_FONT_PATH=/usr/obj/usr/src/tmp/legacy/usr/share/groff_font GROFF_TMAC_PATH=/usr/obj/usr/src/tmp/legacy/usr/share/tmac CC="cc -target x86_64-unknown-freebsd11.1 --sysroot=/usr/obj/usr/src/tmp -B/usr/obj/usr/src/tmp/usr/bin" CXX="c++ -target x86_64-unknown-freebsd11.1 --sysroot=/usr/obj/usr/src/tmp -B/usr/obj/usr/src/tmp/usr/bin" CPP="cpp -target x86_64-unknown-freebsd11.1 --sysroot=/usr/obj/usr/src/tmp -B/usr/obj/usr/src/tmp/usr/bin" AS="as" AR="ar" LD="ld" NM=nm OBJDUMP=objdump OBJCOPY="objcopy" RANLIB=ranlib STRINGS= SIZE="size" INSTALL="sh /usr/src/tools/install.sh" PATH=/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/bin:/usr/obj/usr/src/tmp/usr/sbin:/usr/obj/usr/src/tmp/usr/bin:/sbin:/bin:/usr/sbin:/usr/bin make -D NO_KERNELCLEAN -m /usr/src/share/mk KERNEL=kernel all -DNO_MODULES_OBJ cc -target x86_64-unknown-freebsd11.1 --sysroot=/usr/obj/usr/src/tmp -B/usr/obj/usr/src/tmp/usr/bin -c -O2 -pipe -fno-strict-aliasing -g -nostdinc -I. -I/usr/src/sys -I/usr/src/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -MD -MF.depend.vfs_subr.o -MTvfs_subr.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-error-address-of-packed-member -mno-aes -mno-avx -std=iso9899:1999 -Werror /usr/src/sys/kern/vfs_subr.c /usr/src/sys/kern/vfs_subr.c:3368:30: error: no member named 'v_unpcb' in 'struct vnode' printf(" socket %p\n", vp->v_unpcb); ~~ ^ 1 error generated. *** Error code 1 Stop. make[2]: stopped in /usr/obj/usr/src/sys/server *** Error code 1 Stop. make[1]: stopped in /usr/src *** Error code 1 Stop. > > Modified: > stable/11/sys/kern/vfs_subr.c > Directory Properties: > stable/11/ (props changed) > > Modified: stable/11/sys/kern/vfs_subr.c > ============================================================================== > --- stable/11/sys/kern/vfs_subr.c Tue Feb 6 19:09:49 2018 (r328943) > +++ stable/11/sys/kern/vfs_subr.c Tue Feb 6 19:13:44 2018 (r328944) > @@ -3355,8 +3355,25 @@ vn_printf(struct vnode *vp, const char *fmt, ...) > va_end(ap); > printf("%p: ", (void *)vp); > printf("tag %s, type %s\n", vp->v_tag, typename[vp->v_type]); > - printf(" usecount %d, writecount %d, refcount %d mountedhere %p\n", > - vp->v_usecount, vp->v_writecount, vp->v_holdcnt, vp->v_mountedhere); > + printf(" usecount %d, writecount %d, refcount %d", > + vp->v_usecount, vp->v_writecount, vp->v_holdcnt); > + switch (vp->v_type) { > + case VDIR: > + printf(" mountedhere %p\n", vp->v_mountedhere); > + break; > + case VCHR: > + printf(" rdev %p\n", vp->v_rdev); > + break; > + case VSOCK: > + printf(" socket %p\n", vp->v_unpcb); > + break; > + case VFIFO: > + printf(" fifoinfo %p\n", vp->v_fifoinfo); > + break; > + default: > + printf("\n"); > + break; > + } > buf[0] = '\0'; > buf[1] = '\0'; > if (vp->v_vflag & VV_ROOT) > _______________________________________________ > svn-src-stable-11@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-stable-11 > To unsubscribe, send any mail to "svn-src-stable-11-unsubscribe@freebsd.org" > > -- ------------------- Mike Tancsa, tel +1 519 651 3400 x203 Sentex Communications, mike@sentex.net Providing Internet services since 1994 www.sentex.net Cambridge, Ontario Canada From owner-svn-src-all@freebsd.org Tue Feb 6 22:07:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36FFEF0B815; Tue, 6 Feb 2018 22:07:00 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E16548495A; Tue, 6 Feb 2018 22:06:59 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DC2AE1DEE8; Tue, 6 Feb 2018 22:06:59 +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 w16M6xre035199; Tue, 6 Feb 2018 22:06:59 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16M6xCS035195; Tue, 6 Feb 2018 22:06:59 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201802062206.w16M6xCS035195@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 6 Feb 2018 22:06:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328952 - in head/sys: kern vm X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys: kern vm X-SVN-Commit-Revision: 328952 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 22:07:00 -0000 Author: glebius Date: Tue Feb 6 22:06:59 2018 New Revision: 328952 URL: https://svnweb.freebsd.org/changeset/base/328952 Log: Fix boot_pages calculation for machines that don't have UMA_MD_SMALL_ALLOC. o Call uma_startup1() after initializing kmem, vmem and domains. o Include 8 eight VM startup pages into uma_startup_count() calculation. o Account for vmem_startup() and vm_map_startup() preallocating pages. o Account for extra two allocations done by kmem_init() and vmem_create(). o Hardcode the place of execution of vm_radix_reserve_kva(). Using SYSINIT allowed several other SYSINITs to sneak in before it, thus bumping requirement for amount of boot pages. Modified: head/sys/kern/subr_vmem.c head/sys/vm/vm_init.c head/sys/vm/vm_page.c head/sys/vm/vm_radix.c Modified: head/sys/kern/subr_vmem.c ============================================================================== --- head/sys/kern/subr_vmem.c Tue Feb 6 21:35:41 2018 (r328951) +++ head/sys/kern/subr_vmem.c Tue Feb 6 22:06:59 2018 (r328952) @@ -72,7 +72,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +int vmem_startup_count(void); + #define VMEM_OPTORDER 5 #define VMEM_OPTVALUE (1 << VMEM_OPTORDER) #define VMEM_MAXORDER \ @@ -652,6 +655,16 @@ vmem_bt_alloc(uma_zone_t zone, vm_size_t bytes, int do pause("btalloc", 1); return (NULL); +} + +/* + * How many pages do we need to startup_alloc. + */ +int +vmem_startup_count(void) +{ + + return (howmany(BT_MAXALLOC, UMA_SLAB_SIZE / sizeof(struct vmem_btag))); } #endif Modified: head/sys/vm/vm_init.c ============================================================================== --- head/sys/vm/vm_init.c Tue Feb 6 21:35:41 2018 (r328951) +++ head/sys/vm/vm_init.c Tue Feb 6 22:06:59 2018 (r328952) @@ -93,6 +93,8 @@ __FBSDID("$FreeBSD$"); #include #include +extern void uma_startup1(void); +extern void vm_radix_reserve_kva(void); #if VM_NRESERVLEVEL > 0 #define KVA_QUANTUM (1 << (VM_LEVEL_0_ORDER + PAGE_SHIFT)) @@ -150,7 +152,11 @@ vm_mem_init(dummy) */ vm_set_page_size(); virtual_avail = vm_page_startup(virtual_avail); - + +#ifdef UMA_MD_SMALL_ALLOC + /* Announce page availability to UMA. */ + uma_startup1(); +#endif /* * Initialize other VM packages */ @@ -173,6 +179,12 @@ vm_mem_init(dummy) KVA_QUANTUM); } +#ifndef UMA_MD_SMALL_ALLOC + /* Set up radix zone to use noobj_alloc. */ + vm_radix_reserve_kva(); + /* Announce page availability to UMA. */ + uma_startup1(); +#endif kmem_init_zero_region(); pmap_init(); vm_pager_init(); Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Tue Feb 6 21:35:41 2018 (r328951) +++ head/sys/vm/vm_page.c Tue Feb 6 22:06:59 2018 (r328952) @@ -112,6 +112,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -127,7 +128,7 @@ __FBSDID("$FreeBSD$"); extern int uma_startup_count(int); extern void uma_startup(void *, int); -extern void uma_startup1(void); +extern int vmem_startup_count(void); /* * Associated with page of user-allocatable memory is a @@ -501,12 +502,33 @@ vm_page_startup(vm_offset_t vaddr) /* * Allocate memory for use when boot strapping the kernel memory - * allocator. - * + * allocator. Tell UMA how many zones we are going to create + * before going fully functional. UMA will add its zones. + */ +#ifdef UMA_MD_SMALL_ALLOC + boot_pages = uma_startup_count(0); +#else + /* + * VM startup zones: vmem, vmem_btag, VM OBJECT, RADIX NODE, MAP, + * KMAP ENTRY, MAP ENTRY, VMSPACE. + */ + boot_pages = uma_startup_count(8); + + /* vmem_startup() calls uma_prealloc(). */ + boot_pages += vmem_startup_count(); + /* vm_map_startup() calls uma_prealloc(). */ + boot_pages += howmany(MAX_KMAP, UMA_SLAB_SIZE / sizeof(struct vm_map)); + + /* + * Before going fully functional kmem_init() does allocation + * from "KMAP ENTRY" and vmem_create() does allocation from "vmem". + */ + boot_pages += 2; +#endif + /* * CTFLAG_RDTUN doesn't work during the early boot process, so we must * manually fetch the value. */ - boot_pages = uma_startup_count(0); TUNABLE_INT_FETCH("vm.boot_pages", &boot_pages); new_end = end - (boot_pages * UMA_SLAB_SIZE); new_end = trunc_page(new_end); @@ -739,9 +761,6 @@ vm_page_startup(vm_offset_t vaddr) * can work. */ domainset_zero(); - - /* Announce page availability to UMA. */ - uma_startup1(); return (vaddr); } Modified: head/sys/vm/vm_radix.c ============================================================================== --- head/sys/vm/vm_radix.c Tue Feb 6 21:35:41 2018 (r328951) +++ head/sys/vm/vm_radix.c Tue Feb 6 22:06:59 2018 (r328952) @@ -284,6 +284,7 @@ vm_radix_node_zone_dtor(void *mem, int size __unused, #endif #ifndef UMA_MD_SMALL_ALLOC +void vm_radix_reserve_kva(void); /* * Reserve the KVA necessary to satisfy the node allocation. * This is mandatory in architectures not supporting direct @@ -291,8 +292,8 @@ vm_radix_node_zone_dtor(void *mem, int size __unused, * every node allocation, resulting into deadlocks for consumers already * working with kernel maps. */ -static void -vm_radix_reserve_kva(void *arg __unused) +void +vm_radix_reserve_kva(void) { /* @@ -304,8 +305,6 @@ vm_radix_reserve_kva(void *arg __unused) sizeof(struct vm_radix_node)))) panic("%s: unable to reserve KVA", __func__); } -SYSINIT(vm_radix_reserve_kva, SI_SUB_KMEM, SI_ORDER_THIRD, - vm_radix_reserve_kva, NULL); #endif /* From owner-svn-src-all@freebsd.org Tue Feb 6 22:08:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95C55F0BACC; Tue, 6 Feb 2018 22:08:44 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4677D84B94; Tue, 6 Feb 2018 22:08: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 40D461DEEC; Tue, 6 Feb 2018 22:08: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 w16M8iaK035316; Tue, 6 Feb 2018 22:08:44 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16M8iTe035315; Tue, 6 Feb 2018 22:08:44 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201802062208.w16M8iTe035315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 6 Feb 2018 22:08:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328953 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 328953 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 22:08:44 -0000 Author: glebius Date: Tue Feb 6 22:08:43 2018 New Revision: 328953 URL: https://svnweb.freebsd.org/changeset/base/328953 Log: Improve DIAGNOSTIC printf. Report using a boot page every time regardless of booted status. Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Feb 6 22:06:59 2018 (r328952) +++ head/sys/vm/uma_core.c Tue Feb 6 22:08:43 2018 (r328953) @@ -1088,12 +1088,11 @@ startup_alloc(uma_zone_t zone, vm_size_t bytes, int do * Check our small startup cache to see if it has pages remaining. */ mtx_lock(&uma_boot_pages_mtx); + if (pages <= boot_pages) { #ifdef DIAGNOSTIC - if (booted < BOOT_PAGEALLOC) printf("%s from \"%s\", %d boot pages left\n", __func__, zone->uz_name, boot_pages); #endif - if (pages <= boot_pages) { mem = bootmem; boot_pages -= pages; bootmem += pages * PAGE_SIZE; From owner-svn-src-all@freebsd.org Tue Feb 6 22:10:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2596FF0BC5D; Tue, 6 Feb 2018 22:10:11 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CD1E684D4F; Tue, 6 Feb 2018 22:10:10 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C45F71DEF3; Tue, 6 Feb 2018 22:10:10 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w16MAAaY035477; Tue, 6 Feb 2018 22:10:10 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16MA8fn035448; Tue, 6 Feb 2018 22:10:08 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201802062210.w16MA8fn035448@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Tue, 6 Feb 2018 22:10:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328954 - in head/sys: amd64/amd64 arm/arm cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs compat/linprocfs fs/tmpfs i386/i386 kern mips/mips powerpc/booke powerp... X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: in head/sys: amd64/amd64 arm/arm cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs compat/linprocfs fs/tmpfs i386/i386 kern mips/mips powerpc/booke powerpc/powerpc sparc64/sparc64... X-SVN-Commit-Revision: 328954 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 22:10:11 -0000 Author: jeff Date: Tue Feb 6 22:10:07 2018 New Revision: 328954 URL: https://svnweb.freebsd.org/changeset/base/328954 Log: Use per-domain locks for vm page queue free. Move paging control from global to per-domain state. Protect reservations with the free lock from the domain that they belong to. Refactor to make vm domains more of a first class object. Reviewed by: markj, kib, gallatin Tested by: pho Sponsored by: Netflix, Dell/EMC Isilon Differential Revision: https://reviews.freebsd.org/D14000 Added: head/sys/vm/vm_pagequeue.h (contents, props changed) Modified: head/sys/amd64/amd64/machdep.c head/sys/arm/arm/machdep.c head/sys/arm/arm/pmap-v4.c head/sys/cddl/compat/opensolaris/sys/kmem.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c head/sys/compat/linprocfs/linprocfs.c head/sys/fs/tmpfs/tmpfs_subr.c head/sys/i386/i386/machdep.c head/sys/kern/init_main.c head/sys/kern/subr_vmem.c head/sys/kern/subr_witness.c head/sys/mips/mips/machdep.c head/sys/powerpc/booke/pmap.c head/sys/powerpc/powerpc/machdep.c head/sys/sparc64/sparc64/machdep.c head/sys/sys/vmmeter.h head/sys/vm/swap_pager.c head/sys/vm/uma_core.c head/sys/vm/vm_extern.h head/sys/vm/vm_glue.c head/sys/vm/vm_init.c head/sys/vm/vm_kern.c head/sys/vm/vm_map.c head/sys/vm/vm_meter.c head/sys/vm/vm_object.c head/sys/vm/vm_object.h head/sys/vm/vm_page.c head/sys/vm/vm_page.h head/sys/vm/vm_pageout.c head/sys/vm/vm_pageout.h head/sys/vm/vm_phys.c head/sys/vm/vm_phys.h head/sys/vm/vm_reserv.c head/sys/vm/vm_reserv.h head/sys/vm/vm_swapout.c head/sys/vm/vnode_pager.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/amd64/amd64/machdep.c Tue Feb 6 22:10:07 2018 (r328954) @@ -282,7 +282,7 @@ cpu_startup(dummy) memsize = (uintmax_t)strtoul(sysenv, (char **)NULL, 10) << 10; freeenv(sysenv); } - if (memsize < ptoa((uintmax_t)vm_cnt.v_free_count)) + if (memsize < ptoa((uintmax_t)vm_free_count())) memsize = ptoa((uintmax_t)Maxmem); printf("real memory = %ju (%ju MB)\n", memsize, memsize >> 20); realmem = atop(memsize); @@ -309,8 +309,8 @@ cpu_startup(dummy) vm_ksubmap_init(&kmi); printf("avail memory = %ju (%ju MB)\n", - ptoa((uintmax_t)vm_cnt.v_free_count), - ptoa((uintmax_t)vm_cnt.v_free_count) / 1048576); + ptoa((uintmax_t)vm_free_count()), + ptoa((uintmax_t)vm_free_count()) / 1048576); /* * Set up buffers, so they can be used to read disk labels. Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/arm/arm/machdep.c Tue Feb 6 22:10:07 2018 (r328954) @@ -228,8 +228,8 @@ cpu_startup(void *dummy) (uintmax_t)arm32_ptob(realmem), (uintmax_t)arm32_ptob(realmem) / mbyte); printf("avail memory = %ju (%ju MB)\n", - (uintmax_t)arm32_ptob(vm_cnt.v_free_count), - (uintmax_t)arm32_ptob(vm_cnt.v_free_count) / mbyte); + (uintmax_t)arm32_ptob(vm_free_count()), + (uintmax_t)arm32_ptob(vm_free_count()) / mbyte); if (bootverbose) { arm_physmem_print_tables(); devmap_print_table(); Modified: head/sys/arm/arm/pmap-v4.c ============================================================================== --- head/sys/arm/arm/pmap-v4.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/arm/arm/pmap-v4.c Tue Feb 6 22:10:07 2018 (r328954) @@ -3817,7 +3817,7 @@ pmap_get_pv_entry(void) pv_entry_count++; if (pv_entry_count > pv_entry_high_water) - pagedaemon_wakeup(); + pagedaemon_wakeup(0); /* XXX ARM NUMA */ ret_value = uma_zalloc(pvzone, M_NOWAIT); return ret_value; } Modified: head/sys/cddl/compat/opensolaris/sys/kmem.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/kmem.h Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/cddl/compat/opensolaris/sys/kmem.h Tue Feb 6 22:10:07 2018 (r328954) @@ -78,7 +78,7 @@ void kmem_reap(void); int kmem_debugging(void); void *calloc(size_t n, size_t s); -#define freemem vm_cnt.v_free_count +#define freemem vm_free_count() #define minfree vm_cnt.v_free_min #define heap_arena kernel_arena #define zio_arena NULL Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Feb 6 22:10:07 2018 (r328954) @@ -379,7 +379,7 @@ static void arc_free_target_init(void *unused __unused) { - zfs_arc_free_target = vm_pageout_wakeup_thresh; + zfs_arc_free_target = (vm_cnt.v_free_min / 10) * 11; } SYSINIT(arc_free_target_init, SI_SUB_KTHREAD_PAGE, SI_ORDER_ANY, arc_free_target_init, NULL); Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/compat/linprocfs/linprocfs.c Tue Feb 6 22:10:07 2018 (r328954) @@ -156,7 +156,7 @@ linprocfs_domeminfo(PFS_FILL_ARGS) /* * The correct thing here would be: * - memfree = vm_cnt.v_free_count * PAGE_SIZE; + memfree = vm_free_count() * PAGE_SIZE; memused = memtotal - memfree; * * but it might mislead linux binaries into thinking there @@ -178,7 +178,7 @@ linprocfs_domeminfo(PFS_FILL_ARGS) * like unstaticizing it just for linprocfs's sake. */ buffers = 0; - cached = vm_cnt.v_inactive_count * PAGE_SIZE; + cached = vm_inactive_count() * PAGE_SIZE; sbuf_printf(sb, "MemTotal: %9lu kB\n" Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/fs/tmpfs/tmpfs_subr.c Tue Feb 6 22:10:07 2018 (r328954) @@ -106,7 +106,7 @@ tmpfs_mem_avail(void) { vm_ooffset_t avail; - avail = swap_pager_avail + vm_cnt.v_free_count - tmpfs_pages_reserved; + avail = swap_pager_avail + vm_free_count() - tmpfs_pages_reserved; if (__predict_false(avail < 0)) avail = 0; return (avail); Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/i386/i386/machdep.c Tue Feb 6 22:10:07 2018 (r328954) @@ -271,7 +271,7 @@ cpu_startup(dummy) memsize = (uintmax_t)strtoul(sysenv, (char **)NULL, 10) << 10; freeenv(sysenv); } - if (memsize < ptoa((uintmax_t)vm_cnt.v_free_count)) + if (memsize < ptoa((uintmax_t)vm_free_count())) memsize = ptoa((uintmax_t)Maxmem); printf("real memory = %ju (%ju MB)\n", memsize, memsize >> 20); realmem = atop(memsize); @@ -298,8 +298,8 @@ cpu_startup(dummy) vm_ksubmap_init(&kmi); printf("avail memory = %ju (%ju MB)\n", - ptoa((uintmax_t)vm_cnt.v_free_count), - ptoa((uintmax_t)vm_cnt.v_free_count) / 1048576); + ptoa((uintmax_t)vm_free_count()), + ptoa((uintmax_t)vm_free_count()) / 1048576); /* * Set up buffers, so they can be used to read disk labels. Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/kern/init_main.c Tue Feb 6 22:10:07 2018 (r328954) @@ -87,6 +87,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -555,7 +556,7 @@ proc0_init(void *dummy __unused) p->p_limit->pl_rlimit[RLIMIT_STACK].rlim_cur = dflssiz; p->p_limit->pl_rlimit[RLIMIT_STACK].rlim_max = maxssiz; /* Cast to avoid overflow on i386/PAE. */ - pageablemem = ptoa((vm_paddr_t)vm_cnt.v_free_count); + pageablemem = ptoa((vm_paddr_t)vm_free_count()); p->p_limit->pl_rlimit[RLIMIT_RSS].rlim_cur = p->p_limit->pl_rlimit[RLIMIT_RSS].rlim_max = pageablemem; p->p_limit->pl_rlimit[RLIMIT_MEMLOCK].rlim_cur = pageablemem / 3; Modified: head/sys/kern/subr_vmem.c ============================================================================== --- head/sys/kern/subr_vmem.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/kern/subr_vmem.c Tue Feb 6 22:10:07 2018 (r328954) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "opt_vm.h" @@ -72,6 +73,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include int vmem_startup_count(void); @@ -644,7 +647,7 @@ vmem_bt_alloc(uma_zone_t zone, vm_size_t bytes, int do * possible due to M_USE_RESERVE page allocation. */ if (wait & M_WAITOK) - VM_WAIT; + vm_wait_domain(domain); return (NULL); } mtx_unlock(&vmem_bt_lock); Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/kern/subr_witness.c Tue Feb 6 22:10:07 2018 (r328954) @@ -139,7 +139,7 @@ __FBSDID("$FreeBSD$"); #define WITNESS_COUNT 1536 #endif #define WITNESS_HASH_SIZE 251 /* Prime, gives load factor < 2 */ -#define WITNESS_PENDLIST (2048 + MAXCPU) +#define WITNESS_PENDLIST (2048 + (MAXCPU * 4)) /* Allocate 256 KB of stack data space */ #define WITNESS_LO_DATA_COUNT 2048 Modified: head/sys/mips/mips/machdep.c ============================================================================== --- head/sys/mips/mips/machdep.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/mips/mips/machdep.c Tue Feb 6 22:10:07 2018 (r328954) @@ -210,8 +210,8 @@ cpu_startup(void *dummy) vm_ksubmap_init(&kmi); printf("avail memory = %ju (%juMB)\n", - ptoa((uintmax_t)vm_cnt.v_free_count), - ptoa((uintmax_t)vm_cnt.v_free_count) / 1048576); + ptoa((uintmax_t)vm_free_count()), + ptoa((uintmax_t)vm_free_count()) / 1048576); cpu_init_interrupts(); /* Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/powerpc/booke/pmap.c Tue Feb 6 22:10:07 2018 (r328954) @@ -1190,7 +1190,7 @@ pv_alloc(void) pv_entry_count++; if (pv_entry_count > pv_entry_high_water) - pagedaemon_wakeup(); + pagedaemon_wakeup(0); /* XXX powerpc NUMA */ pv = uma_zalloc(pvzone, M_NOWAIT); return (pv); Modified: head/sys/powerpc/powerpc/machdep.c ============================================================================== --- head/sys/powerpc/powerpc/machdep.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/powerpc/powerpc/machdep.c Tue Feb 6 22:10:07 2018 (r328954) @@ -221,8 +221,8 @@ cpu_startup(void *dummy) vm_ksubmap_init(&kmi); printf("avail memory = %ju (%ju MB)\n", - ptoa((uintmax_t)vm_cnt.v_free_count), - ptoa((uintmax_t)vm_cnt.v_free_count) / 1048576); + ptoa((uintmax_t)vm_free_count()), + ptoa((uintmax_t)vm_free_count()) / 1048576); /* * Set up buffers, so they can be used to read disk labels. Modified: head/sys/sparc64/sparc64/machdep.c ============================================================================== --- head/sys/sparc64/sparc64/machdep.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/sparc64/sparc64/machdep.c Tue Feb 6 22:10:07 2018 (r328954) @@ -190,8 +190,8 @@ cpu_startup(void *arg) EVENTHANDLER_REGISTER(shutdown_final, sparc64_shutdown_final, NULL, SHUTDOWN_PRI_LAST); - printf("avail memory = %lu (%lu MB)\n", vm_cnt.v_free_count * PAGE_SIZE, - vm_cnt.v_free_count / ((1024 * 1024) / PAGE_SIZE)); + printf("avail memory = %lu (%lu MB)\n", vm_free_count() * PAGE_SIZE, + vm_free_count() / ((1024 * 1024) / PAGE_SIZE)); if (bootverbose) printf("machine: %s\n", sparc64_model); Modified: head/sys/sys/vmmeter.h ============================================================================== --- head/sys/sys/vmmeter.h Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/sys/vmmeter.h Tue Feb 6 22:10:07 2018 (r328954) @@ -140,23 +140,23 @@ struct vmmeter { u_int v_interrupt_free_min; /* (c) reserved pages for int code */ u_int v_free_severe; /* (c) severe page depletion point */ u_int v_wire_count VMMETER_ALIGNED; /* (a) pages wired down */ - u_int v_active_count VMMETER_ALIGNED; /* (a) pages active */ - u_int v_inactive_count VMMETER_ALIGNED; /* (a) pages inactive */ - u_int v_laundry_count VMMETER_ALIGNED; /* (a) pages eligible for - laundering */ - u_int v_free_count VMMETER_ALIGNED; /* (f) pages free */ }; #endif /* _KERNEL || _WANT_VMMETER */ #ifdef _KERNEL +#include + extern struct vmmeter vm_cnt; -extern u_int vm_pageout_wakeup_thresh; +extern domainset_t vm_min_domains; +extern domainset_t vm_severe_domains; #define VM_CNT_ADD(var, x) counter_u64_add(vm_cnt.var, x) #define VM_CNT_INC(var) VM_CNT_ADD(var, 1) #define VM_CNT_FETCH(var) counter_u64_fetch(vm_cnt.var) +u_int vm_free_count(void); + /* * Return TRUE if we are under our severe low-free-pages threshold * @@ -167,7 +167,7 @@ static inline int vm_page_count_severe(void) { - return (vm_cnt.v_free_severe > vm_cnt.v_free_count); + return (!DOMAINSET_EMPTY(&vm_severe_domains)); } /* @@ -183,50 +183,8 @@ static inline int vm_page_count_min(void) { - return (vm_cnt.v_free_min > vm_cnt.v_free_count); + return (!DOMAINSET_EMPTY(&vm_min_domains)); } -/* - * Return TRUE if we have not reached our free page target during - * free page recovery operations. - */ -static inline int -vm_page_count_target(void) -{ - - return (vm_cnt.v_free_target > vm_cnt.v_free_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 -vm_paging_target(void) -{ - - return (vm_cnt.v_free_target - vm_cnt.v_free_count); -} - -/* - * Returns TRUE if the pagedaemon needs to be woken up. - */ -static inline int -vm_paging_needed(u_int free_count) -{ - - return (free_count < vm_pageout_wakeup_thresh); -} - -/* - * Return the number of pages we need to launder. - * A positive number indicates that we have a shortfall of clean pages. - */ -static inline int -vm_laundry_target(void) -{ - - return (vm_paging_target()); -} #endif /* _KERNEL */ #endif /* _SYS_VMMETER_H_ */ Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/vm/swap_pager.c Tue Feb 6 22:10:07 2018 (r328954) @@ -2327,7 +2327,7 @@ swapoff_one(struct swdevt *sp, struct ucred *cred) * of data we will have to page back in, plus an epsilon so * the system doesn't become critically low on swap space. */ - if (vm_cnt.v_free_count + swap_pager_avail < nblks + nswap_lowat) + if (vm_free_count() + swap_pager_avail < nblks + nswap_lowat) return (ENOMEM); /* Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/vm/uma_core.c Tue Feb 6 22:10:07 2018 (r328954) @@ -3464,7 +3464,7 @@ uma_large_malloc_domain(vm_size_t size, int domain, in slab->us_data = (void *)addr; slab->us_flags = UMA_SLAB_KERNEL | UMA_SLAB_MALLOC; slab->us_size = size; - slab->us_domain = vm_phys_domidx(PHYS_TO_VM_PAGE( + slab->us_domain = vm_phys_domain(PHYS_TO_VM_PAGE( pmap_kextract(addr))); uma_total_inc(size); } else { Modified: head/sys/vm/vm_extern.h ============================================================================== --- head/sys/vm/vm_extern.h Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/vm/vm_extern.h Tue Feb 6 22:10:07 2018 (r328954) @@ -122,5 +122,9 @@ struct sf_buf *vm_imgact_map_page(vm_object_t object, void vm_imgact_unmap_page(struct sf_buf *sf); void vm_thread_dispose(struct thread *td); int vm_thread_new(struct thread *td, int pages); +u_int vm_active_count(void); +u_int vm_inactive_count(void); +u_int vm_laundry_count(void); +u_int vm_wait_count(void); #endif /* _KERNEL */ #endif /* !_VM_EXTERN_H_ */ Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/vm/vm_glue.c Tue Feb 6 22:10:07 2018 (r328954) @@ -552,7 +552,7 @@ vm_forkproc(struct thread *td, struct proc *p2, struct } while (vm_page_count_severe()) { - VM_WAIT; + vm_wait_severe(); } if ((flags & RFMEM) == 0) { Modified: head/sys/vm/vm_init.c ============================================================================== --- head/sys/vm/vm_init.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/vm/vm_init.c Tue Feb 6 22:10:07 2018 (r328954) @@ -89,6 +89,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/vm/vm_kern.c ============================================================================== --- head/sys/vm/vm_kern.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/vm/vm_kern.c Tue Feb 6 22:10:07 2018 (r328954) @@ -92,6 +92,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -196,7 +197,7 @@ retry: if (!vm_page_reclaim_contig_domain(domain, pflags, 1, low, high, PAGE_SIZE, 0) && (flags & M_WAITOK) != 0) - VM_WAIT; + vm_wait_domain(domain); VM_OBJECT_WLOCK(object); tries++; goto retry; @@ -205,9 +206,9 @@ retry: vmem_free(vmem, addr, size); return (0); } - KASSERT(vm_phys_domidx(m) == domain, + KASSERT(vm_phys_domain(m) == domain, ("kmem_alloc_attr_domain: Domain mismatch %d != %d", - vm_phys_domidx(m), domain)); + vm_phys_domain(m), domain)); if ((flags & M_ZERO) && (m->flags & PG_ZERO) == 0) pmap_zero_page(m); m->valid = VM_PAGE_BITS_ALL; @@ -280,7 +281,7 @@ retry: if (!vm_page_reclaim_contig_domain(domain, pflags, npages, low, high, alignment, boundary) && (flags & M_WAITOK) != 0) - VM_WAIT; + vm_wait_domain(domain); VM_OBJECT_WLOCK(object); tries++; goto retry; @@ -288,9 +289,9 @@ retry: vmem_free(vmem, addr, size); return (0); } - KASSERT(vm_phys_domidx(m) == domain, + KASSERT(vm_phys_domain(m) == domain, ("kmem_alloc_contig_domain: Domain mismatch %d != %d", - vm_phys_domidx(m), domain)); + vm_phys_domain(m), domain)); end_m = m + npages; tmp = addr; for (; m < end_m; m++) { @@ -452,9 +453,9 @@ retry: kmem_unback(object, addr, i); return (KERN_NO_SPACE); } - KASSERT(vm_phys_domidx(m) == domain, + KASSERT(vm_phys_domain(m) == domain, ("kmem_back_domain: Domain mismatch %d != %d", - vm_phys_domidx(m), domain)); + vm_phys_domain(m), domain)); if (flags & M_ZERO && (m->flags & PG_ZERO) == 0) pmap_zero_page(m); KASSERT((m->oflags & VPO_UNMANAGED) != 0, @@ -514,7 +515,7 @@ _kmem_unback(vm_object_t object, vm_offset_t addr, vm_ end = offset + size; VM_OBJECT_WLOCK(object); m = vm_page_lookup(object, atop(offset)); - domain = vm_phys_domidx(m); + domain = vm_phys_domain(m); for (; offset < end; offset += PAGE_SIZE, m = next) { next = vm_page_next(m); vm_page_unwire(m, PQ_NONE); Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/vm/vm_map.c Tue Feb 6 22:10:07 2018 (r328954) @@ -2011,7 +2011,7 @@ vm_map_pmap_enter(vm_map_t map, vm_offset_t addr, vm_p * free pages allocating pv entries. */ if (((flags & MAP_PREFAULT_MADVISE) != 0 && - vm_cnt.v_free_count < vm_cnt.v_free_reserved) || + vm_page_count_severe()) || ((flags & MAP_PREFAULT_PARTIAL) != 0 && tmpidx >= threshold)) { psize = tmpidx; Modified: head/sys/vm/vm_meter.c ============================================================================== --- head/sys/vm/vm_meter.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/vm/vm_meter.c Tue Feb 6 22:10:07 2018 (r328954) @@ -53,6 +53,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include @@ -213,9 +215,6 @@ vmtotal(SYSCTL_HANDLER_ARGS) total.t_dw++; else total.t_sl++; - if (td->td_wchan == - &vm_cnt.v_free_count) - total.t_pw++; } break; case TDS_CAN_RUN: @@ -283,7 +282,8 @@ vmtotal(SYSCTL_HANDLER_ARGS) } } mtx_unlock(&vm_object_list_mtx); - total.t_free = vm_cnt.v_free_count; + total.t_pw = vm_wait_count(); + total.t_free = vm_free_count(); #if defined(COMPAT_FREEBSD11) /* sysctl(8) allocates twice as much memory as reported by sysctl(3) */ if (curproc->p_osrel < P_OSREL_VMTOTAL64 && (req->oldlen == @@ -339,7 +339,7 @@ sysctl_handle_vmstat(SYSCTL_HANDLER_ARGS) #define VM_STATS(parent, var, descr) \ SYSCTL_OID(parent, OID_AUTO, var, CTLTYPE_U64 | CTLFLAG_MPSAFE | \ - CTLFLAG_RD, &vm_cnt.var, 0, sysctl_handle_vmstat, "QU", descr); + CTLFLAG_RD, &vm_cnt.var, 0, sysctl_handle_vmstat, "QU", descr) #define VM_STATS_VM(var, descr) VM_STATS(_vm_stats_vm, var, descr) #define VM_STATS_SYS(var, descr) VM_STATS(_vm_stats_sys, var, descr) @@ -379,19 +379,36 @@ VM_STATS_VM(v_vforkpages, "VM pages affected by vfork( VM_STATS_VM(v_rforkpages, "VM pages affected by rfork()"); VM_STATS_VM(v_kthreadpages, "VM pages affected by fork() by kernel"); +static int +sysctl_handle_vmstat_proc(SYSCTL_HANDLER_ARGS) +{ + u_int (*fn)(void); + uint32_t val; + + fn = arg1; + val = fn(); + return (SYSCTL_OUT(req, &val, sizeof(val))); +} + +#define VM_STATS_PROC(var, descr, fn) \ + SYSCTL_OID(_vm_stats_vm, OID_AUTO, var, CTLTYPE_U32 | CTLFLAG_MPSAFE | \ + CTLFLAG_RD, fn, 0, sysctl_handle_vmstat_proc, "IU", descr) + #define VM_STATS_UINT(var, descr) \ SYSCTL_UINT(_vm_stats_vm, OID_AUTO, var, CTLFLAG_RD, &vm_cnt.var, 0, descr) + VM_STATS_UINT(v_page_size, "Page size in bytes"); VM_STATS_UINT(v_page_count, "Total number of pages in system"); VM_STATS_UINT(v_free_reserved, "Pages reserved for deadlock"); VM_STATS_UINT(v_free_target, "Pages desired free"); VM_STATS_UINT(v_free_min, "Minimum low-free-pages threshold"); -VM_STATS_UINT(v_free_count, "Free pages"); +VM_STATS_PROC(v_free_count, "Free pages", vm_free_count); VM_STATS_UINT(v_wire_count, "Wired pages"); -VM_STATS_UINT(v_active_count, "Active pages"); +VM_STATS_PROC(v_active_count, "Active pages", vm_active_count); VM_STATS_UINT(v_inactive_target, "Desired inactive pages"); -VM_STATS_UINT(v_inactive_count, "Inactive pages"); -VM_STATS_UINT(v_laundry_count, "Pages eligible for laundering"); +VM_STATS_PROC(v_inactive_count, "Inactive pages", vm_inactive_count); +VM_STATS_PROC(v_laundry_count, "Pages eligible for laundering", + vm_laundry_count); VM_STATS_UINT(v_pageout_free_min, "Min pages reserved for kernel"); VM_STATS_UINT(v_interrupt_free_min, "Reserved pages for interrupt code"); VM_STATS_UINT(v_free_severe, "Severe page depletion point"); @@ -406,3 +423,52 @@ SYSCTL_UINT(_vm_stats_vm, OID_AUTO, v_cache_count, CTL SYSCTL_UINT(_vm_stats_vm, OID_AUTO, v_tcached, CTLFLAG_RD, SYSCTL_NULL_UINT_PTR, 0, "Dummy for compatibility"); #endif + +u_int +vm_free_count(void) +{ + u_int v; + int i; + + v = 0; + for (i = 0; i < vm_ndomains; i++) + v += vm_dom[i].vmd_free_count; + + return (v); +} + +static +u_int +vm_pagequeue_count(int pq) +{ + u_int v; + int i; + + v = 0; + for (i = 0; i < vm_ndomains; i++) + v += vm_dom[i].vmd_pagequeues[pq].pq_cnt; + + return (v); +} + +u_int +vm_active_count(void) +{ + + return vm_pagequeue_count(PQ_ACTIVE); +} + +u_int +vm_inactive_count(void) +{ + + return vm_pagequeue_count(PQ_INACTIVE); +} + +u_int +vm_laundry_count(void) +{ + + return vm_pagequeue_count(PQ_LAUNDRY); +} + Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/vm/vm_object.c Tue Feb 6 22:10:07 2018 (r328954) @@ -96,6 +96,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include Modified: head/sys/vm/vm_object.h ============================================================================== --- head/sys/vm/vm_object.h Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/vm/vm_object.h Tue Feb 6 22:10:07 2018 (r328954) @@ -297,6 +297,17 @@ vm_object_color(vm_object_t object, u_short color) } } +static __inline bool +vm_object_reserv(vm_object_t object) +{ + + if (object != NULL && + (object->flags & (OBJ_COLORED | OBJ_FICTITIOUS)) == OBJ_COLORED) { + return (true); + } + return (false); +} + void vm_object_clear_flag(vm_object_t object, u_short bits); void vm_object_pip_add(vm_object_t object, short i); void vm_object_pip_subtract(vm_object_t object, short i); Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/vm/vm_page.c Tue Feb 6 22:10:07 2018 (r328954) @@ -116,8 +116,9 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include +#include +#include #include #include #include @@ -136,10 +137,16 @@ extern int vmem_startup_count(void); */ struct vm_domain vm_dom[MAXMEMDOM]; -struct mtx_padalign __exclusive_cache_line vm_page_queue_free_mtx; struct mtx_padalign __exclusive_cache_line pa_lock[PA_LOCK_COUNT]; +struct mtx_padalign __exclusive_cache_line vm_domainset_lock; +domainset_t __exclusive_cache_line vm_min_domains; +domainset_t __exclusive_cache_line vm_severe_domains; +static int vm_min_waiters; +static int vm_severe_waiters; +static int vm_pageproc_waiters; + /* * bogus page -- for I/O to/from partially complete buffers, * or for paging into sparsely invalid regions. @@ -164,24 +171,22 @@ static int sysctl_vm_page_blacklist(SYSCTL_HANDLER_ARG SYSCTL_PROC(_vm, OID_AUTO, page_blacklist, CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, sysctl_vm_page_blacklist, "A", "Blacklist pages"); -/* Is the page daemon waiting for free pages? */ -static int vm_pageout_pages_needed; - static uma_zone_t fakepg_zone; static void vm_page_alloc_check(vm_page_t m); static void vm_page_clear_dirty_mask(vm_page_t m, vm_page_bits_t pagebits); static void vm_page_enqueue(uint8_t queue, vm_page_t m); -static void vm_page_free_phys(vm_page_t m); -static void vm_page_free_wakeup(void); +static void vm_page_free_phys(struct vm_domain *vmd, vm_page_t m); static void vm_page_init(void *dummy); static int vm_page_insert_after(vm_page_t m, vm_object_t object, vm_pindex_t pindex, vm_page_t mpred); static void vm_page_insert_radixdone(vm_page_t m, vm_object_t object, vm_page_t mpred); -static int vm_page_reclaim_run(int req_class, u_long npages, vm_page_t m_run, - vm_paddr_t high); -static int vm_page_alloc_fail(vm_object_t object, int req); +static int vm_page_reclaim_run(int req_class, int domain, u_long npages, + vm_page_t m_run, vm_paddr_t high); +static void vm_domain_free_wakeup(struct vm_domain *); +static int vm_domain_alloc_fail(struct vm_domain *vmd, vm_object_t object, + int req); SYSINIT(vm_page, SI_SUB_VM, SI_ORDER_SECOND, vm_page_init, NULL); @@ -318,6 +323,7 @@ vm_page_blacklist_next(char **list, char *end) static void vm_page_blacklist_check(char *list, char *end) { + struct vm_domain *vmd; vm_paddr_t pa; vm_page_t m; char *next; @@ -330,9 +336,10 @@ vm_page_blacklist_check(char *list, char *end) m = vm_phys_paddr_to_vm_page(pa); if (m == NULL) continue; - mtx_lock(&vm_page_queue_free_mtx); + vmd = vm_pagequeue_domain(m); + vm_domain_free_lock(vmd); ret = vm_phys_unfree_page(m); - mtx_unlock(&vm_page_queue_free_mtx); + vm_domain_free_unlock(vmd); if (ret == TRUE) { TAILQ_INSERT_TAIL(&blacklist_head, m, listq); if (bootverbose) @@ -395,28 +402,23 @@ sysctl_vm_page_blacklist(SYSCTL_HANDLER_ARGS) } static void -vm_page_domain_init(struct vm_domain *vmd) +vm_page_domain_init(int domain) { + struct vm_domain *vmd; struct vm_pagequeue *pq; int i; + vmd = VM_DOMAIN(domain); + bzero(vmd, sizeof(*vmd)); *__DECONST(char **, &vmd->vmd_pagequeues[PQ_INACTIVE].pq_name) = "vm inactive pagequeue"; - *__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(u_int **, &vmd->vmd_pagequeues[PQ_ACTIVE].pq_vcnt) = - &vm_cnt.v_active_count; *__DECONST(char **, &vmd->vmd_pagequeues[PQ_LAUNDRY].pq_name) = "vm laundry pagequeue"; - *__DECONST(int **, &vmd->vmd_pagequeues[PQ_LAUNDRY].pq_vcnt) = - &vm_cnt.v_laundry_count; *__DECONST(char **, &vmd->vmd_pagequeues[PQ_UNSWAPPABLE].pq_name) = "vm unswappable pagequeue"; - /* Unswappable dirty pages are counted as being in the laundry. */ - *__DECONST(int **, &vmd->vmd_pagequeues[PQ_UNSWAPPABLE].pq_vcnt) = - &vm_cnt.v_laundry_count; + vmd->vmd_domain = domain; vmd->vmd_page_count = 0; vmd->vmd_free_count = 0; vmd->vmd_segs = 0; @@ -427,6 +429,7 @@ vm_page_domain_init(struct vm_domain *vmd) mtx_init(&pq->pq_mutex, pq->pq_name, "vm pagequeue", MTX_DEF | MTX_DUPOK); } + mtx_init(&vmd->vmd_free_mtx, "vm page free queue", NULL, MTX_DEF); } /* @@ -463,7 +466,6 @@ vm_page_init_page(vm_page_t m, vm_paddr_t pa, int segi vm_offset_t vm_page_startup(vm_offset_t vaddr) { - struct vm_domain *vmd; struct vm_phys_seg *seg; vm_page_t m; char *list, *listend; @@ -494,11 +496,11 @@ vm_page_startup(vm_offset_t vaddr) /* * Initialize the page and queue locks. */ - mtx_init(&vm_page_queue_free_mtx, "vm page free queue", NULL, MTX_DEF); + mtx_init(&vm_domainset_lock, "vm domainset lock", NULL, MTX_DEF); for (i = 0; i < PA_LOCK_COUNT; i++) mtx_init(&pa_lock[i], "vm page", NULL, MTX_DEF); for (i = 0; i < vm_ndomains; i++) - vm_page_domain_init(&vm_dom[i]); + vm_page_domain_init(i); /* * Allocate memory for use when boot strapping the kernel memory @@ -704,7 +706,6 @@ vm_page_startup(vm_offset_t vaddr) * physical memory allocator's free lists. */ vm_cnt.v_page_count = 0; - vm_cnt.v_free_count = 0; for (segind = 0; segind < vm_phys_nsegs; segind++) { seg = &vm_phys_segs[segind]; for (m = seg->first_page, pa = seg->start; pa < seg->end; @@ -719,6 +720,8 @@ vm_page_startup(vm_offset_t vaddr) * or doesn't overlap any of them. */ for (i = 0; phys_avail[i + 1] != 0; i += 2) { + struct vm_domain *vmd; + if (seg->start < phys_avail[i] || seg->end > phys_avail[i + 1]) continue; @@ -726,13 +729,14 @@ vm_page_startup(vm_offset_t vaddr) m = seg->first_page; pagecount = (u_long)atop(seg->end - seg->start); - mtx_lock(&vm_page_queue_free_mtx); + vmd = VM_DOMAIN(seg->domain); + vm_domain_free_lock(vmd); vm_phys_free_contig(m, pagecount); - vm_phys_freecnt_adj(m, (int)pagecount); - mtx_unlock(&vm_page_queue_free_mtx); + vm_domain_freecnt_adj(vmd, (int)pagecount); + vm_domain_free_unlock(vmd); vm_cnt.v_page_count += (u_int)pagecount; - vmd = &vm_dom[seg->domain]; + vmd = VM_DOMAIN(seg->domain); vmd->vmd_page_count += (u_int)pagecount; vmd->vmd_segs |= 1UL << m->segind; break; @@ -1657,12 +1661,40 @@ vm_page_alloc_after(vm_object_t object, vm_pindex_t pi return (m); } +/* + * Returns true if the number of free pages exceeds the minimum + * for the request class and false otherwise. + */ +int +vm_domain_available(struct vm_domain *vmd, int req, int npages) +{ + + vm_domain_free_assert_locked(vmd); + req = req & VM_ALLOC_CLASS_MASK; + + /* + * The page daemon is allowed to dig deeper into the free page list. + */ + if (curproc == pageproc && req != VM_ALLOC_INTERRUPT) + req = VM_ALLOC_SYSTEM; + + if (vmd->vmd_free_count >= npages + vmd->vmd_free_reserved || + (req == VM_ALLOC_SYSTEM && + vmd->vmd_free_count >= npages + vmd->vmd_interrupt_free_min) || + (req == VM_ALLOC_INTERRUPT && + vmd->vmd_free_count >= npages)) + return (1); + + return (0); +} + vm_page_t vm_page_alloc_domain_after(vm_object_t object, vm_pindex_t pindex, int domain, int req, vm_page_t mpred) { + struct vm_domain *vmd; vm_page_t m; - int flags, req_class; + int flags; u_int free_count; KASSERT((object != NULL) == ((req & VM_ALLOC_NOOBJ) == 0) && @@ -1678,34 +1710,27 @@ vm_page_alloc_domain_after(vm_object_t object, vm_pind if (object != NULL) VM_OBJECT_ASSERT_WLOCKED(object); - req_class = req & VM_ALLOC_CLASS_MASK; - - /* - * The page daemon is allowed to dig deeper into the free page list. - */ - if (curproc == pageproc && req_class != VM_ALLOC_INTERRUPT) - req_class = VM_ALLOC_SYSTEM; - - /* - * Allocate a page if the number of free pages exceeds the minimum - * for the request class. - */ again: m = NULL; - mtx_lock(&vm_page_queue_free_mtx); - if (vm_cnt.v_free_count > vm_cnt.v_free_reserved || - (req_class == VM_ALLOC_SYSTEM && - vm_cnt.v_free_count > vm_cnt.v_interrupt_free_min) || - (req_class == VM_ALLOC_INTERRUPT && - vm_cnt.v_free_count > 0)) { +#if VM_NRESERVLEVEL > 0 + if (vm_object_reserv(object) && + (m = vm_reserv_extend(req, object, pindex, domain, mpred)) + != NULL) { + domain = vm_phys_domain(m); + vmd = VM_DOMAIN(domain); + goto found; + } +#endif + vmd = VM_DOMAIN(domain); + vm_domain_free_lock(vmd); + if (vm_domain_available(vmd, req, 1)) { /* * Can we allocate the page from a reservation? */ #if VM_NRESERVLEVEL > 0 - if (object == NULL || (object->flags & (OBJ_COLORED | - OBJ_FICTITIOUS)) != OBJ_COLORED || (m = - vm_reserv_alloc_page(object, pindex, domain, - mpred)) == NULL) + if (!vm_object_reserv(object) || + (m = vm_reserv_alloc_page(object, pindex, + domain, mpred)) == NULL) #endif { /* @@ -1727,7 +1752,7 @@ again: /* * Not allocatable, give up. */ - if (vm_page_alloc_fail(object, req)) + if (vm_domain_alloc_fail(vmd, object, req)) goto again; return (NULL); } @@ -1736,8 +1761,18 @@ again: * At this point we had better have found a good page. */ KASSERT(m != NULL, ("missing page")); - free_count = vm_phys_freecnt_adj(m, -1); - mtx_unlock(&vm_page_queue_free_mtx); + free_count = vm_domain_freecnt_adj(vmd, -1); + vm_domain_free_unlock(vmd); + + /* + * Don't wakeup too often - wakeup the pageout daemon when + * we would be nearly out of memory. + */ + if (vm_paging_needed(vmd, free_count)) + pagedaemon_wakeup(vmd->vmd_domain); +#if VM_NRESERVLEVEL > 0 +found: +#endif vm_page_alloc_check(m); /* @@ -1770,7 +1805,7 @@ again: if (object != NULL) { if (vm_page_insert_after(m, object, pindex, mpred)) { - pagedaemon_wakeup(); + pagedaemon_wakeup(domain); if (req & VM_ALLOC_WIRED) { atomic_subtract_int(&vm_cnt.v_wire_count, 1); m->wire_count = 0; @@ -1795,13 +1830,6 @@ again: } else m->pindex = pindex; - /* - * Don't wakeup too often - wakeup the pageout daemon when - * we would be nearly out of memory. - */ - if (vm_paging_needed(free_count)) - pagedaemon_wakeup(); - return (m); } @@ -1869,9 +1897,9 @@ vm_page_alloc_contig_domain(vm_object_t object, vm_pin int req, u_long npages, vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary, vm_memattr_t memattr) { + struct vm_domain *vmd; vm_page_t m, m_ret, mpred; u_int busy_lock, flags, oflags; - int req_class; mpred = NULL; /* XXX: pacify gcc */ KASSERT((object != NULL) == ((req & VM_ALLOC_NOOBJ) == 0) && @@ -1889,14 +1917,7 @@ vm_page_alloc_contig_domain(vm_object_t object, vm_pin object)); } KASSERT(npages > 0, ("vm_page_alloc_contig: npages is zero")); - req_class = req & VM_ALLOC_CLASS_MASK; - /* - * The page daemon is allowed to dig deeper into the free page list. - */ - if (curproc == pageproc && req_class != VM_ALLOC_INTERRUPT) - req_class = VM_ALLOC_SYSTEM; - if (object != NULL) { mpred = vm_radix_lookup_le(&object->rtree, pindex); KASSERT(mpred == NULL || mpred->pindex != pindex, @@ -1908,19 +1929,25 @@ vm_page_alloc_contig_domain(vm_object_t object, vm_pin * below the lower bound for the allocation class? */ again: +#if VM_NRESERVLEVEL > 0 + if (vm_object_reserv(object) && + (m_ret = vm_reserv_extend_contig(req, object, pindex, domain, + npages, low, high, alignment, boundary, mpred)) != NULL) { + domain = vm_phys_domain(m_ret); + vmd = VM_DOMAIN(domain); + goto found; + } +#endif m_ret = NULL; - mtx_lock(&vm_page_queue_free_mtx); - if (vm_cnt.v_free_count >= npages + vm_cnt.v_free_reserved || - (req_class == VM_ALLOC_SYSTEM && - vm_cnt.v_free_count >= npages + vm_cnt.v_interrupt_free_min) || - (req_class == VM_ALLOC_INTERRUPT && - vm_cnt.v_free_count >= npages)) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Feb 6 22:13:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8923AF0C187; Tue, 6 Feb 2018 22:13:41 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 372D685282; Tue, 6 Feb 2018 22:13:41 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 320B91E083; Tue, 6 Feb 2018 22:13:41 +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 w16MDfNY040216; Tue, 6 Feb 2018 22:13:41 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16MDfAp040215; Tue, 6 Feb 2018 22:13:41 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201802062213.w16MDfAp040215@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 6 Feb 2018 22:13:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328955 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 328955 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 22:13:41 -0000 Author: glebius Date: Tue Feb 6 22:13:40 2018 New Revision: 328955 URL: https://svnweb.freebsd.org/changeset/base/328955 Log: Use correct arithmetic to calculate how many pages we need for kegs and hashes. There is no functional change with current sizes. Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Feb 6 22:10:07 2018 (r328954) +++ head/sys/vm/uma_core.c Tue Feb 6 22:13:40 2018 (r328955) @@ -1810,14 +1810,14 @@ uma_startup_count(int zones) pages += howmany(zones, UMA_SLAB_SIZE / zsize); /* ... and their kegs. */ - pages += howmany(ksize * zones, UMA_SLAB_SIZE); + pages += howmany(zones, UMA_SLAB_SIZE / ksize); /* * Take conservative approach that every zone * is going to allocate hash. */ - pages += howmany(sizeof(struct slabhead *) * UMA_HASH_SIZE_INIT * - zones, UMA_SLAB_SIZE); + pages += howmany(zones, UMA_SLAB_SIZE / + (sizeof(struct slabhead *) * UMA_HASH_SIZE_INIT)); return (pages); } From owner-svn-src-all@freebsd.org Tue Feb 6 22:15:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4595DF0C47B; Tue, 6 Feb 2018 22:15:59 +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 AB01E854A3; Tue, 6 Feb 2018 22:15:58 +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 w16MFuZ5002306 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 6 Feb 2018 14:15:56 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w16MFtle002305; Tue, 6 Feb 2018 14:15:55 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 6 Feb 2018 14:15:55 -0800 From: Gleb Smirnoff To: Peter Holm Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328916 - in head/sys: kern vm Message-ID: <20180206221555.GC1063@FreeBSD.org> References: <201802060416.w164G0va096970@repo.freebsd.org> <20180206113017.GA25428@x2.osted.lan> <20180206182839.GB1063@FreeBSD.org> <20180206193430.GA36054@x2.osted.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180206193430.GA36054@x2.osted.lan> User-Agent: Mutt/1.9.3 (2018-01-21) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 22:15:59 -0000 Peter, can you please check post r328952 kernel? -- Gleb Smirnoff From owner-svn-src-all@freebsd.org Tue Feb 6 22:17:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D3E2F0C5D5; Tue, 6 Feb 2018 22:17:02 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 54C11857FC; Tue, 6 Feb 2018 22:17:02 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4F8C61E092; Tue, 6 Feb 2018 22:17:02 +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 w16MH2HL040378; Tue, 6 Feb 2018 22:17:02 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16MH1CS040375; Tue, 6 Feb 2018 22:17:01 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201802062217.w16MH1CS040375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 6 Feb 2018 22:17:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328956 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 328956 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 22:17:02 -0000 Author: ian Date: Tue Feb 6 22:17:01 2018 New Revision: 328956 URL: https://svnweb.freebsd.org/changeset/base/328956 Log: Use const pointers for input data not modified by clock utility functions. Modified: head/sys/kern/subr_clock.c head/sys/kern/subr_fattime.c head/sys/sys/clock.h Modified: head/sys/kern/subr_clock.c ============================================================================== --- head/sys/kern/subr_clock.c Tue Feb 6 22:13:40 2018 (r328955) +++ head/sys/kern/subr_clock.c Tue Feb 6 22:17:01 2018 (r328956) @@ -132,7 +132,7 @@ leapyear(int year) } static void -print_ct(struct clocktime *ct) +print_ct(const struct clocktime *ct) { printf("[%04d-%02d-%02d %02d:%02d:%02d]", ct->year, ct->mon, ct->day, @@ -140,7 +140,7 @@ print_ct(struct clocktime *ct) } int -clock_ct_to_ts(struct clocktime *ct, struct timespec *ts) +clock_ct_to_ts(const struct clocktime *ct, struct timespec *ts) { int i, year, days; @@ -200,7 +200,7 @@ clock_ct_to_ts(struct clocktime *ct, struct timespec * } int -clock_bcd_to_ts(struct bcd_clocktime *bct, struct timespec *ts, bool ampm) +clock_bcd_to_ts(const struct bcd_clocktime *bct, struct timespec *ts, bool ampm) { struct clocktime ct; int bcent, byear; @@ -249,7 +249,7 @@ clock_bcd_to_ts(struct bcd_clocktime *bct, struct time } void -clock_ts_to_ct(struct timespec *ts, struct clocktime *ct) +clock_ts_to_ct(const struct timespec *ts, struct clocktime *ct) { time_t i, year, days; time_t rsec; /* remainder seconds */ @@ -310,7 +310,7 @@ clock_ts_to_ct(struct timespec *ts, struct clocktime * } void -clock_ts_to_bcd(struct timespec *ts, struct bcd_clocktime *bct, bool ampm) +clock_ts_to_bcd(const struct timespec *ts, struct bcd_clocktime *bct, bool ampm) { struct clocktime ct; Modified: head/sys/kern/subr_fattime.c ============================================================================== --- head/sys/kern/subr_fattime.c Tue Feb 6 22:13:40 2018 (r328955) +++ head/sys/kern/subr_fattime.c Tue Feb 6 22:17:01 2018 (r328956) @@ -137,7 +137,8 @@ static const struct { void -timespec2fattime(struct timespec *tsp, int utc, uint16_t *ddp, uint16_t *dtp, uint8_t *dhp) +timespec2fattime(const struct timespec *tsp, int utc, uint16_t *ddp, + uint16_t *dtp, uint8_t *dhp) { time_t t1; unsigned t2, l, m; @@ -217,7 +218,8 @@ static const uint16_t daytab[64] = { }; void -fattime2timespec(unsigned dd, unsigned dt, unsigned dh, int utc, struct timespec *tsp) +fattime2timespec(unsigned dd, unsigned dt, unsigned dh, int utc, + struct timespec *tsp) { unsigned day; Modified: head/sys/sys/clock.h ============================================================================== --- head/sys/sys/clock.h Tue Feb 6 22:13:40 2018 (r328955) +++ head/sys/sys/clock.h Tue Feb 6 22:17:01 2018 (r328956) @@ -88,8 +88,8 @@ struct clocktime { long nsec; /* nano seconds */ }; -int clock_ct_to_ts(struct clocktime *, struct timespec *); -void clock_ts_to_ct(struct timespec *, struct clocktime *); +int clock_ct_to_ts(const struct clocktime *, struct timespec *); +void clock_ts_to_ct(const struct timespec *, struct clocktime *); /* * Structure to hold the values typically reported by time-of-day clocks, @@ -125,8 +125,8 @@ struct bcd_clocktime { bool ispm; /* true if hour represents pm time */ }; -int clock_bcd_to_ts(struct bcd_clocktime *, struct timespec *, bool ampm); -void clock_ts_to_bcd(struct timespec *, struct bcd_clocktime *, bool ampm); +int clock_bcd_to_ts(const struct bcd_clocktime *, struct timespec *, bool ampm); +void clock_ts_to_bcd(const struct timespec *, struct bcd_clocktime *, bool ampm); /* * Time-of-day clock functions and flags. These functions might sleep. @@ -177,8 +177,10 @@ void clock_unregister(device_t _clockdev); /* Traditional POSIX base year */ #define POSIX_BASE_YEAR 1970 -void timespec2fattime(struct timespec *tsp, int utc, u_int16_t *ddp, u_int16_t *dtp, u_int8_t *dhp); -void fattime2timespec(unsigned dd, unsigned dt, unsigned dh, int utc, struct timespec *tsp); +void timespec2fattime(const struct timespec *tsp, int utc, u_int16_t *ddp, + u_int16_t *dtp, u_int8_t *dhp); +void fattime2timespec(unsigned dd, unsigned dt, unsigned dh, int utc, + struct timespec *tsp); #endif /* _KERNEL */ From owner-svn-src-all@freebsd.org Tue Feb 6 22:38:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90585F0E24D; Tue, 6 Feb 2018 22:38:20 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 36E3C86895; Tue, 6 Feb 2018 22:38:20 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 302CD1E3FD; Tue, 6 Feb 2018 22:38:20 +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 w16McKES050437; Tue, 6 Feb 2018 22:38:20 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16McJCM050435; Tue, 6 Feb 2018 22:38:19 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201802062238.w16McJCM050435@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 6 Feb 2018 22:38:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328957 - in head/sys: fs/ext2fs ufs/ufs X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: in head/sys: fs/ext2fs ufs/ufs X-SVN-Commit-Revision: 328957 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 22:38:20 -0000 Author: pfg Date: Tue Feb 6 22:38:19 2018 New Revision: 328957 URL: https://svnweb.freebsd.org/changeset/base/328957 Log: {ext2|ufs}_readdir: Avoid setting negative ncookies. ncookies cannot be negative or the allocator will fail. This should only happen if a caller is very broken but we can still try to survive the event. We should probably also verify for uio_resid > MAXPHYS but in that case it is not clear that just clipping the ncookies value is an adequate response. MFC after: 2 weeks Modified: head/sys/fs/ext2fs/ext2_lookup.c head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- head/sys/fs/ext2fs/ext2_lookup.c Tue Feb 6 22:17:01 2018 (r328956) +++ head/sys/fs/ext2fs/ext2_lookup.c Tue Feb 6 22:38:19 2018 (r328957) @@ -153,7 +153,10 @@ ext2_readdir(struct vop_readdir_args *ap) return (EINVAL); ip = VTOI(vp); if (ap->a_ncookies != NULL) { - ncookies = uio->uio_resid; + if (uio->uio_resid < 0) + ncookies = 0; + else + ncookies = uio->uio_resid; if (uio->uio_offset >= ip->i_size) ncookies = 0; else if (ip->i_size - uio->uio_offset < ncookies) Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Tue Feb 6 22:17:01 2018 (r328956) +++ head/sys/ufs/ufs/ufs_vnops.c Tue Feb 6 22:38:19 2018 (r328957) @@ -2179,7 +2179,10 @@ ufs_readdir(ap) if (ip->i_effnlink == 0) return (0); if (ap->a_ncookies != NULL) { - ncookies = uio->uio_resid; + if (uio->uio_resid < 0) + ncookies = 0; + else + ncookies = uio->uio_resid; if (uio->uio_offset >= ip->i_size) ncookies = 0; else if (ip->i_size - uio->uio_offset < ncookies) From owner-svn-src-all@freebsd.org Tue Feb 6 22:52:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA36EF0F671; Tue, 6 Feb 2018 22:52:47 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay01.pair.com (relay01.pair.com [209.68.5.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5532B87694; Tue, 6 Feb 2018 22:52:47 +0000 (UTC) (envelope-from pho@holm.cc) Received: from x2.osted.lan (87-58-223-204-dynamic.dk.customer.tdc.net [87.58.223.204]) by relay01.pair.com (Postfix) with ESMTP id E165FD01267; Tue, 6 Feb 2018 17:52:45 -0500 (EST) Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.14.9/8.14.9) with ESMTP id w16Mqiaj040626 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 6 Feb 2018 23:52:44 +0100 (CET) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.14.9/8.14.9/Submit) id w16Mqi15040625; Tue, 6 Feb 2018 23:52:44 +0100 (CET) (envelope-from pho) Date: Tue, 6 Feb 2018 23:52:44 +0100 From: Peter Holm To: Gleb Smirnoff Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r328916 - in head/sys: kern vm Message-ID: <20180206225244.GA40529@x2.osted.lan> References: <201802060416.w164G0va096970@repo.freebsd.org> <20180206113017.GA25428@x2.osted.lan> <20180206182839.GB1063@FreeBSD.org> <20180206193430.GA36054@x2.osted.lan> <20180206221555.GC1063@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180206221555.GC1063@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 22:52:47 -0000 On Tue, Feb 06, 2018 at 02:15:55PM -0800, Gleb Smirnoff wrote: > Peter, > > can you please check post r328952 kernel? > Sure. FreeBSD 12.0-CURRENT #0 r328956: Tue Feb 6 23:26:58 CET 2018 pho@x4.osted.lan:/usr/src/sys/i386/compile/PHO i386 FreeBSD clang version 6.0.0 (branches/release_60 321788) (based on LLVM 6.0.0) WARNING: WITNESS option enabled, expect reduced performance. WARNING: DIAGNOSTIC option enabled, expect reduced performance. Entering uma_startup with 9 boot pages configured startup_alloc from "UMA Kegs", 8 boot pages left startup_alloc from "UMA Zones", 7 boot pages left startup_alloc from "UMA Hash", 6 boot pages left startup_alloc from "UMA Zones", 5 boot pages left startup_alloc from "vmem btag", 4 boot pages left startup_alloc from "MAP", 3 boot pages left startup_alloc from "UMA Kegs", 2 boot pages left startup_alloc from "KMAP ENTRY", 1 boot pages left panic: UMA: Increase vm.boot_pages cpuid = 0 time = 1 KDB: stack backtrace: db_trace_self_wrapper(c1654440,c23af290,c1be5bc0,8,c1bbec20,...) at db_trace_self_wrapper+0x2a/frame 0xc2022a70 kdb_backtrace(c164e477,1,0,c2022b30,0,...) at kdb_backtrace+0x2d/frame 0xc2022ad8 vpanic(c16a125d,c2022b30,c2022b30,c2022b48,c0fb7933,...) at vpanic+0x133/frame 0xc2022b10 panic(c16a125d,0,c16a0cb0,44f,c23b0a80,...) at panic+0x1b/frame 0xc2022b24 startup_alloc(c23b1dc0,1000,0,c2022b7b,102,...) at startup_alloc+0x143/frame 0xc2022b48 keg_alloc_slab(0,2,c16a0cb0,983,c23b7000,...) at keg_alloc_slab+0xf6/frame 0xc2022b90 keg_fetch_slab(ffffffff,2,c16a0cb0,9e5,c23b1dc0,...) at keg_fetch_slab+0x10e/frame 0xc2022be8 zone_fetch_slab(c23b1dc0,0,ffffffff,2,c23b5000,...) at zone_fetch_slab+0x61/frame 0xc2022c0c zone_import(c23b1dc0,c2022c68,1,ffffffff,2,...) at zone_import+0x3b/frame 0xc2022c44 zone_alloc_item(ffffffff,2,c16a0cc7,c16357bd,c1b5d050,...) at zone_alloc_item+0x3d/frame 0xc2022c78 uma_zalloc_arg(c23b1dc0,0,2,c1b5d050,0,...) at uma_zalloc_arg+0x66c/frame 0xc2022cb4 vmem_create(c16a1c9a,0,0,1000,0,...) at vmem_create+0x2a/frame 0xc2022ce4 vm_mem_init(0,0,0,0,c186a9d4,...) at vm_mem_init+0xf4/frame 0xc2022d10 mi_startup() at mi_startup+0xf7/frame 0xc2022d38 begin() at begin+0x2f KDB: enter: panic [ thread pid 0 tid 0 ] Stopped at kdb_enter+0x3a: movl $0,kdb_why db> Setting vm.boot_pages in the loader to 128 fixes this. - Peter From owner-svn-src-all@freebsd.org Tue Feb 6 23:06:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E721F10574; Tue, 6 Feb 2018 23:06:38 +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 0657D87FE8; Tue, 6 Feb 2018 23:06:37 +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 w16N6alN002508 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 6 Feb 2018 15:06:36 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w16N6aW7002507; Tue, 6 Feb 2018 15:06:36 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 6 Feb 2018 15:06:35 -0800 From: Gleb Smirnoff To: Peter Holm Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r328916 - in head/sys: kern vm Message-ID: <20180206230635.GE1063@FreeBSD.org> References: <201802060416.w164G0va096970@repo.freebsd.org> <20180206113017.GA25428@x2.osted.lan> <20180206182839.GB1063@FreeBSD.org> <20180206193430.GA36054@x2.osted.lan> <20180206221555.GC1063@FreeBSD.org> <20180206225244.GA40529@x2.osted.lan> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="sdtB3X0nJg68CQEu" Content-Disposition: inline In-Reply-To: <20180206225244.GA40529@x2.osted.lan> User-Agent: Mutt/1.9.3 (2018-01-21) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 23:06:38 -0000 --sdtB3X0nJg68CQEu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Feb 06, 2018 at 11:52:44PM +0100, Peter Holm wrote: P> On Tue, Feb 06, 2018 at 02:15:55PM -0800, Gleb Smirnoff wrote: P> > Peter, P> > P> > can you please check post r328952 kernel? P> > P> P> Sure. P> P> FreeBSD 12.0-CURRENT #0 r328956: Tue Feb 6 23:26:58 CET 2018 P> pho@x4.osted.lan:/usr/src/sys/i386/compile/PHO i386 P> FreeBSD clang version 6.0.0 (branches/release_60 321788) (based on LLVM 6.0.0) P> WARNING: WITNESS option enabled, expect reduced performance. P> WARNING: DIAGNOSTIC option enabled, expect reduced performance. P> Entering uma_startup with 9 boot pages configured P> startup_alloc from "UMA Kegs", 8 boot pages left P> startup_alloc from "UMA Zones", 7 boot pages left P> startup_alloc from "UMA Hash", 6 boot pages left P> startup_alloc from "UMA Zones", 5 boot pages left P> startup_alloc from "vmem btag", 4 boot pages left P> startup_alloc from "MAP", 3 boot pages left P> startup_alloc from "UMA Kegs", 2 boot pages left P> startup_alloc from "KMAP ENTRY", 1 boot pages left P> panic: UMA: Increase vm.boot_pages Off by one :( Can you please boot with this patch and show dmesg? -- Gleb Smirnoff --sdtB3X0nJg68CQEu Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="boot_pages_verbose.diff" Index: sys/vm/uma_core.c =================================================================== --- sys/vm/uma_core.c (revision 328955) +++ sys/vm/uma_core.c (working copy) @@ -1800,6 +1800,7 @@ uma_startup_count(int zones) /* Memory for the zone of zones and zone of kegs. */ pages = howmany(roundup(zsize, CACHE_LINE_SIZE) * 2 + roundup(ksize, CACHE_LINE_SIZE), PAGE_SIZE); + printf("boot_pages master %d\n", pages); zones += UMA_BOOT_ZONES; @@ -1808,9 +1809,11 @@ uma_startup_count(int zones) pages += zones * howmany(zsize, UMA_SLAB_SIZE); else pages += howmany(zones, UMA_SLAB_SIZE / zsize); + printf("boot_pages zones %d\n", pages); /* ... and their kegs. */ pages += howmany(zones, UMA_SLAB_SIZE / ksize); + printf("boot_pages kegs %d\n", pages); /* * Take conservative approach that every zone @@ -1818,6 +1821,7 @@ uma_startup_count(int zones) */ pages += howmany(zones, UMA_SLAB_SIZE / (sizeof(struct slabhead *) * UMA_HASH_SIZE_INIT)); + printf("boot_pages hash %d\n", pages); return (pages); } Index: sys/vm/vm_page.c =================================================================== --- sys/vm/vm_page.c (revision 328955) +++ sys/vm/vm_page.c (working copy) @@ -518,8 +518,10 @@ vm_page_startup(vm_offset_t vaddr) /* vmem_startup() calls uma_prealloc(). */ boot_pages += vmem_startup_count(); + printf("boot_pages vmem %s\n", boot_pages); /* vm_map_startup() calls uma_prealloc(). */ boot_pages += howmany(MAX_KMAP, UMA_SLAB_SIZE / sizeof(struct vm_map)); + printf("boot_pages kmap %s\n", boot_pages); /* * Before going fully functional kmem_init() does allocation --sdtB3X0nJg68CQEu-- From owner-svn-src-all@freebsd.org Tue Feb 6 23:08:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98EBCF107D8; Tue, 6 Feb 2018 23:08:16 +0000 (UTC) (envelope-from dexuan.bsd@gmail.com) Received: from mail-lf0-x22a.google.com (mail-lf0-x22a.google.com [IPv6:2a00:1450:4010:c07::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 95788681D8; Tue, 6 Feb 2018 23:08:15 +0000 (UTC) (envelope-from dexuan.bsd@gmail.com) Received: by mail-lf0-x22a.google.com with SMTP id g72so5130088lfg.5; Tue, 06 Feb 2018 15:08:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=J859qlJHPfz2sfp462GZTDZ3wEtHI05Vhj2AKvUDbMc=; b=e2GPINrJCt0OSnwGDPsDwFEpRRFJVzbrN6ao1vSHbvkjoCJ9jxvtU6bnpbpCeNpowT 8qqzGMxlcxvj3U5r2tu8K6DlXp7TpbJohnVDCSkIvI4iEIC60lpaBd4UOF4Qh6nf2GB9 wSaJuWW5EHrNL1RKLT4iIdQwAJwoJTzLflSRHKExAqfRSC2810IxZyArUbrBLZ6k7AMo WPE2oQ3i1BS9Ys1HuEm85WPv42AWcFPq0feyc5OmpZdUWsmZe+YibBD5dqc4mPjIo8F6 AJx/pii6HBwkTvDXse2Xp3Lh8T0XwwF2bwczIjm8wv3XUKx5IAD/AHBd/EJNgCk8y1mt RvdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=J859qlJHPfz2sfp462GZTDZ3wEtHI05Vhj2AKvUDbMc=; b=ZH1ebcSjwuqoWlCb03jzRKimrBRMMOhnxm+wdFabUN6qzRRAxJ3TEbe7Vbh81E36gg aYLSYhA2PDnBxp8qj9v8fdOK06bdaNj8snKx7GDAxl+ge752q6+bUdpyX4W5640fOmR4 zaIgF/SRPhfntZR6T8imRfI+jgmfYmMV9HruNhl8Ll2VoQd9XHNfizL/n8MNIEPmFusR K4tSDPmi5elGRQ5P5fe1vCL1on6d2NfvN4qrD5qu/7U27wz73M9nNbWINoTg8UXCL2ta nArHowmHqz2cqUyi4LApRSjBFirWX7w9BHRVbrnRL5SLtitnCoaaZ54oOd/y4MSMKVAo DQog== X-Gm-Message-State: APf1xPAtIQgXBTtO1F3d8fcfLpNKqrrikJF3fjJXj4ujidDdY4+X0GSH zzvLmawdJFOAMWK2rTyz9LjQgb4EsN91DXSFivXlNg== X-Google-Smtp-Source: AH8x224t23iKokUEtvwtkBQyF7E4mUy2vfLPYQntJOAJYMni0I/X7w5d1eQf37AKs/YiGw4t19+3ZED0KmYy9wNz90k= X-Received: by 10.25.143.12 with SMTP id r12mr2996459lfd.30.1517958493231; Tue, 06 Feb 2018 15:08:13 -0800 (PST) MIME-Version: 1.0 Received: by 10.25.228.148 with HTTP; Tue, 6 Feb 2018 15:08:12 -0800 (PST) In-Reply-To: <3c1f7e72-364b-f08a-7b25-d2e7177b41c2@sentex.net> References: <201802061913.w16JDiP8047547@repo.freebsd.org> <3c1f7e72-364b-f08a-7b25-d2e7177b41c2@sentex.net> From: Dexuan-BSD Cui Date: Tue, 6 Feb 2018 15:08:12 -0800 Message-ID: Subject: Re: svn commit: r328944 - stable/11/sys/kern To: Mike Tancsa , decui@microsoft.com Cc: Kirk McKusick , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 23:08:16 -0000 I'm getting the error too: /root/freebsd/sys/kern/vfs_subr.c:3368:30: error: no member named 'v_unpcb' in 'struct vnode' printf(" socket %p\n", vp->v_unpcb); On Tue, Feb 6, 2018 at 1:42 PM, Mike Tancsa wrote: > On 2/6/2018 2:13 PM, Kirk McKusick wrote: >> Author: mckusick >> Date: Tue Feb 6 19:13:44 2018 >> New Revision: 328944 >> URL: https://svnweb.freebsd.org/changeset/base/328944 >> >> Log: >> MFC of 328643. >> >> fix vn_printf listing of its union > > Hi, > I am getting a buildfailure with this commit, I think > > -------------------------------------------------------------- >>>> stage 3.1: building everything > -------------------------------------------------------------- > cd /usr/obj/usr/src/sys/server; COMPILER_VERSION=50001 > COMPILER_FEATURES=c++11 COMPILER_TYPE=clang > COMPILER_FREEBSD_VERSION=1100505 MAKEOBJDIRPREFIX=/usr/obj > MACHINE_ARCH=amd64 MACHINE=amd64 CPUTYPE= > GROFF_BIN_PATH=/usr/obj/usr/src/tmp/legacy/usr/bin > GROFF_FONT_PATH=/usr/obj/usr/src/tmp/legacy/usr/share/groff_font > GROFF_TMAC_PATH=/usr/obj/usr/src/tmp/legacy/usr/share/tmac CC="cc > -target x86_64-unknown-freebsd11.1 --sysroot=/usr/obj/usr/src/tmp > -B/usr/obj/usr/src/tmp/usr/bin" CXX="c++ -target > x86_64-unknown-freebsd11.1 --sysroot=/usr/obj/usr/src/tmp > -B/usr/obj/usr/src/tmp/usr/bin" CPP="cpp -target > x86_64-unknown-freebsd11.1 --sysroot=/usr/obj/usr/src/tmp > -B/usr/obj/usr/src/tmp/usr/bin" AS="as" AR="ar" LD="ld" NM=nm > OBJDUMP=objdump OBJCOPY="objcopy" RANLIB=ranlib STRINGS= SIZE="size" > INSTALL="sh /usr/src/tools/install.sh" > PATH=/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/bin:/usr/obj/usr/src/tmp/usr/sbin:/usr/obj/usr/src/tmp/usr/bin:/sbin:/bin:/usr/sbin:/usr/bin > make -D NO_KERNELCLEAN -m /usr/src/share/mk KERNEL=kernel all > -DNO_MODULES_OBJ > cc -target x86_64-unknown-freebsd11.1 --sysroot=/usr/obj/usr/src/tmp > -B/usr/obj/usr/src/tmp/usr/bin -c -O2 -pipe -fno-strict-aliasing -g > -nostdinc -I. -I/usr/src/sys -I/usr/src/sys/contrib/libfdt -D_KERNEL > -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h > -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -MD > -MF.depend.vfs_subr.o -MTvfs_subr.o -mcmodel=kernel -mno-red-zone > -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables > -ffreestanding -fwrapv -fstack-protector -gdwarf-2 -Wall > -Wredundant-decls -Wnested-externs -Wstrict-prototypes > -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef > -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ > -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas > -Wno-error-tautological-compare -Wno-error-empty-body > -Wno-error-parentheses-equality -Wno-error-unused-function > -Wno-error-pointer-sign -Wno-error-shift-negative-value > -Wno-error-address-of-packed-member -mno-aes -mno-avx > -std=iso9899:1999 -Werror /usr/src/sys/kern/vfs_subr.c > /usr/src/sys/kern/vfs_subr.c:3368:30: error: no member named 'v_unpcb' > in 'struct vnode' > printf(" socket %p\n", vp->v_unpcb); > ~~ ^ > 1 error generated. > *** Error code 1 > > Stop. > make[2]: stopped in /usr/obj/usr/src/sys/server > *** Error code 1 > > Stop. > make[1]: stopped in /usr/src > *** Error code 1 > > Stop. > > >> >> Modified: >> stable/11/sys/kern/vfs_subr.c >> Directory Properties: >> stable/11/ (props changed) >> >> Modified: stable/11/sys/kern/vfs_subr.c >> ============================================================================== >> --- stable/11/sys/kern/vfs_subr.c Tue Feb 6 19:09:49 2018 (r328943) >> +++ stable/11/sys/kern/vfs_subr.c Tue Feb 6 19:13:44 2018 (r328944) >> @@ -3355,8 +3355,25 @@ vn_printf(struct vnode *vp, const char *fmt, ...) >> va_end(ap); >> printf("%p: ", (void *)vp); >> printf("tag %s, type %s\n", vp->v_tag, typename[vp->v_type]); >> - printf(" usecount %d, writecount %d, refcount %d mountedhere %p\n", >> - vp->v_usecount, vp->v_writecount, vp->v_holdcnt, vp->v_mountedhere); >> + printf(" usecount %d, writecount %d, refcount %d", >> + vp->v_usecount, vp->v_writecount, vp->v_holdcnt); >> + switch (vp->v_type) { >> + case VDIR: >> + printf(" mountedhere %p\n", vp->v_mountedhere); >> + break; >> + case VCHR: >> + printf(" rdev %p\n", vp->v_rdev); >> + break; >> + case VSOCK: >> + printf(" socket %p\n", vp->v_unpcb); >> + break; >> + case VFIFO: >> + printf(" fifoinfo %p\n", vp->v_fifoinfo); >> + break; >> + default: >> + printf("\n"); >> + break; >> + } >> buf[0] = '\0'; >> buf[1] = '\0'; >> if (vp->v_vflag & VV_ROOT) >> _______________________________________________ >> svn-src-stable-11@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/svn-src-stable-11 >> To unsubscribe, send any mail to "svn-src-stable-11-unsubscribe@freebsd.org" >> >> > > > -- > ------------------- > Mike Tancsa, tel +1 519 651 3400 x203 > Sentex Communications, mike@sentex.net > Providing Internet services since 1994 www.sentex.net > Cambridge, Ontario Canada > From owner-svn-src-all@freebsd.org Tue Feb 6 23:11:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15149F10B01; Tue, 6 Feb 2018 23:11:21 +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 920946845C; Tue, 6 Feb 2018 23:11:20 +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 w16NBESR002545 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 6 Feb 2018 15:11:14 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w16NBEHa002544; Tue, 6 Feb 2018 15:11:14 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 6 Feb 2018 15:11:14 -0800 From: Gleb Smirnoff To: Dexuan-BSD Cui Cc: Mike Tancsa , decui@microsoft.com, Kirk McKusick , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r328944 - stable/11/sys/kern Message-ID: <20180206231114.GF1063@FreeBSD.org> References: <201802061913.w16JDiP8047547@repo.freebsd.org> <3c1f7e72-364b-f08a-7b25-d2e7177b41c2@sentex.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.3 (2018-01-21) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 23:11:21 -0000 On Tue, Feb 06, 2018 at 03:08:12PM -0800, Dexuan-BSD Cui wrote: D> I'm getting the error too: D> D> /root/freebsd/sys/kern/vfs_subr.c:3368:30: error: no member named D> 'v_unpcb' in 'struct vnode' D> printf(" socket %p\n", vp->v_unpcb); It should be v_socket on stable/11. If that change fixes the compile for you, feel free to commit. I don't have stable/11 system at hand. -- Gleb Smirnoff From owner-svn-src-all@freebsd.org Tue Feb 6 23:12:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86625F10C49; Tue, 6 Feb 2018 23:12:17 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3DC8F6878B; Tue, 6 Feb 2018 23:12:17 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 38E3C1EAA0; Tue, 6 Feb 2018 23:12:17 +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 w16NCHgI070031; Tue, 6 Feb 2018 23:12:17 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16NCHTO070030; Tue, 6 Feb 2018 23:12:17 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802062312.w16NCHTO070030@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 6 Feb 2018 23:12:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328958 - head/share/zoneinfo X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/share/zoneinfo X-SVN-Commit-Revision: 328958 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 23:12:17 -0000 Author: imp Date: Tue Feb 6 23:12:16 2018 New Revision: 328958 URL: https://svnweb.freebsd.org/changeset/base/328958 Log: Avoid find -s, use find | sort instead. find -s was introduced to make the metalog more deterministic. However, find -s is not portable. find | sort is portable and accomplishes the same goals, even if it isn't pedantically the same. TZS is the same before / after the change so any fussy differences between the two are moot and there won't be METALOG churn across this change. Differential Revision: https://reviews.freebsd.org/D14231 Modified: head/share/zoneinfo/Makefile Modified: head/share/zoneinfo/Makefile ============================================================================== --- head/share/zoneinfo/Makefile Tue Feb 6 22:38:19 2018 (r328957) +++ head/share/zoneinfo/Makefile Tue Feb 6 23:12:16 2018 (r328958) @@ -95,8 +95,13 @@ zoneinfo: yearistype ${TDATA} zic -D -d ${TZBUILDDIR} -p ${POSIXRULES} -m ${NOBINMODE} \ ${LEAPFILE} -y ${.OBJDIR}/yearistype ${TZFILES} +# +# Sort TZS to ensure they are the same every build. find -s might +# be a shorter way to express this, but it's non-portable. Any +# differences between the two don't matter for this purpose. +# .if make(*install*) -TZS!= cd ${TZBUILDDIR} && find -s * -type f +TZS!= cd ${TZBUILDDIR} && find * -type f | env LC_ALL=C sort .endif beforeinstall: install-zoneinfo From owner-svn-src-all@freebsd.org Tue Feb 6 23:12:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF999F10E23; Tue, 6 Feb 2018 23:12:47 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A685D688EE; Tue, 6 Feb 2018 23:12:47 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A17E01EABB; Tue, 6 Feb 2018 23:12:47 +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 w16NClki070091; Tue, 6 Feb 2018 23:12:47 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16NCltK070090; Tue, 6 Feb 2018 23:12:47 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802062312.w16NCltK070090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 6 Feb 2018 23:12:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328959 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 328959 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 23:12:48 -0000 Author: cem Date: Tue Feb 6 23:12:47 2018 New Revision: 328959 URL: https://svnweb.freebsd.org/changeset/base/328959 Log: fsync.2: Cross-reference fsync(1) Reported by: rpokala Sponsored by: Dell EMC Isilon Modified: head/lib/libc/sys/fsync.2 Modified: head/lib/libc/sys/fsync.2 ============================================================================== --- head/lib/libc/sys/fsync.2 Tue Feb 6 23:12:16 2018 (r328958) +++ head/lib/libc/sys/fsync.2 Tue Feb 6 23:12:47 2018 (r328959) @@ -34,7 +34,7 @@ .\" @(#)fsync.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd May 24, 2017 +.Dd February 6, 2018 .Dt FSYNC 2 .Os .Sh NAME @@ -108,6 +108,7 @@ refers to a socket, not to a file. An I/O error occurred while reading from or writing to the file system. .El .Sh SEE ALSO +.Xr fsync 1 , .Xr sync 2 , .Xr syncer 4 , .Xr sync 8 From owner-svn-src-all@freebsd.org Tue Feb 6 23:21:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BA85F117B1; Tue, 6 Feb 2018 23:21:08 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 528E069129; Tue, 6 Feb 2018 23:21: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D85F1EAFC; Tue, 6 Feb 2018 23:21: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 w16NL84F071352; Tue, 6 Feb 2018 23:21:08 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16NL8ca071351; Tue, 6 Feb 2018 23:21:08 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802062321.w16NL8ca071351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 6 Feb 2018 23:21:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328960 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 328960 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 23:21:08 -0000 Author: imp Date: Tue Feb 6 23:21:08 2018 New Revision: 328960 URL: https://svnweb.freebsd.org/changeset/base/328960 Log: Keep a counter for number of requests completed with an error. Sponsored by: Netflix Modified: head/sys/cam/cam_iosched.c Modified: head/sys/cam/cam_iosched.c ============================================================================== --- head/sys/cam/cam_iosched.c Tue Feb 6 23:12:47 2018 (r328959) +++ head/sys/cam/cam_iosched.c Tue Feb 6 23:21:08 2018 (r328960) @@ -223,6 +223,7 @@ struct iop_stats { int total; /* Total for all time -- wraps */ int in; /* number queued all time -- wraps */ int out; /* number completed all time -- wraps */ + int errs; /* Number of I/Os completed with error -- wraps */ /* * Statistics on different bits of the process. @@ -781,6 +782,7 @@ cam_iosched_iop_stats_init(struct cam_iosched_softc *i ios->max = ios->current = 300000; ios->min = 1; ios->out = 0; + ios->errs = 0; ios->pending = 0; ios->queued = 0; ios->total = 0; @@ -971,7 +973,11 @@ cam_iosched_iop_stats_sysctl_init(struct cam_iosched_s SYSCTL_ADD_INT(ctx, n, OID_AUTO, "out", CTLFLAG_RD, &ios->out, 0, - "# of transactions completed"); + "# of transactions completed (including with error)"); + SYSCTL_ADD_INT(ctx, n, + OID_AUTO, "errs", CTLFLAG_RD, + &ios->errs, 0, + "# of transactions completed with an error"); SYSCTL_ADD_PROC(ctx, n, OID_AUTO, "limiter", CTLTYPE_STRING | CTLFLAG_RW, @@ -1463,13 +1469,19 @@ cam_iosched_bio_complete(struct cam_iosched_softc *isc printf("done: %p %#x\n", bp, bp->bio_cmd); if (bp->bio_cmd == BIO_WRITE) { retval = cam_iosched_limiter_iodone(&isc->write_stats, bp); + if (!(bp->bio_flags & BIO_ERROR)) + isc->write_stats.errs++; isc->write_stats.out++; isc->write_stats.pending--; } else if (bp->bio_cmd == BIO_READ) { retval = cam_iosched_limiter_iodone(&isc->read_stats, bp); + if (!(bp->bio_flags & BIO_ERROR)) + isc->read_stats.errs++; isc->read_stats.out++; isc->read_stats.pending--; } else if (bp->bio_cmd == BIO_DELETE) { + if (!(bp->bio_flags & BIO_ERROR)) + isc->trim_stats.errs++; isc->trim_stats.out++; isc->trim_stats.pending--; } else if (bp->bio_cmd != BIO_FLUSH) { From owner-svn-src-all@freebsd.org Tue Feb 6 23:25:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FF47F11DE1; Tue, 6 Feb 2018 23:25:25 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay01.pair.com (relay01.pair.com [209.68.5.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A4BA56968D; Tue, 6 Feb 2018 23:25:24 +0000 (UTC) (envelope-from pho@holm.cc) Received: from x2.osted.lan (87-58-223-204-dynamic.dk.customer.tdc.net [87.58.223.204]) by relay01.pair.com (Postfix) with ESMTP id 8254BD010F0; Tue, 6 Feb 2018 18:25:23 -0500 (EST) Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.14.9/8.14.9) with ESMTP id w16NPLvG041432 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 7 Feb 2018 00:25:22 +0100 (CET) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.14.9/8.14.9/Submit) id w16NPL0K041431; Wed, 7 Feb 2018 00:25:21 +0100 (CET) (envelope-from pho) Date: Wed, 7 Feb 2018 00:25:21 +0100 From: Peter Holm To: Gleb Smirnoff Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r328916 - in head/sys: kern vm Message-ID: <20180206232521.GA41396@x2.osted.lan> References: <201802060416.w164G0va096970@repo.freebsd.org> <20180206113017.GA25428@x2.osted.lan> <20180206182839.GB1063@FreeBSD.org> <20180206193430.GA36054@x2.osted.lan> <20180206221555.GC1063@FreeBSD.org> <20180206225244.GA40529@x2.osted.lan> <20180206230635.GE1063@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180206230635.GE1063@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 23:25:25 -0000 On Tue, Feb 06, 2018 at 03:06:35PM -0800, Gleb Smirnoff wrote: > On Tue, Feb 06, 2018 at 11:52:44PM +0100, Peter Holm wrote: > P> On Tue, Feb 06, 2018 at 02:15:55PM -0800, Gleb Smirnoff wrote: > P> > Peter, > P> > > P> > can you please check post r328952 kernel? > P> > > P> > P> Sure. > P> > P> FreeBSD 12.0-CURRENT #0 r328956: Tue Feb 6 23:26:58 CET 2018 > P> pho@x4.osted.lan:/usr/src/sys/i386/compile/PHO i386 > P> FreeBSD clang version 6.0.0 (branches/release_60 321788) (based on LLVM 6.0.0) > P> WARNING: WITNESS option enabled, expect reduced performance. > P> WARNING: DIAGNOSTIC option enabled, expect reduced performance. > P> Entering uma_startup with 9 boot pages configured > P> startup_alloc from "UMA Kegs", 8 boot pages left > P> startup_alloc from "UMA Zones", 7 boot pages left > P> startup_alloc from "UMA Hash", 6 boot pages left > P> startup_alloc from "UMA Zones", 5 boot pages left > P> startup_alloc from "vmem btag", 4 boot pages left > P> startup_alloc from "MAP", 3 boot pages left > P> startup_alloc from "UMA Kegs", 2 boot pages left > P> startup_alloc from "KMAP ENTRY", 1 boot pages left > P> panic: UMA: Increase vm.boot_pages > > Off by one :( Can you please boot with this patch and show dmesg? > FreeBSD 12.0-CURRENT #2 r328956M: Wed Feb 7 00:20:47 CET 2018 pho@x4.osted.lan:/usr/src/sys/i386/compile/PHO i386 FreeBSD clang version 6.0.0 (branches/release_60 321788) (based on LLVM 6.0.0) WARNING: WITNESS option enabled, expect reduced performance. WARNING: DIAGNOSTIC option enabled, expect reduced performance. boot_pages master 1 boot_pages zones 3 boot_pages kegs 4 boot_pages hash 5 boot_pages vmem 6 boot_pages kmap 7 Entering uma_startup with 9 boot pages configured startup_alloc from "UMA Kegs", 8 boot pages left startup_alloc from "UMA Zones", 7 boot pages left startup_alloc from "UMA Hash", 6 boot pages left startup_alloc from "UMA Zones", 5 boot pages left startup_alloc from "vmem btag", 4 boot pages left startup_alloc from "MAP", 3 boot pages left startup_alloc from "UMA Kegs", 2 boot pages left startup_alloc from "KMAP ENTRY", 1 boot pages left panic: UMA: Increase vm.boot_pages cpuid = 0 time = 1 KDB: stack backtrace: db_trace_self_wrapper(c16544c0,c23af290,c1be5bc0,8,c1bbec20,...) at db_trace_self_wrapper+0x2a/frame 0xc2022a70 kdb_backtrace(c164e4f7,1,0,c2022b30,0,...) at kdb_backtrace+0x2d/frame 0xc2022ad8 vpanic(c16a1330,c2022b30,c2022b30,c2022b48,c0fb7983,...) at vpanic+0x133/frame 0xc2022b10 panic(c16a1330,0,c16a0d83,44f,c23b0a80,...) at panic+0x1b/frame 0xc2022b24 startup_alloc(c23b1dc0,1000,0,c2022b7b,102,...) at startup_alloc+0x143/frame 0xc2022b48 keg_alloc_slab(0,2,c16a0d83,987,c23b7000,...) at keg_alloc_slab+0xf6/frame 0xc2022b90 keg_fetch_slab(ffffffff,2,c16a0d83,9e9,c23b1dc0,...) at keg_fetch_slab+0x10e/frame 0xc2022be8 zone_fetch_slab(c23b1dc0,0,ffffffff,2,c23b5000,...) at zone_fetch_slab+0x61/frame 0xc2022c0c zone_import(c23b1dc0,c2022c68,1,ffffffff,2,...) at zone_import+0x3b/frame 0xc2022c44 zone_alloc_item(ffffffff,2,c16a0d9a,c163583d,c1b5d050,...) at zone_alloc_item+0x3d/frame 0xc2022c78 uma_zalloc_arg(c23b1dc0,0,2,c1b5d050,0,...) at uma_zalloc_arg+0x66c/frame 0xc2022cb4 vmem_create(c16a1d6e,0,0,1000,0,...) at vmem_create+0x2a/frame 0xc2022ce4 vm_mem_init(0,0,0,0,c186aab4,...) at vm_mem_init+0xf4/frame 0xc2022d10 mi_startup() at mi_startup+0xf7/frame 0xc2022d38 begin() at begin+0x2f KDB: enter: panic [ thread pid 0 tid 0 ] Stopped at kdb_enter+0x3a: movl $0,kdb_why db> - Peter From owner-svn-src-all@freebsd.org Tue Feb 6 23:50:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C660F138C8; Tue, 6 Feb 2018 23:50:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E96E6A5A0; Tue, 6 Feb 2018 23:50:03 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 398491EFC4; Tue, 6 Feb 2018 23:50:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w16No3PC085371; Tue, 6 Feb 2018 23:50:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16No3Vk085370; Tue, 6 Feb 2018 23:50:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201802062350.w16No3Vk085370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 6 Feb 2018 23:50:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328961 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 328961 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 06 Feb 2018 23:50:03 -0000 Author: kib Date: Tue Feb 6 23:50:02 2018 New Revision: 328961 URL: https://svnweb.freebsd.org/changeset/base/328961 Log: Adjust MFC in r328944 to stable/11. This is a direct commit to the branch. Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/kern/vfs_subr.c Modified: stable/11/sys/kern/vfs_subr.c ============================================================================== --- stable/11/sys/kern/vfs_subr.c Tue Feb 6 23:21:08 2018 (r328960) +++ stable/11/sys/kern/vfs_subr.c Tue Feb 6 23:50:02 2018 (r328961) @@ -3365,7 +3365,7 @@ vn_printf(struct vnode *vp, const char *fmt, ...) printf(" rdev %p\n", vp->v_rdev); break; case VSOCK: - printf(" socket %p\n", vp->v_unpcb); + printf(" socket %p\n", vp->v_socket); break; case VFIFO: printf(" fifoinfo %p\n", vp->v_fifoinfo); From owner-svn-src-all@freebsd.org Wed Feb 7 00:00:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63881F1471A; Wed, 7 Feb 2018 00:00:51 +0000 (UTC) (envelope-from decui@microsoft.com) Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sg2apc01on0104.outbound.protection.outlook.com [104.47.125.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT TLS CA 4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 65A9F6B1F6; Wed, 7 Feb 2018 00:00:49 +0000 (UTC) (envelope-from decui@microsoft.com) Received: from KL1P15301MB0006.APCP153.PROD.OUTLOOK.COM (10.170.167.17) by KL1P15301MB0022.APCP153.PROD.OUTLOOK.COM (10.170.167.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.506.7; Wed, 7 Feb 2018 00:00:43 +0000 Received: from KL1P15301MB0006.APCP153.PROD.OUTLOOK.COM ([10.170.167.17]) by KL1P15301MB0006.APCP153.PROD.OUTLOOK.COM ([10.170.167.17]) with mapi id 15.20.0506.007; Wed, 7 Feb 2018 00:00:42 +0000 From: Dexuan Cui To: Gleb Smirnoff , Dexuan-BSD Cui CC: Mike Tancsa , Kirk McKusick , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-stable@freebsd.org" , "svn-src-stable-11@freebsd.org" Subject: RE: svn commit: r328944 - stable/11/sys/kern Thread-Topic: svn commit: r328944 - stable/11/sys/kern Thread-Index: AQHTn5/T37VzMblK80arLfna/5sc4KOYBRYw Date: Wed, 7 Feb 2018 00:00:42 +0000 Message-ID: References: <201802061913.w16JDiP8047547@repo.freebsd.org> <3c1f7e72-364b-f08a-7b25-d2e7177b41c2@sentex.net> <20180206231114.GF1063@FreeBSD.org> In-Reply-To: <20180206231114.GF1063@FreeBSD.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Owner=decui@microsoft.com; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2018-02-07T00:00:37.7579728Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=General; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Application=Microsoft Azure Information Protection; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Extended_MSFT_Method=Automatic; Sensitivity=General x-originating-ip: [2001:4898:80e8:4::5eb] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; KL1P15301MB0022; 6:y8FglW/TlFz7Nw5gyw1hsHvYBtEf62gBeRjk2xPR/6DkzcF5SbqSKfJXMHnDCFa5e70vLJrRnKrYiUvKzMl50LNfETbe49TXgBwY8E5GV3mub8gSblQwQ8wtK8VEj7KR3hOStC5XfwihpDouEiMHAZgwaqeJrQQY7Q9+5XYqRdYs/Un11lJAdgkQbgfCo7aD0NzRZyh4NFu8wreJ9QZ2Z4n+fMZSRbBNxd0Cs31wZPxhdI9C6tJC43Fcj6BozZuclX58nYcgj8BMx1Tzak9T/2DgrUyBDH5jZA4MHTLlv+5bOelrSpetF529bJcpqD0A3qUCLjeiuLfkq5omcev4A6jPMXmzEf+ZzxbrQUUCf8cQrM3U6KtH7srMs7VZj0LK; 5:RiFCiQPhFPbwAz1x8qenh94CCHdk8xKWGge30u6Jc6N7+Xpnv9u0VA1QDAdBZmCgNa4qHkc7BYZJ2wSy8It9Yqe+ZDXF5hbuAYd78g2qiV9QrvPH6t8luWWf99ttPzEk1X/ksYsoqQhbUZ0NRQadYWIXI+1G+5tkNFJS2WPBhn8=; 24:aifmkTO90HYTuQEDzphU23Bjp2BwM/ydI3M811V1i5zegspo6TkMV3gPszx8rmdqWPM5izZtqOxvBhqKEocDRX3GLQjI+e5WquJZ31fuXfE=; 7:z+OOvjl1gr4FoLilIYIWye9InIJu78r//9clo9CVy/k7C7LkH1LP0i+n75oH8aTUlCbRQSD0xSK5y7TZmYRdwsf4PnycVMei+MJIiNnRgLP3+E+0PtfCeFI9OothnpgOh69agrjOT+UaxfA9j/Qejo07OKiCKHfMiE8c4mlfvA+mMRudbaAb7VtlN1NY0e3+eSDcZ7eMTJ3zQPSRyLDVpcbe/MR7fnMHvvLOE9QZLj6mYz9Eh/sg9Rvvzc8JMBSb x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: e636448b-a032-4db2-9c78-08d56dbdd4cd x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603307)(7193020); SRVR:KL1P15301MB0022; x-ms-traffictypediagnostic: KL1P15301MB0022: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(56005881305849)(166708455590820); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(61425038)(6040501)(2401047)(8121501046)(5005006)(3231101)(2400082)(944501161)(10201501046)(3002001)(93006095)(93001095)(6055026)(61426038)(61427038)(6041288)(20161123560045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(6072148)(201708071742011); SRVR:KL1P15301MB0022; BCL:0; PCL:0; RULEID:; SRVR:KL1P15301MB0022; x-forefront-prvs: 0576145E86 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(366004)(376002)(39380400002)(396003)(39860400002)(346002)(189003)(199004)(6506007)(74316002)(22452003)(105586002)(7736002)(68736007)(2900100001)(77096007)(5660300001)(305945005)(86362001)(99286004)(7696005)(229853002)(3280700002)(86612001)(186003)(25786009)(102836004)(14454004)(4326008)(478600001)(6246003)(3660700001)(8990500004)(55016002)(97736004)(110136005)(2950100002)(93886005)(6436002)(10090500001)(966005)(39060400002)(316002)(76176011)(54906003)(8936002)(53936002)(9686003)(81166006)(33656002)(6306002)(81156014)(2906002)(6116002)(106356001)(10290500003)(8676002); DIR:OUT; SFP:1102; SCL:1; SRVR:KL1P15301MB0022; H:KL1P15301MB0006.APCP153.PROD.OUTLOOK.COM; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: UQ/C/SDIyLqaSjLSl6zQapASDtqnFIHck1KlVvZPySMsVBfTYjTogHP4Wmb2RysL7Ej6nVFsRydZ3RWFECsocQ== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: e636448b-a032-4db2-9c78-08d56dbdd4cd X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Feb 2018 00:00:42.4210 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1P15301MB0022 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 00:00:51 -0000 > From: Gleb Smirnoff > Sent: Tuesday, February 6, 2018 15:11 >=20 > On Tue, Feb 06, 2018 at 03:08:12PM -0800, Dexuan-BSD Cui wrote: > D> I'm getting the error too: > D> > D> /root/freebsd/sys/kern/vfs_subr.c:3368:30: error: no member named > D> 'v_unpcb' in 'struct vnode' > D> printf(" socket %p\n", vp->v_unpcb); >=20 > It should be v_socket on stable/11. If that change fixes the compile > for you, feel free to commit. I don't have stable/11 system at hand. > -- > Gleb Smirnoff Yes, that change fixes the issue, and I can see the renaming happened in:=20 https://github.com/freebsd/freebsd/commit/8a7f8bb123cb2056ca239a472deaef029= 62bdd3e kib just fixed it by https://svnweb.freebsd.org/base?view=3Drevision&revision=3D328961 Thanks, -- Dexuan From owner-svn-src-all@freebsd.org Wed Feb 7 00:19:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 021BAF15EC6; Wed, 7 Feb 2018 00:19:13 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 643716BF63; Wed, 7 Feb 2018 00:19:11 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w170J86M018889; Tue, 6 Feb 2018 16:19:08 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w170J8os018888; Tue, 6 Feb 2018 16:19:08 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201802070019.w170J8os018888@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r328951 - head/etc/rc.d In-Reply-To: <201802062135.w16LZfLD020197@repo.freebsd.org> To: Mark Felder Date: Tue, 6 Feb 2018 16:19:08 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 00:19:13 -0000 > Author: feld (ports committer) > Date: Tue Feb 6 21:35:41 2018 > New Revision: 328951 > URL: https://svnweb.freebsd.org/changeset/base/328951 > > Log: > Refactor cleanvar to remove shell expansion vulnerability > > If any process creates a directory named "-P" in /var/run or > /var/spool/lock it will cause the purgedir function to start to rm -r /. > > Simplify a lot of complicated shell logic by leveraging find(1). > > Reviewed by: allanjude > MFC after: 3 days > Differential Revision: https://reviews.freebsd.org/D13778 Please be careful about use of binaries from /usr/bin in /etc/rc.d, though in this case it is probably ok as /usr has been mounted by the time cleanvar runs, that is not always the case. > Modified: > head/etc/rc.d/cleanvar > > Modified: head/etc/rc.d/cleanvar > ============================================================================== > --- head/etc/rc.d/cleanvar Tue Feb 6 21:01:38 2018 (r328950) > +++ head/etc/rc.d/cleanvar Tue Feb 6 21:35:41 2018 (r328951) > @@ -19,34 +19,6 @@ stop_cmd=":" > extra_commands="reload" > reload_cmd="${name}_start" > > -purgedir() > -{ > - local dir file > - > - if [ $# -eq 0 ]; then > - purgedir . > - else > - for dir > - do > - ( > - cd "$dir" && for file in .* * > - do > - # Skip over logging sockets > - [ -S "$file" -a "$file" = "log" ] && continue > - [ -S "$file" -a "$file" = "logpriv" ] && continue > - [ ."$file" = .. -o ."$file" = ... ] && continue > - if [ -d "$file" -a ! -L "$file" ] > - then > - purgedir "$file" > - else > - rm -f -- "$file" > - fi > - done > - ) > - done > - fi > -} > - > cleanvar_prestart() > { > # These files must be removed only the first time this script is run > @@ -58,14 +30,17 @@ cleanvar_prestart() > cleanvar_start() > { > if [ -d /var/run -a ! -f /var/run/clean_var ]; then > - purgedir /var/run > + # Skip over logging sockets > + find /var/run \( -type f -or -type s ! -name log -and ! -name logpriv \) -delete > >/var/run/clean_var > fi > if [ -d /var/spool/lock -a ! -f /var/spool/lock/clean_var ]; then > - purgedir /var/spool/lock > + find /var/spool/lock -type f -delete > >/var/spool/lock/clean_var > fi > - rm -rf /var/spool/uucp/.Temp/* > + if [ -d /var/spool/uucp/.Temp ]; then > + find /var/spool/uucp/.Temp -delete > + fi > } > > load_rc_config $name > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Feb 7 00:29:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 745C5F16B86; Wed, 7 Feb 2018 00:29:43 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D792D6C6BB; Wed, 7 Feb 2018 00:29:42 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w170Tee0018960; Tue, 6 Feb 2018 16:29:40 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w170TebA018959; Tue, 6 Feb 2018 16:29:40 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201802070029.w170TebA018959@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r328934 - in head: . bin/sh In-Reply-To: <1517945713.1366.108.camel@freebsd.org> To: Ian Lepore Date: Tue, 6 Feb 2018 16:29:40 -0800 (PST) CC: rgrimes@freebsd.org, Alex Richardson , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 00:29:43 -0000 [ Charset ISO-8859-1 unsupported, converting... ] > On Tue, 2018-02-06 at 11:25 -0800, Rodney W. Grimes wrote: > > > > > > Author: arichardson > > > Date: Tue Feb??6 15:41:35 2018 > > > New Revision: 328934 > > > URL: https://svnweb.freebsd.org/changeset/base/328934 > > > > > > Log: > > > ? Don't hardcode /usr/bin as the path for mktemp in build tools > > > ?? > > > ? It won't work e.g. when crossbuilding from Ubuntu Linux as mktemp > > > is in > > > ? /bin there. > > > ?? > > > ? Reviewed By: bdrewery > > > ? Approved By: jhb (mentor) > > > ? Differential Revision: https://reviews.freebsd.org/D13937 > > Would it be better to create the variable MKTEMP to point at > > either /bin/mktemp or /usr/bin/mktemp dependent on platform, > > there are reasons we use full paths in Makefiles, mostly to > > stop /usr/local/bin/foo contimaton, which I believe this > > change now opens up, though very slight as I dont know of > > a third party mktemp binary. > > > > I don't understand this idea of /usr/local "polluting" a system. ?It > seems to me exactly the opposite would be the case... if I have found > some 3rd party version of mktemp that I like better, it would be > installed in /usr/local. ?If I went out of my way to install that, then > naturally I WANT it to be used. ?To me, it's insane that the /usr/local > paths are not in front of the base system paths by default, and it's > even more insane that the base system works so hard to NOT use the > replacements I've installed (even if I've arranged PATH so that the > right versions should be used) so that I have to track down why it's > using the wrong thing and apply ad-hoc fixes. Your welcome to wonder down that twisty maze of passages, I however shall not be following you. If you start to accept what ever the users path is for building the freebsd /usr/src tree the rate of failed builds and complaints, and hours spent chasing after oh crap it picked up foo from /usr/local is not a game I care to par take in. You personally, could probably get away with this and be fine, our user base would probably not be very lucky.w Oh, and reproducibility goes totally out the window if you fool with that. > -- Ian -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Feb 7 00:42:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CB9FF17881; Wed, 7 Feb 2018 00:42:16 +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 A8C706CFCB; Wed, 7 Feb 2018 00:42:15 +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 w170gDpV002850 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 6 Feb 2018 16:42:13 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w170gDgn002849; Tue, 6 Feb 2018 16:42:13 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 6 Feb 2018 16:42:13 -0800 From: Gleb Smirnoff To: Peter Holm Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r328916 - in head/sys: kern vm Message-ID: <20180207004213.GG1063@FreeBSD.org> References: <201802060416.w164G0va096970@repo.freebsd.org> <20180206113017.GA25428@x2.osted.lan> <20180206182839.GB1063@FreeBSD.org> <20180206193430.GA36054@x2.osted.lan> <20180206221555.GC1063@FreeBSD.org> <20180206225244.GA40529@x2.osted.lan> <20180206230635.GE1063@FreeBSD.org> <20180206232521.GA41396@x2.osted.lan> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="i9LlY+UWpKt15+FH" Content-Disposition: inline In-Reply-To: <20180206232521.GA41396@x2.osted.lan> User-Agent: Mutt/1.9.3 (2018-01-21) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 00:42:16 -0000 --i9LlY+UWpKt15+FH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Peter, can you please try this patch? In either case success or not, please provide me with dmesg. Thanks a lot! -- Gleb Smirnoff --i9LlY+UWpKt15+FH Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="boot_pages.diff" Index: uma_core.c =================================================================== --- uma_core.c (revision 328955) +++ uma_core.c (working copy) @@ -96,6 +96,7 @@ __FBSDID("$FreeBSD$"); #ifdef DEBUG_MEMGUARD #include #endif +#define DIAGNOSTIC /* * This is the zone and keg from which all zones are spawned. @@ -1800,6 +1801,7 @@ uma_startup_count(int zones) /* Memory for the zone of zones and zone of kegs. */ pages = howmany(roundup(zsize, CACHE_LINE_SIZE) * 2 + roundup(ksize, CACHE_LINE_SIZE), PAGE_SIZE); + printf("boot_pages master %d\n", pages); zones += UMA_BOOT_ZONES; @@ -1807,17 +1809,20 @@ uma_startup_count(int zones) if (zsize > UMA_SLAB_SIZE) pages += zones * howmany(zsize, UMA_SLAB_SIZE); else - pages += howmany(zones, UMA_SLAB_SIZE / zsize); + pages += howmany(zones, UMA_SLAB_SPACE / zsize); + printf("boot_pages zones %d\n", pages); /* ... and their kegs. */ - pages += howmany(zones, UMA_SLAB_SIZE / ksize); + pages += howmany(zones, UMA_SLAB_SPACE / ksize); + printf("boot_pages kegs %d\n", pages); /* * Take conservative approach that every zone * is going to allocate hash. */ - pages += howmany(zones, UMA_SLAB_SIZE / + pages += howmany(zones, UMA_SLAB_SPACE / (sizeof(struct slabhead *) * UMA_HASH_SIZE_INIT)); + printf("boot_pages hash %d\n", pages); return (pages); } Index: uma_int.h =================================================================== --- uma_int.h (revision 328955) +++ uma_int.h (working copy) @@ -138,6 +138,11 @@ #define UMA_MAX_WASTE 10 /* + * Size of memory in a not offpage slab available for actual items. + */ +#define UMA_SLAB_SPACE (UMA_SLAB_SIZE - sizeof(struct uma_slab)) + +/* * I doubt there will be many cases where this is exceeded. This is the initial * size of the hash table for uma_slabs that are managed off page. This hash * does expand by powers of two. Currently it doesn't get smaller. Index: vm_page.c =================================================================== --- vm_page.c (revision 328955) +++ vm_page.c (working copy) @@ -518,8 +518,11 @@ vm_page_startup(vm_offset_t vaddr) /* vmem_startup() calls uma_prealloc(). */ boot_pages += vmem_startup_count(); + printf("boot_pages vmem %d\n", boot_pages); /* vm_map_startup() calls uma_prealloc(). */ - boot_pages += howmany(MAX_KMAP, UMA_SLAB_SIZE / sizeof(struct vm_map)); + boot_pages += howmany(MAX_KMAP, + UMA_SLAB_SPACE / sizeof(struct vm_map)); + printf("boot_pages kmap %d\n", boot_pages); /* * Before going fully functional kmem_init() does allocation --i9LlY+UWpKt15+FH-- From owner-svn-src-all@freebsd.org Wed Feb 7 00:45:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12B7DF17BBC; Wed, 7 Feb 2018 00:45:52 +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 9F2316D229; Wed, 7 Feb 2018 00:45:51 +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 w170jn0o002886 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 6 Feb 2018 16:45:50 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w170jnNG002885; Tue, 6 Feb 2018 16:45:49 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 6 Feb 2018 16:45:49 -0800 From: Gleb Smirnoff To: Peter Holm Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r328916 - in head/sys: kern vm Message-ID: <20180207004549.GH1063@FreeBSD.org> References: <201802060416.w164G0va096970@repo.freebsd.org> <20180206113017.GA25428@x2.osted.lan> <20180206182839.GB1063@FreeBSD.org> <20180206193430.GA36054@x2.osted.lan> <20180206221555.GC1063@FreeBSD.org> <20180206225244.GA40529@x2.osted.lan> <20180206230635.GE1063@FreeBSD.org> <20180206232521.GA41396@x2.osted.lan> <20180207004213.GG1063@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="69pVuxX8awAiJ7fD" Content-Disposition: inline In-Reply-To: <20180207004213.GG1063@FreeBSD.org> User-Agent: Mutt/1.9.3 (2018-01-21) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 00:45:52 -0000 --69pVuxX8awAiJ7fD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Feb 06, 2018 at 04:42:13PM -0800, Gleb Smirnoff wrote: T> Hi Peter, T> T> can you please try this patch? In either case success T> or not, please provide me with dmesg. Thanks a lot! Sorry, patch was missing one file. 99.9% this is a no-op, but better use full patch. -- Gleb Smirnoff --69pVuxX8awAiJ7fD Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="boot_pages.diff" Index: sys/kern/subr_vmem.c =================================================================== --- sys/kern/subr_vmem.c (revision 328955) +++ sys/kern/subr_vmem.c (working copy) @@ -667,7 +667,8 @@ int vmem_startup_count(void) { - return (howmany(BT_MAXALLOC, UMA_SLAB_SIZE / sizeof(struct vmem_btag))); + return (howmany(BT_MAXALLOC, + UMA_SLAB_SPACE / sizeof(struct vmem_btag))); } #endif Index: sys/vm/uma_core.c =================================================================== --- sys/vm/uma_core.c (revision 328955) +++ sys/vm/uma_core.c (working copy) @@ -96,6 +96,7 @@ __FBSDID("$FreeBSD$"); #ifdef DEBUG_MEMGUARD #include #endif +#define DIAGNOSTIC /* * This is the zone and keg from which all zones are spawned. @@ -1800,6 +1801,7 @@ uma_startup_count(int zones) /* Memory for the zone of zones and zone of kegs. */ pages = howmany(roundup(zsize, CACHE_LINE_SIZE) * 2 + roundup(ksize, CACHE_LINE_SIZE), PAGE_SIZE); + printf("boot_pages master %d\n", pages); zones += UMA_BOOT_ZONES; @@ -1807,17 +1809,20 @@ uma_startup_count(int zones) if (zsize > UMA_SLAB_SIZE) pages += zones * howmany(zsize, UMA_SLAB_SIZE); else - pages += howmany(zones, UMA_SLAB_SIZE / zsize); + pages += howmany(zones, UMA_SLAB_SPACE / zsize); + printf("boot_pages zones %d\n", pages); /* ... and their kegs. */ - pages += howmany(zones, UMA_SLAB_SIZE / ksize); + pages += howmany(zones, UMA_SLAB_SPACE / ksize); + printf("boot_pages kegs %d\n", pages); /* * Take conservative approach that every zone * is going to allocate hash. */ - pages += howmany(zones, UMA_SLAB_SIZE / + pages += howmany(zones, UMA_SLAB_SPACE / (sizeof(struct slabhead *) * UMA_HASH_SIZE_INIT)); + printf("boot_pages hash %d\n", pages); return (pages); } Index: sys/vm/uma_int.h =================================================================== --- sys/vm/uma_int.h (revision 328955) +++ sys/vm/uma_int.h (working copy) @@ -138,6 +138,11 @@ #define UMA_MAX_WASTE 10 /* + * Size of memory in a not offpage slab available for actual items. + */ +#define UMA_SLAB_SPACE (UMA_SLAB_SIZE - sizeof(struct uma_slab)) + +/* * I doubt there will be many cases where this is exceeded. This is the initial * size of the hash table for uma_slabs that are managed off page. This hash * does expand by powers of two. Currently it doesn't get smaller. Index: sys/vm/vm_page.c =================================================================== --- sys/vm/vm_page.c (revision 328955) +++ sys/vm/vm_page.c (working copy) @@ -518,8 +518,11 @@ vm_page_startup(vm_offset_t vaddr) /* vmem_startup() calls uma_prealloc(). */ boot_pages += vmem_startup_count(); + printf("boot_pages vmem %d\n", boot_pages); /* vm_map_startup() calls uma_prealloc(). */ - boot_pages += howmany(MAX_KMAP, UMA_SLAB_SIZE / sizeof(struct vm_map)); + boot_pages += howmany(MAX_KMAP, + UMA_SLAB_SPACE / sizeof(struct vm_map)); + printf("boot_pages kmap %d\n", boot_pages); /* * Before going fully functional kmem_init() does allocation --69pVuxX8awAiJ7fD-- From owner-svn-src-all@freebsd.org Wed Feb 7 01:54:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E071F1C6DD; Wed, 7 Feb 2018 01:54:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2FAC66FD60; Wed, 7 Feb 2018 01:54:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A8F420552; Wed, 7 Feb 2018 01:54:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w171sDqC049907; Wed, 7 Feb 2018 01:54:13 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w171sD4P049906; Wed, 7 Feb 2018 01:54:13 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802070154.w171sD4P049906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 7 Feb 2018 01:54:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328964 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 328964 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 01:54:14 -0000 Author: kevans Date: Wed Feb 7 01:54:13 2018 New Revision: 328964 URL: https://svnweb.freebsd.org/changeset/base/328964 Log: if_awg: Skip emac reset if configured for internal PHY On the OrangePi One at least, emac reset when an ethernet cable is not plugged in seems to break ethernet. Soft reset will fail, even with increasing the delay and retries to wait for up to 20 seconds. This can be reproduced across at least two different OrangePi One's by simply leaving ethernet cable unplugged when awg attaches. Whether it's plugged in or not through u-boot process makes no difference. Skipping the reset in this configuration doesn't seem to cause any problems, tried across many many reboots with and without ethernet cable plugged in. Tested on: OrangePi One Tested on: Other boards (manu) Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D13974 Modified: head/sys/arm/allwinner/if_awg.c Modified: head/sys/arm/allwinner/if_awg.c ============================================================================== --- head/sys/arm/allwinner/if_awg.c Wed Feb 7 01:24:49 2018 (r328963) +++ head/sys/arm/allwinner/if_awg.c Wed Feb 7 01:54:13 2018 (r328964) @@ -1834,9 +1834,11 @@ awg_attach(device_t dev) awg_get_eaddr(dev, eaddr); /* Soft reset EMAC core */ - error = awg_reset(dev); - if (error != 0) - return (error); + if (!awg_has_internal_phy(dev)) { + error = awg_reset(dev); + if (error != 0) + return (error); + } /* Setup DMA descriptors */ error = awg_setup_dma(dev); From owner-svn-src-all@freebsd.org Wed Feb 7 06:24:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4483EE0D8D; Wed, 7 Feb 2018 06:24:34 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7CA7B78733; Wed, 7 Feb 2018 06:24:34 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 732C723236; Wed, 7 Feb 2018 06:24:34 +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 w176OY6w083669; Wed, 7 Feb 2018 06:24:34 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w176OYtU083668; Wed, 7 Feb 2018 06:24:34 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201802070624.w176OYtU083668@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Wed, 7 Feb 2018 06:24:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328965 - stable/11/lib/libc/gen X-SVN-Group: stable-11 X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: stable/11/lib/libc/gen X-SVN-Commit-Revision: 328965 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 06:24:35 -0000 Author: mmel Date: Wed Feb 7 06:24:34 2018 New Revision: 328965 URL: https://svnweb.freebsd.org/changeset/base/328965 Log: MFC r325364,r326794: r325364: Add alignment support to __libc_allocate_tls(). r326794: Rework alignment handling in __libc_allocate_tls() for Variant I of TLS layout. Modified: stable/11/lib/libc/gen/tls.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/gen/tls.c ============================================================================== --- stable/11/lib/libc/gen/tls.c Wed Feb 7 01:54:13 2018 (r328964) +++ stable/11/lib/libc/gen/tls.c Wed Feb 7 06:24:34 2018 (r328965) @@ -37,9 +37,15 @@ #include #include #include +#include #include "libc_private.h" +#define tls_assert(cond) ((cond) ? (void) 0 : \ + (tls_msg(#cond ": assert failed: " __FILE__ ":" \ + __XSTRING(__LINE__) "\n"), abort())) +#define tls_msg(s) write(STDOUT_FILENO, s, strlen(s)) + /* Provided by jemalloc to avoid bootstrapping issues. */ void *__je_bootstrap_malloc(size_t size); void *__je_bootstrap_calloc(size_t num, size_t size); @@ -81,10 +87,17 @@ void __libc_free_tls(void *tls, size_t tcbsize, size_t #define TLS_VARIANT_II #endif +#if defined(__mips__) || defined(__powerpc__) || defined(__riscv) +#define DTV_OFFSET 0x8000 +#else +#define DTV_OFFSET 0 +#endif + #ifndef PIC static size_t tls_static_space; static size_t tls_init_size; +static size_t tls_init_align; static void *tls_init; #endif @@ -109,60 +122,190 @@ __libc_tls_get_addr(void *ti __unused) #ifndef PIC +static void * +malloc_aligned(size_t size, size_t align) +{ + void *mem, *res; + + if (align < sizeof(void *)) + align = sizeof(void *); + + mem = __je_bootstrap_malloc(size + sizeof(void *) + align - 1); + res = (void *)roundup2((uintptr_t)mem + sizeof(void *), align); + *(void **)((uintptr_t)res - sizeof(void *)) = mem; + return (res); +} + +static void +free_aligned(void *ptr) +{ + void *mem; + uintptr_t x; + + if (ptr == NULL) + return; + + x = (uintptr_t)ptr; + x -= sizeof(void *); + mem = *(void **)x; + __je_bootstrap_free(mem); +} + #ifdef TLS_VARIANT_I +/* + * There are two versions of variant I of TLS + * + * - ARM and aarch64 uses original variant I as is described in [1] and [2], + * where TP points to start of TCB followed by aligned TLS segment. + * Both TCB and TLS must be aligned to alignment of TLS section. The TCB[0] + * points to DTV vector and DTV values are real addresses (without bias). + * Note: for Local Exec TLS Model, the offsets from TP (TCB in this case) to + * TLS variables are computed by linker, so we cannot overalign TLS section. + * + * - MIPS, PowerPC and RISC-V use modified version of variant I, + * described in [3] where TP points (with bias) to TLS and TCB immediately + * precedes TLS without any alignment gap[4]. Only TLS should be aligned. + * The TCB[0] points to DTV vector and DTV values are biased by constant + * value (0x8000) from real addresses[5]. + * + * [1] Ulrich Drepper: ELF Handling for Thread-Local Storage + * www.akkadia.org/drepper/tls.pdf + * + * [2] ARM IHI 0045E: Addenda to, and Errata in, the ABI for the ARM(r) + * Architecture + * infocenter.arm.com/help/topic/com.arm.doc.ihi0045e/IHI0045E_ABI_addenda.pdf + * + * [3] OpenPOWER: Power Architecture 64-Bit ELF V2 ABI Specification + * https://members.openpowerfoundation.org/document/dl/576 + * + * [4] Its unclear if "without any alignment gap" is hard ABI requirement, + * but we must follow this rule due to suboptimal _set_tp() + * (aka _SET_TP) implementation. This function doesn't expect TP but + * TCB as argument. + * + * [5] I'm not able to validate "values are biased" assertions. + */ + #define TLS_TCB_SIZE (2 * sizeof(void *)) /* - * Free Static TLS using the Variant I method. + * Return pointer to allocated TLS block */ +static void * +get_tls_block_ptr(void *tcb, size_t tcbsize) +{ + size_t extra_size, post_size, pre_size, tls_block_size; + + /* Compute fragments sizes. */ + extra_size = tcbsize - TLS_TCB_SIZE; +#if defined(__aarch64__) || defined(__arm__) + post_size = roundup2(TLS_TCB_SIZE, tls_init_align) - TLS_TCB_SIZE; +#else + post_size = 0; +#endif + tls_block_size = tcbsize + post_size; + pre_size = roundup2(tls_block_size, tls_init_align) - tls_block_size; + + return ((char *)tcb - pre_size - extra_size); +} + +/* + * Free Static TLS using the Variant I method. The tcbsize + * and tcbalign parameters must be the same as those used to allocate + * the block. + */ void __libc_free_tls(void *tcb, size_t tcbsize, size_t tcbalign __unused) { Elf_Addr *dtv; Elf_Addr **tls; - tls = (Elf_Addr **)((Elf_Addr)tcb + tcbsize - TLS_TCB_SIZE); + tls = (Elf_Addr **)tcb; dtv = tls[0]; __je_bootstrap_free(dtv); - __je_bootstrap_free(tcb); + free_aligned(get_tls_block_ptr(tcb, tcbsize)); } /* * Allocate Static TLS using the Variant I method. + * + * To handle all above requirements, we setup the following layout for + * TLS block: + * (whole memory block is aligned with MAX(TLS_TCB_ALIGN, tls_init_align)) + * + * +----------+--------------+--------------+-----------+------------------+ + * | pre gap | extended TCB | TCB | post gap | TLS segment | + * | pre_size | extra_size | TLS_TCB_SIZE | post_size | tls_static_space | + * +----------+--------------+--------------+-----------+------------------+ + * + * where: + * extra_size is tcbsize - TLS_TCB_SIZE + * post_size is used to adjust TCB to TLS aligment for first version of TLS + * layout and is always 0 for second version. + * pre_size is used to adjust TCB aligment for first version and to adjust + * TLS alignment for second version. + * */ void * -__libc_allocate_tls(void *oldtcb, size_t tcbsize, size_t tcbalign __unused) +__libc_allocate_tls(void *oldtcb, size_t tcbsize, size_t tcbalign) { - Elf_Addr *dtv; - Elf_Addr **tls; - char *tcb; + Elf_Addr *dtv, **tcb; + char *tls_block, *tls; + size_t extra_size, maxalign, post_size, pre_size, tls_block_size; if (oldtcb != NULL && tcbsize == TLS_TCB_SIZE) return (oldtcb); - tcb = __je_bootstrap_calloc(1, tls_static_space + tcbsize - TLS_TCB_SIZE); - tls = (Elf_Addr **)(tcb + tcbsize - TLS_TCB_SIZE); + tls_assert(tcbalign >= TLS_TCB_ALIGN); + maxalign = MAX(tcbalign, tls_init_align); + /* Compute fragmets sizes. */ + extra_size = tcbsize - TLS_TCB_SIZE; +#if defined(__aarch64__) || defined(__arm__) + post_size = roundup2(TLS_TCB_SIZE, tls_init_align) - TLS_TCB_SIZE; +#else + post_size = 0; +#endif + tls_block_size = tcbsize + post_size; + pre_size = roundup2(tls_block_size, tls_init_align) - tls_block_size; + tls_block_size += pre_size + tls_static_space; + + /* Allocate whole TLS block */ + tls_block = malloc_aligned(tls_block_size, maxalign); + if (tls_block == NULL) { + tls_msg("__libc_allocate_tls: Out of memory.\n"); + abort(); + } + memset(tls_block, 0, tls_block_size); + tcb = (Elf_Addr **)(tls_block + pre_size + extra_size); + tls = (char *)tcb + TLS_TCB_SIZE + post_size; + if (oldtcb != NULL) { - memcpy(tls, oldtcb, tls_static_space); - __je_bootstrap_free(oldtcb); + memcpy(tls_block, get_tls_block_ptr(oldtcb, tcbsize), + tls_block_size); + free_aligned(oldtcb); /* Adjust the DTV. */ - dtv = tls[0]; - dtv[2] = (Elf_Addr)tls + TLS_TCB_SIZE; + dtv = tcb[0]; + dtv[2] = (Elf_Addr)(tls + DTV_OFFSET); } else { dtv = __je_bootstrap_malloc(3 * sizeof(Elf_Addr)); - tls[0] = dtv; - dtv[0] = 1; - dtv[1] = 1; - dtv[2] = (Elf_Addr)tls + TLS_TCB_SIZE; + if (dtv == NULL) { + tls_msg("__libc_allocate_tls: Out of memory.\n"); + abort(); + } + /* Build the DTV. */ + tcb[0] = dtv; + dtv[0] = 1; /* Generation. */ + dtv[1] = 1; /* Segments count. */ + dtv[2] = (Elf_Addr)(tls + DTV_OFFSET); if (tls_init_size > 0) - memcpy((void*)dtv[2], tls_init, tls_init_size); + memcpy(tls, tls_init, tls_init_size); } - return(tcb); + return (tcb); } #endif @@ -185,12 +328,13 @@ __libc_free_tls(void *tcb, size_t tcbsize __unused, si * Figure out the size of the initial TLS block so that we can * find stuff which ___tls_get_addr() allocated dynamically. */ + tcbalign = MAX(tcbalign, tls_init_align); size = roundup2(tls_static_space, tcbalign); dtv = ((Elf_Addr**)tcb)[1]; tlsend = (Elf_Addr) tcb; tlsstart = tlsend - size; - __je_bootstrap_free((void*) tlsstart); + free_aligned((void*)tlsstart); __je_bootstrap_free(dtv); } @@ -205,12 +349,22 @@ __libc_allocate_tls(void *oldtls, size_t tcbsize, size Elf_Addr *dtv; Elf_Addr segbase, oldsegbase; + tcbalign = MAX(tcbalign, tls_init_align); size = roundup2(tls_static_space, tcbalign); if (tcbsize < 2 * sizeof(Elf_Addr)) tcbsize = 2 * sizeof(Elf_Addr); - tls = __je_bootstrap_calloc(1, size + tcbsize); + tls = malloc_aligned(size + tcbsize, tcbalign); + if (tls == NULL) { + tls_msg("__libc_allocate_tls: Out of memory.\n"); + abort(); + } + memset(tls, 0, size + tcbsize); dtv = __je_bootstrap_malloc(3 * sizeof(Elf_Addr)); + if (dtv == NULL) { + tls_msg("__libc_allocate_tls: Out of memory.\n"); + abort(); + } segbase = (Elf_Addr)(tls + size); ((Elf_Addr*)segbase)[0] = segbase; @@ -305,17 +459,11 @@ _init_tls(void) tls_static_space = roundup2(phdr[i].p_memsz, phdr[i].p_align); tls_init_size = phdr[i].p_filesz; + tls_init_align = phdr[i].p_align; tls_init = (void*) phdr[i].p_vaddr; + break; } } - -#ifdef TLS_VARIANT_I - /* - * tls_static_space should include space for TLS structure - */ - tls_static_space += TLS_TCB_SIZE; -#endif - tls = _rtld_allocate_tls(NULL, TLS_TCB_SIZE, TLS_TCB_ALIGN); _set_tp(tls); From owner-svn-src-all@freebsd.org Wed Feb 7 06:27:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C224FEE1006; Wed, 7 Feb 2018 06:27:30 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6CFB978975; Wed, 7 Feb 2018 06:27:30 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6505E2323B; Wed, 7 Feb 2018 06:27:30 +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 w176RUpA083830; Wed, 7 Feb 2018 06:27:30 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w176RU9c083828; Wed, 7 Feb 2018 06:27:30 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201802070627.w176RU9c083828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Wed, 7 Feb 2018 06:27:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328966 - stable/11/sys/arm/include X-SVN-Group: stable-11 X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: stable/11/sys/arm/include X-SVN-Commit-Revision: 328966 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 06:27:30 -0000 Author: mmel Date: Wed Feb 7 06:27:29 2018 New Revision: 328966 URL: https://svnweb.freebsd.org/changeset/base/328966 Log: MFC r325438: All CP15 registers are bit fields or counters, don't use signed type when accessing them. Modified: stable/11/sys/arm/include/cpu-v4.h stable/11/sys/arm/include/cpu-v6.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/include/cpu-v4.h ============================================================================== --- stable/11/sys/arm/include/cpu-v4.h Wed Feb 7 06:24:34 2018 (r328965) +++ stable/11/sys/arm/include/cpu-v4.h Wed Feb 7 06:27:29 2018 (r328966) @@ -51,10 +51,10 @@ #define _FX(s...) #s #define _RF0(fname, aname...) \ -static __inline register_t \ +static __inline uint32_t \ fname(void) \ { \ - register_t reg; \ + uint32_t reg; \ __asm __volatile("mrc\t" _FX(aname): "=r" (reg)); \ return(reg); \ } @@ -77,7 +77,7 @@ fname(void) \ #define _WF1(fname, aname...) \ static __inline void \ -fname(register_t reg) \ +fname(uint32_t reg) \ { \ __asm __volatile("mcr\t" _FX(aname):: "r" (reg)); \ } Modified: stable/11/sys/arm/include/cpu-v6.h ============================================================================== --- stable/11/sys/arm/include/cpu-v6.h Wed Feb 7 06:24:34 2018 (r328965) +++ stable/11/sys/arm/include/cpu-v6.h Wed Feb 7 06:27:29 2018 (r328966) @@ -65,10 +65,10 @@ extern int pmu_attched; #define _FX(s...) #s #define _RF0(fname, aname...) \ -static __inline register_t \ +static __inline uint32_t \ fname(void) \ { \ - register_t reg; \ + uint32_t reg; \ __asm __volatile("mrc\t" _FX(aname): "=r" (reg)); \ return(reg); \ } @@ -91,7 +91,7 @@ fname(void) \ #define _WF1(fname, aname...) \ static __inline void \ -fname(register_t reg) \ +fname(uint32_t reg) \ { \ __asm __volatile("mcr\t" _FX(aname):: "r" (reg)); \ } From owner-svn-src-all@freebsd.org Wed Feb 7 06:29:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF6BFEE1110; Wed, 7 Feb 2018 06:29:08 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 565EC78AC9; Wed, 7 Feb 2018 06:29:08 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4DA6B2323E; Wed, 7 Feb 2018 06:29:08 +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 w176T8H1083939; Wed, 7 Feb 2018 06:29:08 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w176T8ca083938; Wed, 7 Feb 2018 06:29:08 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201802070629.w176T8ca083938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Wed, 7 Feb 2018 06:29:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328967 - stable/11/sys/arm/arm X-SVN-Group: stable-11 X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: stable/11/sys/arm/arm X-SVN-Commit-Revision: 328967 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 06:29:08 -0000 Author: mmel Date: Wed Feb 7 06:29:07 2018 New Revision: 328967 URL: https://svnweb.freebsd.org/changeset/base/328967 Log: MFC r324821: Fix spelling. Modified: stable/11/sys/arm/arm/cpuinfo.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/arm/cpuinfo.c ============================================================================== --- stable/11/sys/arm/arm/cpuinfo.c Wed Feb 7 06:27:29 2018 (r328966) +++ stable/11/sys/arm/arm/cpuinfo.c Wed Feb 7 06:29:07 2018 (r328967) @@ -157,8 +157,8 @@ cpuinfo_init(void) cpuinfo.icache_line_mask = cpuinfo.icache_line_size - 1; /* Fill AT_HWCAP bits. */ - elf_hwcap |= HWCAP_HALF | HWCAP_FAST_MULT; /* Requierd for all CPUs */ - elf_hwcap |= HWCAP_TLS | HWCAP_EDSP; /* Requierd for v6+ CPUs */ + elf_hwcap |= HWCAP_HALF | HWCAP_FAST_MULT; /* Required for all CPUs */ + elf_hwcap |= HWCAP_TLS | HWCAP_EDSP; /* Required for v6+ CPUs */ tmp = (cpuinfo.id_isar0 >> 24) & 0xF; /* Divide_instrs */ if (tmp >= 1) From owner-svn-src-all@freebsd.org Wed Feb 7 06:54:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BBD7EE26F0; Wed, 7 Feb 2018 06:54:26 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay01.pair.com (relay01.pair.com [209.68.5.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC9EC79840; Wed, 7 Feb 2018 06:54:25 +0000 (UTC) (envelope-from pho@holm.cc) Received: from x2.osted.lan (87-58-223-204-dynamic.dk.customer.tdc.net [87.58.223.204]) by relay01.pair.com (Postfix) with ESMTP id EFE4CD010D0; Wed, 7 Feb 2018 01:46:18 -0500 (EST) Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.14.9/8.14.9) with ESMTP id w176kH6q049813 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 7 Feb 2018 07:46:17 +0100 (CET) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.14.9/8.14.9/Submit) id w176kHPx049812; Wed, 7 Feb 2018 07:46:17 +0100 (CET) (envelope-from pho) Date: Wed, 7 Feb 2018 07:46:17 +0100 From: Peter Holm To: Gleb Smirnoff Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r328916 - in head/sys: kern vm Message-ID: <20180207064617.GA49792@x2.osted.lan> References: <201802060416.w164G0va096970@repo.freebsd.org> <20180206113017.GA25428@x2.osted.lan> <20180206182839.GB1063@FreeBSD.org> <20180206193430.GA36054@x2.osted.lan> <20180206221555.GC1063@FreeBSD.org> <20180206225244.GA40529@x2.osted.lan> <20180206230635.GE1063@FreeBSD.org> <20180206232521.GA41396@x2.osted.lan> <20180207004213.GG1063@FreeBSD.org> <20180207004549.GH1063@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180207004549.GH1063@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 06:54:26 -0000 On Tue, Feb 06, 2018 at 04:45:49PM -0800, Gleb Smirnoff wrote: > On Tue, Feb 06, 2018 at 04:42:13PM -0800, Gleb Smirnoff wrote: > T> Hi Peter, > T> > T> can you please try this patch? In either case success > T> or not, please provide me with dmesg. Thanks a lot! > > Sorry, patch was missing one file. 99.9% this is a no-op, > but better use full patch. > GDB: no debug ports present KDB: debugger backends: ddb KDB: current backend: ddb Copyright (c) 1992-2018 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 12.0-CURRENT #2 r328956M: Wed Feb 7 00:20:47 CET 2018 pho@x4.osted.lan:/usr/src/sys/i386/compile/PHO i386 FreeBSD clang version 6.0.0 (branches/release_60 321788) (based on LLVM 6.0.0) WARNING: WITNESS option enabled, expect reduced performance. WARNING: DIAGNOSTIC option enabled, expect reduced performance. boot_pages master 1 boot_pages zones 3 boot_pages kegs 4 boot_pages hash 5 boot_pages vmem 6 boot_pages kmap 7 Entering uma_startup with 9 boot pages configured startup_alloc from "UMA Kegs", 8 boot pages left startup_alloc from "UMA Zones", 7 boot pages left startup_alloc from "UMA Hash", 6 boot pages left startup_alloc from "UMA Zones", 5 boot pages left startup_alloc from "vmem btag", 4 boot pages left startup_alloc from "MAP", 3 boot pages left startup_alloc from "UMA Kegs", 2 boot pages left startup_alloc from "KMAP ENTRY", 1 boot pages left panic: UMA: Increase vm.boot_pages cpuid = 0 time = 1 KDB: stack backtrace: db_trace_self_wrapper(c16544c0,c23af290,c1be5bc0,8,c1bbec20,...) at db_trace_self_wrapper+0x2a/frame 0xc2022a70 kdb_backtrace(c164e4f7,1,0,c2022b30,0,...) at kdb_backtrace+0x2d/frame 0xc2022ad8 vpanic(c16a1330,c2022b30,c2022b30,c2022b48,c0fb7983,...) at vpanic+0x133/frame 0xc2022b10 panic(c16a1330,0,c16a0d83,44f,c23b0a80,...) at panic+0x1b/frame 0xc2022b24 startup_alloc(c23b1dc0,1000,0,c2022b7b,102,...) at startup_alloc+0x143/frame 0xc2022b48 keg_alloc_slab(0,2,c16a0d83,987,c23b7000,...) at keg_alloc_slab+0xf6/frame 0xc2022b90 keg_fetch_slab(ffffffff,2,c16a0d83,9e9,c23b1dc0,...) at keg_fetch_slab+0x10e/frame 0xc2022be8 zone_fetch_slab(c23b1dc0,0,ffffffff,2,c23b5000,...) at zone_fetch_slab+0x61/frame 0xc2022c0c zone_import(c23b1dc0,c2022c68,1,ffffffff,2,...) at zone_import+0x3b/frame 0xc2022c44 zone_alloc_item(ffffffff,2,c16a0d9a,c163583d,c1b5d050,...) at zone_alloc_item+0x3d/frame 0xc2022c78 uma_zalloc_arg(c23b1dc0,0,2,c1b5d050,0,...) at uma_zalloc_arg+0x66c/frame 0xc2022cb4 vmem_create(c16a1d6e,0,0,1000,0,...) at vmem_create+0x2a/frame 0xc2022ce4 vm_mem_init(0,0,0,0,c186aab4,...) at vm_mem_init+0xf4/frame 0xc2022d10 mi_startup() at mi_startup+0xf7/frame 0xc2022d38 begin() at begin+0x2f KDB: enter: panic [ thread pid 0 tid 0 ] Stopped at kdb_enter+0x3a: movl $0,kdb_why db> - Peter From owner-svn-src-all@freebsd.org Wed Feb 7 07:25:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4DB5EE446B; Wed, 7 Feb 2018 07:25:40 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay01.pair.com (relay01.pair.com [209.68.5.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 567F17A814; Wed, 7 Feb 2018 07:25:40 +0000 (UTC) (envelope-from pho@holm.cc) Received: from x2.osted.lan (87-58-223-204-dynamic.dk.customer.tdc.net [87.58.223.204]) by relay01.pair.com (Postfix) with ESMTP id 51498D010C5; Wed, 7 Feb 2018 02:25:34 -0500 (EST) Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.14.9/8.14.9) with ESMTP id w177PWLD050565 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 7 Feb 2018 08:25:32 +0100 (CET) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.14.9/8.14.9/Submit) id w177PVX2050564; Wed, 7 Feb 2018 08:25:31 +0100 (CET) (envelope-from pho) Date: Wed, 7 Feb 2018 08:25:31 +0100 From: Peter Holm To: Gleb Smirnoff Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r328916 - in head/sys: kern vm Message-ID: <20180207072531.GA50530@x2.osted.lan> References: <20180206113017.GA25428@x2.osted.lan> <20180206182839.GB1063@FreeBSD.org> <20180206193430.GA36054@x2.osted.lan> <20180206221555.GC1063@FreeBSD.org> <20180206225244.GA40529@x2.osted.lan> <20180206230635.GE1063@FreeBSD.org> <20180206232521.GA41396@x2.osted.lan> <20180207004213.GG1063@FreeBSD.org> <20180207004549.GH1063@FreeBSD.org> <20180207064617.GA49792@x2.osted.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180207064617.GA49792@x2.osted.lan> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 07:25:40 -0000 On Wed, Feb 07, 2018 at 07:46:17AM +0100, Peter Holm wrote: > On Tue, Feb 06, 2018 at 04:45:49PM -0800, Gleb Smirnoff wrote: > > On Tue, Feb 06, 2018 at 04:42:13PM -0800, Gleb Smirnoff wrote: > > T> Hi Peter, > > T> > > T> can you please try this patch? In either case success > > T> or not, please provide me with dmesg. Thanks a lot! > > > > Sorry, patch was missing one file. 99.9% this is a no-op, > > but better use full patch. > > > Here the output with vm.boot_pages=128 https://people.freebsd.org/~pho/gleb011.txt - Peter From owner-svn-src-all@freebsd.org Wed Feb 7 09:28:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B37E8EECF1D; Wed, 7 Feb 2018 09:28:24 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 56F977EF98; Wed, 7 Feb 2018 09:28: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 43C0C24F16; Wed, 7 Feb 2018 09:28: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 w179SOu1072938; Wed, 7 Feb 2018 09:28:24 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w179SOej072937; Wed, 7 Feb 2018 09:28:24 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201802070928.w179SOej072937@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 7 Feb 2018 09:28:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328968 - stable/11/sys/netpfil/ipfw X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/11/sys/netpfil/ipfw X-SVN-Commit-Revision: 328968 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 09:28:24 -0000 Author: ae Date: Wed Feb 7 09:28:23 2018 New Revision: 328968 URL: https://svnweb.freebsd.org/changeset/base/328968 Log: MFC r328326: When IPv6 packet is handled by O_REJECT opcode, convert ICMP code specified in the arg1 into ICMPv6 destination unreachable code according to RFC7915. Obtained from: Yandex LLC Sponsored by: Yandex LLC Modified: stable/11/sys/netpfil/ipfw/ip_fw2.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- stable/11/sys/netpfil/ipfw/ip_fw2.c Wed Feb 7 06:29:07 2018 (r328967) +++ stable/11/sys/netpfil/ipfw/ip_fw2.c Wed Feb 7 09:28:23 2018 (r328968) @@ -710,6 +710,32 @@ is_icmp6_query(int icmp6_type) return (0); } +static int +map_icmp_unreach(int code) +{ + + /* RFC 7915 p4.2 */ + switch (code) { + case ICMP_UNREACH_NET: + case ICMP_UNREACH_HOST: + case ICMP_UNREACH_SRCFAIL: + case ICMP_UNREACH_NET_UNKNOWN: + case ICMP_UNREACH_HOST_UNKNOWN: + case ICMP_UNREACH_TOSNET: + case ICMP_UNREACH_TOSHOST: + return (ICMP6_DST_UNREACH_NOROUTE); + case ICMP_UNREACH_PORT: + return (ICMP6_DST_UNREACH_NOPORT); + default: + /* + * Map the rest of codes into admit prohibited. + * XXX: unreach proto should be mapped into ICMPv6 + * parameter problem, but we use only unreach type. + */ + return (ICMP6_DST_UNREACH_ADMIN); + } +} + static void send_reject6(struct ip_fw_args *args, int code, u_int hlen, struct ip6_hdr *ip6) { @@ -2570,9 +2596,12 @@ do { \ (proto != IPPROTO_ICMPV6 || (is_icmp6_query(icmp6_type) == 1)) && !(m->m_flags & (M_BCAST|M_MCAST)) && - !IN6_IS_ADDR_MULTICAST(&args->f_id.dst_ip6)) { - send_reject6( - args, cmd->arg1, hlen, + !IN6_IS_ADDR_MULTICAST( + &args->f_id.dst_ip6)) { + send_reject6(args, + cmd->opcode == O_REJECT ? + map_icmp_unreach(cmd->arg1): + cmd->arg1, hlen, (struct ip6_hdr *)ip); m = args->m; } From owner-svn-src-all@freebsd.org Wed Feb 7 09:35:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 027ABEED7CE; Wed, 7 Feb 2018 09:35:28 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: from mail-qt0-f173.google.com (mail-qt0-f173.google.com [209.85.216.173]) (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 9B2297F693; Wed, 7 Feb 2018 09:35:27 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: by mail-qt0-f173.google.com with SMTP id r13so251823qtm.8; Wed, 07 Feb 2018 01:35:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=aL9CPJlzN0932/2dEozEt1tCll16j1F/1KxYuWDyyXo=; b=e5cLz3sueH+sqeleZjMfglR0okNqa8NLDutVq2eZ7zgzugcICtlJB8Kw941+TI2ovX LOeLGXR60BaNrOeL5JujJIOtKYc9JFgGp2albpAT/os88O6oMKLme/LxSvag7qD2dFIq iqHWQeC20ZIajkN779TaWQRc74+TkQ2HG03cta6EsyngVaBGq5Hj6KVaN0KCx8YU1eBu Ie6mHDoPMk0eLSihrRBH5FoKeU3OEn3I2GiShfuBvGe3hv3wfx/bjId8nYIC80ozJdgb ogI73KCm5hi6LXNMMujuJDxoJ4CYNYW77pWaqdp3SiEnOvQVkHO5Y9nX0lawez/F/16C rfrA== X-Gm-Message-State: APf1xPBcYKczQ/RvjoBMCsl2+NLwp+OtTniyLCAD+XcYVavn+ysg4ltn y1EX8LbB/e+SdmtgBHBuKZyfTdOl/c4= X-Google-Smtp-Source: AH8x224AdmEr0RfBGhCNuFregDidU40CHZ5mSchxJAwsiUjWChlPAXIlKRQC2Dc8CVgQ13AfkIv6Fw== X-Received: by 10.200.13.193 with SMTP id t1mr623373qti.287.1517996120918; Wed, 07 Feb 2018 01:35:20 -0800 (PST) Received: from mail-qt0-f181.google.com (mail-qt0-f181.google.com. [209.85.216.181]) by smtp.gmail.com with ESMTPSA id r62sm699121qkc.52.2018.02.07.01.35.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Feb 2018 01:35:20 -0800 (PST) Received: by mail-qt0-f181.google.com with SMTP id t25so265603qtg.3; Wed, 07 Feb 2018 01:35:20 -0800 (PST) X-Received: by 10.237.51.161 with SMTP id v30mr8582547qtd.27.1517996120443; Wed, 07 Feb 2018 01:35:20 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.85.47 with HTTP; Wed, 7 Feb 2018 01:34:59 -0800 (PST) In-Reply-To: <201802061925.w16JP4aq017961@pdx.rh.CN85.dnsmgr.net> References: <201802061541.w16FfadO041469@repo.freebsd.org> <201802061925.w16JP4aq017961@pdx.rh.CN85.dnsmgr.net> From: Alexander Richardson Date: Wed, 7 Feb 2018 09:34:59 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r328934 - in head: . bin/sh To: rgrimes@freebsd.org 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.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 09:35:28 -0000 On 6 February 2018 at 19:25, Rodney W. Grimes wrote: >> Author: arichardson >> Date: Tue Feb 6 15:41:35 2018 >> New Revision: 328934 >> URL: https://svnweb.freebsd.org/changeset/base/328934 >> >> Log: >> Don't hardcode /usr/bin as the path for mktemp in build tools >> >> It won't work e.g. when crossbuilding from Ubuntu Linux as mktemp is i= n >> /bin there. >> >> Reviewed By: bdrewery >> Approved By: jhb (mentor) >> Differential Revision: https://reviews.freebsd.org/D13937 > > Would it be better to create the variable MKTEMP to point at > either /bin/mktemp or /usr/bin/mktemp dependent on platform, > there are reasons we use full paths in Makefiles, mostly to > stop /usr/local/bin/foo contimaton, which I believe this > change now opens up, though very slight as I dont know of > a third party mktemp binary. > I'm happy to have a mktemp variable instead, but I don't believe files in /usr/local/bin are a problem. When in add an echo $PATH to the mktokens.sh file I get the following output: PATH=3D/home/alr48/obj/build/freebsd-mips-build/exports/users/alr48/sources= /freebsd-mips/mips.mips64/tmp/legacy/usr/sbin:/home/alr48/obj/build/freebsd= -mips-build/exports/users/alr48/sources/freebsd-mips/mips.mips64/tmp/legacy= /usr/bin:/home/alr48/obj/build/freebsd-mips-build/exports/users/alr48/sourc= es/freebsd-mips/mips.mips64/tmp/legacy/bin:/home/alr48/obj/build/freebsd-mi= ps-build/exports/users/alr48/sources/freebsd-mips/mips.mips64/tmp/usr/sbin:= /home/alr48/obj/build/freebsd-mips-build/exports/users/alr48/sources/freebs= d-mips/mips.mips64/tmp/usr/bin:/sbin:/bin:/usr/sbin:/usr/bin This only contains WORLDTMP and /sbin:/bin:/usr/sbin:/usr/bin since the toplevel makefile already sets PATH to /sbin:/bin:/usr/sbin:/usr/bin. From owner-svn-src-all@freebsd.org Wed Feb 7 09:35:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6297CEED81C; Wed, 7 Feb 2018 09:35:48 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 18CD57F7AF; Wed, 7 Feb 2018 09:35:48 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 13A52250AA; Wed, 7 Feb 2018 09:35:48 +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 w179Zl30077890; Wed, 7 Feb 2018 09:35:47 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w179Zlif077889; Wed, 7 Feb 2018 09:35:47 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201802070935.w179Zlif077889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 7 Feb 2018 09:35:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328969 - head/sys/mips/conf X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/mips/conf X-SVN-Commit-Revision: 328969 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 09:35:48 -0000 Author: adrian Date: Wed Feb 7 09:35:47 2018 New Revision: 328969 URL: https://svnweb.freebsd.org/changeset/base/328969 Log: [ar71xx] Fix the TL-wdr3600/tl-wdr4300 hints in the new world order. Tested: * tl-wdr4300 Modified: head/sys/mips/conf/TL-WDR4300.hints Modified: head/sys/mips/conf/TL-WDR4300.hints ============================================================================== --- head/sys/mips/conf/TL-WDR4300.hints Wed Feb 7 09:28:23 2018 (r328968) +++ head/sys/mips/conf/TL-WDR4300.hints Wed Feb 7 09:35:47 2018 (r328969) @@ -114,9 +114,15 @@ hint.arge.1.miimode=1 # GMII # MAC for arge1 is the second 6 bytes of the ART # hint.arge.1.eeprommac=0x1f7f0006 -# ath0: Where the ART is - last 64k in the flash -hint.ath.0.eepromaddr=0x1fff0000 -hint.ath.0.eepromsize=16384 +# ART calibration data mapping - for the AR934x AHB device +hint.ar71xx_caldata.0.at="nexus0" +hint.ar71xx_caldata.0.order=0 +# Where the ART is - last 64k in the first 8MB of flash +hint.ar71xx_caldata.0.map.0.ath_fixup_addr=0x1fff0000 +hint.ar71xx_caldata.0.map.0.ath_fixup_size=16384 + +# And now tell the ath(4) driver where to look! +hint.ath.0.eeprom_firmware="ar71xx_caldata.0.map.0.eeprom_firmware" # ath1: it's different; it's a PCIe attached device, so # we instead need to teach the PCIe bridge code about it From owner-svn-src-all@freebsd.org Wed Feb 7 09:37:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1561EEDA79; Wed, 7 Feb 2018 09:37:22 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 73D2A7F9CF; Wed, 7 Feb 2018 09:37: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6EB61250B0; Wed, 7 Feb 2018 09:37: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 w179bMlP077981; Wed, 7 Feb 2018 09:37:22 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w179bMpI077980; Wed, 7 Feb 2018 09:37:22 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201802070937.w179bMpI077980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 7 Feb 2018 09:37:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328970 - head/sys/dev/ath X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/ath X-SVN-Commit-Revision: 328970 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 09:37:22 -0000 Author: adrian Date: Wed Feb 7 09:37:22 2018 New Revision: 328970 URL: https://svnweb.freebsd.org/changeset/base/328970 Log: [ath] Use the BSSID address logic for STA VAPs too. For DWDS VAPs on ath(4) we need to ensure that the STA vap and hostap VAP have different MAC addresses. If the STA code path doesn't utilise the address assign / reclaim path then it doesn't update the bitmap with which address was allocated. This should fix a bunch of corner issues I've been seeing with DWDS STA + AP VAPs that I was working around with manual MAC address assignment. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Wed Feb 7 09:35:47 2018 (r328969) +++ head/sys/dev/ath/if_ath.c Wed Feb 7 09:37:22 2018 (r328970) @@ -1624,7 +1624,7 @@ ath_vap_create(struct ieee80211com *ic, const char nam } /* STA, AHDEMO? */ - if (opmode == IEEE80211_M_HOSTAP || opmode == IEEE80211_M_MBSS) { + if (opmode == IEEE80211_M_HOSTAP || opmode == IEEE80211_M_MBSS || opmode == IEEE80211_M_STA) { assign_address(sc, mac, flags & IEEE80211_CLONE_BSSID); ath_hal_setbssidmask(sc->sc_ah, sc->sc_hwbssidmask); } @@ -1858,6 +1858,7 @@ ath_vap_delete(struct ieee80211vap *vap) if (sc->sc_nstavaps == 0 && sc->sc_swbmiss) sc->sc_swbmiss = 0; } else if (vap->iv_opmode == IEEE80211_M_HOSTAP || + vap->iv_opmode == IEEE80211_M_STA || vap->iv_opmode == IEEE80211_M_MBSS) { reclaim_address(sc, vap->iv_myaddr); ath_hal_setbssidmask(ah, sc->sc_hwbssidmask); From owner-svn-src-all@freebsd.org Wed Feb 7 10:32:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED5D9EF16AE for ; Wed, 7 Feb 2018 10:32:16 +0000 (UTC) (envelope-from oliver.pinter@balabit.com) Received: from mail-wm0-x229.google.com (mail-wm0-x229.google.com [IPv6:2a00:1450:400c:c09::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 29117821D3 for ; Wed, 7 Feb 2018 10:32:16 +0000 (UTC) (envelope-from oliver.pinter@balabit.com) Received: by mail-wm0-x229.google.com with SMTP id f71so2191100wmf.0 for ; Wed, 07 Feb 2018 02:32:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=balabit-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=0XDgtKJ4CnIRWoG9ysnwRxWbI8ADOUIiBj4ZaaQM1cg=; b=K8U4t8julpNU65pIkkyZYGSfzHgMOrH3Uu9h0580BUePpG3n+z6VCZlMy3h+0AcUwX LNM7NgeU9LHHdxmSapia8tbzGOLLRqLOy2OvUljXvmzlGpgbv+6KOTl15YYfhf6eXX7L qCwLB53p5AdxNvDhZ1BX78vIKaIJHp/leqTwEFEQ7TYtd41e199cXodagrgETvFlnmkd 2lLjQw7iTsnJB5lui7F4NrHyapTlnwxqsKVuwnV6G6ebnFZasTr2qCiMhnJQV4B1Vn1b r7oVolyuoJOE4X96C+B/b2xCBuHQNESmD5V6rEIp26Hry31f5R2NxhhjQxHig9pfghjQ 2POw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=0XDgtKJ4CnIRWoG9ysnwRxWbI8ADOUIiBj4ZaaQM1cg=; b=Nq56f9DWTECCTSgj5Ztak3yDenPdSZvN+cQAmD+p3OOfHtje8KeGHSOnBWYRxQcNLa sfeA6u2TfpMazwv1oLs8CkWmB0cTN/L5H9myzwHWdOxevDxkTv84KNOqh/VhmW+XIEhI WgCwteqK1yqzIEYEFrsCKCOkv53xcxUr5nFT4zHo5eObX67kQu/ZAONn8sqFoW4Qm/mQ 1jhrePRguo3hZht5KT8c2zL5DFZ8Zq+I0JrjRP95bllGzhyHbs5nmmrM4DKeBUNGTP+m 3aAdvV8EXSP8XSL7e6ozLwjgMy/eAm4u1ytPJXtIRhxUdu/Hia0qm9nJ2zwqItRbFiO5 RyQg== X-Gm-Message-State: APf1xPCp43Tgaa5oJzs/dwom0viwwkPvNke+nzkxkxvwECETdp+DLfLO dLXHPPgWlY/zEq3fQa7OEZ9D7i4JVM+NcMzvqkRsNgSpWMU= X-Google-Smtp-Source: AH8x224ZhgE8Fz655VfLTxA2qDvugbr//w6fu0uxgiiSGh3YYxHJVKnTQst3r6P2vT7audIH7yHklActardyX0c4xzo= X-Received: by 10.80.205.17 with SMTP id z17mr8032762edi.83.1517999534752; Wed, 07 Feb 2018 02:32:14 -0800 (PST) MIME-Version: 1.0 Received: by 10.80.224.133 with HTTP; Wed, 7 Feb 2018 02:32:14 -0800 (PST) In-Reply-To: <201802061914.w16JEr5K047679@repo.freebsd.org> References: <201802061914.w16JEr5K047679@repo.freebsd.org> From: =?UTF-8?B?UGludMOpciwgT2xpdsOpcg==?= Date: Wed, 7 Feb 2018 11:32:14 +0100 Message-ID: Subject: Re: svn commit: r328946 - stable/10/sys/kern To: Kirk McKusick Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 10:32:17 -0000 On Tue, Feb 6, 2018 at 8:14 PM, Kirk McKusick wrote: > Author: mckusick > Date: Tue Feb 6 19:14:53 2018 > New Revision: 328946 > URL: https://svnweb.freebsd.org/changeset/base/328946 > > Log: > MFC of 328643. > > fix vn_printf listing of its union > > 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 Tue Feb 6 19:14:15 2018 > (r328945) > +++ stable/10/sys/kern/vfs_subr.c Tue Feb 6 19:14:53 2018 > (r328946) > @@ -3020,8 +3020,25 @@ vn_printf(struct vnode *vp, const char *fmt, ...) > va_end(ap); > printf("%p: ", (void *)vp); > printf("tag %s, type %s\n", vp->v_tag, typename[vp->v_type]); > - printf(" usecount %d, writecount %d, refcount %d mountedhere > %p\n", > - vp->v_usecount, vp->v_writecount, vp->v_holdcnt, > vp->v_mountedhere); > + printf(" usecount %d, writecount %d, refcount %d", > + vp->v_usecount, vp->v_writecount, vp->v_holdcnt); > + switch (vp->v_type) { > + case VDIR: > + printf(" mountedhere %p\n", vp->v_mountedhere); > + break; > + case VCHR: > + printf(" rdev %p\n", vp->v_rdev); > + break; > + case VSOCK: > + printf(" socket %p\n", vp->v_unpcb); > + break; > Hi! Could you please cherry-pick r328961 here too? > + case VFIFO: > + printf(" fifoinfo %p\n", vp->v_fifoinfo); > + break; > + default: > + printf("\n"); > + break; > + } > buf[0] = '\0'; > buf[1] = '\0'; > if (vp->v_vflag & VV_ROOT) > _______________________________________________ > svn-src-stable-10@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10 > To unsubscribe, send any mail to "svn-src-stable-10- > unsubscribe@freebsd.org" > From owner-svn-src-all@freebsd.org Wed Feb 7 10:47:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67FF7EF2582 for ; Wed, 7 Feb 2018 10:47:23 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x243.google.com (mail-it0-x243.google.com [IPv6:2607:f8b0:4001:c0b::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 EC1FF82A2F for ; Wed, 7 Feb 2018 10:47:22 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x243.google.com with SMTP id 196so1693599iti.5 for ; Wed, 07 Feb 2018 02:47:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=8faVEyg3ZViy8wi4MlH5WwATEPObQksVh6aPOiuQ09M=; b=FRslOI6AxXcjf/cWIF+2b8mSrOXkL+rHUAitoX90ht1zum1mbTu+IfsPfUjPtWr5FR Q1nj53dQJv7uCHUW8W9OhNAQxQSans41Hw978O8t5QPvumRdl73Lqhs7xm2rNldQ+VDj jb7xqTwOQvQWOygbZi3B5SeNH9rQXYohg135cDLNwdlPB2wvlSSrWYEWgyxL675gc+2c 0hOGF1aAKAE6Mk6OuAOqS5nHmDrlD0BHuuFFuHfuBDxnD+ITyiwcPEHjek6BJxpJj67O jBdaamqSMhdqXFoW4Wesm0ByKe0CQhGA3hft9lXYXpRsxqpM4+s4pmvvkXnL1pQshCqs u5zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=8faVEyg3ZViy8wi4MlH5WwATEPObQksVh6aPOiuQ09M=; b=oHR4/qgN914R6ictog0mwyLOZoRxx1y/IPDu84vXnwgH8rmU8KT6jpsmhmj2FDMYtE 5RpEX6jCnb1LQLIj+M66K5byWrMOyC5VAM1j7JNmunX0gdvmtZ5sEJb0FCxPpsCyoeGk wMUf/ZD7xzJlIQKGFx74l7v68hwrUkuA8J97VKGv1LiZEbTeic5TXfzgJsgegM5PUrl2 OYx/xo7g77MSded11GJ8yel6HrWsjSYTzpvMTOVtCKw53k6nD/M62NHu1rMmZ8fWVsZ2 UejQPq21z81sz1SnIdPiFiUSN4SugFAfzgdsqHLjXNvqDzreRw/DQ7nlzb/0+dWwXqN8 OyrA== X-Gm-Message-State: APf1xPCXPnXUtruHFl9yEdYVv60YLyoFina4LoIvLLab4DxlO0PcrlBl AF2cVnHJVI+eKQfsrBpnuy9xemafMm5/YccwQiYTZA== X-Google-Smtp-Source: AH8x226DF42b3GFq4H5psOt5dZ/5E5KSDpgb/0rlvA4rcmPESJOAwOzTaGci/ZrW+xWlKKFhIkH12d2XJhj3DkgX1Ug= X-Received: by 10.36.68.206 with SMTP id o197mr7357358ita.97.1518000442098; Wed, 07 Feb 2018 02:47:22 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Wed, 7 Feb 2018 02:47:21 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:c81d:c97b:c7cd:ac64] Received: by 10.79.201.67 with HTTP; Wed, 7 Feb 2018 02:47:21 -0800 (PST) In-Reply-To: References: <201802061541.w16FfadO041469@repo.freebsd.org> <201802061925.w16JP4aq017961@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Wed, 7 Feb 2018 03:47:21 -0700 X-Google-Sender-Auth: -GbJn6uikVwKMBkqVnjt3kzs964 Message-ID: Subject: Re: svn commit: r328934 - in head: . bin/sh To: Alex Richardson Cc: "Rodney W. Grimes" , 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.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 10:47:23 -0000 On Feb 7, 2018 2:35 AM, "Alexander Richardson" wrote: On 6 February 2018 at 19:25, Rodney W. Grimes wrote: >> Author: arichardson >> Date: Tue Feb 6 15:41:35 2018 >> New Revision: 328934 >> URL: https://svnweb.freebsd.org/changeset/base/328934 >> >> Log: >> Don't hardcode /usr/bin as the path for mktemp in build tools >> >> It won't work e.g. when crossbuilding from Ubuntu Linux as mktemp is in >> /bin there. >> >> Reviewed By: bdrewery >> Approved By: jhb (mentor) >> Differential Revision: https://reviews.freebsd.org/D13937 > > Would it be better to create the variable MKTEMP to point at > either /bin/mktemp or /usr/bin/mktemp dependent on platform, > there are reasons we use full paths in Makefiles, mostly to > stop /usr/local/bin/foo contimaton, which I believe this > change now opens up, though very slight as I dont know of > a third party mktemp binary. > I'm happy to have a mktemp variable instead, but I don't believe files in /usr/local/bin are a problem. When in add an echo $PATH to the mktokens.sh file I get the following output: PATH=/home/alr48/obj/build/freebsd-mips-build/exports/ users/alr48/sources/freebsd-mips/mips.mips64/tmp/legacy/ usr/sbin:/home/alr48/obj/build/freebsd-mips-build/ exports/users/alr48/sources/freebsd-mips/mips.mips64/tmp/ legacy/usr/bin:/home/alr48/obj/build/freebsd-mips-build/ exports/users/alr48/sources/freebsd-mips/mips.mips64/tmp/ legacy/bin:/home/alr48/obj/build/freebsd-mips-build/ exports/users/alr48/sources/freebsd-mips/mips.mips64/tmp/ usr/sbin:/home/alr48/obj/build/freebsd-mips-build/ exports/users/alr48/sources/freebsd-mips/mips.mips64/tmp/ usr/bin:/sbin:/bin:/usr/sbin:/usr/bin This only contains WORLDTMP and /sbin:/bin:/usr/sbin:/usr/bin since the toplevel makefile already sets PATH to /sbin:/bin:/usr/sbin:/usr/bin. I honestly wouldn't add a variable. It makes it more complicated for zero benefit. Unless a reasonable use case can be shown, it just flutters up the build for no benefit. Warner From owner-svn-src-all@freebsd.org Wed Feb 7 12:12:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85333F00D45; Wed, 7 Feb 2018 12:12:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 32C8D862A0; Wed, 7 Feb 2018 12:12:07 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2DC7D26ABB; Wed, 7 Feb 2018 12:12:07 +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 w17CC659058164; Wed, 7 Feb 2018 12:12:06 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17CC6lt058156; Wed, 7 Feb 2018 12:12:06 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802071212.w17CC6lt058156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 7 Feb 2018 12:12:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328971 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 328971 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 12:12:07 -0000 Author: hselasky Date: Wed Feb 7 12:12:06 2018 New Revision: 328971 URL: https://svnweb.freebsd.org/changeset/base/328971 Log: Fix implementation of ktime_add_ns() and ktime_sub_ns() in the LinuxKPI to actually return the computed result instead of the input value. This is a regression issue after r289572. Found by: gcc6 MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/ktime.h Modified: head/sys/compat/linuxkpi/common/include/linux/ktime.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/ktime.h Wed Feb 7 09:37:22 2018 (r328970) +++ head/sys/compat/linuxkpi/common/include/linux/ktime.h Wed Feb 7 12:12:06 2018 (r328971) @@ -88,18 +88,14 @@ ktime_to_timeval(ktime_t kt) static inline ktime_t ktime_add_ns(ktime_t kt, int64_t ns) { - ktime_t res; - - res.tv64 = kt.tv64 + ns; + kt.tv64 += ns; return kt; } static inline ktime_t ktime_sub_ns(ktime_t kt, int64_t ns) { - ktime_t res; - - res.tv64 = kt.tv64 - ns; + kt.tv64 -= ns; return kt; } From owner-svn-src-all@freebsd.org Wed Feb 7 14:50:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1EE8F0B786; Wed, 7 Feb 2018 14:50:06 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 875BA6C72B; Wed, 7 Feb 2018 14:50:06 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8226B372; Wed, 7 Feb 2018 14:50:06 +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 w17Eo6xI033429; Wed, 7 Feb 2018 14:50:06 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17Eo6sc033426; Wed, 7 Feb 2018 14:50:06 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201802071450.w17Eo6sc033426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 7 Feb 2018 14:50:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328972 - in head: . share/mk X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: . share/mk X-SVN-Commit-Revision: 328972 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 14:50:07 -0000 Author: emaste Date: Wed Feb 7 14:50:06 2018 New Revision: 328972 URL: https://svnweb.freebsd.org/changeset/base/328972 Log: add retpoline compiler and linker feature flags These features indicate that the compiler and linker support the retpoline speculative execution vulnerability (CVE-2017-5715) mitigation. Reviewed by: dim, imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D14228 Modified: head/Makefile.inc1 head/share/mk/bsd.compiler.mk head/share/mk/bsd.linker.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Feb 7 12:12:06 2018 (r328971) +++ head/Makefile.inc1 Wed Feb 7 14:50:06 2018 (r328972) @@ -165,11 +165,11 @@ test-system-compiler: .PHONY .if !defined(X_COMPILER_TYPE) CROSSENV+= COMPILER_VERSION=${COMPILER_VERSION} \ COMPILER_TYPE=${COMPILER_TYPE} \ - COMPILER_FEATURES=${COMPILER_FEATURES} \ + COMPILER_FEATURES="${COMPILER_FEATURES}" \ COMPILER_FREEBSD_VERSION=${COMPILER_FREEBSD_VERSION} .else CROSSENV+= COMPILER_VERSION=${X_COMPILER_VERSION} \ - COMPILER_FEATURES=${X_COMPILER_FEATURES} \ + COMPILER_FEATURES="${X_COMPILER_FEATURES}" \ COMPILER_TYPE=${X_COMPILER_TYPE} \ COMPILER_FREEBSD_VERSION=${X_COMPILER_FREEBSD_VERSION} .endif Modified: head/share/mk/bsd.compiler.mk ============================================================================== --- head/share/mk/bsd.compiler.mk Wed Feb 7 12:12:06 2018 (r328971) +++ head/share/mk/bsd.compiler.mk Wed Feb 7 14:50:06 2018 (r328972) @@ -19,7 +19,9 @@ # COMPILER_FEATURES will contain one or more of the following, based on # compiler support for that feature: # -# - c++11 : supports full (or nearly full) C++11 programming environment. +# - c++11: supports full (or nearly full) C++11 programming environment. +# - retpoline: supports the retpoline speculative execution vulnerability +# mitigation. # # These variables with an X_ prefix will also be provided if XCC is set. # @@ -178,11 +180,13 @@ ${X_}COMPILER_FREEBSD_VERSION= unknown .endif .endif +${X_}COMPILER_FEATURES= .if ${${X_}COMPILER_TYPE} == "clang" || \ (${${X_}COMPILER_TYPE} == "gcc" && ${${X_}COMPILER_VERSION} >= 40800) -${X_}COMPILER_FEATURES= c++11 -.else -${X_}COMPILER_FEATURES= +${X_}COMPILER_FEATURES+= c++11 +.endif +.if ${${X_}COMPILER_TYPE} == "clang" && ${${X_}COMPILER_VERSION} >= 60000 +${X_}COMPILER_FEATURES+= retpoline .endif .else Modified: head/share/mk/bsd.linker.mk ============================================================================== --- head/share/mk/bsd.linker.mk Wed Feb 7 12:12:06 2018 (r328971) +++ head/share/mk/bsd.linker.mk Wed Feb 7 14:50:06 2018 (r328972) @@ -12,7 +12,9 @@ # LINKER_FEATURES may contain one or more of the following, based on # linker support for that feature: # -# - build-id : support for generating a Build-ID note +# - build-id: support for generating a Build-ID note +# - retpoline: support for generating PLT with retpoline speculative +# execution vulnerability mitigation # # These variables with an X_ prefix will also be provided if XLD is set. # @@ -72,6 +74,9 @@ ${X_}LINKER_FEATURES+= build-id .endif .if ${${X_}LINKER_TYPE} != "lld" || ${${X_}LINKER_VERSION} >= 50000 ${X_}LINKER_FEATURES+= filter +.endif +.if ${${X_}LINKER_TYPE} == "lld" && ${${X_}LINKER_VERSION} >= 60000 +${X_}LINKER_FEATURES+= retpoline .endif .endif .else From owner-svn-src-all@freebsd.org Wed Feb 7 15:06:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 169E7F0CC65; Wed, 7 Feb 2018 15:06:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B19ED6D5ED; Wed, 7 Feb 2018 15:06:54 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A3F4A6B8; Wed, 7 Feb 2018 15:06:54 +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 w17F6soJ043165; Wed, 7 Feb 2018 15:06:54 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17F6s5l043163; Wed, 7 Feb 2018 15:06:54 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802071506.w17F6s5l043163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 7 Feb 2018 15:06:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328973 - in stable/11: include sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11: include sys/sys X-SVN-Commit-Revision: 328973 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 15:06:55 -0000 Author: hselasky Date: Wed Feb 7 15:06:54 2018 New Revision: 328973 URL: https://svnweb.freebsd.org/changeset/base/328973 Log: MFC r328237: Use the __alloc_size2 attribute where relevant. This follows the documented use in GCC. It is basically only relevant for calloc(3), reallocarray(3) and mallocarray(9). NOTE: Without this change clang 5.0.1 can produce incorrect optimisation code for static processing of data using the allocated object. For example this has been seen compiling the mlx4 core module, which allocates a fixed size array which is then sorted by a fixed order loop. The optimised result, -O2, is incorrect unless this patch is in place. Suggested by: Mark Millard Reference: https://docs.freebsd.org/cgi/mid.cgi?9DE674C6-EAA3-4E8A-906F-446E74D82FC4 Modified: stable/11/include/stdlib.h stable/11/sys/sys/malloc.h Directory Properties: stable/11/ (props changed) Modified: stable/11/include/stdlib.h ============================================================================== --- stable/11/include/stdlib.h Wed Feb 7 14:50:06 2018 (r328972) +++ stable/11/include/stdlib.h Wed Feb 7 15:06:54 2018 (r328973) @@ -90,7 +90,7 @@ long atol(const char *); void *bsearch(const void *, const void *, size_t, size_t, int (*)(const void * _Nonnull, const void *)); void *calloc(size_t, size_t) __malloc_like __result_use_check - __alloc_size(1) __alloc_size(2); + __alloc_size2(1, 2); div_t div(int, int) __pure2; _Noreturn void exit(int); void free(void *); @@ -307,8 +307,8 @@ void qsort_r(void *, size_t, size_t, void *, int (*)(void *, const void *, const void *)); int radixsort(const unsigned char **, int, const unsigned char *, unsigned); -void *reallocarray(void *, size_t, size_t) __result_use_check __alloc_size(2) - __alloc_size(3); +void *reallocarray(void *, size_t, size_t) __result_use_check + __alloc_size2(2, 3); void *reallocf(void *, size_t) __result_use_check __alloc_size(2); int rpmatch(const char *); void setprogname(const char *); Modified: stable/11/sys/sys/malloc.h ============================================================================== --- stable/11/sys/sys/malloc.h Wed Feb 7 14:50:06 2018 (r328972) +++ stable/11/sys/sys/malloc.h Wed Feb 7 15:06:54 2018 (r328973) @@ -178,7 +178,7 @@ void *malloc(unsigned long size, struct malloc_type *t __malloc_like __result_use_check __alloc_size(1); void *mallocarray(size_t nmemb, size_t size, struct malloc_type *type, int flags) __malloc_like __result_use_check - __alloc_size(1) __alloc_size(2); + __alloc_size2(1, 2); void malloc_init(void *); int malloc_last_fail(void); void malloc_type_allocated(struct malloc_type *type, unsigned long size); From owner-svn-src-all@freebsd.org Wed Feb 7 15:32:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A050F0EC41; Wed, 7 Feb 2018 15:32:33 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 34E766E9B4; Wed, 7 Feb 2018 15:32:33 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F69BB98; Wed, 7 Feb 2018 15:32:33 +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 w17FWXFE057980; Wed, 7 Feb 2018 15:32:33 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17FWW7L057965; Wed, 7 Feb 2018 15:32:32 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201802071532.w17FWW7L057965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 7 Feb 2018 15:32:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328974 - in stable/11/usr.bin/mkimg: . tests X-SVN-Group: stable-11 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in stable/11/usr.bin/mkimg: . tests X-SVN-Commit-Revision: 328974 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 15:32:33 -0000 Author: manu Date: Wed Feb 7 15:32:31 2018 New Revision: 328974 URL: https://svnweb.freebsd.org/changeset/base/328974 Log: MFC r306325, r306329-r306330, r306333, r306620-r306622, r307387, r307544, r307550, r318137, r319125, r319295 r306325 by marcel: Replace the use of linker sets with constructors for both the formats and schemes. Formats and schemes are registered at runtime now, rather than collected at link time. r306329 by marcel: Eliminate the use of EDOOFUS. The error code was used to signal programming errors, but is really a poor substitute for assert. And less portable as well. r306330 by marcel: Avoid depending on the header for le*enc and be*enc. Not only is the header unportable, the encoding/decoding functions are as well. Instead, duplicate the handful of small inlines we need into a private header called endian.h. Aside: an alternative approach is to move the encoding/decoding functions to a separate system header. While the header is still nonportable, such an approach would make it possible to re-use the definitions by playing games with include paths. This may be the preferred approach if more (build) utilities need this. This change does not preclude that. In fact, it makes it easier. r306333 by marcel: Portability changes: 1. macOS nor Linux have MAP_NOCORE nor MAP_NOSYNC. Define as 0. 2. macOS doesn't have SEEK_DATA nor SEEK_HOLE. Define as -1 so that lseek will return -1 (with errno set to EINVAL). 3. gcc correctly warns that error is assigned but not used in image_copyout_region(). Fix by returning on the first error. r306620 by marcel: Replace STAILQ with TAILQ. TAILQs are portable enough that they can be used on both macOS and Linux. STAILQs are not. In particular, STAILQ_LAST does not next on Linux. Since neither STAILQ_FOREACH_SAFE nor TAILQ_FOREACH_SAFE exist on Linux, replace its use with a regular TAILQ_FOREACH. The _SAFE variant was only used for having the next pointer in a local variable. r306621 by marcel: Prefer over . While here remove redundant inclusion of . Move the inclusion of the disk partitioning headers out of order and inbetween standard headers and local header. They will change in a subsequent commit. r306622 by marcel: Replace OFF_MAX with INT64_MAX. The former is defined on Linux. r307387 by marcel: Switch to using the portable partition scheme headers. r307544 by marcel: o Provide a private definition for UUIDs (mkimg_uuid_t) because UUIDs are not portable. o Move mkimg_uuid() to a new file and merge both gpt_uuid_enc() and vhd_uuid_enc() into a single mkimg_uuid_enc() that lives in the same file. o Move the OS-specific implementation of generating a UUID to osdep_uuidgen() and provide the implementations for FreeBSD, macOS and Linux. o Expect the partitioning scheme headers to be found by having a search to the directory in which the headers live. This avoids conflicts on non-FreeBSD machines. r307550 by imp: Add a new flag to mkimg (-a num) to specify the active partition for those partitioning schemes that have this concept. Implement it as an override for mbr's setting 0x80 in the flags for the first partition when we have boot code. Differential Revision: https://reviews.freebsd.org/D4403 r318137: mkimg: Add -C argument to specify maximum capacity Add a -C option to specify a maximum capacity for the final image file. It is useful to control the size of the generated image for sdcard or when we will add dynamic size partition. Add --capacity which is a shorthand to define min and max capacity at the same time. Reviewed by: bapt, marcel, wblock (manpages) Sponsored by: Gandi.net Differential Revision: https://reviews.freebsd.org/D10509 r319125: mkimg: Correct an off by one error in the PMBR size The PMBR last sector should be number of sector - 1 (As stated in UEFI Spec 2.6 page 118 table 17). This fixes warning printed by linux tools like parted or fdisk. Sponsored by: Gandi.net r319295 by ngie: Update the usr.bin/mkimg golden test output files after ^/head@r319125 ^/head@r319125 changed the location of the backup pmbr, requiring the output files to be regenerated, since they're binary disk dumps. The output files were regenerated with "make rebase"--fixed in ^/head@r319294. MFC with: r319125, r319294 PR: 219673 Sponsored by: Dell EMC Isilon Added: stable/11/usr.bin/mkimg/endian.h - copied unchanged from r306330, head/usr.bin/mkimg/endian.h stable/11/usr.bin/mkimg/uuid.c - copied unchanged from r307544, head/usr.bin/mkimg/uuid.c Modified: stable/11/usr.bin/mkimg/Makefile stable/11/usr.bin/mkimg/apm.c stable/11/usr.bin/mkimg/bsd.c stable/11/usr.bin/mkimg/ebr.c stable/11/usr.bin/mkimg/format.c stable/11/usr.bin/mkimg/format.h stable/11/usr.bin/mkimg/gpt.c stable/11/usr.bin/mkimg/image.c stable/11/usr.bin/mkimg/mbr.c stable/11/usr.bin/mkimg/mkimg.1 stable/11/usr.bin/mkimg/mkimg.c stable/11/usr.bin/mkimg/mkimg.h stable/11/usr.bin/mkimg/pc98.c stable/11/usr.bin/mkimg/qcow.c stable/11/usr.bin/mkimg/raw.c stable/11/usr.bin/mkimg/scheme.c stable/11/usr.bin/mkimg/scheme.h stable/11/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow.gz.uu stable/11/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow2.gz.uu stable/11/usr.bin/mkimg/tests/img-1x1-4096-gpt.raw.gz.uu stable/11/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhd.gz.uu stable/11/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhdf.gz.uu stable/11/usr.bin/mkimg/tests/img-1x1-4096-gpt.vmdk.gz.uu stable/11/usr.bin/mkimg/tests/img-1x1-512-gpt.qcow.gz.uu stable/11/usr.bin/mkimg/tests/img-1x1-512-gpt.qcow2.gz.uu stable/11/usr.bin/mkimg/tests/img-1x1-512-gpt.raw.gz.uu stable/11/usr.bin/mkimg/tests/img-1x1-512-gpt.vhd.gz.uu stable/11/usr.bin/mkimg/tests/img-1x1-512-gpt.vhdf.gz.uu stable/11/usr.bin/mkimg/tests/img-1x1-512-gpt.vmdk.gz.uu stable/11/usr.bin/mkimg/tests/img-63x255-4096-gpt.qcow.gz.uu stable/11/usr.bin/mkimg/tests/img-63x255-4096-gpt.qcow2.gz.uu stable/11/usr.bin/mkimg/tests/img-63x255-4096-gpt.raw.gz.uu stable/11/usr.bin/mkimg/tests/img-63x255-4096-gpt.vhd.gz.uu stable/11/usr.bin/mkimg/tests/img-63x255-4096-gpt.vhdf.gz.uu stable/11/usr.bin/mkimg/tests/img-63x255-4096-gpt.vmdk.gz.uu stable/11/usr.bin/mkimg/tests/img-63x255-512-gpt.qcow.gz.uu stable/11/usr.bin/mkimg/tests/img-63x255-512-gpt.qcow2.gz.uu stable/11/usr.bin/mkimg/tests/img-63x255-512-gpt.raw.gz.uu stable/11/usr.bin/mkimg/tests/img-63x255-512-gpt.vhd.gz.uu stable/11/usr.bin/mkimg/tests/img-63x255-512-gpt.vhdf.gz.uu stable/11/usr.bin/mkimg/tests/img-63x255-512-gpt.vmdk.gz.uu stable/11/usr.bin/mkimg/vhd.c stable/11/usr.bin/mkimg/vmdk.c stable/11/usr.bin/mkimg/vtoc8.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/mkimg/Makefile ============================================================================== --- stable/11/usr.bin/mkimg/Makefile Wed Feb 7 15:06:54 2018 (r328973) +++ stable/11/usr.bin/mkimg/Makefile Wed Feb 7 15:32:31 2018 (r328974) @@ -3,14 +3,15 @@ .include PROG= mkimg -SRCS= format.c image.c mkimg.c scheme.c +SRCS= format.c image.c mkimg.c scheme.c uuid.c MAN= mkimg.1 -MKIMG_VERSION=20151211 +MKIMG_VERSION=20161016 mkimg.o: Makefile CFLAGS+=-DMKIMG_VERSION=${MKIMG_VERSION} CFLAGS+=-DSPARSE_WRITE +CFLAGS+=-I${SRCTOP}/sys/sys/disk # List of formats to support SRCS+= \ Modified: stable/11/usr.bin/mkimg/apm.c ============================================================================== --- stable/11/usr.bin/mkimg/apm.c Wed Feb 7 15:06:54 2018 (r328973) +++ stable/11/usr.bin/mkimg/apm.c Wed Feb 7 15:32:31 2018 (r328974) @@ -27,25 +27,19 @@ #include __FBSDID("$FreeBSD$"); -#include -#include -#include #include +#include #include #include #include +#include + +#include "endian.h" #include "image.h" #include "mkimg.h" #include "scheme.h" -#ifndef APM_ENT_TYPE_APPLE_BOOT -#define APM_ENT_TYPE_APPLE_BOOT "Apple_Bootstrap" -#endif -#ifndef APM_ENT_TYPE_FREEBSD_NANDFS -#define APM_ENT_TYPE_FREEBSD_NANDFS "FreeBSD-nandfs" -#endif - static struct mkimg_alias apm_aliases[] = { { ALIAS_FREEBSD, ALIAS_PTR2TYPE(APM_ENT_TYPE_FREEBSD) }, { ALIAS_FREEBSD_BOOT, ALIAS_PTR2TYPE(APM_ENT_TYPE_APPLE_BOOT) }, @@ -91,7 +85,7 @@ apm_write(lba_t imgsz, void *bootcode __unused) strncpy(ent->ent_type, APM_ENT_TYPE_SELF, sizeof(ent->ent_type)); strncpy(ent->ent_name, "Apple", sizeof(ent->ent_name)); - STAILQ_FOREACH(part, &partlist, link) { + TAILQ_FOREACH(part, &partlist, link) { ent = (void *)(buf + (part->index + 2) * secsz); be16enc(&ent->ent_sig, APM_ENT_SIG); be32enc(&ent->ent_pmblkcnt, nparts + 1); Modified: stable/11/usr.bin/mkimg/bsd.c ============================================================================== --- stable/11/usr.bin/mkimg/bsd.c Wed Feb 7 15:06:54 2018 (r328973) +++ stable/11/usr.bin/mkimg/bsd.c Wed Feb 7 15:32:31 2018 (r328974) @@ -27,22 +27,19 @@ #include __FBSDID("$FreeBSD$"); -#include -#include -#include #include +#include #include #include #include +#include + +#include "endian.h" #include "image.h" #include "mkimg.h" #include "scheme.h" -#ifndef FS_NANDFS -#define FS_NANDFS 30 -#endif - static struct mkimg_alias bsd_aliases[] = { { ALIAS_FREEBSD_NANDFS, ALIAS_INT2TYPE(FS_NANDFS) }, { ALIAS_FREEBSD_SWAP, ALIAS_INT2TYPE(FS_SWAP) }, @@ -57,7 +54,7 @@ bsd_metadata(u_int where, lba_t blk) { if (where == SCHEME_META_IMG_START) - blk += BBSIZE / secsz; + blk += BSD_BOOTBLOCK_SIZE / secsz; else if (where == SCHEME_META_IMG_END) blk = round_cylinder(blk); else @@ -75,21 +72,21 @@ bsd_write(lba_t imgsz, void *bootcode) int bsdparts, error, n; uint16_t checksum; - buf = malloc(BBSIZE); + buf = malloc(BSD_BOOTBLOCK_SIZE); if (buf == NULL) return (ENOMEM); if (bootcode != NULL) { - memcpy(buf, bootcode, BBSIZE); + memcpy(buf, bootcode, BSD_BOOTBLOCK_SIZE); memset(buf + secsz, 0, sizeof(struct disklabel)); } else - memset(buf, 0, BBSIZE); + memset(buf, 0, BSD_BOOTBLOCK_SIZE); bsdparts = nparts + 1; /* Account for c partition */ - if (bsdparts < MAXPARTITIONS) - bsdparts = MAXPARTITIONS; + if (bsdparts < BSD_NPARTS_MIN) + bsdparts = BSD_NPARTS_MIN; d = (void *)(buf + secsz); - le32enc(&d->d_magic, DISKMAGIC); + le32enc(&d->d_magic, BSD_MAGIC); le32enc(&d->d_secsize, secsz); le32enc(&d->d_nsectors, nsecs); le32enc(&d->d_ntracks, nheads); @@ -97,14 +94,14 @@ bsd_write(lba_t imgsz, void *bootcode) le32enc(&d->d_secpercyl, nsecs * nheads); le32enc(&d->d_secperunit, imgsz); le16enc(&d->d_rpm, 3600); - le32enc(&d->d_magic2, DISKMAGIC); + le32enc(&d->d_magic2, BSD_MAGIC); le16enc(&d->d_npartitions, bsdparts); - le32enc(&d->d_bbsize, BBSIZE); + le32enc(&d->d_bbsize, BSD_BOOTBLOCK_SIZE); - dp = &d->d_partitions[RAW_PART]; + dp = &d->d_partitions[BSD_PART_RAW]; le32enc(&dp->p_size, imgsz); - STAILQ_FOREACH(part, &partlist, link) { - n = part->index + ((part->index >= RAW_PART) ? 1 : 0); + TAILQ_FOREACH(part, &partlist, link) { + n = part->index + ((part->index >= BSD_PART_RAW) ? 1 : 0); dp = &d->d_partitions[n]; le32enc(&dp->p_size, part->size); le32enc(&dp->p_offset, part->block); @@ -120,7 +117,7 @@ bsd_write(lba_t imgsz, void *bootcode) checksum ^= le16dec(p); le16enc(&d->d_checksum, checksum); - error = image_write(0, buf, BBSIZE / secsz); + error = image_write(0, buf, BSD_BOOTBLOCK_SIZE / secsz); free(buf); return (error); } @@ -131,8 +128,8 @@ static struct mkimg_scheme bsd_scheme = { .aliases = bsd_aliases, .metadata = bsd_metadata, .write = bsd_write, - .nparts = 19, - .bootcode = BBSIZE, + .nparts = BSD_NPARTS_MAX - 1, + .bootcode = BSD_BOOTBLOCK_SIZE, .maxsecsz = 512 }; Modified: stable/11/usr.bin/mkimg/ebr.c ============================================================================== --- stable/11/usr.bin/mkimg/ebr.c Wed Feb 7 15:06:54 2018 (r328973) +++ stable/11/usr.bin/mkimg/ebr.c Wed Feb 7 15:32:31 2018 (r328974) @@ -27,27 +27,21 @@ #include __FBSDID("$FreeBSD$"); -#include -#include -#include #include +#include #include #include #include +#include + +#include "endian.h" #include "image.h" #include "mkimg.h" #include "scheme.h" -#ifndef DOSPTYP_FAT16B -#define DOSPTYP_FAT16B 0x06 -#endif -#ifndef DOSPTYP_FAT32 -#define DOSPTYP_FAT32 0x0b -#endif - static struct mkimg_alias ebr_aliases[] = { - { ALIAS_FAT16B, ALIAS_INT2TYPE(DOSPTYP_FAT16B) }, + { ALIAS_FAT16B, ALIAS_INT2TYPE(DOSPTYP_FAT16) }, { ALIAS_FAT32, ALIAS_INT2TYPE(DOSPTYP_FAT32) }, { ALIAS_FREEBSD, ALIAS_INT2TYPE(DOSPTYP_386BSD) }, { ALIAS_NONE, 0 } @@ -88,7 +82,7 @@ ebr_write(lba_t imgsz __unused, void *bootcode __unuse le16enc(ebr + DOSMAGICOFFSET, DOSMAGIC); error = 0; - STAILQ_FOREACH_SAFE(part, &partlist, link, next) { + TAILQ_FOREACH(part, &partlist, link) { block = part->block - nsecs; size = round_track(part->size); dp = (void *)(ebr + DOSPARTOFF); @@ -100,6 +94,7 @@ ebr_write(lba_t imgsz __unused, void *bootcode __unuse le32enc(&dp->dp_size, size); /* Add link entry */ + next = TAILQ_NEXT(part, link); if (next != NULL) { size = round_track(next->size); dp++; Copied: stable/11/usr.bin/mkimg/endian.h (from r306330, head/usr.bin/mkimg/endian.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/usr.bin/mkimg/endian.h Wed Feb 7 15:32:31 2018 (r328974, copy of r306330, head/usr.bin/mkimg/endian.h) @@ -0,0 +1,106 @@ +/*- + * Copyright (c) 2002 Thomas Moestl + * 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 _MKIMG_ENDIAN_H_ +#define _MKIMG_ENDIAN_H_ + +static __inline uint16_t +be16dec(const void *pp) +{ + uint8_t const *p = (uint8_t const *)pp; + + return ((p[0] << 8) | p[1]); +} + +static __inline void +be16enc(void *pp, uint16_t u) +{ + uint8_t *p = (uint8_t *)pp; + + p[0] = (u >> 8) & 0xff; + p[1] = u & 0xff; +} + +static __inline void +be32enc(void *pp, uint32_t u) +{ + uint8_t *p = (uint8_t *)pp; + + p[0] = (u >> 24) & 0xff; + p[1] = (u >> 16) & 0xff; + p[2] = (u >> 8) & 0xff; + p[3] = u & 0xff; +} + +static __inline void +be64enc(void *pp, uint64_t u) +{ + uint8_t *p = (uint8_t *)pp; + + be32enc(p, (uint32_t)(u >> 32)); + be32enc(p + 4, (uint32_t)(u & 0xffffffffU)); +} + +static __inline uint16_t +le16dec(const void *pp) +{ + uint8_t const *p = (uint8_t const *)pp; + + return ((p[1] << 8) | p[0]); +} + +static __inline void +le16enc(void *pp, uint16_t u) +{ + uint8_t *p = (uint8_t *)pp; + + p[0] = u & 0xff; + p[1] = (u >> 8) & 0xff; +} + +static __inline void +le32enc(void *pp, uint32_t u) +{ + uint8_t *p = (uint8_t *)pp; + + p[0] = u & 0xff; + p[1] = (u >> 8) & 0xff; + p[2] = (u >> 16) & 0xff; + p[3] = (u >> 24) & 0xff; +} + +static __inline void +le64enc(void *pp, uint64_t u) +{ + uint8_t *p = (uint8_t *)pp; + + le32enc(p, (uint32_t)(u & 0xffffffffU)); + le32enc(p + 4, (uint32_t)(u >> 32)); +} + +#endif /* _MKIMG_ENDIAN_H_ */ Modified: stable/11/usr.bin/mkimg/format.c ============================================================================== --- stable/11/usr.bin/mkimg/format.c Wed Feb 7 15:06:54 2018 (r328973) +++ stable/11/usr.bin/mkimg/format.c Wed Feb 7 15:32:31 2018 (r328974) @@ -27,9 +27,6 @@ #include __FBSDID("$FreeBSD$"); -#include -#include -#include #include #include #include @@ -42,8 +39,24 @@ __FBSDID("$FreeBSD$"); #include "format.h" #include "mkimg.h" +static struct mkimg_format *first; static struct mkimg_format *format; +struct mkimg_format * +format_iterate(struct mkimg_format *f) +{ + + return ((f == NULL) ? first : f->next); +} + +void +format_register(struct mkimg_format *f) +{ + + f->next = first; + first = f; +} + int format_resize(lba_t end) { @@ -56,10 +69,10 @@ format_resize(lba_t end) int format_select(const char *spec) { - struct mkimg_format *f, **iter; + struct mkimg_format *f; - SET_FOREACH(iter, formats) { - f = *iter; + f = NULL; + while ((f = format_iterate(f)) != NULL) { if (strcasecmp(spec, f->name) == 0) { format = f; return (0); Modified: stable/11/usr.bin/mkimg/format.h ============================================================================== --- stable/11/usr.bin/mkimg/format.h Wed Feb 7 15:06:54 2018 (r328973) +++ stable/11/usr.bin/mkimg/format.h Wed Feb 7 15:32:31 2018 (r328974) @@ -29,21 +29,24 @@ #ifndef _MKIMG_FORMAT_H_ #define _MKIMG_FORMAT_H_ -#include - struct mkimg_format { + struct mkimg_format *next; const char *name; const char *description; int (*resize)(lba_t); int (*write)(int); }; -SET_DECLARE(formats, struct mkimg_format); -#define FORMAT_DEFINE(nm) DATA_SET(formats, nm) +#define FORMAT_DEFINE(nm) \ +static void format_register_##nm(void) __attribute__((constructor)); \ +static void format_register_##nm(void) { format_register(&nm); } -int format_resize(lba_t); +struct mkimg_format *format_iterate(struct mkimg_format *); +void format_register(struct mkimg_format *); int format_select(const char *); struct mkimg_format *format_selected(void); + +int format_resize(lba_t); int format_write(int); #endif /* _MKIMG_FORMAT_H_ */ Modified: stable/11/usr.bin/mkimg/gpt.c ============================================================================== --- stable/11/usr.bin/mkimg/gpt.c Wed Feb 7 15:06:54 2018 (r328973) +++ stable/11/usr.bin/mkimg/gpt.c Wed Feb 7 15:32:31 2018 (r328974) @@ -27,38 +27,32 @@ #include __FBSDID("$FreeBSD$"); -#include -#include -#include #include -#include #include #include #include #include #include -#include +#include +#include + +#include "endian.h" #include "image.h" #include "mkimg.h" #include "scheme.h" -#ifndef GPT_ENT_TYPE_FREEBSD_NANDFS -#define GPT_ENT_TYPE_FREEBSD_NANDFS \ - {0x74ba7dd9,0xa689,0x11e1,0xbd,0x04,{0x00,0xe0,0x81,0x28,0x6a,0xcf}} -#endif +static mkimg_uuid_t gpt_uuid_efi = GPT_ENT_TYPE_EFI; +static mkimg_uuid_t gpt_uuid_freebsd = GPT_ENT_TYPE_FREEBSD; +static mkimg_uuid_t gpt_uuid_freebsd_boot = GPT_ENT_TYPE_FREEBSD_BOOT; +static mkimg_uuid_t gpt_uuid_freebsd_nandfs = GPT_ENT_TYPE_FREEBSD_NANDFS; +static mkimg_uuid_t gpt_uuid_freebsd_swap = GPT_ENT_TYPE_FREEBSD_SWAP; +static mkimg_uuid_t gpt_uuid_freebsd_ufs = GPT_ENT_TYPE_FREEBSD_UFS; +static mkimg_uuid_t gpt_uuid_freebsd_vinum = GPT_ENT_TYPE_FREEBSD_VINUM; +static mkimg_uuid_t gpt_uuid_freebsd_zfs = GPT_ENT_TYPE_FREEBSD_ZFS; +static mkimg_uuid_t gpt_uuid_mbr = GPT_ENT_TYPE_MBR; +static mkimg_uuid_t gpt_uuid_ms_basic_data = GPT_ENT_TYPE_MS_BASIC_DATA; -static uuid_t gpt_uuid_efi = GPT_ENT_TYPE_EFI; -static uuid_t gpt_uuid_freebsd = GPT_ENT_TYPE_FREEBSD; -static uuid_t gpt_uuid_freebsd_boot = GPT_ENT_TYPE_FREEBSD_BOOT; -static uuid_t gpt_uuid_freebsd_nandfs = GPT_ENT_TYPE_FREEBSD_NANDFS; -static uuid_t gpt_uuid_freebsd_swap = GPT_ENT_TYPE_FREEBSD_SWAP; -static uuid_t gpt_uuid_freebsd_ufs = GPT_ENT_TYPE_FREEBSD_UFS; -static uuid_t gpt_uuid_freebsd_vinum = GPT_ENT_TYPE_FREEBSD_VINUM; -static uuid_t gpt_uuid_freebsd_zfs = GPT_ENT_TYPE_FREEBSD_ZFS; -static uuid_t gpt_uuid_mbr = GPT_ENT_TYPE_MBR; -static uuid_t gpt_uuid_ms_basic_data = GPT_ENT_TYPE_MS_BASIC_DATA; - static struct mkimg_alias gpt_aliases[] = { { ALIAS_EFI, ALIAS_PTR2TYPE(&gpt_uuid_efi) }, { ALIAS_FREEBSD, ALIAS_PTR2TYPE(&gpt_uuid_freebsd) }, @@ -131,21 +125,6 @@ crc32(const void *buf, size_t sz) return (crc ^ ~0U); } -static void -gpt_uuid_enc(void *buf, const uuid_t *uuid) -{ - uint8_t *p = buf; - int i; - - le32enc(p, uuid->time_low); - le16enc(p + 4, uuid->time_mid); - le16enc(p + 6, uuid->time_hi_and_version); - p[8] = uuid->clock_seq_hi_and_reserved; - p[9] = uuid->clock_seq_low; - for (i = 0; i < _UUID_NODE_LEN; i++) - p[10 + i] = uuid->node[i]; -} - static u_int gpt_tblsz(void) { @@ -173,7 +152,7 @@ gpt_write_pmbr(lba_t blks, void *bootcode) uint32_t secs; int error; - secs = (blks > UINT32_MAX) ? UINT32_MAX : (uint32_t)blks; + secs = (blks > UINT32_MAX) ? UINT32_MAX : (uint32_t)blks - 1; pmbr = malloc(secsz); if (pmbr == NULL) @@ -199,7 +178,7 @@ gpt_write_pmbr(lba_t blks, void *bootcode) static struct gpt_ent * gpt_mktbl(u_int tblsz) { - uuid_t uuid; + mkimg_uuid_t uuid; struct gpt_ent *tbl, *ent; struct part *part; int c, idx; @@ -208,11 +187,11 @@ gpt_mktbl(u_int tblsz) if (tbl == NULL) return (NULL); - STAILQ_FOREACH(part, &partlist, link) { + TAILQ_FOREACH(part, &partlist, link) { ent = tbl + part->index; - gpt_uuid_enc(&ent->ent_type, ALIAS_TYPE2PTR(part->type)); + mkimg_uuid_enc(&ent->ent_type, ALIAS_TYPE2PTR(part->type)); mkimg_uuid(&uuid); - gpt_uuid_enc(&ent->ent_uuid, &uuid); + mkimg_uuid_enc(&ent->ent_uuid, &uuid); le64enc(&ent->ent_lba_start, part->block); le64enc(&ent->ent_lba_end, part->block + part->size - 1); if (part->label != NULL) { @@ -243,7 +222,7 @@ gpt_write_hdr(struct gpt_hdr *hdr, uint64_t self, uint static int gpt_write(lba_t imgsz, void *bootcode) { - uuid_t uuid; + mkimg_uuid_t uuid; struct gpt_ent *tbl; struct gpt_hdr *hdr; uint32_t crc; @@ -280,7 +259,7 @@ gpt_write(lba_t imgsz, void *bootcode) le64enc(&hdr->hdr_lba_start, 2 + tblsz); le64enc(&hdr->hdr_lba_end, imgsz - tblsz - 2); mkimg_uuid(&uuid); - gpt_uuid_enc(&hdr->hdr_uuid, &uuid); + mkimg_uuid_enc(&hdr->hdr_uuid, &uuid); le32enc(&hdr->hdr_entries, nparts); le32enc(&hdr->hdr_entsz, sizeof(struct gpt_ent)); crc = crc32(tbl, nparts * sizeof(struct gpt_ent)); Modified: stable/11/usr.bin/mkimg/image.c ============================================================================== --- stable/11/usr.bin/mkimg/image.c Wed Feb 7 15:06:54 2018 (r328973) +++ stable/11/usr.bin/mkimg/image.c Wed Feb 7 15:32:31 2018 (r328974) @@ -28,9 +28,7 @@ __FBSDID("$FreeBSD$"); #include -#include #include -#include #include #include #include @@ -45,8 +43,22 @@ __FBSDID("$FreeBSD$"); #include "image.h" #include "mkimg.h" +#ifndef MAP_NOCORE +#define MAP_NOCORE 0 +#endif +#ifndef MAP_NOSYNC +#define MAP_NOSYNC 0 +#endif + +#ifndef SEEK_DATA +#define SEEK_DATA -1 +#endif +#ifndef SEEK_HOLE +#define SEEK_HOLE -1 +#endif + struct chunk { - STAILQ_ENTRY(chunk) ch_list; + TAILQ_ENTRY(chunk) ch_list; size_t ch_size; /* Size of chunk in bytes. */ lba_t ch_block; /* Block address in image. */ union { @@ -64,7 +76,7 @@ struct chunk { #define CH_TYPE_MEMORY 2 /* Memory-backed chunk */ }; -static STAILQ_HEAD(chunk_head, chunk) image_chunks; +static TAILQ_HEAD(chunk_head, chunk) image_chunks; static u_int image_nchunks; static char image_swap_file[PATH_MAX]; @@ -125,14 +137,14 @@ image_chunk_find(lba_t blk) struct chunk *ch; ch = (last != NULL && last->ch_block <= blk) - ? last : STAILQ_FIRST(&image_chunks); + ? last : TAILQ_FIRST(&image_chunks); while (ch != NULL) { if (ch->ch_block <= blk && (lba_t)(ch->ch_block + (ch->ch_size / secsz)) > blk) { last = ch; break; } - ch = STAILQ_NEXT(ch, ch_list); + ch = TAILQ_NEXT(ch, ch_list); } return (ch); } @@ -174,7 +186,7 @@ image_chunk_memory(struct chunk *ch, lba_t blk) ch->ch_size = (blk - ch->ch_block) * secsz; new->ch_block = blk; new->ch_size -= ch->ch_size; - STAILQ_INSERT_AFTER(&image_chunks, ch, new, ch_list); + TAILQ_INSERT_AFTER(&image_chunks, ch, new, ch_list); image_nchunks++; ch = new; } @@ -189,7 +201,7 @@ image_chunk_memory(struct chunk *ch, lba_t blk) ch->ch_size = secsz; new->ch_block++; new->ch_size -= secsz; - STAILQ_INSERT_AFTER(&image_chunks, ch, new, ch_list); + TAILQ_INSERT_AFTER(&image_chunks, ch, new, ch_list); image_nchunks++; } @@ -205,7 +217,7 @@ image_chunk_skipto(lba_t to) lba_t from; size_t sz; - ch = STAILQ_LAST(&image_chunks, chunk, ch_list); + ch = TAILQ_LAST(&image_chunks, chunk_head); from = (ch != NULL) ? ch->ch_block + (ch->ch_size / secsz) : 0LL; assert(from <= to); @@ -230,7 +242,7 @@ image_chunk_skipto(lba_t to) ch->ch_block = from; ch->ch_size = sz; ch->ch_type = CH_TYPE_ZEROES; - STAILQ_INSERT_TAIL(&image_chunks, ch, ch_list); + TAILQ_INSERT_TAIL(&image_chunks, ch, ch_list); image_nchunks++; return (0); } @@ -240,7 +252,7 @@ image_chunk_append(lba_t blk, size_t sz, off_t ofs, in { struct chunk *ch; - ch = STAILQ_LAST(&image_chunks, chunk, ch_list); + ch = TAILQ_LAST(&image_chunks, chunk_head); if (ch != NULL && ch->ch_type == CH_TYPE_FILE) { if (fd == ch->ch_u.file.fd && blk == (lba_t)(ch->ch_block + (ch->ch_size / secsz)) && @@ -261,7 +273,7 @@ image_chunk_append(lba_t blk, size_t sz, off_t ofs, in ch->ch_type = CH_TYPE_FILE; ch->ch_u.file.ofs = ofs; ch->ch_u.file.fd = fd; - STAILQ_INSERT_TAIL(&image_chunks, ch, ch_list); + TAILQ_INSERT_TAIL(&image_chunks, ch, ch_list); image_nchunks++; return (0); } @@ -456,8 +468,7 @@ image_copyin_mapped(lba_t blk, int fd, uint64_t *sizep * I don't know what this means or whether it * can happen at all... */ - error = EDOOFUS; - break; + assert(0); } } if (error) @@ -583,10 +594,13 @@ image_copyout_region(int fd, lba_t blk, lba_t size) size *= secsz; - while (size > 0) { + error = 0; + while (!error && size > 0) { ch = image_chunk_find(blk); - if (ch == NULL) - return (EINVAL); + if (ch == NULL) { + error = EINVAL; + break; + } ofs = (blk - ch->ch_block) * secsz; sz = ch->ch_size - ofs; sz = ((lba_t)sz < size) ? sz : (size_t)size; @@ -602,12 +616,12 @@ image_copyout_region(int fd, lba_t blk, lba_t size) error = image_copyout_memory(fd, sz, ch->ch_u.mem.ptr); break; default: - return (EDOOFUS); + assert(0); } size -= sz; blk += sz / secsz; } - return (0); + return (error); } int @@ -682,7 +696,7 @@ image_cleanup(void) { struct chunk *ch; - while ((ch = STAILQ_FIRST(&image_chunks)) != NULL) { + while ((ch = TAILQ_FIRST(&image_chunks)) != NULL) { switch (ch->ch_type) { case CH_TYPE_FILE: /* We may be closing the same file multiple times. */ @@ -695,7 +709,7 @@ image_cleanup(void) default: break; } - STAILQ_REMOVE_HEAD(&image_chunks, ch_list); + TAILQ_REMOVE(&image_chunks, ch, ch_list); free(ch); } if (image_swap_fd != -1) @@ -708,7 +722,7 @@ image_init(void) { const char *tmpdir; - STAILQ_INIT(&image_chunks); + TAILQ_INIT(&image_chunks); image_nchunks = 0; image_swap_size = 0; Modified: stable/11/usr.bin/mkimg/mbr.c ============================================================================== --- stable/11/usr.bin/mkimg/mbr.c Wed Feb 7 15:06:54 2018 (r328973) +++ stable/11/usr.bin/mkimg/mbr.c Wed Feb 7 15:32:31 2018 (r328974) @@ -27,35 +27,23 @@ #include __FBSDID("$FreeBSD$"); -#include -#include -#include #include +#include #include #include #include +#include + +#include "endian.h" #include "image.h" #include "mkimg.h" #include "scheme.h" -#ifndef DOSPTYP_FAT16B -#define DOSPTYP_FAT16B 0x06 -#endif -#ifndef DOSPTYP_FAT32 -#define DOSPTYP_FAT32 0x0b -#endif -#ifndef DOSPTYP_PPCBOOT -#define DOSPTYP_PPCBOOT 0x41 -#endif -#ifndef DOSPTYP_EFI -#define DOSPTYP_EFI 0xef -#endif - static struct mkimg_alias mbr_aliases[] = { { ALIAS_EBR, ALIAS_INT2TYPE(DOSPTYP_EXT) }, { ALIAS_EFI, ALIAS_INT2TYPE(DOSPTYP_EFI) }, - { ALIAS_FAT16B, ALIAS_INT2TYPE(DOSPTYP_FAT16B) }, + { ALIAS_FAT16B, ALIAS_INT2TYPE(DOSPTYP_FAT16) }, { ALIAS_FAT32, ALIAS_INT2TYPE(DOSPTYP_FAT32) }, { ALIAS_FREEBSD, ALIAS_INT2TYPE(DOSPTYP_386BSD) }, { ALIAS_NTFS, ALIAS_INT2TYPE(DOSPTYP_NTFS) }, @@ -101,10 +89,15 @@ mbr_write(lba_t imgsz __unused, void *bootcode) memset(mbr, 0, secsz); le16enc(mbr + DOSMAGICOFFSET, DOSMAGIC); dpbase = (void *)(mbr + DOSPARTOFF); - STAILQ_FOREACH(part, &partlist, link) { + TAILQ_FOREACH(part, &partlist, link) { size = round_track(part->size); dp = dpbase + part->index; - dp->dp_flag = (part->index == 0 && bootcode != NULL) ? 0x80 : 0; + if (active_partition != 0) + dp->dp_flag = + (part->index + 1 == active_partition) ? 0x80 : 0; + else + dp->dp_flag = + (part->index == 0 && bootcode != NULL) ? 0x80 : 0; mbr_chs(&dp->dp_scyl, &dp->dp_shd, &dp->dp_ssect, part->block); dp->dp_typ = ALIAS_TYPE2INT(part->type); Modified: stable/11/usr.bin/mkimg/mkimg.1 ============================================================================== --- stable/11/usr.bin/mkimg/mkimg.1 Wed Feb 7 15:06:54 2018 (r328973) +++ stable/11/usr.bin/mkimg/mkimg.1 Wed Feb 7 15:32:31 2018 (r328974) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 7, 2015 +.Dd April 26, 2017 .Dt MKIMG 1 .Os .Sh NAME @@ -37,9 +37,12 @@ .Op Fl S Ar secsz .Op Fl T Ar tracksz .Op Fl b Ar bootcode -.Op Fl c Ar capacity +.Op Fl c Ar min_capacity +.Op Fl C Ar max_capacity +.Op Fl -capacity Ar capacity .Op Fl f Ar format .Op Fl o Ar outfile +.Op Fl a Ar active .Op Fl v .Op Fl y .Op Fl s Ar scheme Op Fl p Ar partition ... @@ -119,11 +122,23 @@ An empty partition table can be written to the disk wh partitioning scheme with the .Fl s option, but without specifying any partitions. -When the size required to for all the partitions is larger than the +When the size required for all the partitions is larger than the given capacity, then the disk image will be larger than the capacity given. .Pp The +.Fl C +option specifies a maximum capacity for the disk image. +If the combined sizes of the given partitions exceed the size given with +.Fl C , +image creation fails. +.Pp +The +.Fl -capacity +option is a shorthand to specify the minimum and maximum capacity at the +same time. +.Pp +The .Fl v option increases the level of output that the .Nm @@ -138,6 +153,26 @@ utility will generate predictable values for Universal (UUIDs) and time stamps so that consecutive runs of the .Nm utility will create images that are identical. +.Pp +The +.Ar active +option marks a partition as active, if the partitioning +scheme supports it. +Currently, only the +.Ar mbr +scheme supports this concept. +By default, +.Nm +will only mark the first partition as active when boot code is +specified. +Use the +.Ar active +option to override the active partition. +The number specified corresponds to the number after the 's' in the +partition's +.Xr geom 8 +name. +No partitions are marked active when the value is 0. .Pp A set of long options exist to query about the .Nm Modified: stable/11/usr.bin/mkimg/mkimg.c ============================================================================== --- stable/11/usr.bin/mkimg/mkimg.c Wed Feb 7 15:06:54 2018 (r328973) +++ stable/11/usr.bin/mkimg/mkimg.c Wed Feb 7 15:32:31 2018 (r328974) @@ -27,17 +27,15 @@ #include __FBSDID("$FreeBSD$"); -#include -#include +#include #include -#include -#include #include #include #include #include #include #include +#include #include #include #include @@ -49,20 +47,23 @@ __FBSDID("$FreeBSD$"); #include "mkimg.h" #include "scheme.h" -#define LONGOPT_FORMATS 0x01000001 -#define LONGOPT_SCHEMES 0x01000002 -#define LONGOPT_VERSION 0x01000003 +#define LONGOPT_FORMATS 0x01000001 +#define LONGOPT_SCHEMES 0x01000002 +#define LONGOPT_VERSION 0x01000003 +#define LONGOPT_CAPACITY 0x01000004 static struct option longopts[] = { { "formats", no_argument, NULL, LONGOPT_FORMATS }, { "schemes", no_argument, NULL, LONGOPT_SCHEMES }, { "version", no_argument, NULL, LONGOPT_VERSION }, + { "capacity", required_argument, NULL, LONGOPT_CAPACITY }, { NULL, 0, NULL, 0 } }; -static uint64_t capacity; +static uint64_t min_capacity = 0; +static uint64_t max_capacity = 0; -struct partlisthead partlist = STAILQ_HEAD_INITIALIZER(partlist); +struct partlisthead partlist = TAILQ_HEAD_INITIALIZER(partlist); u_int nparts = 0; u_int unit_testing; @@ -73,24 +74,25 @@ u_int nheads = 1; u_int nsecs = 1; u_int secsz = 512; u_int blksz = 0; +uint32_t active_partition = 0; static void print_formats(int usage) { - struct mkimg_format *f, **f_iter; + struct mkimg_format *f; const char *sep; if (usage) { fprintf(stderr, " formats:\n"); - SET_FOREACH(f_iter, formats) { - f = *f_iter; + f = NULL; + while ((f = format_iterate(f)) != NULL) { fprintf(stderr, "\t%s\t- %s\n", f->name, f->description); } } else { sep = ""; - SET_FOREACH(f_iter, formats) { - f = *f_iter; + f = NULL; + while ((f = format_iterate(f)) != NULL) { printf("%s%s", sep, f->name); sep = " "; } @@ -101,20 +103,20 @@ print_formats(int usage) static void print_schemes(int usage) { - struct mkimg_scheme *s, **s_iter; + struct mkimg_scheme *s; const char *sep; if (usage) { fprintf(stderr, " schemes:\n"); - SET_FOREACH(s_iter, schemes) { - s = *s_iter; + s = NULL; + while ((s = scheme_iterate(s)) != NULL) { fprintf(stderr, "\t%s\t- %s\n", s->name, s->description); } } else { sep = ""; - SET_FOREACH(s_iter, schemes) { - s = *s_iter; + s = NULL; + while ((s = scheme_iterate(s)) != NULL) { printf("%s%s", sep, s->name); sep = " "; } @@ -148,8 +150,10 @@ usage(const char *why) fprintf(stderr, "\t--schemes\t- list partition schemes\n"); fprintf(stderr, "\t--version\t- show version information\n"); fputc('\n', stderr); + fprintf(stderr, "\t-a \t- mark num'th partion as active\n"); fprintf(stderr, "\t-b \t- file containing boot code\n"); - fprintf(stderr, "\t-c \t- capacity (in bytes) of the disk\n"); + fprintf(stderr, "\t-c \t- minimum capacity (in bytes) of the disk\n"); + fprintf(stderr, "\t-C \t- maximum capacity (in bytes) of the disk\n"); fprintf(stderr, "\t-f \n"); fprintf(stderr, "\t-o \t- file to write image into\n"); fprintf(stderr, "\t-p \n"); @@ -302,7 +306,7 @@ parse_part(const char *spec) } part->index = nparts; - STAILQ_INSERT_TAIL(&partlist, part, link); + TAILQ_INSERT_TAIL(&partlist, part, link); nparts++; return (0); @@ -376,31 +380,20 @@ mkimg_chs(lba_t lba, u_int maxcyl, u_int *cylp, u_int *secp = sec; } -void -mkimg_uuid(struct uuid *uuid) -{ - static uint8_t gen[sizeof(struct uuid)]; - u_int i; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Feb 7 16:28:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EC28F12BEB; Wed, 7 Feb 2018 16:28:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3DBBF70EAA; Wed, 7 Feb 2018 16:28:27 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 340DF13C4; Wed, 7 Feb 2018 16:28: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 w17GSR58082979; Wed, 7 Feb 2018 16:28:27 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17GSQsD082977; Wed, 7 Feb 2018 16:28:26 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802071628.w17GSQsD082977@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 7 Feb 2018 16:28:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328975 - head X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 328975 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 16:28:27 -0000 Author: imp Date: Wed Feb 7 16:28:26 2018 New Revision: 328975 URL: https://svnweb.freebsd.org/changeset/base/328975 Log: Add a note about why we have the conditional before including bsd.compiler.mk. It's so fmake from older 9.x systems still works (still a supported build config, and having the note here will let us know when we can cull it more easily). Also pull in a related change from include to sinclude from arichardson@'s cross building work, as well as it's companion in Makefile.inc1 with a note about why we do the odd thing there. Submitted by: archardson Differential Revision: https://reviews.freebsd.org/D14241 Modified: head/Makefile head/Makefile.inc1 Modified: head/Makefile ============================================================================== --- head/Makefile Wed Feb 7 15:32:31 2018 (r328974) +++ head/Makefile Wed Feb 7 16:28:26 2018 (r328975) @@ -106,9 +106,13 @@ # # This is included so CC is set to ccache for -V, and COMPILER_TYPE/VERSION -# can be cached for sub-makes. +# can be cached for sub-makes. We can't do this while still running on the +# old fmake from FreeBSD 9.x or older, so avoid including it then to avoid +# heartburn upgrading from older systems. The need for CC is done with new +# make later in the build, and caching COMPILER_TYPE/VERSION is only an +# optimization. Also sinclude it to be friendlier to foreign OS hosted builds. .if ${MAKE_VERSION} >= 20140620 && defined(.PARSEDIR) -.include +.sinclude .endif # Note: we use this awkward construct to be compatible with FreeBSD's Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Feb 7 15:32:31 2018 (r328974) +++ head/Makefile.inc1 Wed Feb 7 16:28:26 2018 (r328975) @@ -85,8 +85,10 @@ MK_GCC_BOOTSTRAP= no .-include "${OBJTOP}/compiler-metadata.mk" .endif -# Pull in COMPILER_TYPE and COMPILER_FREEBSD_VERSION early. -.include +# Pull in COMPILER_TYPE and COMPILER_FREEBSD_VERSION early. Pull it from the +# tree to be friendlier to foreign OS builds. It's safe to do so unconditionally +# here since we will always have the right make, unlike in src/Makefile +.include "share/mk/bsd.compiler.mk" .include "share/mk/src.opts.mk" # Check if there is a local compiler that can satisfy as an external compiler. From owner-svn-src-all@freebsd.org Wed Feb 7 16:45:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64ED5F13FB3; Wed, 7 Feb 2018 16:45:40 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 167C872000; Wed, 7 Feb 2018 16:45:40 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0FFD51708; Wed, 7 Feb 2018 16:45:40 +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 w17GjeoW093423; Wed, 7 Feb 2018 16:45:40 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17Gjd2F093411; Wed, 7 Feb 2018 16:45:39 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201802071645.w17Gjd2F093411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 7 Feb 2018 16:45:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328976 - in stable/11/usr.bin/mkimg: . tests X-SVN-Group: stable-11 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in stable/11/usr.bin/mkimg: . tests X-SVN-Commit-Revision: 328976 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 16:45:40 -0000 Author: manu Date: Wed Feb 7 16:45:38 2018 New Revision: 328976 URL: https://svnweb.freebsd.org/changeset/base/328976 Log: Revert r328974, r307387 was not supposed to be part of it. Deleted: stable/11/usr.bin/mkimg/endian.h stable/11/usr.bin/mkimg/uuid.c Modified: stable/11/usr.bin/mkimg/Makefile stable/11/usr.bin/mkimg/apm.c stable/11/usr.bin/mkimg/bsd.c stable/11/usr.bin/mkimg/ebr.c stable/11/usr.bin/mkimg/format.c stable/11/usr.bin/mkimg/format.h stable/11/usr.bin/mkimg/gpt.c stable/11/usr.bin/mkimg/image.c stable/11/usr.bin/mkimg/mbr.c stable/11/usr.bin/mkimg/mkimg.1 stable/11/usr.bin/mkimg/mkimg.c stable/11/usr.bin/mkimg/mkimg.h stable/11/usr.bin/mkimg/pc98.c stable/11/usr.bin/mkimg/qcow.c stable/11/usr.bin/mkimg/raw.c stable/11/usr.bin/mkimg/scheme.c stable/11/usr.bin/mkimg/scheme.h stable/11/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow.gz.uu stable/11/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow2.gz.uu stable/11/usr.bin/mkimg/tests/img-1x1-4096-gpt.raw.gz.uu stable/11/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhd.gz.uu stable/11/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhdf.gz.uu stable/11/usr.bin/mkimg/tests/img-1x1-4096-gpt.vmdk.gz.uu stable/11/usr.bin/mkimg/tests/img-1x1-512-gpt.qcow.gz.uu stable/11/usr.bin/mkimg/tests/img-1x1-512-gpt.qcow2.gz.uu stable/11/usr.bin/mkimg/tests/img-1x1-512-gpt.raw.gz.uu stable/11/usr.bin/mkimg/tests/img-1x1-512-gpt.vhd.gz.uu stable/11/usr.bin/mkimg/tests/img-1x1-512-gpt.vhdf.gz.uu stable/11/usr.bin/mkimg/tests/img-1x1-512-gpt.vmdk.gz.uu stable/11/usr.bin/mkimg/tests/img-63x255-4096-gpt.qcow.gz.uu stable/11/usr.bin/mkimg/tests/img-63x255-4096-gpt.qcow2.gz.uu stable/11/usr.bin/mkimg/tests/img-63x255-4096-gpt.raw.gz.uu stable/11/usr.bin/mkimg/tests/img-63x255-4096-gpt.vhd.gz.uu stable/11/usr.bin/mkimg/tests/img-63x255-4096-gpt.vhdf.gz.uu stable/11/usr.bin/mkimg/tests/img-63x255-4096-gpt.vmdk.gz.uu stable/11/usr.bin/mkimg/tests/img-63x255-512-gpt.qcow.gz.uu stable/11/usr.bin/mkimg/tests/img-63x255-512-gpt.qcow2.gz.uu stable/11/usr.bin/mkimg/tests/img-63x255-512-gpt.raw.gz.uu stable/11/usr.bin/mkimg/tests/img-63x255-512-gpt.vhd.gz.uu stable/11/usr.bin/mkimg/tests/img-63x255-512-gpt.vhdf.gz.uu stable/11/usr.bin/mkimg/tests/img-63x255-512-gpt.vmdk.gz.uu stable/11/usr.bin/mkimg/vhd.c stable/11/usr.bin/mkimg/vmdk.c stable/11/usr.bin/mkimg/vtoc8.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/mkimg/Makefile ============================================================================== --- stable/11/usr.bin/mkimg/Makefile Wed Feb 7 16:28:26 2018 (r328975) +++ stable/11/usr.bin/mkimg/Makefile Wed Feb 7 16:45:38 2018 (r328976) @@ -3,15 +3,14 @@ .include PROG= mkimg -SRCS= format.c image.c mkimg.c scheme.c uuid.c +SRCS= format.c image.c mkimg.c scheme.c MAN= mkimg.1 -MKIMG_VERSION=20161016 +MKIMG_VERSION=20151211 mkimg.o: Makefile CFLAGS+=-DMKIMG_VERSION=${MKIMG_VERSION} CFLAGS+=-DSPARSE_WRITE -CFLAGS+=-I${SRCTOP}/sys/sys/disk # List of formats to support SRCS+= \ Modified: stable/11/usr.bin/mkimg/apm.c ============================================================================== --- stable/11/usr.bin/mkimg/apm.c Wed Feb 7 16:28:26 2018 (r328975) +++ stable/11/usr.bin/mkimg/apm.c Wed Feb 7 16:45:38 2018 (r328976) @@ -27,19 +27,25 @@ #include __FBSDID("$FreeBSD$"); +#include +#include +#include #include -#include #include #include #include -#include - -#include "endian.h" #include "image.h" #include "mkimg.h" #include "scheme.h" +#ifndef APM_ENT_TYPE_APPLE_BOOT +#define APM_ENT_TYPE_APPLE_BOOT "Apple_Bootstrap" +#endif +#ifndef APM_ENT_TYPE_FREEBSD_NANDFS +#define APM_ENT_TYPE_FREEBSD_NANDFS "FreeBSD-nandfs" +#endif + static struct mkimg_alias apm_aliases[] = { { ALIAS_FREEBSD, ALIAS_PTR2TYPE(APM_ENT_TYPE_FREEBSD) }, { ALIAS_FREEBSD_BOOT, ALIAS_PTR2TYPE(APM_ENT_TYPE_APPLE_BOOT) }, @@ -85,7 +91,7 @@ apm_write(lba_t imgsz, void *bootcode __unused) strncpy(ent->ent_type, APM_ENT_TYPE_SELF, sizeof(ent->ent_type)); strncpy(ent->ent_name, "Apple", sizeof(ent->ent_name)); - TAILQ_FOREACH(part, &partlist, link) { + STAILQ_FOREACH(part, &partlist, link) { ent = (void *)(buf + (part->index + 2) * secsz); be16enc(&ent->ent_sig, APM_ENT_SIG); be32enc(&ent->ent_pmblkcnt, nparts + 1); Modified: stable/11/usr.bin/mkimg/bsd.c ============================================================================== --- stable/11/usr.bin/mkimg/bsd.c Wed Feb 7 16:28:26 2018 (r328975) +++ stable/11/usr.bin/mkimg/bsd.c Wed Feb 7 16:45:38 2018 (r328976) @@ -27,19 +27,22 @@ #include __FBSDID("$FreeBSD$"); +#include +#include +#include #include -#include #include #include #include -#include - -#include "endian.h" #include "image.h" #include "mkimg.h" #include "scheme.h" +#ifndef FS_NANDFS +#define FS_NANDFS 30 +#endif + static struct mkimg_alias bsd_aliases[] = { { ALIAS_FREEBSD_NANDFS, ALIAS_INT2TYPE(FS_NANDFS) }, { ALIAS_FREEBSD_SWAP, ALIAS_INT2TYPE(FS_SWAP) }, @@ -54,7 +57,7 @@ bsd_metadata(u_int where, lba_t blk) { if (where == SCHEME_META_IMG_START) - blk += BSD_BOOTBLOCK_SIZE / secsz; + blk += BBSIZE / secsz; else if (where == SCHEME_META_IMG_END) blk = round_cylinder(blk); else @@ -72,21 +75,21 @@ bsd_write(lba_t imgsz, void *bootcode) int bsdparts, error, n; uint16_t checksum; - buf = malloc(BSD_BOOTBLOCK_SIZE); + buf = malloc(BBSIZE); if (buf == NULL) return (ENOMEM); if (bootcode != NULL) { - memcpy(buf, bootcode, BSD_BOOTBLOCK_SIZE); + memcpy(buf, bootcode, BBSIZE); memset(buf + secsz, 0, sizeof(struct disklabel)); } else - memset(buf, 0, BSD_BOOTBLOCK_SIZE); + memset(buf, 0, BBSIZE); bsdparts = nparts + 1; /* Account for c partition */ - if (bsdparts < BSD_NPARTS_MIN) - bsdparts = BSD_NPARTS_MIN; + if (bsdparts < MAXPARTITIONS) + bsdparts = MAXPARTITIONS; d = (void *)(buf + secsz); - le32enc(&d->d_magic, BSD_MAGIC); + le32enc(&d->d_magic, DISKMAGIC); le32enc(&d->d_secsize, secsz); le32enc(&d->d_nsectors, nsecs); le32enc(&d->d_ntracks, nheads); @@ -94,14 +97,14 @@ bsd_write(lba_t imgsz, void *bootcode) le32enc(&d->d_secpercyl, nsecs * nheads); le32enc(&d->d_secperunit, imgsz); le16enc(&d->d_rpm, 3600); - le32enc(&d->d_magic2, BSD_MAGIC); + le32enc(&d->d_magic2, DISKMAGIC); le16enc(&d->d_npartitions, bsdparts); - le32enc(&d->d_bbsize, BSD_BOOTBLOCK_SIZE); + le32enc(&d->d_bbsize, BBSIZE); - dp = &d->d_partitions[BSD_PART_RAW]; + dp = &d->d_partitions[RAW_PART]; le32enc(&dp->p_size, imgsz); - TAILQ_FOREACH(part, &partlist, link) { - n = part->index + ((part->index >= BSD_PART_RAW) ? 1 : 0); + STAILQ_FOREACH(part, &partlist, link) { + n = part->index + ((part->index >= RAW_PART) ? 1 : 0); dp = &d->d_partitions[n]; le32enc(&dp->p_size, part->size); le32enc(&dp->p_offset, part->block); @@ -117,7 +120,7 @@ bsd_write(lba_t imgsz, void *bootcode) checksum ^= le16dec(p); le16enc(&d->d_checksum, checksum); - error = image_write(0, buf, BSD_BOOTBLOCK_SIZE / secsz); + error = image_write(0, buf, BBSIZE / secsz); free(buf); return (error); } @@ -128,8 +131,8 @@ static struct mkimg_scheme bsd_scheme = { .aliases = bsd_aliases, .metadata = bsd_metadata, .write = bsd_write, - .nparts = BSD_NPARTS_MAX - 1, - .bootcode = BSD_BOOTBLOCK_SIZE, + .nparts = 19, + .bootcode = BBSIZE, .maxsecsz = 512 }; Modified: stable/11/usr.bin/mkimg/ebr.c ============================================================================== --- stable/11/usr.bin/mkimg/ebr.c Wed Feb 7 16:28:26 2018 (r328975) +++ stable/11/usr.bin/mkimg/ebr.c Wed Feb 7 16:45:38 2018 (r328976) @@ -27,21 +27,27 @@ #include __FBSDID("$FreeBSD$"); +#include +#include +#include #include -#include #include #include #include -#include - -#include "endian.h" #include "image.h" #include "mkimg.h" #include "scheme.h" +#ifndef DOSPTYP_FAT16B +#define DOSPTYP_FAT16B 0x06 +#endif +#ifndef DOSPTYP_FAT32 +#define DOSPTYP_FAT32 0x0b +#endif + static struct mkimg_alias ebr_aliases[] = { - { ALIAS_FAT16B, ALIAS_INT2TYPE(DOSPTYP_FAT16) }, + { ALIAS_FAT16B, ALIAS_INT2TYPE(DOSPTYP_FAT16B) }, { ALIAS_FAT32, ALIAS_INT2TYPE(DOSPTYP_FAT32) }, { ALIAS_FREEBSD, ALIAS_INT2TYPE(DOSPTYP_386BSD) }, { ALIAS_NONE, 0 } @@ -82,7 +88,7 @@ ebr_write(lba_t imgsz __unused, void *bootcode __unuse le16enc(ebr + DOSMAGICOFFSET, DOSMAGIC); error = 0; - TAILQ_FOREACH(part, &partlist, link) { + STAILQ_FOREACH_SAFE(part, &partlist, link, next) { block = part->block - nsecs; size = round_track(part->size); dp = (void *)(ebr + DOSPARTOFF); @@ -94,7 +100,6 @@ ebr_write(lba_t imgsz __unused, void *bootcode __unuse le32enc(&dp->dp_size, size); /* Add link entry */ - next = TAILQ_NEXT(part, link); if (next != NULL) { size = round_track(next->size); dp++; Modified: stable/11/usr.bin/mkimg/format.c ============================================================================== --- stable/11/usr.bin/mkimg/format.c Wed Feb 7 16:28:26 2018 (r328975) +++ stable/11/usr.bin/mkimg/format.c Wed Feb 7 16:45:38 2018 (r328976) @@ -27,6 +27,9 @@ #include __FBSDID("$FreeBSD$"); +#include +#include +#include #include #include #include @@ -39,24 +42,8 @@ __FBSDID("$FreeBSD$"); #include "format.h" #include "mkimg.h" -static struct mkimg_format *first; static struct mkimg_format *format; -struct mkimg_format * -format_iterate(struct mkimg_format *f) -{ - - return ((f == NULL) ? first : f->next); -} - -void -format_register(struct mkimg_format *f) -{ - - f->next = first; - first = f; -} - int format_resize(lba_t end) { @@ -69,10 +56,10 @@ format_resize(lba_t end) int format_select(const char *spec) { - struct mkimg_format *f; + struct mkimg_format *f, **iter; - f = NULL; - while ((f = format_iterate(f)) != NULL) { + SET_FOREACH(iter, formats) { + f = *iter; if (strcasecmp(spec, f->name) == 0) { format = f; return (0); Modified: stable/11/usr.bin/mkimg/format.h ============================================================================== --- stable/11/usr.bin/mkimg/format.h Wed Feb 7 16:28:26 2018 (r328975) +++ stable/11/usr.bin/mkimg/format.h Wed Feb 7 16:45:38 2018 (r328976) @@ -29,24 +29,21 @@ #ifndef _MKIMG_FORMAT_H_ #define _MKIMG_FORMAT_H_ +#include + struct mkimg_format { - struct mkimg_format *next; const char *name; const char *description; int (*resize)(lba_t); int (*write)(int); }; -#define FORMAT_DEFINE(nm) \ -static void format_register_##nm(void) __attribute__((constructor)); \ -static void format_register_##nm(void) { format_register(&nm); } +SET_DECLARE(formats, struct mkimg_format); +#define FORMAT_DEFINE(nm) DATA_SET(formats, nm) -struct mkimg_format *format_iterate(struct mkimg_format *); -void format_register(struct mkimg_format *); +int format_resize(lba_t); int format_select(const char *); struct mkimg_format *format_selected(void); - -int format_resize(lba_t); int format_write(int); #endif /* _MKIMG_FORMAT_H_ */ Modified: stable/11/usr.bin/mkimg/gpt.c ============================================================================== --- stable/11/usr.bin/mkimg/gpt.c Wed Feb 7 16:28:26 2018 (r328975) +++ stable/11/usr.bin/mkimg/gpt.c Wed Feb 7 16:45:38 2018 (r328976) @@ -27,32 +27,38 @@ #include __FBSDID("$FreeBSD$"); +#include +#include +#include #include +#include #include #include #include #include #include +#include -#include -#include - -#include "endian.h" #include "image.h" #include "mkimg.h" #include "scheme.h" -static mkimg_uuid_t gpt_uuid_efi = GPT_ENT_TYPE_EFI; -static mkimg_uuid_t gpt_uuid_freebsd = GPT_ENT_TYPE_FREEBSD; -static mkimg_uuid_t gpt_uuid_freebsd_boot = GPT_ENT_TYPE_FREEBSD_BOOT; -static mkimg_uuid_t gpt_uuid_freebsd_nandfs = GPT_ENT_TYPE_FREEBSD_NANDFS; -static mkimg_uuid_t gpt_uuid_freebsd_swap = GPT_ENT_TYPE_FREEBSD_SWAP; -static mkimg_uuid_t gpt_uuid_freebsd_ufs = GPT_ENT_TYPE_FREEBSD_UFS; -static mkimg_uuid_t gpt_uuid_freebsd_vinum = GPT_ENT_TYPE_FREEBSD_VINUM; -static mkimg_uuid_t gpt_uuid_freebsd_zfs = GPT_ENT_TYPE_FREEBSD_ZFS; -static mkimg_uuid_t gpt_uuid_mbr = GPT_ENT_TYPE_MBR; -static mkimg_uuid_t gpt_uuid_ms_basic_data = GPT_ENT_TYPE_MS_BASIC_DATA; +#ifndef GPT_ENT_TYPE_FREEBSD_NANDFS +#define GPT_ENT_TYPE_FREEBSD_NANDFS \ + {0x74ba7dd9,0xa689,0x11e1,0xbd,0x04,{0x00,0xe0,0x81,0x28,0x6a,0xcf}} +#endif +static uuid_t gpt_uuid_efi = GPT_ENT_TYPE_EFI; +static uuid_t gpt_uuid_freebsd = GPT_ENT_TYPE_FREEBSD; +static uuid_t gpt_uuid_freebsd_boot = GPT_ENT_TYPE_FREEBSD_BOOT; +static uuid_t gpt_uuid_freebsd_nandfs = GPT_ENT_TYPE_FREEBSD_NANDFS; +static uuid_t gpt_uuid_freebsd_swap = GPT_ENT_TYPE_FREEBSD_SWAP; +static uuid_t gpt_uuid_freebsd_ufs = GPT_ENT_TYPE_FREEBSD_UFS; +static uuid_t gpt_uuid_freebsd_vinum = GPT_ENT_TYPE_FREEBSD_VINUM; +static uuid_t gpt_uuid_freebsd_zfs = GPT_ENT_TYPE_FREEBSD_ZFS; +static uuid_t gpt_uuid_mbr = GPT_ENT_TYPE_MBR; +static uuid_t gpt_uuid_ms_basic_data = GPT_ENT_TYPE_MS_BASIC_DATA; + static struct mkimg_alias gpt_aliases[] = { { ALIAS_EFI, ALIAS_PTR2TYPE(&gpt_uuid_efi) }, { ALIAS_FREEBSD, ALIAS_PTR2TYPE(&gpt_uuid_freebsd) }, @@ -125,6 +131,21 @@ crc32(const void *buf, size_t sz) return (crc ^ ~0U); } +static void +gpt_uuid_enc(void *buf, const uuid_t *uuid) +{ + uint8_t *p = buf; + int i; + + le32enc(p, uuid->time_low); + le16enc(p + 4, uuid->time_mid); + le16enc(p + 6, uuid->time_hi_and_version); + p[8] = uuid->clock_seq_hi_and_reserved; + p[9] = uuid->clock_seq_low; + for (i = 0; i < _UUID_NODE_LEN; i++) + p[10 + i] = uuid->node[i]; +} + static u_int gpt_tblsz(void) { @@ -152,7 +173,7 @@ gpt_write_pmbr(lba_t blks, void *bootcode) uint32_t secs; int error; - secs = (blks > UINT32_MAX) ? UINT32_MAX : (uint32_t)blks - 1; + secs = (blks > UINT32_MAX) ? UINT32_MAX : (uint32_t)blks; pmbr = malloc(secsz); if (pmbr == NULL) @@ -178,7 +199,7 @@ gpt_write_pmbr(lba_t blks, void *bootcode) static struct gpt_ent * gpt_mktbl(u_int tblsz) { - mkimg_uuid_t uuid; + uuid_t uuid; struct gpt_ent *tbl, *ent; struct part *part; int c, idx; @@ -187,11 +208,11 @@ gpt_mktbl(u_int tblsz) if (tbl == NULL) return (NULL); - TAILQ_FOREACH(part, &partlist, link) { + STAILQ_FOREACH(part, &partlist, link) { ent = tbl + part->index; - mkimg_uuid_enc(&ent->ent_type, ALIAS_TYPE2PTR(part->type)); + gpt_uuid_enc(&ent->ent_type, ALIAS_TYPE2PTR(part->type)); mkimg_uuid(&uuid); - mkimg_uuid_enc(&ent->ent_uuid, &uuid); + gpt_uuid_enc(&ent->ent_uuid, &uuid); le64enc(&ent->ent_lba_start, part->block); le64enc(&ent->ent_lba_end, part->block + part->size - 1); if (part->label != NULL) { @@ -222,7 +243,7 @@ gpt_write_hdr(struct gpt_hdr *hdr, uint64_t self, uint static int gpt_write(lba_t imgsz, void *bootcode) { - mkimg_uuid_t uuid; + uuid_t uuid; struct gpt_ent *tbl; struct gpt_hdr *hdr; uint32_t crc; @@ -259,7 +280,7 @@ gpt_write(lba_t imgsz, void *bootcode) le64enc(&hdr->hdr_lba_start, 2 + tblsz); le64enc(&hdr->hdr_lba_end, imgsz - tblsz - 2); mkimg_uuid(&uuid); - mkimg_uuid_enc(&hdr->hdr_uuid, &uuid); + gpt_uuid_enc(&hdr->hdr_uuid, &uuid); le32enc(&hdr->hdr_entries, nparts); le32enc(&hdr->hdr_entsz, sizeof(struct gpt_ent)); crc = crc32(tbl, nparts * sizeof(struct gpt_ent)); Modified: stable/11/usr.bin/mkimg/image.c ============================================================================== --- stable/11/usr.bin/mkimg/image.c Wed Feb 7 16:28:26 2018 (r328975) +++ stable/11/usr.bin/mkimg/image.c Wed Feb 7 16:45:38 2018 (r328976) @@ -28,7 +28,9 @@ __FBSDID("$FreeBSD$"); #include +#include #include +#include #include #include #include @@ -43,22 +45,8 @@ __FBSDID("$FreeBSD$"); #include "image.h" #include "mkimg.h" -#ifndef MAP_NOCORE -#define MAP_NOCORE 0 -#endif -#ifndef MAP_NOSYNC -#define MAP_NOSYNC 0 -#endif - -#ifndef SEEK_DATA -#define SEEK_DATA -1 -#endif -#ifndef SEEK_HOLE -#define SEEK_HOLE -1 -#endif - struct chunk { - TAILQ_ENTRY(chunk) ch_list; + STAILQ_ENTRY(chunk) ch_list; size_t ch_size; /* Size of chunk in bytes. */ lba_t ch_block; /* Block address in image. */ union { @@ -76,7 +64,7 @@ struct chunk { #define CH_TYPE_MEMORY 2 /* Memory-backed chunk */ }; -static TAILQ_HEAD(chunk_head, chunk) image_chunks; +static STAILQ_HEAD(chunk_head, chunk) image_chunks; static u_int image_nchunks; static char image_swap_file[PATH_MAX]; @@ -137,14 +125,14 @@ image_chunk_find(lba_t blk) struct chunk *ch; ch = (last != NULL && last->ch_block <= blk) - ? last : TAILQ_FIRST(&image_chunks); + ? last : STAILQ_FIRST(&image_chunks); while (ch != NULL) { if (ch->ch_block <= blk && (lba_t)(ch->ch_block + (ch->ch_size / secsz)) > blk) { last = ch; break; } - ch = TAILQ_NEXT(ch, ch_list); + ch = STAILQ_NEXT(ch, ch_list); } return (ch); } @@ -186,7 +174,7 @@ image_chunk_memory(struct chunk *ch, lba_t blk) ch->ch_size = (blk - ch->ch_block) * secsz; new->ch_block = blk; new->ch_size -= ch->ch_size; - TAILQ_INSERT_AFTER(&image_chunks, ch, new, ch_list); + STAILQ_INSERT_AFTER(&image_chunks, ch, new, ch_list); image_nchunks++; ch = new; } @@ -201,7 +189,7 @@ image_chunk_memory(struct chunk *ch, lba_t blk) ch->ch_size = secsz; new->ch_block++; new->ch_size -= secsz; - TAILQ_INSERT_AFTER(&image_chunks, ch, new, ch_list); + STAILQ_INSERT_AFTER(&image_chunks, ch, new, ch_list); image_nchunks++; } @@ -217,7 +205,7 @@ image_chunk_skipto(lba_t to) lba_t from; size_t sz; - ch = TAILQ_LAST(&image_chunks, chunk_head); + ch = STAILQ_LAST(&image_chunks, chunk, ch_list); from = (ch != NULL) ? ch->ch_block + (ch->ch_size / secsz) : 0LL; assert(from <= to); @@ -242,7 +230,7 @@ image_chunk_skipto(lba_t to) ch->ch_block = from; ch->ch_size = sz; ch->ch_type = CH_TYPE_ZEROES; - TAILQ_INSERT_TAIL(&image_chunks, ch, ch_list); + STAILQ_INSERT_TAIL(&image_chunks, ch, ch_list); image_nchunks++; return (0); } @@ -252,7 +240,7 @@ image_chunk_append(lba_t blk, size_t sz, off_t ofs, in { struct chunk *ch; - ch = TAILQ_LAST(&image_chunks, chunk_head); + ch = STAILQ_LAST(&image_chunks, chunk, ch_list); if (ch != NULL && ch->ch_type == CH_TYPE_FILE) { if (fd == ch->ch_u.file.fd && blk == (lba_t)(ch->ch_block + (ch->ch_size / secsz)) && @@ -273,7 +261,7 @@ image_chunk_append(lba_t blk, size_t sz, off_t ofs, in ch->ch_type = CH_TYPE_FILE; ch->ch_u.file.ofs = ofs; ch->ch_u.file.fd = fd; - TAILQ_INSERT_TAIL(&image_chunks, ch, ch_list); + STAILQ_INSERT_TAIL(&image_chunks, ch, ch_list); image_nchunks++; return (0); } @@ -468,7 +456,8 @@ image_copyin_mapped(lba_t blk, int fd, uint64_t *sizep * I don't know what this means or whether it * can happen at all... */ - assert(0); + error = EDOOFUS; + break; } } if (error) @@ -594,13 +583,10 @@ image_copyout_region(int fd, lba_t blk, lba_t size) size *= secsz; - error = 0; - while (!error && size > 0) { + while (size > 0) { ch = image_chunk_find(blk); - if (ch == NULL) { - error = EINVAL; - break; - } + if (ch == NULL) + return (EINVAL); ofs = (blk - ch->ch_block) * secsz; sz = ch->ch_size - ofs; sz = ((lba_t)sz < size) ? sz : (size_t)size; @@ -616,12 +602,12 @@ image_copyout_region(int fd, lba_t blk, lba_t size) error = image_copyout_memory(fd, sz, ch->ch_u.mem.ptr); break; default: - assert(0); + return (EDOOFUS); } size -= sz; blk += sz / secsz; } - return (error); + return (0); } int @@ -696,7 +682,7 @@ image_cleanup(void) { struct chunk *ch; - while ((ch = TAILQ_FIRST(&image_chunks)) != NULL) { + while ((ch = STAILQ_FIRST(&image_chunks)) != NULL) { switch (ch->ch_type) { case CH_TYPE_FILE: /* We may be closing the same file multiple times. */ @@ -709,7 +695,7 @@ image_cleanup(void) default: break; } - TAILQ_REMOVE(&image_chunks, ch, ch_list); + STAILQ_REMOVE_HEAD(&image_chunks, ch_list); free(ch); } if (image_swap_fd != -1) @@ -722,7 +708,7 @@ image_init(void) { const char *tmpdir; - TAILQ_INIT(&image_chunks); + STAILQ_INIT(&image_chunks); image_nchunks = 0; image_swap_size = 0; Modified: stable/11/usr.bin/mkimg/mbr.c ============================================================================== --- stable/11/usr.bin/mkimg/mbr.c Wed Feb 7 16:28:26 2018 (r328975) +++ stable/11/usr.bin/mkimg/mbr.c Wed Feb 7 16:45:38 2018 (r328976) @@ -27,23 +27,35 @@ #include __FBSDID("$FreeBSD$"); +#include +#include +#include #include -#include #include #include #include -#include - -#include "endian.h" #include "image.h" #include "mkimg.h" #include "scheme.h" +#ifndef DOSPTYP_FAT16B +#define DOSPTYP_FAT16B 0x06 +#endif +#ifndef DOSPTYP_FAT32 +#define DOSPTYP_FAT32 0x0b +#endif +#ifndef DOSPTYP_PPCBOOT +#define DOSPTYP_PPCBOOT 0x41 +#endif +#ifndef DOSPTYP_EFI +#define DOSPTYP_EFI 0xef +#endif + static struct mkimg_alias mbr_aliases[] = { { ALIAS_EBR, ALIAS_INT2TYPE(DOSPTYP_EXT) }, { ALIAS_EFI, ALIAS_INT2TYPE(DOSPTYP_EFI) }, - { ALIAS_FAT16B, ALIAS_INT2TYPE(DOSPTYP_FAT16) }, + { ALIAS_FAT16B, ALIAS_INT2TYPE(DOSPTYP_FAT16B) }, { ALIAS_FAT32, ALIAS_INT2TYPE(DOSPTYP_FAT32) }, { ALIAS_FREEBSD, ALIAS_INT2TYPE(DOSPTYP_386BSD) }, { ALIAS_NTFS, ALIAS_INT2TYPE(DOSPTYP_NTFS) }, @@ -89,15 +101,10 @@ mbr_write(lba_t imgsz __unused, void *bootcode) memset(mbr, 0, secsz); le16enc(mbr + DOSMAGICOFFSET, DOSMAGIC); dpbase = (void *)(mbr + DOSPARTOFF); - TAILQ_FOREACH(part, &partlist, link) { + STAILQ_FOREACH(part, &partlist, link) { size = round_track(part->size); dp = dpbase + part->index; - if (active_partition != 0) - dp->dp_flag = - (part->index + 1 == active_partition) ? 0x80 : 0; - else - dp->dp_flag = - (part->index == 0 && bootcode != NULL) ? 0x80 : 0; + dp->dp_flag = (part->index == 0 && bootcode != NULL) ? 0x80 : 0; mbr_chs(&dp->dp_scyl, &dp->dp_shd, &dp->dp_ssect, part->block); dp->dp_typ = ALIAS_TYPE2INT(part->type); Modified: stable/11/usr.bin/mkimg/mkimg.1 ============================================================================== --- stable/11/usr.bin/mkimg/mkimg.1 Wed Feb 7 16:28:26 2018 (r328975) +++ stable/11/usr.bin/mkimg/mkimg.1 Wed Feb 7 16:45:38 2018 (r328976) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 26, 2017 +.Dd August 7, 2015 .Dt MKIMG 1 .Os .Sh NAME @@ -37,12 +37,9 @@ .Op Fl S Ar secsz .Op Fl T Ar tracksz .Op Fl b Ar bootcode -.Op Fl c Ar min_capacity -.Op Fl C Ar max_capacity -.Op Fl -capacity Ar capacity +.Op Fl c Ar capacity .Op Fl f Ar format .Op Fl o Ar outfile -.Op Fl a Ar active .Op Fl v .Op Fl y .Op Fl s Ar scheme Op Fl p Ar partition ... @@ -122,23 +119,11 @@ An empty partition table can be written to the disk wh partitioning scheme with the .Fl s option, but without specifying any partitions. -When the size required for all the partitions is larger than the +When the size required to for all the partitions is larger than the given capacity, then the disk image will be larger than the capacity given. .Pp The -.Fl C -option specifies a maximum capacity for the disk image. -If the combined sizes of the given partitions exceed the size given with -.Fl C , -image creation fails. -.Pp -The -.Fl -capacity -option is a shorthand to specify the minimum and maximum capacity at the -same time. -.Pp -The .Fl v option increases the level of output that the .Nm @@ -153,26 +138,6 @@ utility will generate predictable values for Universal (UUIDs) and time stamps so that consecutive runs of the .Nm utility will create images that are identical. -.Pp -The -.Ar active -option marks a partition as active, if the partitioning -scheme supports it. -Currently, only the -.Ar mbr -scheme supports this concept. -By default, -.Nm -will only mark the first partition as active when boot code is -specified. -Use the -.Ar active -option to override the active partition. -The number specified corresponds to the number after the 's' in the -partition's -.Xr geom 8 -name. -No partitions are marked active when the value is 0. .Pp A set of long options exist to query about the .Nm Modified: stable/11/usr.bin/mkimg/mkimg.c ============================================================================== --- stable/11/usr.bin/mkimg/mkimg.c Wed Feb 7 16:28:26 2018 (r328975) +++ stable/11/usr.bin/mkimg/mkimg.c Wed Feb 7 16:45:38 2018 (r328976) @@ -27,15 +27,17 @@ #include __FBSDID("$FreeBSD$"); -#include +#include +#include #include +#include +#include #include #include #include #include #include #include -#include #include #include #include @@ -47,23 +49,20 @@ __FBSDID("$FreeBSD$"); #include "mkimg.h" #include "scheme.h" -#define LONGOPT_FORMATS 0x01000001 -#define LONGOPT_SCHEMES 0x01000002 -#define LONGOPT_VERSION 0x01000003 -#define LONGOPT_CAPACITY 0x01000004 +#define LONGOPT_FORMATS 0x01000001 +#define LONGOPT_SCHEMES 0x01000002 +#define LONGOPT_VERSION 0x01000003 static struct option longopts[] = { { "formats", no_argument, NULL, LONGOPT_FORMATS }, { "schemes", no_argument, NULL, LONGOPT_SCHEMES }, { "version", no_argument, NULL, LONGOPT_VERSION }, - { "capacity", required_argument, NULL, LONGOPT_CAPACITY }, { NULL, 0, NULL, 0 } }; -static uint64_t min_capacity = 0; -static uint64_t max_capacity = 0; +static uint64_t capacity; -struct partlisthead partlist = TAILQ_HEAD_INITIALIZER(partlist); +struct partlisthead partlist = STAILQ_HEAD_INITIALIZER(partlist); u_int nparts = 0; u_int unit_testing; @@ -74,25 +73,24 @@ u_int nheads = 1; u_int nsecs = 1; u_int secsz = 512; u_int blksz = 0; -uint32_t active_partition = 0; static void print_formats(int usage) { - struct mkimg_format *f; + struct mkimg_format *f, **f_iter; const char *sep; if (usage) { fprintf(stderr, " formats:\n"); - f = NULL; - while ((f = format_iterate(f)) != NULL) { + SET_FOREACH(f_iter, formats) { + f = *f_iter; fprintf(stderr, "\t%s\t- %s\n", f->name, f->description); } } else { sep = ""; - f = NULL; - while ((f = format_iterate(f)) != NULL) { + SET_FOREACH(f_iter, formats) { + f = *f_iter; printf("%s%s", sep, f->name); sep = " "; } @@ -103,20 +101,20 @@ print_formats(int usage) static void print_schemes(int usage) { - struct mkimg_scheme *s; + struct mkimg_scheme *s, **s_iter; const char *sep; if (usage) { fprintf(stderr, " schemes:\n"); - s = NULL; - while ((s = scheme_iterate(s)) != NULL) { + SET_FOREACH(s_iter, schemes) { + s = *s_iter; fprintf(stderr, "\t%s\t- %s\n", s->name, s->description); } } else { sep = ""; - s = NULL; - while ((s = scheme_iterate(s)) != NULL) { + SET_FOREACH(s_iter, schemes) { + s = *s_iter; printf("%s%s", sep, s->name); sep = " "; } @@ -150,10 +148,8 @@ usage(const char *why) fprintf(stderr, "\t--schemes\t- list partition schemes\n"); fprintf(stderr, "\t--version\t- show version information\n"); fputc('\n', stderr); - fprintf(stderr, "\t-a \t- mark num'th partion as active\n"); fprintf(stderr, "\t-b \t- file containing boot code\n"); - fprintf(stderr, "\t-c \t- minimum capacity (in bytes) of the disk\n"); - fprintf(stderr, "\t-C \t- maximum capacity (in bytes) of the disk\n"); + fprintf(stderr, "\t-c \t- capacity (in bytes) of the disk\n"); fprintf(stderr, "\t-f \n"); fprintf(stderr, "\t-o \t- file to write image into\n"); fprintf(stderr, "\t-p \n"); @@ -306,7 +302,7 @@ parse_part(const char *spec) } part->index = nparts; - TAILQ_INSERT_TAIL(&partlist, part, link); + STAILQ_INSERT_TAIL(&partlist, part, link); nparts++; return (0); @@ -380,20 +376,31 @@ mkimg_chs(lba_t lba, u_int maxcyl, u_int *cylp, u_int *secp = sec; } +void +mkimg_uuid(struct uuid *uuid) +{ + static uint8_t gen[sizeof(struct uuid)]; + u_int i; + + if (!unit_testing) { + uuidgen(uuid, 1); + return; + } + + for (i = 0; i < sizeof(gen); i++) + gen[i]++; + memcpy(uuid, gen, sizeof(uuid_t)); +} + static int capacity_resize(lba_t end) { - lba_t min_capsz, max_capsz; + lba_t capsz; - min_capsz = (min_capacity + secsz - 1) / secsz; - max_capsz = (max_capacity + secsz - 1) / secsz; - - if (max_capsz != 0 && end > max_capsz) - return (ENOSPC); - if (end >= min_capsz) + capsz = (capacity + secsz - 1) / secsz; + if (end >= capsz) return (0); - - return (image_set_size(min_capsz)); + return (image_set_size(capsz)); } static void @@ -406,14 +413,14 @@ mkimg(void) int error, fd; /* First check partition information */ - TAILQ_FOREACH(part, &partlist, link) { + STAILQ_FOREACH(part, &partlist, link) { error = scheme_check_part(part); if (error) errc(EX_DATAERR, error, "partition %d", part->index+1); } block = scheme_metadata(SCHEME_META_IMG_START, 0); - TAILQ_FOREACH(part, &partlist, link) { + STAILQ_FOREACH(part, &partlist, link) { block = scheme_metadata(SCHEME_META_PART_BEFORE, block); if (verbose) fprintf(stderr, "partition %d: starting block %llu " @@ -480,14 +487,9 @@ main(int argc, char *argv[]) bcfd = -1; outfd = 1; /* Write to stdout by default */ - while ((c = getopt_long(argc, argv, "a:b:c:C:f:o:p:s:vyH:P:S:T:", + while ((c = getopt_long(argc, argv, "b:c:f:o:p:s:vyH:P:S:T:", longopts, NULL)) != -1) { switch (c) { - case 'a': /* ACTIVE PARTITION, if supported */ - error = parse_uint32(&active_partition, 1, 100, optarg); - if (error) - errc(EX_DATAERR, error, "Partition ordinal"); - break; case 'b': /* BOOT CODE */ if (bcfd != -1) usage("multiple bootcode given"); @@ -495,16 +497,11 @@ main(int argc, char *argv[]) if (bcfd == -1) err(EX_UNAVAILABLE, "%s", optarg); break; - case 'c': /* MINIMUM CAPACITY */ - error = parse_uint64(&min_capacity, 1, INT64_MAX, optarg); + case 'c': /* CAPACITY */ + error = parse_uint64(&capacity, 1, OFF_MAX, optarg); if (error) - errc(EX_DATAERR, error, "minimum capacity in bytes"); + errc(EX_DATAERR, error, "capacity in bytes"); break; - case 'C': /* MAXIMUM CAPACITY */ - error = parse_uint64(&max_capacity, 1, INT64_MAX, optarg); - if (error) - errc(EX_DATAERR, error, "maximum capacity in bytes"); - break; case 'f': /* OUTPUT FORMAT */ if (format_selected() != NULL) usage("multiple formats given"); @@ -574,12 +571,6 @@ main(int argc, char *argv[]) print_version(); exit(EX_OK); /*NOTREACHED*/ - case LONGOPT_CAPACITY: - error = parse_uint64(&min_capacity, 1, INT64_MAX, optarg); - if (error) - errc(EX_DATAERR, error, "capacity in bytes"); - max_capacity = min_capacity; - break; default: usage("unknown option"); } @@ -589,10 +580,8 @@ main(int argc, char *argv[]) usage("trailing arguments"); if (scheme_selected() == NULL && nparts > 0) usage("no scheme"); - if (nparts == 0 && min_capacity == 0) + if (nparts == 0 && capacity == 0) usage("no partitions"); - if (max_capacity != 0 && min_capacity > max_capacity) - usage("minimum capacity cannot be larger than the maximum one"); if (secsz > blksz) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Feb 7 16:46:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4CAAF1404C; Wed, 7 Feb 2018 16:46:22 +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 7BCCF72126; Wed, 7 Feb 2018 16:46:21 +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 w17GkKt1013064 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 7 Feb 2018 08:46:20 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w17GkJVn013063; Wed, 7 Feb 2018 08:46:19 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 7 Feb 2018 08:46:19 -0800 From: Gleb Smirnoff To: Peter Holm Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r328916 - in head/sys: kern vm Message-ID: <20180207164619.GK1063@FreeBSD.org> References: <20180206113017.GA25428@x2.osted.lan> <20180206182839.GB1063@FreeBSD.org> <20180206193430.GA36054@x2.osted.lan> <20180206221555.GC1063@FreeBSD.org> <20180206225244.GA40529@x2.osted.lan> <20180206230635.GE1063@FreeBSD.org> <20180206232521.GA41396@x2.osted.lan> <20180207004213.GG1063@FreeBSD.org> <20180207004549.GH1063@FreeBSD.org> <20180207064617.GA49792@x2.osted.lan> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="5gxpn/Q6ypwruk0T" Content-Disposition: inline In-Reply-To: <20180207064617.GA49792@x2.osted.lan> User-Agent: Mutt/1.9.3 (2018-01-21) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 16:46:23 -0000 --5gxpn/Q6ypwruk0T Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Feb 07, 2018 at 07:46:17AM +0100, Peter Holm wrote: P> On Tue, Feb 06, 2018 at 04:45:49PM -0800, Gleb Smirnoff wrote: P> > On Tue, Feb 06, 2018 at 04:42:13PM -0800, Gleb Smirnoff wrote: P> > T> Hi Peter, P> > T> P> > T> can you please try this patch? In either case success P> > T> or not, please provide me with dmesg. Thanks a lot! P> > P> > Sorry, patch was missing one file. 99.9% this is a no-op, P> > but better use full patch. Let's do one more attempt. I found where I miss one keg. -- Gleb Smirnoff --5gxpn/Q6ypwruk0T Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="boot_pages.diff" Index: sys/kern/subr_vmem.c =================================================================== --- sys/kern/subr_vmem.c (revision 328955) +++ sys/kern/subr_vmem.c (working copy) @@ -667,7 +667,8 @@ int vmem_startup_count(void) { - return (howmany(BT_MAXALLOC, UMA_SLAB_SIZE / sizeof(struct vmem_btag))); + return (howmany(BT_MAXALLOC, + UMA_SLAB_SPACE / sizeof(struct vmem_btag))); } #endif Index: sys/vm/uma_core.c =================================================================== --- sys/vm/uma_core.c (revision 328955) +++ sys/vm/uma_core.c (working copy) @@ -96,6 +96,7 @@ __FBSDID("$FreeBSD$"); #ifdef DEBUG_MEMGUARD #include #endif +#define DIAGNOSTIC /* * This is the zone and keg from which all zones are spawned. @@ -1796,28 +1797,40 @@ uma_startup_count(int zones) zsize = sizeof(struct uma_zone) + (sizeof(struct uma_cache) * (mp_maxid + 1)) + (sizeof(struct uma_zone_domain) * vm_ndomains); + printf("ksize %d zsize %d slab %lu\n", ksize, zsize, sizeof(struct uma_slab)); - /* Memory for the zone of zones and zone of kegs. */ + /* + * Memory for the zone of kegs and its keg, + * and for zone of zones. + */ pages = howmany(roundup(zsize, CACHE_LINE_SIZE) * 2 + roundup(ksize, CACHE_LINE_SIZE), PAGE_SIZE); + printf("boot_pages master %d\n", pages); zones += UMA_BOOT_ZONES; - /* Memory for startup zones, UMA and VM, ... */ + /* Memory for the rest of startup zones, UMA and VM, ... */ if (zsize > UMA_SLAB_SIZE) pages += zones * howmany(zsize, UMA_SLAB_SIZE); else - pages += howmany(zones, UMA_SLAB_SIZE / zsize); + pages += howmany(zones, UMA_SLAB_SPACE / zsize); + printf("boot_pages zones %d\n", pages); - /* ... and their kegs. */ - pages += howmany(zones, UMA_SLAB_SIZE / ksize); + /* ... and their kegs. Note that zone of zones allocates a keg! */ + pages += howmany(zones + 1, UMA_SLAB_SPACE / ksize); + printf("boot_pages kegs %d\n", pages); /* - * Take conservative approach that every zone - * is going to allocate hash. + * Most of startup zones are not going to be offpages, that's + * why we use UMA_SLAB_SPACE instead of UMA_SLAB_SIZE in all + * calculations. Some large bucket zones will be offpage, and + * thus will allocate hashes. We take conservative approach + * and assume that all zones may allocate hash. This may give + * us some positive imprecision, usually an extra single page. */ - pages += howmany(zones, UMA_SLAB_SIZE / + pages += howmany(zones, UMA_SLAB_SPACE / (sizeof(struct slabhead *) * UMA_HASH_SIZE_INIT)); + printf("boot_pages hash %d\n", pages); return (pages); } Index: sys/vm/uma_int.h =================================================================== --- sys/vm/uma_int.h (revision 328955) +++ sys/vm/uma_int.h (working copy) @@ -138,6 +138,11 @@ #define UMA_MAX_WASTE 10 /* + * Size of memory in a not offpage slab available for actual items. + */ +#define UMA_SLAB_SPACE (UMA_SLAB_SIZE - sizeof(struct uma_slab)) + +/* * I doubt there will be many cases where this is exceeded. This is the initial * size of the hash table for uma_slabs that are managed off page. This hash * does expand by powers of two. Currently it doesn't get smaller. Index: sys/vm/vm_page.c =================================================================== --- sys/vm/vm_page.c (revision 328955) +++ sys/vm/vm_page.c (working copy) @@ -518,8 +518,11 @@ vm_page_startup(vm_offset_t vaddr) /* vmem_startup() calls uma_prealloc(). */ boot_pages += vmem_startup_count(); + printf("boot_pages vmem %d\n", boot_pages); /* vm_map_startup() calls uma_prealloc(). */ - boot_pages += howmany(MAX_KMAP, UMA_SLAB_SIZE / sizeof(struct vm_map)); + boot_pages += howmany(MAX_KMAP, + UMA_SLAB_SPACE / sizeof(struct vm_map)); + printf("boot_pages kmap %d\n", boot_pages); /* * Before going fully functional kmem_init() does allocation --5gxpn/Q6ypwruk0T-- From owner-svn-src-all@freebsd.org Wed Feb 7 16:57:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B9F9F14C63; Wed, 7 Feb 2018 16:57:11 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 09738728DE; Wed, 7 Feb 2018 16:57:11 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F39A218B2; Wed, 7 Feb 2018 16:57:10 +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 w17GvAmg098219; Wed, 7 Feb 2018 16:57:10 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17GvA43098211; Wed, 7 Feb 2018 16:57:10 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201802071657.w17GvA43098211@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 7 Feb 2018 16:57:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328977 - in head/sys: kern vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: kern vm X-SVN-Commit-Revision: 328977 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 16:57:11 -0000 Author: markj Date: Wed Feb 7 16:57:10 2018 New Revision: 328977 URL: https://svnweb.freebsd.org/changeset/base/328977 Log: Dequeue wired pages lazily. Previously, wiring a page would cause it to be removed from its page queue. In the common case, unwiring causes it to be enqueued at the tail of that page queue. This change modifies vm_page_wire() to not dequeue the page, thus avoiding the highly contended page queue locks. Instead, vm_page_unwire() takes care of requeuing the page as a single operation, and the page daemon dequeues wired pages as they are encountered during a queue scan to avoid needlessly revisiting them later. For pages in PQ_ACTIVE we do even better, since a requeue is unnecessary. The change improves scalability for some common workloads. For instance, threads wiring pages into the buffer cache no longer need to modify global page queues, and unwiring is usually done by the bufspace thread, so concurrency is not as much of an issue. As another example, many sysctl handlers wire the output buffer to avoid faults on copyout, and since the buffer is likely to be in PQ_ACTIVE, we now entirely avoid modifying the page queue in this case. The change also adds a block comment describing some properties of struct vm_page's reference counters, and the busy lock. Reviewed by: jeff Discussed with: alc, kib MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D11943 Modified: head/sys/kern/kern_sendfile.c head/sys/kern/vfs_bio.c head/sys/vm/vm_object.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h head/sys/vm/vm_pageout.c head/sys/vm/vm_swapout.c Modified: head/sys/kern/kern_sendfile.c ============================================================================== --- head/sys/kern/kern_sendfile.c Wed Feb 7 16:45:38 2018 (r328976) +++ head/sys/kern/kern_sendfile.c Wed Feb 7 16:57:10 2018 (r328977) @@ -128,6 +128,7 @@ SYSCTL_PROC(_kern_ipc, OID_AUTO, sfstat, CTLTYPE_OPAQU static void sendfile_free_page(vm_page_t pg, bool nocache) { + bool freed; vm_page_lock(pg); /* @@ -136,15 +137,15 @@ sendfile_free_page(vm_page_t pg, bool nocache) * responsible for freeing the page. In 'noncache' case try to free * the page, but only if it is cheap to. */ - if (vm_page_unwire(pg, nocache ? PQ_NONE : PQ_INACTIVE)) { + if (vm_page_unwire_noq(pg)) { vm_object_t obj; if ((obj = pg->object) == NULL) vm_page_free(pg); - else if (nocache) { - if (!vm_page_xbusied(pg) && VM_OBJECT_TRYWLOCK(obj)) { - bool freed; - + else { + freed = false; + if (nocache && !vm_page_xbusied(pg) && + VM_OBJECT_TRYWLOCK(obj)) { /* Only free unmapped pages. */ if (obj->ref_count == 0 || !pmap_page_is_mapped(pg)) @@ -153,13 +154,24 @@ sendfile_free_page(vm_page_t pg, bool nocache) * locked cannot be relied upon. */ freed = vm_page_try_to_free(pg); - else - freed = false; VM_OBJECT_WUNLOCK(obj); - if (!freed) + } + if (!freed) { + /* + * If we were asked to not cache the page, place + * it near the head of the inactive queue so + * that it is reclaimed sooner. Otherwise, + * maintain LRU. + */ + if (nocache) vm_page_deactivate_noreuse(pg); - } else - vm_page_deactivate_noreuse(pg); + else if (pg->queue == PQ_ACTIVE) + vm_page_reference(pg); + else if (pg->queue != PQ_INACTIVE) + vm_page_deactivate(pg); + else + vm_page_requeue(pg); + } } } vm_page_unlock(pg); Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Wed Feb 7 16:45:38 2018 (r328976) +++ head/sys/kern/vfs_bio.c Wed Feb 7 16:57:10 2018 (r328977) @@ -2621,7 +2621,7 @@ vfs_vmio_unwire(struct buf *bp, vm_page_t m) bool freed; vm_page_lock(m); - if (vm_page_unwire(m, PQ_NONE)) { + if (vm_page_unwire_noq(m)) { /* * Determine if the page should be freed before adding * it to the inactive queue. @@ -2637,14 +2637,16 @@ vfs_vmio_unwire(struct buf *bp, vm_page_t m) if (!freed) { /* * If the page is unlikely to be reused, let the - * VM know. Otherwise, maintain LRU page - * ordering and put the page at the tail of the - * inactive queue. + * VM know. Otherwise, maintain LRU. */ if ((bp->b_flags & B_NOREUSE) != 0) vm_page_deactivate_noreuse(m); - else + else if (m->queue == PQ_ACTIVE) + vm_page_reference(m); + else if (m->queue != PQ_INACTIVE) vm_page_deactivate(m); + else + vm_page_requeue(m); } } vm_page_unlock(m); Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Wed Feb 7 16:45:38 2018 (r328976) +++ head/sys/vm/vm_object.c Wed Feb 7 16:57:10 2018 (r328977) @@ -1275,7 +1275,7 @@ next_page: if (tm->valid != VM_PAGE_BITS_ALL) goto next_pindex; vm_page_lock(tm); - if (tm->hold_count != 0 || tm->wire_count != 0) { + if (vm_page_held(tm)) { vm_page_unlock(tm); goto next_pindex; } Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Wed Feb 7 16:45:38 2018 (r328976) +++ head/sys/vm/vm_page.c Wed Feb 7 16:57:10 2018 (r328977) @@ -2053,8 +2053,7 @@ vm_page_alloc_check(vm_page_t m) KASSERT(m->object == NULL, ("page %p has object", m)); KASSERT(m->queue == PQ_NONE, ("page %p has unexpected queue %d", m, m->queue)); - KASSERT(m->wire_count == 0, ("page %p is wired", m)); - KASSERT(m->hold_count == 0, ("page %p is held", m)); + KASSERT(!vm_page_held(m), ("page %p is held", m)); KASSERT(!vm_page_busied(m), ("page %p is busy", m)); KASSERT(m->dirty == 0, ("page %p is dirty", m)); KASSERT(pmap_page_get_memattr(m) == VM_MEMATTR_DEFAULT, @@ -2220,7 +2219,7 @@ vm_page_scan_contig(u_long npages, vm_page_t m_start, vm_page_change_lock(m, &m_mtx); m_inc = 1; retry: - if (m->wire_count != 0 || m->hold_count != 0) + if (vm_page_held(m)) run_ext = 0; #if VM_NRESERVLEVEL > 0 else if ((level = vm_reserv_level(m)) >= 0 && @@ -2248,8 +2247,7 @@ retry: */ VM_OBJECT_RUNLOCK(object); goto retry; - } else if (m->wire_count != 0 || - m->hold_count != 0) { + } else if (vm_page_held(m)) { run_ext = 0; goto unlock; } @@ -2391,7 +2389,7 @@ vm_page_reclaim_run(int req_class, int domain, u_long */ vm_page_change_lock(m, &m_mtx); retry: - if (m->wire_count != 0 || m->hold_count != 0) + if (vm_page_held(m)) error = EBUSY; else if ((object = m->object) != NULL) { /* @@ -2408,8 +2406,7 @@ retry: */ VM_OBJECT_WUNLOCK(object); goto retry; - } else if (m->wire_count != 0 || - m->hold_count != 0) { + } else if (vm_page_held(m)) { error = EBUSY; goto unlock; } @@ -3042,9 +3039,7 @@ vm_page_activate(vm_page_t m) if (queue != PQ_NONE) vm_page_dequeue(m); vm_page_enqueue(PQ_ACTIVE, m); - } else - KASSERT(queue == PQ_NONE, - ("vm_page_activate: wired page %p is queued", m)); + } } else { if (m->act_count < ACT_INIT) m->act_count = ACT_INIT; @@ -3241,26 +3236,18 @@ vm_page_free_toq(vm_page_t m) } /* - * vm_page_wire: + * vm_page_wire: * - * Mark this page as wired down by yet - * another map, removing it from paging queues - * as necessary. + * Mark this page as wired down. If the page is fictitious, then + * its wire count must remain one. * - * If the page is fictitious, then its wire count must remain one. - * - * The page must be locked. + * The page must be locked. */ void vm_page_wire(vm_page_t m) { - /* - * Only bump the wire statistics if the page is not already wired, - * and only unqueue the page if it is on some queue (if it is unmanaged - * it is already off the queues). - */ - vm_page_lock_assert(m, MA_OWNED); + vm_page_assert_locked(m); if ((m->flags & PG_FICTITIOUS) != 0) { KASSERT(m->wire_count == 1, ("vm_page_wire: fictitious page %p's wire count isn't one", @@ -3271,7 +3258,6 @@ vm_page_wire(vm_page_t m) KASSERT((m->oflags & VPO_UNMANAGED) == 0 || m->queue == PQ_NONE, ("vm_page_wire: unmanaged page %p is queued", m)); - vm_page_remque(m); atomic_add_int(&vm_cnt.v_wire_count, 1); } m->wire_count++; @@ -3288,38 +3274,69 @@ vm_page_wire(vm_page_t m) * Only managed pages belonging to an object can be paged out. If the number * of wirings transitions to zero and the page is eligible for page out, then * the page is added to the specified paging queue (unless PQ_NONE is - * specified). + * specified, in which case the page is dequeued if it belongs to a paging + * queue). * * If a page is fictitious, then its wire count must always be one. * * A managed page must be locked. */ -boolean_t +bool vm_page_unwire(vm_page_t m, uint8_t queue) { + bool unwired; KASSERT(queue < PQ_COUNT || queue == PQ_NONE, ("vm_page_unwire: invalid queue %u request for page %p", queue, m)); + + unwired = vm_page_unwire_noq(m); + if (unwired && (m->oflags & VPO_UNMANAGED) == 0 && m->object != NULL) { + if (m->queue == queue) { + if (queue == PQ_ACTIVE) + vm_page_reference(m); + else if (queue != PQ_NONE) + vm_page_requeue(m); + } else { + vm_page_remque(m); + if (queue != PQ_NONE) { + vm_page_enqueue(queue, m); + if (queue == PQ_ACTIVE) + /* Initialize act_count. */ + vm_page_activate(m); + } + } + } + return (unwired); +} + +/* + * + * vm_page_unwire_noq: + * + * Unwire a page without (re-)inserting it into a page queue. It is up + * to the caller to enqueue, requeue, or free the page as appropriate. + * In most cases, vm_page_unwire() should be used instead. + */ +bool +vm_page_unwire_noq(vm_page_t m) +{ + if ((m->oflags & VPO_UNMANAGED) == 0) vm_page_assert_locked(m); if ((m->flags & PG_FICTITIOUS) != 0) { KASSERT(m->wire_count == 1, ("vm_page_unwire: fictitious page %p's wire count isn't one", m)); - return (FALSE); + return (false); } - if (m->wire_count > 0) { - m->wire_count--; - if (m->wire_count == 0) { - atomic_subtract_int(&vm_cnt.v_wire_count, 1); - if ((m->oflags & VPO_UNMANAGED) == 0 && - m->object != NULL && queue != PQ_NONE) - vm_page_enqueue(queue, m); - return (TRUE); - } else - return (FALSE); - } else + if (m->wire_count == 0) panic("vm_page_unwire: page %p's wire count is zero", m); + m->wire_count--; + if (m->wire_count == 0) { + atomic_subtract_int(&vm_cnt.v_wire_count, 1); + return (true); + } else + return (false); } /* @@ -3448,8 +3465,7 @@ vm_page_try_to_free(vm_page_t m) vm_page_assert_locked(m); VM_OBJECT_ASSERT_WLOCKED(m->object); KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("page %p is unmanaged", m)); - if (m->dirty != 0 || m->hold_count != 0 || m->wire_count != 0 || - vm_page_busied(m)) + if (m->dirty != 0 || vm_page_held(m) || vm_page_busied(m)) return (false); if (m->object->ref_count != 0) { pmap_remove_all(m); Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Wed Feb 7 16:45:38 2018 (r328976) +++ head/sys/vm/vm_page.h Wed Feb 7 16:57:10 2018 (r328977) @@ -97,7 +97,7 @@ * or the lock for either the free or paging queue (Q). If a field is * annotated below with two of these locks, then holding either lock is * sufficient for read access, but both locks are required for write - * access. + * access. An annotation of (C) indicates that the field is immutable. * * In contrast, the synchronization of accesses to the page's * dirty field is machine dependent (M). In the @@ -111,6 +111,38 @@ * contains the dirty field. In the machine-independent layer, * the implementation of read-modify-write operations on the * field is encapsulated in vm_page_clear_dirty_mask(). + * + * The page structure contains two counters which prevent page reuse. + * Both counters are protected by the page lock (P). The hold + * counter counts transient references obtained via a pmap lookup, and + * is also used to prevent page reclamation in situations where it is + * undesirable to block other accesses to the page. The wire counter + * is used to implement mlock(2) and is non-zero for pages containing + * kernel memory. Pages that are wired or held will not be reclaimed + * or laundered by the page daemon, but are treated differently during + * a page queue scan: held pages remain at their position in the queue, + * while wired pages are removed from the queue and must later be + * re-enqueued appropriately by the unwiring thread. It is legal to + * call vm_page_free() on a held page; doing so causes it to be removed + * from its object and page queue, and the page is released to the + * allocator once the last hold reference is dropped. In contrast, + * wired pages may not be freed. + * + * In some pmap implementations, the wire count of a page table page is + * used to track the number of populated entries. + * + * The busy lock is an embedded reader-writer lock which protects the + * page's contents and identity (i.e., its tuple) and + * interlocks with the object lock (O). In particular, a page may be + * busied or unbusied only with the object write lock held. To avoid + * bloating the page structure, the busy lock lacks some of the + * features available to the kernel's general-purpose synchronization + * primitives. As a result, busy lock ordering rules are not verified, + * lock recursion is not detected, and an attempt to xbusy a busy page + * or sbusy an xbusy page results will trigger a panic rather than + * causing the thread to block. vm_page_sleep_if_busy() can be used to + * sleep until the page's busy state changes, after which the caller + * must re-lookup the page and re-evaluate its state. */ #if PAGE_SIZE == 4096 @@ -152,9 +184,9 @@ struct vm_page { uint8_t oflags; /* page VPO_* flags (O) */ uint8_t queue; /* page queue index (P,Q) */ int8_t psind; /* pagesizes[] index (O) */ - int8_t segind; + int8_t segind; /* vm_phys segment index (C) */ uint8_t order; /* index of the buddy queue */ - uint8_t pool; + uint8_t pool; /* vm_phys freepool index (Q) */ u_char act_count; /* page usage count (P) */ /* NOTE that these must support one bit per DEV_BSIZE in a page */ /* so, on normal X86 kernels, they must be at least 8 bits wide */ @@ -489,7 +521,8 @@ bool vm_page_try_to_free(vm_page_t m); int vm_page_trysbusy(vm_page_t m); void vm_page_unhold_pages(vm_page_t *ma, int count); void vm_page_unswappable(vm_page_t m); -boolean_t vm_page_unwire(vm_page_t m, uint8_t queue); +bool vm_page_unwire(vm_page_t m, uint8_t queue); +bool vm_page_unwire_noq(vm_page_t m); void vm_page_updatefake(vm_page_t m, vm_paddr_t paddr, vm_memattr_t memattr); void vm_page_wire (vm_page_t); void vm_page_xunbusy_hard(vm_page_t m); @@ -714,6 +747,18 @@ vm_page_in_laundry(vm_page_t m) { return (m->queue == PQ_LAUNDRY || m->queue == PQ_UNSWAPPABLE); +} + +/* + * vm_page_held: + * + * Return true if a reference prevents the page from being reclaimable. + */ +static inline bool +vm_page_held(vm_page_t m) +{ + + return (m->hold_count > 0 || m->wire_count > 0); } #endif /* _KERNEL */ Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Wed Feb 7 16:45:38 2018 (r328976) +++ head/sys/vm/vm_pageout.c Wed Feb 7 16:57:10 2018 (r328977) @@ -335,11 +335,8 @@ vm_pageout_cluster(vm_page_t m) VM_OBJECT_ASSERT_WLOCKED(object); pindex = m->pindex; - /* - * We can't clean the page if it is busy or held. - */ vm_page_assert_unbusied(m); - KASSERT(m->hold_count == 0, ("page %p is held", m)); + KASSERT(!vm_page_held(m), ("page %p is held", m)); pmap_remove_write(m); vm_page_unlock(m); @@ -378,8 +375,7 @@ more: break; } vm_page_lock(p); - if (!vm_page_in_laundry(p) || - p->hold_count != 0) { /* may be undergoing I/O */ + if (!vm_page_in_laundry(p) || vm_page_held(p)) { vm_page_unlock(p); ib = 0; break; @@ -405,8 +401,7 @@ more: if (p->dirty == 0) break; vm_page_lock(p); - if (!vm_page_in_laundry(p) || - p->hold_count != 0) { /* may be undergoing I/O */ + if (!vm_page_in_laundry(p) || vm_page_held(p)) { vm_page_unlock(p); break; } @@ -655,10 +650,10 @@ vm_pageout_clean(vm_page_t m, int *numpagedout) } /* - * The page may have been busied or held while the object + * The page may have been busied or referenced while the object * and page locks were released. */ - if (vm_page_busied(m) || m->hold_count != 0) { + if (vm_page_busied(m) || vm_page_held(m)) { vm_page_unlock(m); error = EBUSY; goto unlock_all; @@ -747,11 +742,18 @@ scan: vm_page_unlock(m); continue; } + if (m->wire_count != 0) { + vm_page_dequeue_locked(m); + vm_page_unlock(m); + continue; + } object = m->object; if ((!VM_OBJECT_TRYWLOCK(object) && (!vm_pageout_fallback_object_lock(m, &next) || - m->hold_count != 0)) || vm_page_busied(m)) { + vm_page_held(m))) || vm_page_busied(m)) { VM_OBJECT_WUNLOCK(object); + if (m->wire_count != 0 && vm_page_pagequeue(m) == pq) + vm_page_dequeue_locked(m); vm_page_unlock(m); continue; } @@ -1190,8 +1192,17 @@ vm_pageout_scan(struct vm_domain *vmd, int pass) */ if (!vm_pageout_page_lock(m, &next)) goto unlock_page; - else if (m->hold_count != 0) { + else if (m->wire_count != 0) { /* + * Wired pages may not be freed, and unwiring a queued + * page will cause it to be requeued. Thus, remove them + * from the queue now to avoid unnecessary revisits. + */ + vm_page_dequeue_locked(m); + addl_page_shortage++; + goto unlock_page; + } else if (m->hold_count != 0) { + /* * Held pages are essentially stuck in the * queue. So, they ought to be discounted * from the inactive count. See the @@ -1205,9 +1216,13 @@ vm_pageout_scan(struct vm_domain *vmd, int pass) if (!VM_OBJECT_TRYWLOCK(object)) { if (!vm_pageout_fallback_object_lock(m, &next)) goto unlock_object; - else if (m->hold_count != 0) { + else if (m->wire_count != 0) { + vm_page_dequeue_locked(m); addl_page_shortage++; goto unlock_object; + } else if (m->hold_count != 0) { + addl_page_shortage++; + goto unlock_object; } } if (vm_page_busied(m)) { @@ -1226,7 +1241,7 @@ unlock_page: vm_page_unlock(m); continue; } - KASSERT(m->hold_count == 0, ("Held page %p", m)); + KASSERT(!vm_page_held(m), ("Held page %p", m)); /* * Dequeue the inactive page and unlock the inactive page @@ -1431,6 +1446,15 @@ drop_page: * the page for eligibility. */ VM_CNT_INC(v_pdpages); + + /* + * Wired pages are dequeued lazily. + */ + if (m->wire_count != 0) { + vm_page_dequeue_locked(m); + vm_page_unlock(m); + continue; + } /* * Check to see "how much" the page has been used. Modified: head/sys/vm/vm_swapout.c ============================================================================== --- head/sys/vm/vm_swapout.c Wed Feb 7 16:45:38 2018 (r328976) +++ head/sys/vm/vm_swapout.c Wed Feb 7 16:57:10 2018 (r328977) @@ -209,7 +209,7 @@ vm_swapout_object_deactivate_pages(pmap_t pmap, vm_obj continue; VM_CNT_INC(v_pdpages); vm_page_lock(p); - if (p->wire_count != 0 || p->hold_count != 0 || + if (vm_page_held(p) || !pmap_page_exists_quick(pmap, p)) { vm_page_unlock(p); continue; From owner-svn-src-all@freebsd.org Wed Feb 7 16:58:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2362F14DDE; Wed, 7 Feb 2018 16:58:01 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A820572A52; Wed, 7 Feb 2018 16:58:01 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A31EF18BB; Wed, 7 Feb 2018 16:58:01 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w17Gw1Ux098292; Wed, 7 Feb 2018 16:58:01 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17Gw18a098291; Wed, 7 Feb 2018 16:58:01 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <201802071658.w17Gw18a098291@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Wed, 7 Feb 2018 16:58:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328978 - head/sys/mips/mips X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/sys/mips/mips X-SVN-Commit-Revision: 328978 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 16:58:02 -0000 Author: arichardson Date: Wed Feb 7 16:58:01 2018 New Revision: 328978 URL: https://svnweb.freebsd.org/changeset/base/328978 Log: Fix compilation of mips_postboot_fixup() with a C11 compiler The _Alignas specifier must come before the declaration and not after. It works if _Alignas() expands to __attribute__(aligned(x)) which was the only case I tested before. Approved By: jhb (mentor) Modified: head/sys/mips/mips/machdep.c Modified: head/sys/mips/mips/machdep.c ============================================================================== --- head/sys/mips/mips/machdep.c Wed Feb 7 16:57:10 2018 (r328977) +++ head/sys/mips/mips/machdep.c Wed Feb 7 16:58:01 2018 (r328978) @@ -387,7 +387,7 @@ mips_postboot_fixup(void) * We store u_long sized objects into the reload area, so the array * must be so aligned. The standard allows any alignment for char data. */ - static char fake_preload[256] _Alignas(_Alignof(u_long)); + _Alignas(_Alignof(u_long)) static char fake_preload[256]; caddr_t preload_ptr = (caddr_t)&fake_preload[0]; size_t size = 0; From owner-svn-src-all@freebsd.org Wed Feb 7 17:09:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0487F15BF2; Wed, 7 Feb 2018 17:09:12 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A27D473387; Wed, 7 Feb 2018 17:09:12 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D3D11A64; Wed, 7 Feb 2018 17:09:12 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w17H9C5w003265; Wed, 7 Feb 2018 17:09:12 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17H9Ccu003264; Wed, 7 Feb 2018 17:09:12 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <201802071709.w17H9Ccu003264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Wed, 7 Feb 2018 17:09:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328979 - head/usr.bin/lex X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/usr.bin/lex X-SVN-Commit-Revision: 328979 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 17:09:13 -0000 Author: arichardson Date: Wed Feb 7 17:09:12 2018 New Revision: 328979 URL: https://svnweb.freebsd.org/changeset/base/328979 Log: Fix broken SPDX comment in usr.bin/lex/initparse.c Approved By: jhb (mentor) Modified: head/usr.bin/lex/initparse.c Modified: head/usr.bin/lex/initparse.c ============================================================================== --- head/usr.bin/lex/initparse.c Wed Feb 7 16:58:01 2018 (r328978) +++ head/usr.bin/lex/initparse.c Wed Feb 7 17:09:12 2018 (r328979) @@ -17,7 +17,7 @@ static const char yysccsid[] = "@(#)yaccpar 1.9 (Berke #define YYPURE 0 #line 35 "parse.y" -/ * SPDX-License-Identifier: BSD-2-Clause */ +/* SPDX-License-Identifier: BSD-2-Clause */ /* Copyright (c) 1990 The Regents of the University of California. */ /* All rights reserved. */ From owner-svn-src-all@freebsd.org Wed Feb 7 17:44:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B55EBF17FF1; Wed, 7 Feb 2018 17:44:33 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay01.pair.com (relay01.pair.com [209.68.5.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 642BB74A76; Wed, 7 Feb 2018 17:44:33 +0000 (UTC) (envelope-from pho@holm.cc) Received: from x2.osted.lan (87-58-223-204-dynamic.dk.customer.tdc.net [87.58.223.204]) by relay01.pair.com (Postfix) with ESMTP id CF728D00350; Wed, 7 Feb 2018 12:44:31 -0500 (EST) Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.14.9/8.14.9) with ESMTP id w17HiTpx063163 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 7 Feb 2018 18:44:29 +0100 (CET) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.14.9/8.14.9/Submit) id w17HiTwi063162; Wed, 7 Feb 2018 18:44:29 +0100 (CET) (envelope-from pho) Date: Wed, 7 Feb 2018 18:44:29 +0100 From: Peter Holm To: Gleb Smirnoff Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r328916 - in head/sys: kern vm Message-ID: <20180207174429.GA63039@x2.osted.lan> References: <20180206182839.GB1063@FreeBSD.org> <20180206193430.GA36054@x2.osted.lan> <20180206221555.GC1063@FreeBSD.org> <20180206225244.GA40529@x2.osted.lan> <20180206230635.GE1063@FreeBSD.org> <20180206232521.GA41396@x2.osted.lan> <20180207004213.GG1063@FreeBSD.org> <20180207004549.GH1063@FreeBSD.org> <20180207064617.GA49792@x2.osted.lan> <20180207164619.GK1063@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180207164619.GK1063@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 17:44:34 -0000 On Wed, Feb 07, 2018 at 08:46:19AM -0800, Gleb Smirnoff wrote: > On Wed, Feb 07, 2018 at 07:46:17AM +0100, Peter Holm wrote: > P> On Tue, Feb 06, 2018 at 04:45:49PM -0800, Gleb Smirnoff wrote: > P> > On Tue, Feb 06, 2018 at 04:42:13PM -0800, Gleb Smirnoff wrote: > P> > T> Hi Peter, > P> > T> > P> > T> can you please try this patch? In either case success > P> > T> or not, please provide me with dmesg. Thanks a lot! > P> > > P> > Sorry, patch was missing one file. 99.9% this is a no-op, > P> > but better use full patch. > > Let's do one more attempt. I found where I miss one keg. > Yes, that boots after two tweaks to the patch: #define DIAGNOSTIC (already defined in my build) printf("ksize %d zsize %d slab %lu\n", ksize, zsize, sizeof(struct uma_slab)); (lu -> u) GDB: no debug ports present KDB: debugger backends: ddb KDB: current backend: ddb Copyright (c) 1992-2018 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 12.0-CURRENT #4 r328956M: Wed Feb 7 18:28:57 CET 2018 pho@x4.osted.lan:/usr/src/sys/i386/compile/PHO i386 FreeBSD clang version 6.0.0 (branches/release_60 321788) (based on LLVM 6.0.0) WARNING: WITNESS option enabled, expect reduced performance. WARNING: DIAGNOSTIC option enabled, expect reduced performance. ksize 204 zsize 292 slab 88 boot_pages master 1 boot_pages zones 3 boot_pages kegs 5 boot_pages hash 6 boot_pages vmem 7 boot_pages kmap 8 Entering uma_startup with 10 boot pages configured startup_alloc from "UMA Kegs", 9 boot pages left startup_alloc from "UMA Zones", 8 boot pages left startup_alloc from "UMA Hash", 7 boot pages left startup_alloc from "UMA Zones", 6 boot pages left startup_alloc from "vmem btag", 5 boot pages left startup_alloc from "MAP", 4 boot pages left startup_alloc from "UMA Kegs", 3 boot pages left startup_alloc from "KMAP ENTRY", 2 boot pages left startup_alloc from "vmem", 1 boot pages left Entering uma_startup1 with 0 boot pages left VT(vga): resolution 640x480 CPU: AMD Phenom(tm) 9150e Quad-Core Processor (1800.02-MHz 686-class CPU) Origin="AuthenticAMD" Id=0x100f23 Family=0x10 Model=0x2 Stepping=3 Features=0x178bfbff Features2=0x802009 AMD Features=0xee500800 AMD Features2=0x7ff SVM: NP,NAsids=64 TSC: P-state invariant real memory = 8589934592 (8192 MB) avail memory = 3525746688 (3362 MB) Event timer "LAPIC" quality 100 ACPI APIC Table: <060508 APIC1048> FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs FreeBSD/SMP: 1 package(s) x 4 core(s) random: unblocking device. ioapic0 irqs 0-23 on motherboard SMP: AP CPU #1 Launched! SMP: AP CPU #3 Launched! SMP: AP CPU #2 Launched! Timecounter "TSC" frequency 1800017912 Hz quality 800 random: entropy device external interface kbd1 at kbdmux0 [ath_hal] loaded module_register_init: MOD_LOAD (vesa, 0xc11af130, 0) error 19 nexus0 vtvga0: on motherboard cryptosoft0: on motherboard acpi0: <060508 RSDT1048> on motherboard acpi0: Power Button (fixed) cpu0: on acpi0 cpu1: on acpi0 cpu2: on acpi0 cpu3: on acpi0 attimer0: port 0x40-0x43 irq 0 on acpi0 Timecounter "i8254" frequency 1193182 Hz quality 0 Event timer "i8254" frequency 1193182 Hz quality 100 atrtc0: port 0x70-0x71 irq 8 on acpi0 atrtc0: registered as a time-of-day clock, resolution 1.000000s Event timer "RTC" frequency 32768 Hz quality 0 Timecounter "ACPI-fast" frequency 3579545 Hz quality 900 acpi_timer0: <24-bit timer at 3.579545MHz> port 0x808-0x80b on acpi0 pcib0: port 0xcf8-0xcff on acpi0 pci0: on pcib0 pcib1: at device 1.0 on pci0 pci1: on pcib1 vgapci0: port 0xc000-0xc0ff mem 0xf0000000-0xf7ffffff,0xfe9f0000-0xfe9fffff,0xfe800000-0xfe8fffff irq 18 at device 5.0 on pci1 vgapci0: Boot video device hdac0: mem 0xfe9e8000-0xfe9ebfff irq 19 at device 5.2 on pci1 pcib2: at device 7.0 on pci0 pci2: on pcib2 re0: port 0xd800-0xd8ff mem 0xfeaff000-0xfeafffff irq 19 at device 0.0 on pci2 re0: Using 1 MSI message re0: Chip rev. 0x38000000 re0: MAC rev. 0x00000000 miibus0: on re0 rgephy0: PHY 1 on miibus0 rgephy0: none, 10baseT, 10baseT-FDX, 10baseT-FDX-flow, 100baseTX, 100baseTX-FDX, 100baseTX-FDX-flow, 1000baseT, 1000baseT-master, 1000baseT-FDX, 1000baseT-FDX-master, 1000baseT-FDX-flow, 1000baseT-FDX-flow-master, auto, auto-flow re0: Using defaults for TSO: 65518/35/2048 re0: Ethernet address: 00:21:85:15:33:7d ahci0: port 0xb000-0xb007,0xa000-0xa003,0x9000-0x9007,0x8000-0x8003,0x7000-0x700f mem 0xfe7ff800-0xfe7ffbff irq 22 at device 18.0 on pci0 ahci0: AHCI v1.10 with 4 3Gbps ports, Port Multiplier supported ahci0: quirks=0x7000 ahcich0: at channel 0 on ahci0 ahcich1: at channel 1 on ahci0 ahcich2: at channel 2 on ahci0 ahcich3: at channel 3 on ahci0 ohci0: mem 0xfe7fe000-0xfe7fefff irq 16 at device 19.0 on pci0 usbus0 on ohci0 usbus0: 12Mbps Full Speed USB v1.0 ohci1: mem 0xfe7fd000-0xfe7fdfff irq 17 at device 19.1 on pci0 usbus1 on ohci1 usbus1: 12Mbps Full Speed USB v1.0 ohci2: mem 0xfe7fc000-0xfe7fcfff irq 18 at device 19.2 on pci0 usbus2 on ohci2 usbus2: 12Mbps Full Speed USB v1.0 ohci3: mem 0xfe7fb000-0xfe7fbfff irq 17 at device 19.3 on pci0 usbus3 on ohci3 usbus3: 12Mbps Full Speed USB v1.0 ohci4: mem 0xfe7fa000-0xfe7fafff irq 18 at device 19.4 on pci0 usbus4 on ohci4 usbus4: 12Mbps Full Speed USB v1.0 ehci0: mem 0xfe7ff000-0xfe7ff0ff irq 19 at device 19.5 on pci0 ehci0: AMD SB600/700 quirk applied usbus5: EHCI version 1.0 usbus5 on ehci0 usbus5: 480Mbps High Speed USB v2.0 atapci0: port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xff00-0xff0f at device 20.1 on pci0 ata0: at channel 0 on atapci0 hdac1: mem 0xfe7f4000-0xfe7f7fff irq 16 at device 20.2 on pci0 isab0: at device 20.3 on pci0 isa0: on isab0 pcib3: at device 20.4 on pci0 pci3: on pcib3 pci3: at device 6.0 (no driver attached) amdtemp0: on hostb4 amdtemp0: Erratum 319: temperature measurement may be inaccurate acpi_button0: on acpi0 uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0 uart0: console (115200,n,8,1) fdc0: port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on acpi0 atkbdc0: at port 0x60,0x64 on isa0 atkbd0: irq 1 on atkbdc0 kbd0 at atkbd0 atkbd0: [GIANT-LOCKED] ppc0: parallel port not found. hwpstate0: on cpu0 NULL mp in getnewvnode(9), tag crossmp Timecounters tick every 1.000 msec hdacc0: at cad 0 on hdac0 hdaa0: at nid 1 on hdacc0 pcm0: at nid 3 on hdaa0 hdacc1: at cad 3 on hdac1 hdaa1: at nid 1 on hdacc1 pcm1: at nid 20,22,21,23 and 24,26 on hdaa1 pcm2: at nid 27 and 25 on hdaa1 pcm3: at nid 30 on hdaa1 ugen1.1: at usbus1 ugen0.1: at usbus0 uhub0: ugen2.1: at usbus2 ugen5.1: at usbus5 on usbus1 uhub2: on usbus0 uhub3: on usbus2 uhub1: on usbus5 ugen4.1: at usbus4 ugen3.1: at usbus3 uhub4: Expensive timeout(9) function: 0xc05fdc10(0xd5ff9000) 0.009115125 s (aprobe0:ahcich0:0:15:0): NOP FLUSHQUEUE. ACB: 00 00 00 00 00 00 00 00 00 00 00 00 on usbus4 (aprobe0:ahcich0:0:15:0): CAM status: Command timeout uhub5: (aprobe0:ahcich0:0:15:0): Error 5, Retries exhausted on usbus3 ada0 at ahcich0 bus 0 scbus0 target 0 lun 0 ada0: ATA8-ACS SATA 2.x device ada0: Serial Number 9VMJ99G5 ada0: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes) ada0: Command Queueing enabled ada0: 476940MB (976773168 512 byte sectors) cd0 at ata0 bus 0 scbus4 target 1 lun 0 cd0: <_NEC DVD_RW ND-4550A 1.06> Removable CD-ROM SCSI device cd0: 33.300MB/s transfers (UDMA2, ATAPI 12bytes, PIO 65534bytes) cd0: Att WARNING: WITNESS option enabled, expect reduced performance. WARNING: DIAGNOSTIC option enabled, expect reduced performance. Trying to mount root from ufs:/dev/ada0s1a [rw]... uhub3: 2 ports with 2 removable, self powered uhub0: 2 ports with 2 removable, self powered uhub2: 2 ports with 2 removable, self powered uhub5: 2 ports with 2 removable, self powered uhub4: 2 ports with 2 removable, self powered Setting hostuuid: 00000000-0000-0000-0000-00218515337d. Setting hostid: 0x6b64ac17. Starting ddb. eval: limits: not found /etc/rc: WARNING: failed to start ddb warning: total configured swap (4194304 pages) exceeds maximum recommended amount (1725680 pages). warning: increase kern.maxswzone or reduce amount of swap. Starting file system checks: /dev/ada0s1a: FILE SYSTEM CLEAN; SKIPPING CHECKS /dev/ada0s1a: clean, 491799 free (2239 frags, 61195 blocks, 0.2% fragmentation) /dev/ada0s1f: FILE SYSTEM CLEAN; SKIPPING CHECKS /dev/ada0s1f: clean, 849938 free (11154 frags, 104848 blocks, 1.1% fragmentation) /dev/label/tmp: FILE SYSTEM CLEAN; SKIPPING CHECKS /dev/label/tmp: clean, 46221764 free (41964 frags, 5772475 blocks, 0.0% fragmentation) /dev/ada0s1d: FILE SYSTEM CLEAN; SKIPPING CHECKS /dev/ada0s1d: clean, 1924117 free (393013 frags, 191388 blocks, 3.9% fragmentation) /dev/ada0s1e: FILE SYSTEM CLEAN; SKIPPING CHECKS /dev/ada0s1e: clean, 5609067 free (232203 frags, 672108 blocks, 0.9% fragmentation) Mounting local filesystems:. ELF ldconfig path: /lib /usr/lib /usr/lib/compat /usr/local/lib /usr/local/lib/compat/pkg /usr/local/arduino/lib /usr/local/lib/compat /usr/local/lib/compat/pkg /usr/local/lib/gcc49 /usr/local/lib/mysql /usr/local/lib/nss /usr/local/lib/perl5/5.24/mach/CORE /usr/local/lib/pth /usr/local/lib/qt4 /usr/local/llvm37/lib /usr/local/llvm39/lib a.out ldconfig path: /usr/lib/aout /usr/lib/compat/aout Setting hostname: x4.osted.lan. Setting up harvesting: [UMA],[FS_ATIME],SWI,INTERRUPT,NET_NG,NET_ETHER,NET_TUN,MOUSE,KEYBOARD,ATTACH,CACHED Feeding entropy: . uhub1: 10 ports with 10 removable, self powered re0: link state changed to DOWN Starting Network: lo0 re0. lo0: flags=8049 metric 0 mtu 16384 options=600003 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2 inet 127.0.0.1 netmask 0xff000000 nd6 options=21 groups: lo re0: flags=8843 metric 0 mtu 1500 options=8209b ether 00:21:85:15:33:7d inet 192.168.1.101 netmask 0xffffff00 broadcast 192.168.1.255 nd6 options=29 media: Ethernet autoselect (none) status: no carrier Starting devd. add host 127.0.0.1: gateway lo0 fib 0: route already in table add net default: gateway 192.168.1.1 add host ::1: gateway lo0 fib 0: route already in table add net fe80::: gateway ::1 add net ff02::: gateway ::1 add net ::ffff:0.0.0.0: gateway ::1 add net ::0.0.0.0: gateway ::1 Creating and/or trimming log files. Starting syslogd. Starting rpcbind. NFS access cache time=60 Starting watchdogd. No core dumps found. Additional ABI support: linux. lock order reversal: 1st 0xcb1dc088 bufwait (bufwait) @ kern/vfs_bio.c:3564 2nd 0xd86c4600 dirhash (dirhash) @ ufs/ufs/ufs_dirhash.c:289 stack backtrace: #0 0xc0cdf5e1 at witness_debugger+0x81 #1 0xc0cdf4a8 at witness_checkorder+0xcd8 #2 0xc0c80b34 at _sx_xlock+0x64 #3 0xc0f9b273 at ufsdirhash_add+0x53 #4 0xc0f9fddf at ufs_direnter+0x4df #5 0xc0fa8f52 at ufs_mkdir+0x852 #6 0xc1285b86 at VOP_MKDIR_APV+0xf6 #7 0xc0d5c5de at kern_mkdirat+0x21e #8 0xc0d5c3b1 at sys_mkdir+0x31 #9 0xc1251a1e at syscall+0x6ee #10 0xc123b0eb at Xint0x80_syscall+0x2b Clearing /tmp (X related). Starting nfsuserd. Starting mountd. Starting nfsd. Starting statd. Starting lockd. Recovering vi editor sessions:. Updating motd:. Mounting late filesystems:. Starting ntpd. Starting powerd. Starting smartd. Feb 7 18:32:31 x4 smartd[639]: Device: /dev/ada0, WARNING: A firmware update for this drive may be available, Feb 7 18:32:31 x4 smartd[639]: see the following Seagate web pages: Feb 7 18:32:31 x4 smartd[639]: http://knowledge.seagate.com/articles/en_US/FAQ/207931en Feb 7 18:32:31 x4 smartd[639]: http://knowledge.seagate.com/articles/en_US/FAQ/213891en Configuring vt: keymap blanktime. Performing sanity check on sshd configuration. Starting sshd. Starting sendmail_submit. Starting sendmail_msp_queue. Starting cron. Local package initialization: backuplock order reversal: 1st 0xd87d3a0c ufs (ufs) @ kern/vfs_subr.c:2607 2nd 0xcb1dc088 bufwait (bufwait) @ ufs/ffs/ffs_vnops.c:282 3rd 0xdbe55cdc ufs (ufs) @ kern/vfs_subr.c:2607 stack backtrace: #0 0xc0cdf5e1 at witness_debugger+0x81 #1 0xc0cdf4a8 at witness_checkorder+0xcd8 #2 0xc0c4b3e6 at __lockmgr_args+0x796 #3 0xc0f95837 at ffs_lock+0xa7 #4 0xc128698a at VOP_LOCK1_APV+0xda #5 0xc0d5fb91 at _vn_lock+0x61 #6 0xc0d4ba81 at vget+0xc1 #7 0xc0d3ccf2 at vfs_hash_get+0xd2 #8 0xc0f90534 at ffs_vgetf+0x44 #9 0xc0f854d7 at softdep_sync_buf+0x357 #10 0xc0f966df at ffs_syncvnode+0x2df #11 0xc0f939a8 at ffs_sync+0x248 #12 0xc0d61324 at vfs_write_suspend+0x1c4 #13 0xc0d61555 at vfs_write_suspend_umnt+0x45 #14 0xc0f93084 at ffs_unmount+0xb4 #15 0xc0d43413 at dounmount+0x583 #16 0xc0d42d85 at sys_unmount+0x315 #17 0xc1251a1e at syscall+0x6ee lock order reversal: 1st 0xd87d419c ufs (ufs) @ kern/vfs_mount.c:1280 2nd 0xd85b946c devfs (devfs) @ ufs/ffs/ffs_softdep.c:1912 stack backtrace: #0 0xc0cdf5e1 at witness_debugger+0x81 #1 0xc0cdf4a8 at witness_checkorder+0xcd8 #2 0xc0c4ab87 at lockmgr_lock_fast_path+0x1c7 #3 0xc0d38e2b at vop_stdlock+0x3b #4 0xc128698a at VOP_LOCK1_APV+0xda #5 0xc0d5fb91 at _vn_lock+0x61 #6 0xc0f729f5 at softdep_flushworklist+0x65 #7 0xc0f93c1a at ffs_sync+0x4ba #8 0xc0d61324 at vfs_write_suspend+0x1c4 #9 0xc0d61555 at vfs_write_suspend_umnt+0x45 #10 0xc0f93084 at ffs_unmount+0xb4 #11 0xc0d43413 at dounmount+0x583 #12 0xc0d42d85 at sys_unmount+0x315 #13 0xc1251a1e at syscall+0x6ee #14 0xc123b0eb at Xint0x80_syscall+0x2b ** /dev/label/tmp ** Last Mounted on /tmp ** Phase 1 - Check Blocks and Sizes ** Phase 2 - Check Pathnames - Peter From owner-svn-src-all@freebsd.org Wed Feb 7 17:45:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 139B0F1808B; Wed, 7 Feb 2018 17:45:02 +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 973BF74B9C; Wed, 7 Feb 2018 17:45:01 +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 w17HixlN013368 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 7 Feb 2018 09:44:59 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w17HixPS013367; Wed, 7 Feb 2018 09:44:59 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 7 Feb 2018 09:44:59 -0800 From: Gleb Smirnoff To: Peter Holm , jtl@FreeBSD.org Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r328916 - in head/sys: kern vm Message-ID: <20180207174459.GL1063@FreeBSD.org> References: <20180206182839.GB1063@FreeBSD.org> <20180206193430.GA36054@x2.osted.lan> <20180206221555.GC1063@FreeBSD.org> <20180206225244.GA40529@x2.osted.lan> <20180206230635.GE1063@FreeBSD.org> <20180206232521.GA41396@x2.osted.lan> <20180207004213.GG1063@FreeBSD.org> <20180207004549.GH1063@FreeBSD.org> <20180207064617.GA49792@x2.osted.lan> <20180207164619.GK1063@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ILuaRSyQpoVaJ1HG" Content-Disposition: inline In-Reply-To: <20180207164619.GK1063@FreeBSD.org> User-Agent: Mutt/1.9.3 (2018-01-21) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 17:45:02 -0000 --ILuaRSyQpoVaJ1HG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Feb 07, 2018 at 08:46:19AM -0800, Gleb Smirnoff wrote: T> On Wed, Feb 07, 2018 at 07:46:17AM +0100, Peter Holm wrote: T> P> On Tue, Feb 06, 2018 at 04:45:49PM -0800, Gleb Smirnoff wrote: T> P> > On Tue, Feb 06, 2018 at 04:42:13PM -0800, Gleb Smirnoff wrote: T> P> > T> Hi Peter, T> P> > T> T> P> > T> can you please try this patch? In either case success T> P> > T> or not, please provide me with dmesg. Thanks a lot! T> P> > T> P> > Sorry, patch was missing one file. 99.9% this is a no-op, T> P> > but better use full patch. T> T> Let's do one more attempt. I found where I miss one keg. The previous patch will probably work for Peter, but not for Jonathan. Here is an updated one. -- Gleb Smirnoff --ILuaRSyQpoVaJ1HG Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="boot_pages.diff" Index: sys/kern/subr_vmem.c =================================================================== --- sys/kern/subr_vmem.c (revision 328955) +++ sys/kern/subr_vmem.c (working copy) @@ -667,7 +667,8 @@ int vmem_startup_count(void) { - return (howmany(BT_MAXALLOC, UMA_SLAB_SIZE / sizeof(struct vmem_btag))); + return (howmany(BT_MAXALLOC, + UMA_SLAB_SPACE / sizeof(struct vmem_btag))); } #endif Index: sys/vm/uma_core.c =================================================================== --- sys/vm/uma_core.c (revision 328955) +++ sys/vm/uma_core.c (working copy) @@ -96,6 +96,7 @@ __FBSDID("$FreeBSD$"); #ifdef DEBUG_MEMGUARD #include #endif +#define DIAGNOSTIC /* * This is the zone and keg from which all zones are spawned. @@ -1102,7 +1103,7 @@ startup_alloc(uma_zone_t zone, vm_size_t bytes, in } mtx_unlock(&uma_boot_pages_mtx); if (booted < BOOT_PAGEALLOC) - panic("UMA: Increase vm.boot_pages"); + panic("UMA zone \"%s\": Increase vm.boot_pages", zone->uz_name); /* * Now that we've booted reset these users to their real allocator. */ @@ -1785,6 +1786,8 @@ zone_foreach(void (*zfunc)(uma_zone_t)) * zone of zones and zone of kegs are accounted separately. */ #define UMA_BOOT_ZONES 11 +/* Zone of zones and zone of kegs have arbitrary alignemnt. */ +#define UMA_BOOT_ALIGN 32 static int zsize, ksize; int uma_startup_count(int zones) @@ -1796,28 +1799,43 @@ uma_startup_count(int zones) zsize = sizeof(struct uma_zone) + (sizeof(struct uma_cache) * (mp_maxid + 1)) + (sizeof(struct uma_zone_domain) * vm_ndomains); + printf("ksize %d zsize %d slab %lu\n", ksize, zsize, sizeof(struct uma_slab)); - /* Memory for the zone of zones and zone of kegs. */ + /* + * Memory for the zone of kegs and its keg, + * and for zone of zones. + */ pages = howmany(roundup(zsize, CACHE_LINE_SIZE) * 2 + roundup(ksize, CACHE_LINE_SIZE), PAGE_SIZE); + printf("boot_pages master %d\n", pages); zones += UMA_BOOT_ZONES; - /* Memory for startup zones, UMA and VM, ... */ + /* Memory for the rest of startup zones, UMA and VM, ... */ if (zsize > UMA_SLAB_SIZE) - pages += zones * howmany(zsize, UMA_SLAB_SIZE); + pages += zones * howmany(roundup2(zsize, UMA_BOOT_ALIGN), + UMA_SLAB_SIZE); else - pages += howmany(zones, UMA_SLAB_SIZE / zsize); + pages += howmany(zones, + UMA_SLAB_SPACE / roundup2(zsize, UMA_BOOT_ALIGN)); + printf("boot_pages zones %d\n", pages); - /* ... and their kegs. */ - pages += howmany(zones, UMA_SLAB_SIZE / ksize); + /* ... and their kegs. Note that zone of zones allocates a keg! */ + pages += howmany(zones + 1, + UMA_SLAB_SPACE / roundup2(ksize, UMA_BOOT_ALIGN)); + printf("boot_pages kegs %d\n", pages); /* - * Take conservative approach that every zone - * is going to allocate hash. + * Most of startup zones are not going to be offpages, that's + * why we use UMA_SLAB_SPACE instead of UMA_SLAB_SIZE in all + * calculations. Some large bucket zones will be offpage, and + * thus will allocate hashes. We take conservative approach + * and assume that all zones may allocate hash. This may give + * us some positive imprecision, usually an extra single page. */ - pages += howmany(zones, UMA_SLAB_SIZE / + pages += howmany(zones, UMA_SLAB_SPACE / (sizeof(struct slabhead *) * UMA_HASH_SIZE_INIT)); + printf("boot_pages hash %d\n", pages); return (pages); } @@ -1856,7 +1874,7 @@ uma_startup(void *mem, int npages) args.uminit = zero_init; args.fini = NULL; args.keg = masterkeg; - args.align = 32 - 1; + args.align = UMA_BOOT_ALIGN - 1; args.flags = UMA_ZFLAG_INTERNAL; zone_ctor(kegs, zsize, &args, M_WAITOK); @@ -1871,7 +1889,7 @@ uma_startup(void *mem, int npages) args.uminit = zero_init; args.fini = NULL; args.keg = NULL; - args.align = 32 - 1; + args.align = UMA_BOOT_ALIGN - 1; args.flags = UMA_ZFLAG_INTERNAL; zone_ctor(zones, zsize, &args, M_WAITOK); Index: sys/vm/uma_int.h =================================================================== --- sys/vm/uma_int.h (revision 328955) +++ sys/vm/uma_int.h (working copy) @@ -138,6 +138,11 @@ #define UMA_MAX_WASTE 10 /* + * Size of memory in a not offpage slab available for actual items. + */ +#define UMA_SLAB_SPACE (UMA_SLAB_SIZE - sizeof(struct uma_slab)) + +/* * I doubt there will be many cases where this is exceeded. This is the initial * size of the hash table for uma_slabs that are managed off page. This hash * does expand by powers of two. Currently it doesn't get smaller. Index: sys/vm/vm_page.c =================================================================== --- sys/vm/vm_page.c (revision 328955) +++ sys/vm/vm_page.c (working copy) @@ -518,8 +518,11 @@ vm_page_startup(vm_offset_t vaddr) /* vmem_startup() calls uma_prealloc(). */ boot_pages += vmem_startup_count(); + printf("boot_pages vmem %d\n", boot_pages); /* vm_map_startup() calls uma_prealloc(). */ - boot_pages += howmany(MAX_KMAP, UMA_SLAB_SIZE / sizeof(struct vm_map)); + boot_pages += howmany(MAX_KMAP, + UMA_SLAB_SPACE / sizeof(struct vm_map)); + printf("boot_pages kmap %d\n", boot_pages); /* * Before going fully functional kmem_init() does allocation --ILuaRSyQpoVaJ1HG-- From owner-svn-src-all@freebsd.org Wed Feb 7 18:17:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB007F1A4C2; Wed, 7 Feb 2018 18:17:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D55047644F; Wed, 7 Feb 2018 18:17:10 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D005625A9; Wed, 7 Feb 2018 18:17:10 +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 w17IHAQp039622; Wed, 7 Feb 2018 18:17:10 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17IHAXA039620; Wed, 7 Feb 2018 18:17:10 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802071817.w17IHAXA039620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 7 Feb 2018 18:17:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328980 - stable/11/sys/compat/linuxkpi/common/src X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 328980 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 18:17:12 -0000 Author: hselasky Date: Wed Feb 7 18:17:10 2018 New Revision: 328980 URL: https://svnweb.freebsd.org/changeset/base/328980 Log: MFC r328436 and r328731: Decouple Linux files from the belonging character device right after open in the LinuxKPI. This is done by calling finit() just before returning a magic value of ENXIO in the "linux_dev_fdopen" function. The Linux file structure should mimic the BSD file structure as much as possible. This patch decouples the Linux file structure from the belonging character device right after the "linux_dev_fdopen" function has returned. This fixes an issue which allows a Linux file handle to exist after a character device has been destroyed and removed from the directory index of /dev. Only when the reference count of the BSD file handle reaches zero, the Linux file handle is destroyed. This fixes use-after-free issues related to accessing the Linux file structure after the character device has been destroyed. While at it add a missing NULL check for non-present file operation. Calling a NULL pointer will result in a segmentation fault. Fix some recent regressions after r328436 in the LinuxKPI: 1) The OPW() function macro should have the same return type like the function it executes. 2) The DEVFS I/O-limit should be enforced for all character device reads and writes. 3) The character device file handle should be passable, same as for DEVFS based file handles. Reviewed by: kib @ Reported by: jbeich @ Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Wed Feb 7 17:09:12 2018 (r328979) +++ stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Wed Feb 7 18:17:10 2018 (r328980) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -391,18 +392,6 @@ kobject_init_and_add(struct kobject *kobj, const struc } static void -linux_file_dtor(void *cdp) -{ - struct linux_file *filp; - - linux_set_current(curthread); - filp = cdp; - filp->f_op->release(filp->f_vnode, filp); - vdrop(filp->f_vnode); - kfree(filp); -} - -static void linux_kq_lock(void *arg) { spinlock_t *s = arg; @@ -438,7 +427,7 @@ linux_kq_lock_unowned(void *arg) } static void -linux_dev_kqfilter_poll(struct linux_file *, int); +linux_file_kqfilter_poll(struct linux_file *, int); struct linux_file * linux_file_alloc(void) @@ -678,24 +667,31 @@ static struct cdev_pager_ops linux_cdev_pager_ops[2] = }, }; +#define OPW(fp,td,code) ({ \ + struct file *__fpop; \ + __typeof(code) __retval; \ + \ + __fpop = (td)->td_fpop; \ + (td)->td_fpop = (fp); \ + __retval = (code); \ + (td)->td_fpop = __fpop; \ + __retval; \ +}) + static int -linux_dev_open(struct cdev *dev, int oflags, int devtype, struct thread *td) +linux_dev_fdopen(struct cdev *dev, int fflags, struct thread *td, struct file *file) { struct linux_cdev *ldev; struct linux_file *filp; - struct file *file; int error; - file = td->td_fpop; ldev = dev->si_drv1; - if (ldev == NULL) - return (ENODEV); filp = linux_file_alloc(); filp->f_dentry = &filp->f_dentry_store; filp->f_op = ldev->ops; + filp->f_mode = file->f_flag; filp->f_flags = file->f_flag; - vhold(file->f_vnode); filp->f_vnode = file->f_vnode; filp->_file = file; @@ -704,35 +700,17 @@ linux_dev_open(struct cdev *dev, int oflags, int devty if (filp->f_op->open) { error = -filp->f_op->open(file->f_vnode, filp); if (error) { - vdrop(filp->f_vnode); kfree(filp); - goto done; + return (error); } } - error = devfs_set_cdevpriv(filp, linux_file_dtor); - if (error) { - filp->f_op->release(file->f_vnode, filp); - vdrop(filp->f_vnode); - kfree(filp); - } -done: - return (error); -} -static int -linux_dev_close(struct cdev *dev, int fflag, int devtype, struct thread *td) -{ - struct linux_file *filp; - struct file *file; - int error; + /* hold on to the vnode - used for fstat() */ + vhold(filp->f_vnode); - file = td->td_fpop; - if ((error = devfs_get_cdevpriv((void **)&filp)) != 0) - return (error); - filp->f_flags = file->f_flag; - devfs_clear_cdevpriv(); - - return (0); + /* release the file from devfs */ + finit(file, filp->f_mode, DTYPE_DEV, filp, &linuxfileops); + return (ENXIO); } #define LINUX_IOCTL_MIN_PTR 0x10000UL @@ -850,24 +828,12 @@ linux_access_ok(int rw, const void *uaddr, size_t len) } static int -linux_dev_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, - struct thread *td) +linux_file_ioctl_sub(struct file *fp, struct linux_file *filp, + u_long cmd, caddr_t data, struct thread *td) { - struct linux_file *filp; - struct file *file; unsigned size; int error; - file = td->td_fpop; - if ((error = devfs_get_cdevpriv((void **)&filp)) != 0) - return (error); - filp->f_flags = file->f_flag; - - /* the LinuxKPI supports blocking and non-blocking I/O */ - if (cmd == FIONBIO || cmd == FIOASYNC) - return (0); - - linux_set_current(td); size = IOCPARM_LEN(cmd); /* refer to logic in sys_ioctl() */ if (size > 0) { @@ -888,17 +854,17 @@ linux_dev_ioctl(struct cdev *dev, u_long cmd, caddr_t if (td->td_proc->p_elf_machine == EM_386) { /* try the compat IOCTL handler first */ if (filp->f_op->compat_ioctl != NULL) - error = -filp->f_op->compat_ioctl(filp, cmd, (u_long)data); + error = -OPW(fp, td, filp->f_op->compat_ioctl(filp, cmd, (u_long)data)); else error = ENOTTY; /* fallback to the regular IOCTL handler, if any */ if (error == ENOTTY && filp->f_op->unlocked_ioctl != NULL) - error = -filp->f_op->unlocked_ioctl(filp, cmd, (u_long)data); + error = -OPW(fp, td, filp->f_op->unlocked_ioctl(filp, cmd, (u_long)data)); } else #endif if (filp->f_op->unlocked_ioctl != NULL) - error = -filp->f_op->unlocked_ioctl(filp, cmd, (u_long)data); + error = -OPW(fp, td, filp->f_op->unlocked_ioctl(filp, cmd, (u_long)data)); else error = ENOTTY; if (size > 0) { @@ -908,118 +874,15 @@ linux_dev_ioctl(struct cdev *dev, u_long cmd, caddr_t if (error == EWOULDBLOCK) { /* update kqfilter status, if any */ - linux_dev_kqfilter_poll(filp, + linux_file_kqfilter_poll(filp, LINUX_KQ_FLAG_HAS_READ | LINUX_KQ_FLAG_HAS_WRITE); } else if (error == ERESTARTSYS) error = ERESTART; return (error); } -static int -linux_dev_read(struct cdev *dev, struct uio *uio, int ioflag) -{ - struct linux_file *filp; - struct thread *td; - struct file *file; - ssize_t bytes; - int error; - - td = curthread; - file = td->td_fpop; - if ((error = devfs_get_cdevpriv((void **)&filp)) != 0) - return (error); - filp->f_flags = file->f_flag; - /* XXX no support for I/O vectors currently */ - if (uio->uio_iovcnt != 1) - return (EOPNOTSUPP); - linux_set_current(td); - if (filp->f_op->read) { - bytes = filp->f_op->read(filp, uio->uio_iov->iov_base, - uio->uio_iov->iov_len, &uio->uio_offset); - if (bytes >= 0) { - uio->uio_iov->iov_base = - ((uint8_t *)uio->uio_iov->iov_base) + bytes; - uio->uio_iov->iov_len -= bytes; - uio->uio_resid -= bytes; - } else { - error = -bytes; - if (error == ERESTARTSYS) - error = ERESTART; - } - } else - error = ENXIO; - - /* update kqfilter status, if any */ - linux_dev_kqfilter_poll(filp, LINUX_KQ_FLAG_HAS_READ); - - return (error); -} - -static int -linux_dev_write(struct cdev *dev, struct uio *uio, int ioflag) -{ - struct linux_file *filp; - struct thread *td; - struct file *file; - ssize_t bytes; - int error; - - td = curthread; - file = td->td_fpop; - if ((error = devfs_get_cdevpriv((void **)&filp)) != 0) - return (error); - filp->f_flags = file->f_flag; - /* XXX no support for I/O vectors currently */ - if (uio->uio_iovcnt != 1) - return (EOPNOTSUPP); - linux_set_current(td); - if (filp->f_op->write) { - bytes = filp->f_op->write(filp, uio->uio_iov->iov_base, - uio->uio_iov->iov_len, &uio->uio_offset); - if (bytes >= 0) { - uio->uio_iov->iov_base = - ((uint8_t *)uio->uio_iov->iov_base) + bytes; - uio->uio_iov->iov_len -= bytes; - uio->uio_resid -= bytes; - } else { - error = -bytes; - if (error == ERESTARTSYS) - error = ERESTART; - } - } else - error = ENXIO; - - /* update kqfilter status, if any */ - linux_dev_kqfilter_poll(filp, LINUX_KQ_FLAG_HAS_WRITE); - - return (error); -} - #define LINUX_POLL_TABLE_NORMAL ((poll_table *)1) -static int -linux_dev_poll(struct cdev *dev, int events, struct thread *td) -{ - struct linux_file *filp; - struct file *file; - int revents; - - if (devfs_get_cdevpriv((void **)&filp) != 0) - goto error; - - file = td->td_fpop; - filp->f_flags = file->f_flag; - linux_set_current(td); - if (filp->f_op->poll != NULL) - revents = filp->f_op->poll(filp, LINUX_POLL_TABLE_NORMAL) & events; - else - revents = 0; - - return (revents); -error: - return (events & (POLLHUP|POLLIN|POLLRDNORM|POLLOUT|POLLWRNORM)); -} - /* * This function atomically updates the poll wakeup state and returns * the previous state at the time of update. @@ -1127,7 +990,7 @@ linux_poll_wakeup(struct linux_file *filp) } static void -linux_dev_kqfilter_detach(struct knote *kn) +linux_file_kqfilter_detach(struct knote *kn) { struct linux_file *filp = kn->kn_hook; @@ -1137,7 +1000,7 @@ linux_dev_kqfilter_detach(struct knote *kn) } static int -linux_dev_kqfilter_read_event(struct knote *kn, long hint) +linux_file_kqfilter_read_event(struct knote *kn, long hint) { struct linux_file *filp = kn->kn_hook; @@ -1147,7 +1010,7 @@ linux_dev_kqfilter_read_event(struct knote *kn, long h } static int -linux_dev_kqfilter_write_event(struct knote *kn, long hint) +linux_file_kqfilter_write_event(struct knote *kn, long hint) { struct linux_file *filp = kn->kn_hook; @@ -1158,24 +1021,26 @@ linux_dev_kqfilter_write_event(struct knote *kn, long static struct filterops linux_dev_kqfiltops_read = { .f_isfd = 1, - .f_detach = linux_dev_kqfilter_detach, - .f_event = linux_dev_kqfilter_read_event, + .f_detach = linux_file_kqfilter_detach, + .f_event = linux_file_kqfilter_read_event, }; static struct filterops linux_dev_kqfiltops_write = { .f_isfd = 1, - .f_detach = linux_dev_kqfilter_detach, - .f_event = linux_dev_kqfilter_write_event, + .f_detach = linux_file_kqfilter_detach, + .f_event = linux_file_kqfilter_write_event, }; static void -linux_dev_kqfilter_poll(struct linux_file *filp, int kqflags) +linux_file_kqfilter_poll(struct linux_file *filp, int kqflags) { int temp; if (filp->f_kqflags & kqflags) { + struct thread *td = curthread; + /* get the latest polling state */ - temp = filp->f_op->poll(filp, NULL); + temp = OPW(filp->_file, td, filp->f_op->poll(filp, NULL)); spin_lock(&filp->f_kqlock); /* clear kqflags */ @@ -1196,17 +1061,14 @@ linux_dev_kqfilter_poll(struct linux_file *filp, int k } static int -linux_dev_kqfilter(struct cdev *dev, struct knote *kn) +linux_file_kqfilter(struct file *file, struct knote *kn) { struct linux_file *filp; - struct file *file; struct thread *td; int error; td = curthread; - file = td->td_fpop; - if ((error = devfs_get_cdevpriv((void **)&filp)) != 0) - return (error); + filp = (struct linux_file *)file->f_data; filp->f_flags = file->f_flag; if (filp->f_op->poll == NULL) return (EINVAL); @@ -1218,12 +1080,14 @@ linux_dev_kqfilter(struct cdev *dev, struct knote *kn) kn->kn_fop = &linux_dev_kqfiltops_read; kn->kn_hook = filp; knlist_add(&filp->f_selinfo.si_note, kn, 1); + error = 0; break; case EVFILT_WRITE: filp->f_kqflags |= LINUX_KQ_FLAG_HAS_WRITE; kn->kn_fop = &linux_dev_kqfiltops_write; kn->kn_hook = filp; knlist_add(&filp->f_selinfo.si_note, kn, 1); + error = 0; break; default: error = EINVAL; @@ -1235,32 +1099,28 @@ linux_dev_kqfilter(struct cdev *dev, struct knote *kn) linux_set_current(td); /* update kqfilter status, if any */ - linux_dev_kqfilter_poll(filp, + linux_file_kqfilter_poll(filp, LINUX_KQ_FLAG_HAS_READ | LINUX_KQ_FLAG_HAS_WRITE); } return (error); } static int -linux_dev_mmap_single(struct cdev *dev, vm_ooffset_t *offset, - vm_size_t size, struct vm_object **object, int nprot) +linux_file_mmap_single(struct file *fp, vm_ooffset_t *offset, + vm_size_t size, struct vm_object **object, int nprot, + struct thread *td) { struct vm_area_struct *vmap; struct mm_struct *mm; struct linux_file *filp; - struct thread *td; - struct file *file; vm_memattr_t attr; int error; - td = curthread; - file = td->td_fpop; - if ((error = devfs_get_cdevpriv((void **)&filp)) != 0) - return (error); - filp->f_flags = file->f_flag; + filp = (struct linux_file *)fp->f_data; + filp->f_flags = fp->f_flag; if (filp->f_op->mmap == NULL) - return (ENODEV); + return (EOPNOTSUPP); linux_set_current(td); @@ -1288,7 +1148,7 @@ linux_dev_mmap_single(struct cdev *dev, vm_ooffset_t * if (unlikely(down_write_killable(&vmap->vm_mm->mmap_sem))) { error = EINTR; } else { - error = -filp->f_op->mmap(filp, vmap); + error = -OPW(fp, td, filp->f_op->mmap(filp, vmap)); up_write(&vmap->vm_mm->mmap_sem); } @@ -1351,11 +1211,11 @@ linux_dev_mmap_single(struct cdev *dev, vm_ooffset_t * if (vm_no_fault) { *object = cdev_pager_allocate(vm_private_data, OBJT_DEVICE, &linux_cdev_pager_ops[1], size, nprot, *offset, - curthread->td_ucred); + td->td_ucred); } else { *object = cdev_pager_allocate(vm_private_data, OBJT_MGTDEVICE, &linux_cdev_pager_ops[0], size, nprot, *offset, - curthread->td_ucred); + td->td_ucred); } /* check if allocating the VM object failed */ @@ -1376,7 +1236,7 @@ linux_dev_mmap_single(struct cdev *dev, vm_ooffset_t * (vm_paddr_t)vmap->vm_pfn << PAGE_SHIFT, vmap->vm_len); *object = vm_pager_allocate(OBJT_SG, sg, vmap->vm_len, - nprot, 0, curthread->td_ucred); + nprot, 0, td->td_ucred); linux_cdev_handle_free(vmap); @@ -1397,15 +1257,7 @@ linux_dev_mmap_single(struct cdev *dev, vm_ooffset_t * struct cdevsw linuxcdevsw = { .d_version = D_VERSION, - .d_flags = D_TRACKCLOSE, - .d_open = linux_dev_open, - .d_close = linux_dev_close, - .d_read = linux_dev_read, - .d_write = linux_dev_write, - .d_ioctl = linux_dev_ioctl, - .d_mmap_single = linux_dev_mmap_single, - .d_poll = linux_dev_poll, - .d_kqfilter = linux_dev_kqfilter, + .d_fdopen = linux_dev_fdopen, .d_name = "lkpidev", }; @@ -1423,24 +1275,71 @@ linux_file_read(struct file *file, struct uio *uio, st /* XXX no support for I/O vectors currently */ if (uio->uio_iovcnt != 1) return (EOPNOTSUPP); + if (uio->uio_resid > DEVFS_IOSIZE_MAX) + return (EINVAL); linux_set_current(td); if (filp->f_op->read) { - bytes = filp->f_op->read(filp, uio->uio_iov->iov_base, - uio->uio_iov->iov_len, &uio->uio_offset); + bytes = OPW(file, td, filp->f_op->read(filp, uio->uio_iov->iov_base, + uio->uio_iov->iov_len, &uio->uio_offset)); if (bytes >= 0) { uio->uio_iov->iov_base = ((uint8_t *)uio->uio_iov->iov_base) + bytes; uio->uio_iov->iov_len -= bytes; uio->uio_resid -= bytes; - } else + } else { error = -bytes; + if (error == ERESTARTSYS) + error = ERESTART; + } } else error = ENXIO; + /* update kqfilter status, if any */ + linux_file_kqfilter_poll(filp, LINUX_KQ_FLAG_HAS_READ); + return (error); } static int +linux_file_write(struct file *file, struct uio *uio, struct ucred *active_cred, + int flags, struct thread *td) +{ + struct linux_file *filp; + ssize_t bytes; + int error; + + error = 0; + filp = (struct linux_file *)file->f_data; + filp->f_flags = file->f_flag; + /* XXX no support for I/O vectors currently */ + if (uio->uio_iovcnt != 1) + return (EOPNOTSUPP); + if (uio->uio_resid > DEVFS_IOSIZE_MAX) + return (EINVAL); + linux_set_current(td); + if (filp->f_op->write) { + bytes = OPW(file, td, filp->f_op->write(filp, uio->uio_iov->iov_base, + uio->uio_iov->iov_len, &uio->uio_offset)); + if (bytes >= 0) { + uio->uio_iov->iov_base = + ((uint8_t *)uio->uio_iov->iov_base) + bytes; + uio->uio_iov->iov_len -= bytes; + uio->uio_resid -= bytes; + } else { + error = -bytes; + if (error == ERESTARTSYS) + error = ERESTART; + } + } else + error = ENXIO; + + /* update kqfilter status, if any */ + linux_file_kqfilter_poll(filp, LINUX_KQ_FLAG_HAS_WRITE); + + return (error); +} + +static int linux_file_poll(struct file *file, int events, struct ucred *active_cred, struct thread *td) { @@ -1451,7 +1350,7 @@ linux_file_poll(struct file *file, int events, struct filp->f_flags = file->f_flag; linux_set_current(td); if (filp->f_op->poll != NULL) - revents = filp->f_op->poll(filp, LINUX_POLL_TABLE_NORMAL) & events; + revents = OPW(file, td, filp->f_op->poll(filp, LINUX_POLL_TABLE_NORMAL)) & events; else revents = 0; @@ -1465,11 +1364,16 @@ linux_file_close(struct file *file, struct thread *td) int error; filp = (struct linux_file *)file->f_data; + + KASSERT(file_count(filp) == 0, ("File refcount(%d) is not zero", file_count(filp))); + filp->f_flags = file->f_flag; linux_set_current(td); linux_poll_wait_dequeue(filp); - error = -filp->f_op->release(NULL, filp); + error = -OPW(file, td, filp->f_op->release(filp->f_vnode, filp)); funsetown(&filp->f_sigio); + if (filp->f_vnode != NULL) + vdrop(filp->f_vnode); kfree(filp); return (error); @@ -1493,30 +1397,128 @@ linux_file_ioctl(struct file *fp, u_long cmd, void *da case FIOASYNC: if (filp->f_op->fasync == NULL) break; - error = filp->f_op->fasync(0, filp, fp->f_flag & FASYNC); + error = -OPW(fp, td, filp->f_op->fasync(0, filp, fp->f_flag & FASYNC)); break; case FIOSETOWN: error = fsetown(*(int *)data, &filp->f_sigio); - if (error == 0) - error = filp->f_op->fasync(0, filp, - fp->f_flag & FASYNC); + if (error == 0) { + if (filp->f_op->fasync == NULL) + break; + error = -OPW(fp, td, filp->f_op->fasync(0, filp, + fp->f_flag & FASYNC)); + } break; case FIOGETOWN: *(int *)data = fgetown(&filp->f_sigio); break; default: - error = ENOTTY; + error = linux_file_ioctl_sub(fp, filp, cmd, data, td); break; } return (error); } static int +linux_file_mmap_sub(struct thread *td, vm_size_t objsize, vm_prot_t prot, + vm_prot_t *maxprotp, int *flagsp, struct file *fp, + vm_ooffset_t *foff, vm_object_t *objp) +{ + /* + * Character devices do not provide private mappings + * of any kind: + */ + if ((*maxprotp & VM_PROT_WRITE) == 0 && + (prot & VM_PROT_WRITE) != 0) + return (EACCES); + if ((*flagsp & (MAP_PRIVATE | MAP_COPY)) != 0) + return (EINVAL); + + return (linux_file_mmap_single(fp, foff, objsize, objp, (int)prot, td)); +} + +static int +linux_file_mmap(struct file *fp, vm_map_t map, vm_offset_t *addr, vm_size_t size, + vm_prot_t prot, vm_prot_t cap_maxprot, int flags, vm_ooffset_t foff, + struct thread *td) +{ + struct linux_file *filp; + struct mount *mp; + struct vnode *vp; + vm_object_t object; + vm_prot_t maxprot; + int error; + + filp = (struct linux_file *)fp->f_data; + + vp = filp->f_vnode; + if (vp == NULL) + return (EOPNOTSUPP); + + /* + * Ensure that file and memory protections are + * compatible. + */ + mp = vp->v_mount; + if (mp != NULL && (mp->mnt_flag & MNT_NOEXEC) != 0) { + maxprot = VM_PROT_NONE; + if ((prot & VM_PROT_EXECUTE) != 0) + return (EACCES); + } else + maxprot = VM_PROT_EXECUTE; + if ((fp->f_flag & FREAD) != 0) + maxprot |= VM_PROT_READ; + else if ((prot & VM_PROT_READ) != 0) + return (EACCES); + + /* + * If we are sharing potential changes via MAP_SHARED and we + * are trying to get write permission although we opened it + * without asking for it, bail out. + * + * Note that most character devices always share mappings. + * + * Rely on linux_file_mmap_sub() to fail invalid MAP_PRIVATE + * requests rather than doing it here. + */ + if ((flags & MAP_SHARED) != 0) { + if ((fp->f_flag & FWRITE) != 0) + maxprot |= VM_PROT_WRITE; + else if ((prot & VM_PROT_WRITE) != 0) + return (EACCES); + } + maxprot &= cap_maxprot; + + error = linux_file_mmap_sub(td, size, prot, &maxprot, &flags, fp, &foff, + &object); + if (error != 0) + return (error); + + error = vm_mmap_object(map, addr, size, prot, maxprot, flags, object, + foff, FALSE, td); + if (error != 0) + vm_object_deallocate(object); + return (error); +} + +static int linux_file_stat(struct file *fp, struct stat *sb, struct ucred *active_cred, struct thread *td) { + struct linux_file *filp; + struct vnode *vp; + int error; - return (EOPNOTSUPP); + filp = (struct linux_file *)fp->f_data; + if (filp->f_vnode == NULL) + return (EOPNOTSUPP); + + vp = filp->f_vnode; + + vn_lock(vp, LK_SHARED | LK_RETRY); + error = vn_stat(vp, sb, td->td_ucred, NOCRED, td); + VOP_UNLOCK(vp, 0); + + return (error); } static int @@ -1544,17 +1546,19 @@ linux_iminor(struct inode *inode) struct fileops linuxfileops = { .fo_read = linux_file_read, - .fo_write = invfo_rdwr, + .fo_write = linux_file_write, .fo_truncate = invfo_truncate, - .fo_kqfilter = invfo_kqfilter, + .fo_kqfilter = linux_file_kqfilter, .fo_stat = linux_file_stat, .fo_fill_kinfo = linux_file_fill_kinfo, .fo_poll = linux_file_poll, .fo_close = linux_file_close, .fo_ioctl = linux_file_ioctl, + .fo_mmap = linux_file_mmap, .fo_chmod = invfo_chmod, .fo_chown = invfo_chown, .fo_sendfile = invfo_sendfile, + .fo_flags = DFLAG_PASSABLE, }; /* From owner-svn-src-all@freebsd.org Wed Feb 7 18:18:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2813F1A702; Wed, 7 Feb 2018 18:18:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 64C9E7662D; Wed, 7 Feb 2018 18:18:33 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5FC1125AA; Wed, 7 Feb 2018 18:18:33 +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 w17IIXaj039721; Wed, 7 Feb 2018 18:18:33 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17IIXCi039720; Wed, 7 Feb 2018 18:18:33 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802071818.w17IIXCi039720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 7 Feb 2018 18:18:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328981 - stable/11/sys/compat/linuxkpi/common/src X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 328981 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 18:18:33 -0000 Author: hselasky Date: Wed Feb 7 18:18:33 2018 New Revision: 328981 URL: https://svnweb.freebsd.org/changeset/base/328981 Log: MFC r328694: Make sure the LinuxKPI's internal ERESTARTSYS error code gets translated into ERESTART for mmap and page fault calls aswell. Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Wed Feb 7 18:17:10 2018 (r328980) +++ stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Wed Feb 7 18:18:33 2018 (r328981) @@ -1149,6 +1149,8 @@ linux_file_mmap_single(struct file *fp, vm_ooffset_t * error = EINTR; } else { error = -OPW(fp, td, filp->f_op->mmap(filp, vmap)); + if (error == ERESTARTSYS) + error = ERESTART; up_write(&vmap->vm_mm->mmap_sem); } From owner-svn-src-all@freebsd.org Wed Feb 7 18:25:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 389A7F1AF08; Wed, 7 Feb 2018 18:25:07 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay01.pair.com (relay01.pair.com [209.68.5.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DDE3B76D68; Wed, 7 Feb 2018 18:25:06 +0000 (UTC) (envelope-from pho@holm.cc) Received: from x2.osted.lan (87-58-223-204-dynamic.dk.customer.tdc.net [87.58.223.204]) by relay01.pair.com (Postfix) with ESMTP id B0633D00AD8; Wed, 7 Feb 2018 13:25:05 -0500 (EST) Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.14.9/8.14.9) with ESMTP id w17IP3B7063975 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 7 Feb 2018 19:25:04 +0100 (CET) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.14.9/8.14.9/Submit) id w17IP31c063974; Wed, 7 Feb 2018 19:25:03 +0100 (CET) (envelope-from pho) Date: Wed, 7 Feb 2018 19:25:03 +0100 From: Peter Holm To: Gleb Smirnoff Cc: jtl@FreeBSD.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r328916 - in head/sys: kern vm Message-ID: <20180207182503.GA63930@x2.osted.lan> References: <20180206193430.GA36054@x2.osted.lan> <20180206221555.GC1063@FreeBSD.org> <20180206225244.GA40529@x2.osted.lan> <20180206230635.GE1063@FreeBSD.org> <20180206232521.GA41396@x2.osted.lan> <20180207004213.GG1063@FreeBSD.org> <20180207004549.GH1063@FreeBSD.org> <20180207064617.GA49792@x2.osted.lan> <20180207164619.GK1063@FreeBSD.org> <20180207174459.GL1063@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180207174459.GL1063@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 18:25:07 -0000 On Wed, Feb 07, 2018 at 09:44:59AM -0800, Gleb Smirnoff wrote: > On Wed, Feb 07, 2018 at 08:46:19AM -0800, Gleb Smirnoff wrote: > T> On Wed, Feb 07, 2018 at 07:46:17AM +0100, Peter Holm wrote: > T> P> On Tue, Feb 06, 2018 at 04:45:49PM -0800, Gleb Smirnoff wrote: > T> P> > On Tue, Feb 06, 2018 at 04:42:13PM -0800, Gleb Smirnoff wrote: > T> P> > T> Hi Peter, > T> P> > T> > T> P> > T> can you please try this patch? In either case success > T> P> > T> or not, please provide me with dmesg. Thanks a lot! > T> P> > > T> P> > Sorry, patch was missing one file. 99.9% this is a no-op, > T> P> > but better use full patch. > T> > T> Let's do one more attempt. I found where I miss one keg. > > The previous patch will probably work for Peter, but not for > Jonathan. Here is an updated one. > Yes, it boots on i386. - Peter From owner-svn-src-all@freebsd.org Wed Feb 7 18:32:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3B67F1B868; Wed, 7 Feb 2018 18:32:52 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 84D437763D; Wed, 7 Feb 2018 18:32:52 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7FAAE28E8; Wed, 7 Feb 2018 18:32:52 +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 w17IWqkG049684; Wed, 7 Feb 2018 18:32:52 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17IWqQp049679; Wed, 7 Feb 2018 18:32:52 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201802071832.w17IWqQp049679@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 7 Feb 2018 18:32:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328982 - in head/sys: kern vm X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys: kern vm X-SVN-Commit-Revision: 328982 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 18:32:53 -0000 Author: glebius Date: Wed Feb 7 18:32:51 2018 New Revision: 328982 URL: https://svnweb.freebsd.org/changeset/base/328982 Log: Fix three miscalculations in amount of boot pages: o Most of startup zones have struct uma_slab embedded into the slab, so provide macro UMA_SLAB_SPACE and use it instead of UMA_SLAB_SIZE, when calculating how many pages would certain kind of allocations require. Some zones are offpage, so we might have a positive inaccuracy. o The keg for the zone of zones is allocated "dynamically", so we need +1 when calculating amount of pages for kegs. [1] o The zones of zones and zones of kegs have arbitrary alignment of 32, and this also needs to be accounted for. [2] While here, spread more comments and improve diagnostic messages. Reported by: pho [1], jtl [2] Modified: head/sys/kern/subr_vmem.c head/sys/vm/uma_core.c head/sys/vm/uma_int.h head/sys/vm/vm_page.c Modified: head/sys/kern/subr_vmem.c ============================================================================== --- head/sys/kern/subr_vmem.c Wed Feb 7 18:18:33 2018 (r328981) +++ head/sys/kern/subr_vmem.c Wed Feb 7 18:32:51 2018 (r328982) @@ -667,7 +667,8 @@ int vmem_startup_count(void) { - return (howmany(BT_MAXALLOC, UMA_SLAB_SIZE / sizeof(struct vmem_btag))); + return (howmany(BT_MAXALLOC, + UMA_SLAB_SPACE / sizeof(struct vmem_btag))); } #endif Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Wed Feb 7 18:18:33 2018 (r328981) +++ head/sys/vm/uma_core.c Wed Feb 7 18:32:51 2018 (r328982) @@ -1102,7 +1102,7 @@ startup_alloc(uma_zone_t zone, vm_size_t bytes, int do } mtx_unlock(&uma_boot_pages_mtx); if (booted < BOOT_PAGEALLOC) - panic("UMA: Increase vm.boot_pages"); + panic("UMA zone \"%s\": Increase vm.boot_pages", zone->uz_name); /* * Now that we've booted reset these users to their real allocator. */ @@ -1785,6 +1785,8 @@ zone_foreach(void (*zfunc)(uma_zone_t)) * zone of zones and zone of kegs are accounted separately. */ #define UMA_BOOT_ZONES 11 +/* Zone of zones and zone of kegs have arbitrary alignment. */ +#define UMA_BOOT_ALIGN 32 static int zsize, ksize; int uma_startup_count(int zones) @@ -1797,26 +1799,36 @@ uma_startup_count(int zones) (sizeof(struct uma_cache) * (mp_maxid + 1)) + (sizeof(struct uma_zone_domain) * vm_ndomains); - /* Memory for the zone of zones and zone of kegs. */ + /* + * Memory for the zone of kegs and its keg, + * and for zone of zones. + */ pages = howmany(roundup(zsize, CACHE_LINE_SIZE) * 2 + roundup(ksize, CACHE_LINE_SIZE), PAGE_SIZE); zones += UMA_BOOT_ZONES; - /* Memory for startup zones, UMA and VM, ... */ + /* Memory for the rest of startup zones, UMA and VM, ... */ if (zsize > UMA_SLAB_SIZE) - pages += zones * howmany(zsize, UMA_SLAB_SIZE); + pages += zones * howmany(roundup2(zsize, UMA_BOOT_ALIGN), + UMA_SLAB_SIZE); else - pages += howmany(zones, UMA_SLAB_SIZE / zsize); + pages += howmany(zones, + UMA_SLAB_SPACE / roundup2(zsize, UMA_BOOT_ALIGN)); - /* ... and their kegs. */ - pages += howmany(zones, UMA_SLAB_SIZE / ksize); + /* ... and their kegs. Note that zone of zones allocates a keg! */ + pages += howmany(zones + 1, + UMA_SLAB_SPACE / roundup2(ksize, UMA_BOOT_ALIGN)); /* - * Take conservative approach that every zone - * is going to allocate hash. + * Most of startup zones are not going to be offpages, that's + * why we use UMA_SLAB_SPACE instead of UMA_SLAB_SIZE in all + * calculations. Some large bucket zones will be offpage, and + * thus will allocate hashes. We take conservative approach + * and assume that all zones may allocate hash. This may give + * us some positive inaccuracy, usually an extra single page. */ - pages += howmany(zones, UMA_SLAB_SIZE / + pages += howmany(zones, UMA_SLAB_SPACE / (sizeof(struct slabhead *) * UMA_HASH_SIZE_INIT)); return (pages); @@ -1856,7 +1868,7 @@ uma_startup(void *mem, int npages) args.uminit = zero_init; args.fini = NULL; args.keg = masterkeg; - args.align = 32 - 1; + args.align = UMA_BOOT_ALIGN - 1; args.flags = UMA_ZFLAG_INTERNAL; zone_ctor(kegs, zsize, &args, M_WAITOK); @@ -1871,7 +1883,7 @@ uma_startup(void *mem, int npages) args.uminit = zero_init; args.fini = NULL; args.keg = NULL; - args.align = 32 - 1; + args.align = UMA_BOOT_ALIGN - 1; args.flags = UMA_ZFLAG_INTERNAL; zone_ctor(zones, zsize, &args, M_WAITOK); Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Wed Feb 7 18:18:33 2018 (r328981) +++ head/sys/vm/uma_int.h Wed Feb 7 18:32:51 2018 (r328982) @@ -138,6 +138,11 @@ #define UMA_MAX_WASTE 10 /* + * Size of memory in a not offpage slab available for actual items. + */ +#define UMA_SLAB_SPACE (UMA_SLAB_SIZE - sizeof(struct uma_slab)) + +/* * I doubt there will be many cases where this is exceeded. This is the initial * size of the hash table for uma_slabs that are managed off page. This hash * does expand by powers of two. Currently it doesn't get smaller. Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Wed Feb 7 18:18:33 2018 (r328981) +++ head/sys/vm/vm_page.c Wed Feb 7 18:32:51 2018 (r328982) @@ -519,7 +519,8 @@ vm_page_startup(vm_offset_t vaddr) /* vmem_startup() calls uma_prealloc(). */ boot_pages += vmem_startup_count(); /* vm_map_startup() calls uma_prealloc(). */ - boot_pages += howmany(MAX_KMAP, UMA_SLAB_SIZE / sizeof(struct vm_map)); + boot_pages += howmany(MAX_KMAP, + UMA_SLAB_SPACE / sizeof(struct vm_map)); /* * Before going fully functional kmem_init() does allocation From owner-svn-src-all@freebsd.org Wed Feb 7 18:33:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF79DF1B9A7; Wed, 7 Feb 2018 18:33:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 736D07786A; Wed, 7 Feb 2018 18:33: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6E39928EA; Wed, 7 Feb 2018 18:33: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 w17IXkwa049903; Wed, 7 Feb 2018 18:33:46 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17IXkDe049902; Wed, 7 Feb 2018 18:33:46 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802071833.w17IXkDe049902@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 7 Feb 2018 18:33:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328983 - head/sys/cam/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam/nvme X-SVN-Commit-Revision: 328983 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 18:33:46 -0000 Author: imp Date: Wed Feb 7 18:33:46 2018 New Revision: 328983 URL: https://svnweb.freebsd.org/changeset/base/328983 Log: Fix cut and pasted comments to reflect differences in code from the original source. Sponsored by: Netflix Modified: head/sys/cam/nvme/nvme_da.c Modified: head/sys/cam/nvme/nvme_da.c ============================================================================== --- head/sys/cam/nvme/nvme_da.c Wed Feb 7 18:32:51 2018 (r328982) +++ head/sys/cam/nvme/nvme_da.c Wed Feb 7 18:33:46 2018 (r328983) @@ -1094,19 +1094,25 @@ ndaflush(void) CAM_PERIPH_FOREACH(periph, &ndadriver) { softc = (struct nda_softc *)periph->softc; + if (SCHEDULER_STOPPED()) { - /* If we paniced with the lock held, do not recurse. */ + /* + * If we paniced with the lock held or the periph is not + * open, do not recurse. Otherwise, call ndadump since + * that avoids the sleeping cam_periph_getccb does if no + * CCBs are available. + */ if (!cam_periph_owned(periph) && (softc->flags & NDA_FLAG_OPEN)) { ndadump(softc->disk, NULL, 0, 0, 0); } continue; } - cam_periph_lock(periph); + /* - * We only sync the cache if the drive is still open, and - * if the drive is capable of it.. + * We only sync the cache if the drive is still open */ + cam_periph_lock(periph); if ((softc->flags & NDA_FLAG_OPEN) == 0) { cam_periph_unlock(periph); continue; From owner-svn-src-all@freebsd.org Wed Feb 7 18:33:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F6CBF1B9F0; Wed, 7 Feb 2018 18:33:54 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 05E8877954; Wed, 7 Feb 2018 18:33:54 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 00E0F28EB; Wed, 7 Feb 2018 18:33:54 +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 w17IXr6D049956; Wed, 7 Feb 2018 18:33:53 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17IXrTU049955; Wed, 7 Feb 2018 18:33:53 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802071833.w17IXrTU049955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 7 Feb 2018 18:33:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328984 - head/sys/arm/conf X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/arm/conf X-SVN-Commit-Revision: 328984 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 18:33:54 -0000 Author: imp Date: Wed Feb 7 18:33:53 2018 New Revision: 328984 URL: https://svnweb.freebsd.org/changeset/base/328984 Log: Cull Atmel board configs no longer relevant. Remove most of the Atmel at91 boards. Most of them are no longer relevant or used by people. Kept ATMEL since it should work on all the boards that still work (I've not confirmed this, since I don't have all these boards). Also kept SAM9G20EK, since I have several boards that it is used on. If I've deleted a kernel in error, please let me know. Deleted: head/sys/arm/conf/BWCT head/sys/arm/conf/BWCT.hints head/sys/arm/conf/EB9200 head/sys/arm/conf/EB9200.hints head/sys/arm/conf/ETHERNUT5 head/sys/arm/conf/ETHERNUT5.hints head/sys/arm/conf/HL200 head/sys/arm/conf/HL201 head/sys/arm/conf/HL201.hints head/sys/arm/conf/KB920X head/sys/arm/conf/KB920X.hints head/sys/arm/conf/QILA9G20 head/sys/arm/conf/QILA9G20.hints head/sys/arm/conf/SAM9260EK head/sys/arm/conf/SAM9260EK.hints head/sys/arm/conf/SAM9X25EK head/sys/arm/conf/SAM9X25EK.hints head/sys/arm/conf/SN9G45 From owner-svn-src-all@freebsd.org Wed Feb 7 18:46:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E04E1F1C7EA; Wed, 7 Feb 2018 18:46:09 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8F20E78652; Wed, 7 Feb 2018 18:46:09 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 860832ABC; Wed, 7 Feb 2018 18:46:09 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w17Ik9kj055501; Wed, 7 Feb 2018 18:46:09 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17Ik894055491; Wed, 7 Feb 2018 18:46:08 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802071846.w17Ik894055491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 7 Feb 2018 18:46:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328985 - head/sys/dev/usb/template X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/usb/template X-SVN-Commit-Revision: 328985 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 18:46:10 -0000 Author: hselasky Date: Wed Feb 7 18:46:08 2018 New Revision: 328985 URL: https://svnweb.freebsd.org/changeset/base/328985 Log: Give USB template SYSUNINIT()'s a uniq name to avoid symbol name collision when building stand/usb. Regression after r328194. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/template/usb_template_audio.c head/sys/dev/usb/template/usb_template_cdce.c head/sys/dev/usb/template/usb_template_kbd.c head/sys/dev/usb/template/usb_template_midi.c head/sys/dev/usb/template/usb_template_modem.c head/sys/dev/usb/template/usb_template_mouse.c head/sys/dev/usb/template/usb_template_msc.c head/sys/dev/usb/template/usb_template_mtp.c head/sys/dev/usb/template/usb_template_phone.c head/sys/dev/usb/template/usb_template_serialnet.c Modified: head/sys/dev/usb/template/usb_template_audio.c ============================================================================== --- head/sys/dev/usb/template/usb_template_audio.c Wed Feb 7 18:33:53 2018 (r328984) +++ head/sys/dev/usb/template/usb_template_audio.c Wed Feb 7 18:46:08 2018 (r328985) @@ -475,4 +475,4 @@ audio_uninit(void *arg __unused) } SYSINIT(audio_init, SI_SUB_LOCK, SI_ORDER_FIRST, audio_init, NULL); -SYSUNINIT(audio_init, SI_SUB_LOCK, SI_ORDER_FIRST, audio_uninit, NULL); +SYSUNINIT(audio_uninit, SI_SUB_LOCK, SI_ORDER_FIRST, audio_uninit, NULL); Modified: head/sys/dev/usb/template/usb_template_cdce.c ============================================================================== --- head/sys/dev/usb/template/usb_template_cdce.c Wed Feb 7 18:33:53 2018 (r328984) +++ head/sys/dev/usb/template/usb_template_cdce.c Wed Feb 7 18:46:08 2018 (r328985) @@ -348,4 +348,4 @@ eth_uninit(void *arg __unused) } SYSINIT(eth_init, SI_SUB_LOCK, SI_ORDER_FIRST, eth_init, NULL); -SYSUNINIT(eth_init, SI_SUB_LOCK, SI_ORDER_FIRST, eth_uninit, NULL); +SYSUNINIT(eth_uninit, SI_SUB_LOCK, SI_ORDER_FIRST, eth_uninit, NULL); Modified: head/sys/dev/usb/template/usb_template_kbd.c ============================================================================== --- head/sys/dev/usb/template/usb_template_kbd.c Wed Feb 7 18:33:53 2018 (r328984) +++ head/sys/dev/usb/template/usb_template_kbd.c Wed Feb 7 18:46:08 2018 (r328985) @@ -289,4 +289,4 @@ kbd_uninit(void *arg __unused) } SYSINIT(kbd_init, SI_SUB_LOCK, SI_ORDER_FIRST, kbd_init, NULL); -SYSUNINIT(kbd_init, SI_SUB_LOCK, SI_ORDER_FIRST, kbd_uninit, NULL); +SYSUNINIT(kbd_uninit, SI_SUB_LOCK, SI_ORDER_FIRST, kbd_uninit, NULL); Modified: head/sys/dev/usb/template/usb_template_midi.c ============================================================================== --- head/sys/dev/usb/template/usb_template_midi.c Wed Feb 7 18:33:53 2018 (r328984) +++ head/sys/dev/usb/template/usb_template_midi.c Wed Feb 7 18:46:08 2018 (r328985) @@ -309,4 +309,4 @@ midi_uninit(void *arg __unused) } SYSINIT(midi_init, SI_SUB_LOCK, SI_ORDER_FIRST, midi_init, NULL); -SYSUNINIT(midi_init, SI_SUB_LOCK, SI_ORDER_FIRST, midi_uninit, NULL); +SYSUNINIT(midi_uninit, SI_SUB_LOCK, SI_ORDER_FIRST, midi_uninit, NULL); Modified: head/sys/dev/usb/template/usb_template_modem.c ============================================================================== --- head/sys/dev/usb/template/usb_template_modem.c Wed Feb 7 18:33:53 2018 (r328984) +++ head/sys/dev/usb/template/usb_template_modem.c Wed Feb 7 18:46:08 2018 (r328985) @@ -317,4 +317,4 @@ modem_uninit(void *arg __unused) } SYSINIT(modem_init, SI_SUB_LOCK, SI_ORDER_FIRST, modem_init, NULL); -SYSUNINIT(modem_init, SI_SUB_LOCK, SI_ORDER_FIRST, modem_uninit, NULL); +SYSUNINIT(modem_uninit, SI_SUB_LOCK, SI_ORDER_FIRST, modem_uninit, NULL); Modified: head/sys/dev/usb/template/usb_template_mouse.c ============================================================================== --- head/sys/dev/usb/template/usb_template_mouse.c Wed Feb 7 18:33:53 2018 (r328984) +++ head/sys/dev/usb/template/usb_template_mouse.c Wed Feb 7 18:46:08 2018 (r328985) @@ -287,4 +287,4 @@ mouse_uninit(void *arg __unused) } SYSINIT(mouse_init, SI_SUB_LOCK, SI_ORDER_FIRST, mouse_init, NULL); -SYSUNINIT(mouse_init, SI_SUB_LOCK, SI_ORDER_FIRST, mouse_uninit, NULL); +SYSUNINIT(mouse_uninit, SI_SUB_LOCK, SI_ORDER_FIRST, mouse_uninit, NULL); Modified: head/sys/dev/usb/template/usb_template_msc.c ============================================================================== --- head/sys/dev/usb/template/usb_template_msc.c Wed Feb 7 18:33:53 2018 (r328984) +++ head/sys/dev/usb/template/usb_template_msc.c Wed Feb 7 18:46:08 2018 (r328985) @@ -257,4 +257,4 @@ msc_uninit(void *arg __unused) } SYSINIT(msc_init, SI_SUB_LOCK, SI_ORDER_FIRST, msc_init, NULL); -SYSUNINIT(msc_init, SI_SUB_LOCK, SI_ORDER_FIRST, msc_uninit, NULL); +SYSUNINIT(msc_uninit, SI_SUB_LOCK, SI_ORDER_FIRST, msc_uninit, NULL); Modified: head/sys/dev/usb/template/usb_template_mtp.c ============================================================================== --- head/sys/dev/usb/template/usb_template_mtp.c Wed Feb 7 18:33:53 2018 (r328984) +++ head/sys/dev/usb/template/usb_template_mtp.c Wed Feb 7 18:46:08 2018 (r328985) @@ -324,4 +324,4 @@ mtp_uninit(void *arg __unused) } SYSINIT(mtp_init, SI_SUB_LOCK, SI_ORDER_FIRST, mtp_init, NULL); -SYSUNINIT(mtp_init, SI_SUB_LOCK, SI_ORDER_FIRST, mtp_uninit, NULL); +SYSUNINIT(mtp_uninit, SI_SUB_LOCK, SI_ORDER_FIRST, mtp_uninit, NULL); Modified: head/sys/dev/usb/template/usb_template_phone.c ============================================================================== --- head/sys/dev/usb/template/usb_template_phone.c Wed Feb 7 18:33:53 2018 (r328984) +++ head/sys/dev/usb/template/usb_template_phone.c Wed Feb 7 18:46:08 2018 (r328985) @@ -500,4 +500,4 @@ phone_uninit(void *arg __unused) } SYSINIT(phone_init, SI_SUB_LOCK, SI_ORDER_FIRST, phone_init, NULL); -SYSUNINIT(phone_init, SI_SUB_LOCK, SI_ORDER_FIRST, phone_uninit, NULL); +SYSUNINIT(phone_uninit, SI_SUB_LOCK, SI_ORDER_FIRST, phone_uninit, NULL); Modified: head/sys/dev/usb/template/usb_template_serialnet.c ============================================================================== --- head/sys/dev/usb/template/usb_template_serialnet.c Wed Feb 7 18:33:53 2018 (r328984) +++ head/sys/dev/usb/template/usb_template_serialnet.c Wed Feb 7 18:46:08 2018 (r328985) @@ -456,4 +456,4 @@ serialnet_uninit(void *arg __unused) } SYSINIT(serialnet_init, SI_SUB_LOCK, SI_ORDER_FIRST, serialnet_init, NULL); -SYSUNINIT(serialnet_init, SI_SUB_LOCK, SI_ORDER_FIRST, serialnet_uninit, NULL); +SYSUNINIT(serialnet_uninit, SI_SUB_LOCK, SI_ORDER_FIRST, serialnet_uninit, NULL); From owner-svn-src-all@freebsd.org Wed Feb 7 18:49:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3F74F1CA9F; Wed, 7 Feb 2018 18:49:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A3EE37886E; Wed, 7 Feb 2018 18:49:06 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A6742ACD; Wed, 7 Feb 2018 18:49:06 +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 w17In6BU055637; Wed, 7 Feb 2018 18:49:06 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17In6Gq055636; Wed, 7 Feb 2018 18:49:06 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802071849.w17In6Gq055636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 7 Feb 2018 18:49:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328986 - head/stand/usb X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/stand/usb X-SVN-Commit-Revision: 328986 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 18:49:07 -0000 Author: hselasky Date: Wed Feb 7 18:49:06 2018 New Revision: 328986 URL: https://svnweb.freebsd.org/changeset/base/328986 Log: Fix relative location of USB sources after recent move. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/stand/usb/usbcore.mk Modified: head/stand/usb/usbcore.mk ============================================================================== --- head/stand/usb/usbcore.mk Wed Feb 7 18:46:08 2018 (r328985) +++ head/stand/usb/usbcore.mk Wed Feb 7 18:49:06 2018 (r328986) @@ -32,7 +32,7 @@ # USBCOREDIR:= ${.PARSEDIR} -S=${USBCOREDIR}/../.. +S=${USBCOREDIR}/../../sys MACHDEP_DIRS= From owner-svn-src-all@freebsd.org Wed Feb 7 18:50:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4336CF1CC48; Wed, 7 Feb 2018 18:50:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E36A778A15; Wed, 7 Feb 2018 18:50:36 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE5762AD7; Wed, 7 Feb 2018 18:50:36 +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 w17IoaHk055762; Wed, 7 Feb 2018 18:50:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17Ioa2a055761; Wed, 7 Feb 2018 18:50:36 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802071850.w17Ioa2a055761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 7 Feb 2018 18:50:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328987 - head/stand/kshim X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/stand/kshim X-SVN-Commit-Revision: 328987 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 18:50:37 -0000 Author: hselasky Date: Wed Feb 7 18:50:36 2018 New Revision: 328987 URL: https://svnweb.freebsd.org/changeset/base/328987 Log: A more definitions to kernel emulation shim in order to build stand/usb. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/stand/kshim/bsd_kernel.h Modified: head/stand/kshim/bsd_kernel.h ============================================================================== --- head/stand/kshim/bsd_kernel.h Wed Feb 7 18:49:06 2018 (r328986) +++ head/stand/kshim/bsd_kernel.h Wed Feb 7 18:50:36 2018 (r328987) @@ -50,6 +50,8 @@ #define USB_BUS_EXPLORE_PROC(bus) (usb_process + 0) #define USB_BUS_CONTROL_XFER_PROC(bus) (usb_process + 1) #define SYSCTL_DECL(...) +struct sysctl_ctx_list { +}; struct sysctl_req { void *newptr; }; @@ -59,6 +61,13 @@ struct sysctl_req { #define SYSCTL_INT(...) #define SYSCTL_UINT(...) #define SYSCTL_PROC(...) +#define SYSCTL_ADD_NODE(...) NULL +#define SYSCTL_ADD_U16(...) NULL +#define SYSCTL_ADD_PROC(...) NULL +#define sysctl_handle_int(...) EOPNOTSUPP +#define sysctl_handle_string(...) EOPNOTSUPP +#define sysctl_ctx_init(ctx) do { (void)(ctx); } while (0) +#define sysctl_ctx_free(ctx) do { (void)(ctx); } while (0) #define TUNABLE_INT(...) #define MALLOC_DECLARE(...) #define MALLOC_DEFINE(...) @@ -177,6 +186,10 @@ struct uio; struct thread; struct malloc_type; struct usb_process; + +#ifndef INT32_MAX +#define INT32_MAX 0x7fffffff +#endif #ifndef HAVE_STANDARD_DEFS #define _UINT8_T_DECLARED From owner-svn-src-all@freebsd.org Wed Feb 7 18:59:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24C47F1D520; Wed, 7 Feb 2018 18:59:56 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA5547906F; Wed, 7 Feb 2018 18:59:55 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0B552C66; Wed, 7 Feb 2018 18:59:55 +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 w17IxtHx060810; Wed, 7 Feb 2018 18:59:55 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17IxtxX060804; Wed, 7 Feb 2018 18:59:55 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201802071859.w17IxtxX060804@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 7 Feb 2018 18:59:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328988 - in head/sys: conf modules/ipfw netinet netpfil/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in head/sys: conf modules/ipfw netinet netpfil/ipfw X-SVN-Commit-Revision: 328988 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 18:59:56 -0000 Author: ae Date: Wed Feb 7 18:59:54 2018 New Revision: 328988 URL: https://svnweb.freebsd.org/changeset/base/328988 Log: Rework ipfw dynamic states implementation to be lockless on fast path. o added struct ipfw_dyn_info that keeps all needed for ipfw_chk and for dynamic states implementation information; o added DYN_LOOKUP_NEEDED() macro that can be used to determine the need of new lookup of dynamic states; o ipfw_dyn_rule now becomes obsolete. Currently it used to pass information from kernel to userland only. o IPv4 and IPv6 states now described by different structures dyn_ipv4_state and dyn_ipv6_state; o IPv6 scope zones support is added; o ipfw(4) now depends from Concurrency Kit; o states are linked with "entry" field using CK_SLIST. This allows lockless lookup and protected by mutex modifications. o the "expired" SLIST field is used for states expiring. o struct dyn_data is used to keep generic information for both IPv4 and IPv6; o struct dyn_parent is used to keep O_LIMIT_PARENT information; o IPv4 and IPv6 states are stored in different hash tables; o O_LIMIT_PARENT states now are kept separately from O_LIMIT and O_KEEP_STATE states; o per-cpu dyn_hp pointers are used to implement hazard pointers and they prevent freeing states that are locklessly used by lookup threads; o mutexes to protect modification of lists in hash tables now kept in separate arrays. 65535 limit to maximum number of hash buckets now removed. o Separate lookup and install functions added for IPv4 and IPv6 states and for parent states. o By default now is used Jenkinks hash function. Obtained from: Yandex LLC MFC after: 42 days Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D12685 Modified: head/sys/conf/files head/sys/modules/ipfw/Makefile head/sys/netinet/ip_fw.h head/sys/netpfil/ipfw/ip_fw2.c head/sys/netpfil/ipfw/ip_fw_dynamic.c head/sys/netpfil/ipfw/ip_fw_private.h head/sys/netpfil/ipfw/ip_fw_sockopt.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Feb 7 18:50:36 2018 (r328987) +++ head/sys/conf/files Wed Feb 7 18:59:54 2018 (r328988) @@ -4374,7 +4374,8 @@ netpfil/ipfw/ip_dn_io.c optional inet dummynet netpfil/ipfw/ip_dn_glue.c optional inet dummynet netpfil/ipfw/ip_fw2.c optional inet ipfirewall netpfil/ipfw/ip_fw_bpf.c optional inet ipfirewall -netpfil/ipfw/ip_fw_dynamic.c optional inet ipfirewall +netpfil/ipfw/ip_fw_dynamic.c optional inet ipfirewall \ + compile-with "${NORMAL_C} -I$S/contrib/ck/include" netpfil/ipfw/ip_fw_eaction.c optional inet ipfirewall netpfil/ipfw/ip_fw_log.c optional inet ipfirewall netpfil/ipfw/ip_fw_pfil.c optional inet ipfirewall Modified: head/sys/modules/ipfw/Makefile ============================================================================== --- head/sys/modules/ipfw/Makefile Wed Feb 7 18:50:36 2018 (r328987) +++ head/sys/modules/ipfw/Makefile Wed Feb 7 18:59:54 2018 (r328988) @@ -9,7 +9,7 @@ SRCS+= ip_fw_sockopt.c ip_fw_table.c ip_fw_table_algo. SRCS+= ip_fw_table_value.c SRCS+= opt_inet.h opt_inet6.h opt_ipdivert.h opt_ipfw.h -CFLAGS+= -DIPFIREWALL +CFLAGS+= -DIPFIREWALL -I${SRCTOP}/sys/contrib/ck/include # #If you want it verbose #CFLAGS+= -DIPFIREWALL_VERBOSE Modified: head/sys/netinet/ip_fw.h ============================================================================== --- head/sys/netinet/ip_fw.h Wed Feb 7 18:50:36 2018 (r328987) +++ head/sys/netinet/ip_fw.h Wed Feb 7 18:59:54 2018 (r328988) @@ -671,7 +671,7 @@ struct ipfw_flow_id { uint32_t src_ip; uint16_t dst_port; uint16_t src_port; - uint8_t fib; + uint8_t fib; /* XXX: must be uint16_t */ uint8_t proto; uint8_t _flags; /* protocol-specific flags */ uint8_t addr_type; /* 4=ip4, 6=ip6, 1=ether ? */ @@ -682,6 +682,7 @@ struct ipfw_flow_id { }; #endif +#define IS_IP4_FLOW_ID(id) ((id)->addr_type == 4) #define IS_IP6_FLOW_ID(id) ((id)->addr_type == 6) /* Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Wed Feb 7 18:50:36 2018 (r328987) +++ head/sys/netpfil/ipfw/ip_fw2.c Wed Feb 7 18:59:54 2018 (r328988) @@ -1387,8 +1387,7 @@ ipfw_chk(struct ip_fw_args *args) * MATCH_NONE when checked and not matched (q = NULL), * MATCH_FORWARD or MATCH_REVERSE otherwise (q != NULL) */ - int dyn_dir = MATCH_UNKNOWN; - uint16_t dyn_name = 0; + struct ipfw_dyn_info dyn_info; struct ip_fw *q = NULL; struct ip_fw_chain *chain = &V_layer3_chain; @@ -1420,6 +1419,7 @@ ipfw_chk(struct ip_fw_args *args) proto = args->f_id.proto = 0; /* mark f_id invalid */ /* XXX 0 is a valid proto: IP/IPv6 Hop-by-Hop Option */ + DYN_INFO_INIT(&dyn_info); /* * PULLUP_TO(len, p, T) makes sure that len + sizeof(T) is contiguous, * then it sets p to point at the offset "len" in the mbuf. WARNING: the @@ -2605,7 +2605,8 @@ do { \ case O_LIMIT: case O_KEEP_STATE: if (ipfw_dyn_install_state(chain, f, - (ipfw_insn_limit *)cmd, args, tablearg)) { + (ipfw_insn_limit *)cmd, args, ulp, + pktlen, &dyn_info, tablearg)) { /* error or limit violation */ retval = IP_FW_DENY; l = 0; /* exit inner loop */ @@ -2619,34 +2620,15 @@ do { \ /* * dynamic rules are checked at the first * keep-state or check-state occurrence, - * with the result being stored in dyn_dir - * and dyn_name. + * with the result being stored in dyn_info. * The compiler introduces a PROBE_STATE * instruction for us when we have a * KEEP_STATE (because PROBE_STATE needs * to be run first). - * - * (dyn_dir == MATCH_UNKNOWN) means this is - * first lookup for such f_id. Do lookup. - * - * (dyn_dir != MATCH_UNKNOWN && - * dyn_name != 0 && dyn_name != cmd->arg1) - * means previous lookup didn't find dynamic - * rule for specific state name and current - * lookup will search rule with another state - * name. Redo lookup. - * - * (dyn_dir != MATCH_UNKNOWN && dyn_name == 0) - * means previous lookup was for `any' name - * and it didn't find rule. No need to do - * lookup again. */ - if ((dyn_dir == MATCH_UNKNOWN || - (dyn_name != 0 && - dyn_name != cmd->arg1)) && - (q = ipfw_dyn_lookup_state(&args->f_id, - ulp, pktlen, &dyn_dir, - (dyn_name = cmd->arg1))) != NULL) { + if (DYN_LOOKUP_NEEDED(&dyn_info, cmd) && + (q = ipfw_dyn_lookup_state(args, ulp, + pktlen, cmd, &dyn_info)) != NULL) { /* * Found dynamic entry, jump to the * 'action' part of the parent rule @@ -2654,13 +2636,7 @@ do { \ * cmdlen. */ f = q; - /* XXX we would like to have f_pos - * readily accessible in the dynamic - * rule, instead of having to - * lookup q->rule. - */ - f_pos = ipfw_find_rule(chain, - f->rulenum, f->id); + f_pos = dyn_info.f_pos; cmd = ACTION_PTR(f); l = f->cmd_len - f->act_ofs; cmdlen = 0; @@ -2877,7 +2853,8 @@ do { \ case O_FORWARD_IP: if (args->eh) /* not valid on layer2 pkts */ break; - if (q != f || dyn_dir == MATCH_FORWARD) { + if (q != f || + dyn_info.direction == MATCH_FORWARD) { struct sockaddr_in *sa; sa = &(((ipfw_insn_sa *)cmd)->sa); @@ -2937,7 +2914,8 @@ do { \ case O_FORWARD_IP6: if (args->eh) /* not valid on layer2 pkts */ break; - if (q != f || dyn_dir == MATCH_FORWARD) { + if (q != f || + dyn_info.direction == MATCH_FORWARD) { struct sockaddr_in6 *sin6; sin6 = &(((ipfw_insn_sa6 *)cmd)->sa); @@ -3089,7 +3067,7 @@ do { \ * @args content, and it may be * used for new state lookup later. */ - dyn_dir = MATCH_UNKNOWN; + DYN_INFO_INIT(&dyn_info); } break; Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_dynamic.c Wed Feb 7 18:50:36 2018 (r328987) +++ head/sys/netpfil/ipfw/ip_fw_dynamic.c Wed Feb 7 18:59:54 2018 (r328988) @@ -1,6 +1,8 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * + * Copyright (c) 2017-2018 Yandex LLC + * Copyright (c) 2017-2018 Andrey V. Elsukov * Copyright (c) 2002 Luigi Rizzo, Universita` di Pisa * * Redistribution and use in source and binary forms, with or without @@ -28,32 +30,27 @@ #include __FBSDID("$FreeBSD$"); -#define DEB(x) -#define DDB(x) x - -/* - * Dynamic rule support for ipfw - */ - -#include "opt_ipfw.h" #include "opt_inet.h" +#include "opt_inet6.h" +#include "opt_ipfw.h" #ifndef INET #error IPFIREWALL requires INET. #endif /* INET */ -#include "opt_inet6.h" #include #include -#include +#include #include #include -#include #include +#include +#include #include +#include #include #include #include -#include /* for ETHERTYPE_IP */ +#include #include #include #include @@ -61,8 +58,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include /* ip_defttl */ +#include #include +#include #include #include @@ -70,6 +68,7 @@ __FBSDID("$FreeBSD$"); #ifdef INET6 #include #include +#include #endif #include @@ -79,86 +78,261 @@ __FBSDID("$FreeBSD$"); #ifdef MAC #include #endif +#include /* - * Description of dynamic rules. + * Description of dynamic states. * - * Dynamic rules are stored in lists accessed through a hash table - * (ipfw_dyn_v) whose size is curr_dyn_buckets. This value can - * be modified through the sysctl variable dyn_buckets which is - * updated when the table becomes empty. + * Dynamic states are stored in lists accessed through a hash tables + * whose size is curr_dyn_buckets. This value can be modified through + * the sysctl variable dyn_buckets. * - * XXX currently there is only one list, ipfw_dyn. + * Currently there are four tables: dyn_ipv4, dyn_ipv6, dyn_ipv4_parent, + * and dyn_ipv6_parent. * - * When a packet is received, its address fields are first masked - * with the mask defined for the rule, then hashed, then matched - * against the entries in the corresponding list. - * Dynamic rules can be used for different purposes: + * When a packet is received, its address fields hashed, then matched + * against the entries in the corresponding list by addr_type. + * Dynamic states can be used for different purposes: * + stateful rules; * + enforcing limits on the number of sessions; * + in-kernel NAT (not implemented yet) * - * The lifetime of dynamic rules is regulated by dyn_*_lifetime, + * The lifetime of dynamic states is regulated by dyn_*_lifetime, * measured in seconds and depending on the flags. * - * The total number of dynamic rules is equal to UMA zone items count. - * The max number of dynamic rules is dyn_max. When we reach + * The total number of dynamic states is equal to UMA zone items count. + * The max number of dynamic states is dyn_max. When we reach * the maximum number of rules we do not create anymore. This is * done to avoid consuming too much memory, but also too much * time when searching on each packet (ideally, we should try instead * to put a limit on the length of the list on each bucket...). * - * Each dynamic rule holds a pointer to the parent ipfw rule so - * we know what action to perform. Dynamic rules are removed when - * the parent rule is deleted. This can be changed by dyn_keep_states - * sysctl. + * Each state holds a pointer to the parent ipfw rule so we know what + * action to perform. Dynamic rules are removed when the parent rule is + * deleted. * * There are some limitations with dynamic rules -- we do not * obey the 'randomized match', and we do not do multiple * passes through the firewall. XXX check the latter!!! */ -struct ipfw_dyn_bucket { - struct mtx mtx; /* Bucket protecting lock */ - ipfw_dyn_rule *head; /* Pointer to first rule */ +/* By default use jenkins hash function */ +#define IPFIREWALL_JENKINSHASH + +#define DYN_COUNTER_INC(d, dir, pktlen) do { \ + (d)->pcnt_ ## dir++; \ + (d)->bcnt_ ## dir += pktlen; \ + } while (0) + +struct dyn_data { + void *parent; /* pointer to parent rule */ + uint32_t chain_id; /* cached ruleset id */ + uint32_t f_pos; /* cached rule index */ + + uint32_t hashval; /* hash value used for hash resize */ + uint16_t fibnum; /* fib used to send keepalives */ + uint8_t _pad[3]; + uint8_t set; /* parent rule set number */ + uint16_t rulenum; /* parent rule number */ + uint32_t ruleid; /* parent rule id */ + + uint32_t state; /* TCP session state and flags */ + uint32_t ack_fwd; /* most recent ACKs in forward */ + uint32_t ack_rev; /* and reverse direction (used */ + /* to generate keepalives) */ + uint32_t sync; /* synchronization time */ + uint32_t expire; /* expire time */ + + uint64_t pcnt_fwd; /* bytes counter in forward */ + uint64_t bcnt_fwd; /* packets counter in forward */ + uint64_t pcnt_rev; /* bytes counter in reverse */ + uint64_t bcnt_rev; /* packets counter in reverse */ }; +#define DPARENT_COUNT_DEC(p) do { \ + MPASS(p->count > 0); \ + ck_pr_dec_32(&(p)->count); \ +} while (0) +#define DPARENT_COUNT_INC(p) ck_pr_inc_32(&(p)->count) +#define DPARENT_COUNT(p) ck_pr_load_32(&(p)->count) +struct dyn_parent { + void *parent; /* pointer to parent rule */ + uint32_t count; /* number of linked states */ + uint8_t _pad; + uint8_t set; /* parent rule set number */ + uint16_t rulenum; /* parent rule number */ + uint32_t ruleid; /* parent rule id */ + uint32_t hashval; /* hash value used for hash resize */ + uint32_t expire; /* expire time */ +}; + +struct dyn_ipv4_state { + uint8_t type; /* State type */ + uint8_t proto; /* UL Protocol */ + uint16_t kidx; /* named object index */ + uint16_t sport, dport; /* ULP source and destination ports */ + in_addr_t src, dst; /* IPv4 source and destination */ + + union { + struct dyn_data *data; + struct dyn_parent *limit; + }; + CK_SLIST_ENTRY(dyn_ipv4_state) entry; + SLIST_ENTRY(dyn_ipv4_state) expired; +}; +CK_SLIST_HEAD(dyn_ipv4ck_slist, dyn_ipv4_state); +static VNET_DEFINE(struct dyn_ipv4ck_slist *, dyn_ipv4); +static VNET_DEFINE(struct dyn_ipv4ck_slist *, dyn_ipv4_parent); + +SLIST_HEAD(dyn_ipv4_slist, dyn_ipv4_state); +static VNET_DEFINE(struct dyn_ipv4_slist, dyn_expired_ipv4); +#define V_dyn_ipv4 VNET(dyn_ipv4) +#define V_dyn_ipv4_parent VNET(dyn_ipv4_parent) +#define V_dyn_expired_ipv4 VNET(dyn_expired_ipv4) + +#ifdef INET6 +struct dyn_ipv6_state { + uint8_t type; /* State type */ + uint8_t proto; /* UL Protocol */ + uint16_t kidx; /* named object index */ + uint16_t sport, dport; /* ULP source and destination ports */ + struct in6_addr src, dst; /* IPv6 source and destination */ + uint32_t zoneid; /* IPv6 scope zone id */ + union { + struct dyn_data *data; + struct dyn_parent *limit; + }; + CK_SLIST_ENTRY(dyn_ipv6_state) entry; + SLIST_ENTRY(dyn_ipv6_state) expired; +}; +CK_SLIST_HEAD(dyn_ipv6ck_slist, dyn_ipv6_state); +static VNET_DEFINE(struct dyn_ipv6ck_slist *, dyn_ipv6); +static VNET_DEFINE(struct dyn_ipv6ck_slist *, dyn_ipv6_parent); + +SLIST_HEAD(dyn_ipv6_slist, dyn_ipv6_state); +static VNET_DEFINE(struct dyn_ipv6_slist, dyn_expired_ipv6); +#define V_dyn_ipv6 VNET(dyn_ipv6) +#define V_dyn_ipv6_parent VNET(dyn_ipv6_parent) +#define V_dyn_expired_ipv6 VNET(dyn_expired_ipv6) +#endif /* INET6 */ + /* - * Static variables followed by global ones + * Per-CPU pointer indicates that specified state is currently in use + * and must not be reclaimed by expiration callout. */ -static VNET_DEFINE(struct ipfw_dyn_bucket *, ipfw_dyn_v); -static VNET_DEFINE(u_int32_t, dyn_buckets_max); -static VNET_DEFINE(u_int32_t, curr_dyn_buckets); -static VNET_DEFINE(struct callout, ipfw_timeout); -#define V_ipfw_dyn_v VNET(ipfw_dyn_v) -#define V_dyn_buckets_max VNET(dyn_buckets_max) -#define V_curr_dyn_buckets VNET(curr_dyn_buckets) -#define V_ipfw_timeout VNET(ipfw_timeout) +static void **dyn_hp_cache; +static DPCPU_DEFINE(void *, dyn_hp); +#define DYNSTATE_GET(cpu) ck_pr_load_ptr(DPCPU_ID_PTR((cpu), dyn_hp)) +#define DYNSTATE_PROTECT(v) ck_pr_store_ptr(DPCPU_PTR(dyn_hp), (v)) +#define DYNSTATE_RELEASE() DYNSTATE_PROTECT(NULL) +#define DYNSTATE_CRITICAL_ENTER() critical_enter() +#define DYNSTATE_CRITICAL_EXIT() do { \ + DYNSTATE_RELEASE(); \ + critical_exit(); \ +} while (0); -static VNET_DEFINE(uma_zone_t, ipfw_dyn_rule_zone); -#define V_ipfw_dyn_rule_zone VNET(ipfw_dyn_rule_zone) +/* + * We keep two version numbers, one is updated when new entry added to + * the list. Second is updated when an entry deleted from the list. + * Versions are updated under bucket lock. + * + * Bucket "add" version number is used to know, that in the time between + * state lookup (i.e. ipfw_dyn_lookup_state()) and the followed state + * creation (i.e. ipfw_dyn_install_state()) another concurrent thread did + * not install some state in this bucket. Using this info we can avoid + * additional state lookup, because we are sure that we will not install + * the state twice. + * + * Also doing the tracking of bucket "del" version during lookup we can + * be sure, that state entry was not unlinked and freed in time between + * we read the state pointer and protect it with hazard pointer. + * + * An entry unlinked from CK list keeps unchanged until it is freed. + * Unlinked entries are linked into expired lists using "expired" field. + */ -#define IPFW_BUCK_LOCK_INIT(b) \ - mtx_init(&(b)->mtx, "IPFW dynamic bucket", NULL, MTX_DEF) -#define IPFW_BUCK_LOCK_DESTROY(b) \ - mtx_destroy(&(b)->mtx) -#define IPFW_BUCK_LOCK(i) mtx_lock(&V_ipfw_dyn_v[(i)].mtx) -#define IPFW_BUCK_UNLOCK(i) mtx_unlock(&V_ipfw_dyn_v[(i)].mtx) -#define IPFW_BUCK_ASSERT(i) mtx_assert(&V_ipfw_dyn_v[(i)].mtx, MA_OWNED) +/* + * dyn_expire_lock is used to protect access to dyn_expired_xxx lists. + * dyn_bucket_lock is used to get write access to lists in specific bucket. + * Currently one dyn_bucket_lock is used for all ipv4, ipv4_parent, ipv6, + * and ipv6_parent lists. + */ +static VNET_DEFINE(struct mtx, dyn_expire_lock); +static VNET_DEFINE(struct mtx *, dyn_bucket_lock); +#define V_dyn_expire_lock VNET(dyn_expire_lock) +#define V_dyn_bucket_lock VNET(dyn_bucket_lock) +/* + * Bucket's add/delete generation versions. + */ +static VNET_DEFINE(uint32_t *, dyn_ipv4_add); +static VNET_DEFINE(uint32_t *, dyn_ipv4_del); +static VNET_DEFINE(uint32_t *, dyn_ipv4_parent_add); +static VNET_DEFINE(uint32_t *, dyn_ipv4_parent_del); +#define V_dyn_ipv4_add VNET(dyn_ipv4_add) +#define V_dyn_ipv4_del VNET(dyn_ipv4_del) +#define V_dyn_ipv4_parent_add VNET(dyn_ipv4_parent_add) +#define V_dyn_ipv4_parent_del VNET(dyn_ipv4_parent_del) -static VNET_DEFINE(int, dyn_keep_states); -#define V_dyn_keep_states VNET(dyn_keep_states) +#ifdef INET6 +static VNET_DEFINE(uint32_t *, dyn_ipv6_add); +static VNET_DEFINE(uint32_t *, dyn_ipv6_del); +static VNET_DEFINE(uint32_t *, dyn_ipv6_parent_add); +static VNET_DEFINE(uint32_t *, dyn_ipv6_parent_del); +#define V_dyn_ipv6_add VNET(dyn_ipv6_add) +#define V_dyn_ipv6_del VNET(dyn_ipv6_del) +#define V_dyn_ipv6_parent_add VNET(dyn_ipv6_parent_add) +#define V_dyn_ipv6_parent_del VNET(dyn_ipv6_parent_del) +#endif /* INET6 */ +#define DYN_BUCKET(h, b) ((h) & (b - 1)) +#define DYN_BUCKET_VERSION(b, v) ck_pr_load_32(&V_dyn_ ## v[(b)]) +#define DYN_BUCKET_VERSION_BUMP(b, v) ck_pr_inc_32(&V_dyn_ ## v[(b)]) + +#define DYN_BUCKET_LOCK_INIT(lock, b) \ + mtx_init(&lock[(b)], "IPFW dynamic bucket", NULL, MTX_DEF) +#define DYN_BUCKET_LOCK_DESTROY(lock, b) mtx_destroy(&lock[(b)]) +#define DYN_BUCKET_LOCK(b) mtx_lock(&V_dyn_bucket_lock[(b)]) +#define DYN_BUCKET_UNLOCK(b) mtx_unlock(&V_dyn_bucket_lock[(b)]) +#define DYN_BUCKET_ASSERT(b) mtx_assert(&V_dyn_bucket_lock[(b)], MA_OWNED) + +#define DYN_EXPIRED_LOCK_INIT() \ + mtx_init(&V_dyn_expire_lock, "IPFW expired states list", NULL, MTX_DEF) +#define DYN_EXPIRED_LOCK_DESTROY() mtx_destroy(&V_dyn_expire_lock) +#define DYN_EXPIRED_LOCK() mtx_lock(&V_dyn_expire_lock) +#define DYN_EXPIRED_UNLOCK() mtx_unlock(&V_dyn_expire_lock) + +static VNET_DEFINE(uint32_t, dyn_buckets_max); +static VNET_DEFINE(uint32_t, curr_dyn_buckets); +static VNET_DEFINE(struct callout, dyn_timeout); +#define V_dyn_buckets_max VNET(dyn_buckets_max) +#define V_curr_dyn_buckets VNET(curr_dyn_buckets) +#define V_dyn_timeout VNET(dyn_timeout) + +/* Maximum length of states chain in a bucket */ +static VNET_DEFINE(uint32_t, curr_max_length); +#define V_curr_max_length VNET(curr_max_length) + +static VNET_DEFINE(uma_zone_t, dyn_data_zone); +static VNET_DEFINE(uma_zone_t, dyn_parent_zone); +static VNET_DEFINE(uma_zone_t, dyn_ipv4_zone); +#ifdef INET6 +static VNET_DEFINE(uma_zone_t, dyn_ipv6_zone); +#define V_dyn_ipv6_zone VNET(dyn_ipv6_zone) +#endif /* INET6 */ +#define V_dyn_data_zone VNET(dyn_data_zone) +#define V_dyn_parent_zone VNET(dyn_parent_zone) +#define V_dyn_ipv4_zone VNET(dyn_ipv4_zone) + /* * Timeouts for various events in handing dynamic rules. */ -static VNET_DEFINE(u_int32_t, dyn_ack_lifetime); -static VNET_DEFINE(u_int32_t, dyn_syn_lifetime); -static VNET_DEFINE(u_int32_t, dyn_fin_lifetime); -static VNET_DEFINE(u_int32_t, dyn_rst_lifetime); -static VNET_DEFINE(u_int32_t, dyn_udp_lifetime); -static VNET_DEFINE(u_int32_t, dyn_short_lifetime); +static VNET_DEFINE(uint32_t, dyn_ack_lifetime); +static VNET_DEFINE(uint32_t, dyn_syn_lifetime); +static VNET_DEFINE(uint32_t, dyn_fin_lifetime); +static VNET_DEFINE(uint32_t, dyn_rst_lifetime); +static VNET_DEFINE(uint32_t, dyn_udp_lifetime); +static VNET_DEFINE(uint32_t, dyn_short_lifetime); #define V_dyn_ack_lifetime VNET(dyn_ack_lifetime) #define V_dyn_syn_lifetime VNET(dyn_syn_lifetime) @@ -174,10 +348,10 @@ static VNET_DEFINE(u_int32_t, dyn_short_lifetime); * dyn_rst_lifetime and dyn_fin_lifetime should be strictly lower * than dyn_keepalive_period. */ - -static VNET_DEFINE(u_int32_t, dyn_keepalive_interval); -static VNET_DEFINE(u_int32_t, dyn_keepalive_period); -static VNET_DEFINE(u_int32_t, dyn_keepalive); +#define DYN_KEEPALIVE_MAXQ 512 +static VNET_DEFINE(uint32_t, dyn_keepalive_interval); +static VNET_DEFINE(uint32_t, dyn_keepalive_period); +static VNET_DEFINE(uint32_t, dyn_keepalive); static VNET_DEFINE(time_t, dyn_keepalive_last); #define V_dyn_keepalive_interval VNET(dyn_keepalive_interval) @@ -185,113 +359,208 @@ static VNET_DEFINE(time_t, dyn_keepalive_last); #define V_dyn_keepalive VNET(dyn_keepalive) #define V_dyn_keepalive_last VNET(dyn_keepalive_last) -static VNET_DEFINE(u_int32_t, dyn_max); /* max # of dynamic rules */ - -#define DYN_COUNT uma_zone_get_cur(V_ipfw_dyn_rule_zone) +static VNET_DEFINE(uint32_t, dyn_max); /* max # of dynamic states */ +static VNET_DEFINE(uint32_t, dyn_count); /* number of states */ +static VNET_DEFINE(uint32_t, dyn_parent_max); /* max # of parent states */ +static VNET_DEFINE(uint32_t, dyn_parent_count); /* number of parent states */ #define V_dyn_max VNET(dyn_max) +#define V_dyn_count VNET(dyn_count) +#define V_dyn_parent_max VNET(dyn_parent_max) +#define V_dyn_parent_count VNET(dyn_parent_count) -/* for userspace, we emulate the uma_zone_counter with ipfw_dyn_count */ -static int ipfw_dyn_count; /* number of objects */ +#define DYN_COUNT_DEC(name) do { \ + MPASS((V_ ## name) > 0); \ + ck_pr_dec_32(&(V_ ## name)); \ +} while (0) +#define DYN_COUNT_INC(name) ck_pr_inc_32(&(V_ ## name)) +#define DYN_COUNT(name) ck_pr_load_32(&(V_ ## name)) -#ifdef USERSPACE /* emulation of UMA object counters for userspace */ -#define uma_zone_get_cur(x) ipfw_dyn_count -#endif /* USERSPACE */ +static time_t last_log; /* Log ratelimiting */ -static int last_log; /* Log ratelimiting */ +/* + * Get/set maximum number of dynamic states in given VNET instance. + */ +static int +sysctl_dyn_max(SYSCTL_HANDLER_ARGS) +{ + uint32_t nstates; + int error; -static void ipfw_dyn_tick(void *vnetx); -static void check_dyn_rules(struct ip_fw_chain *, ipfw_range_tlv *, int, int); -#ifdef SYSCTL_NODE + nstates = V_dyn_max; + error = sysctl_handle_32(oidp, &nstates, 0, req); + /* Read operation or some error */ + if ((error != 0) || (req->newptr == NULL)) + return (error); -static int sysctl_ipfw_dyn_count(SYSCTL_HANDLER_ARGS); -static int sysctl_ipfw_dyn_max(SYSCTL_HANDLER_ARGS); + V_dyn_max = nstates; + uma_zone_set_max(V_dyn_data_zone, V_dyn_max); + return (0); +} -SYSBEGIN(f2) +static int +sysctl_dyn_parent_max(SYSCTL_HANDLER_ARGS) +{ + uint32_t nstates; + int error; + nstates = V_dyn_parent_max; + error = sysctl_handle_32(oidp, &nstates, 0, req); + /* Read operation or some error */ + if ((error != 0) || (req->newptr == NULL)) + return (error); + + V_dyn_parent_max = nstates; + uma_zone_set_max(V_dyn_parent_zone, V_dyn_parent_max); + return (0); +} + +static int +sysctl_dyn_buckets(SYSCTL_HANDLER_ARGS) +{ + uint32_t nbuckets; + int error; + + nbuckets = V_dyn_buckets_max; + error = sysctl_handle_32(oidp, &nbuckets, 0, req); + /* Read operation or some error */ + if ((error != 0) || (req->newptr == NULL)) + return (error); + + if (nbuckets > 256) + V_dyn_buckets_max = 1 << fls(nbuckets - 1); + else + return (EINVAL); + return (0); +} + SYSCTL_DECL(_net_inet_ip_fw); -SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, dyn_buckets, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(dyn_buckets_max), 0, - "Max number of dyn. buckets"); -SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, curr_dyn_buckets, + +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, dyn_count, + CTLFLAG_VNET | CTLFLAG_RD, &VNET_NAME(dyn_count), 0, + "Current number of dynamic states."); +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, dyn_parent_count, + CTLFLAG_VNET | CTLFLAG_RD, &VNET_NAME(dyn_parent_count), 0, + "Current number of parent states. "); +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, curr_dyn_buckets, CTLFLAG_VNET | CTLFLAG_RD, &VNET_NAME(curr_dyn_buckets), 0, - "Current Number of dyn. buckets"); -SYSCTL_PROC(_net_inet_ip_fw, OID_AUTO, dyn_count, - CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RD, 0, 0, sysctl_ipfw_dyn_count, "IU", - "Number of dyn. rules"); + "Current number of buckets for states hash table."); +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, curr_max_length, + CTLFLAG_VNET | CTLFLAG_RD, &VNET_NAME(curr_max_length), 0, + "Current maximum length of states chains in hash buckets."); +SYSCTL_PROC(_net_inet_ip_fw, OID_AUTO, dyn_buckets, + CTLFLAG_VNET | CTLTYPE_U32 | CTLFLAG_RW, 0, 0, sysctl_dyn_buckets, + "IU", "Max number of buckets for dynamic states hash table."); SYSCTL_PROC(_net_inet_ip_fw, OID_AUTO, dyn_max, - CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, 0, 0, sysctl_ipfw_dyn_max, "IU", - "Max number of dyn. rules"); -SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, dyn_ack_lifetime, + CTLFLAG_VNET | CTLTYPE_U32 | CTLFLAG_RW, 0, 0, sysctl_dyn_max, + "IU", "Max number of dynamic states."); +SYSCTL_PROC(_net_inet_ip_fw, OID_AUTO, dyn_parent_max, + CTLFLAG_VNET | CTLTYPE_U32 | CTLFLAG_RW, 0, 0, sysctl_dyn_parent_max, + "IU", "Max number of parent dynamic states."); +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, dyn_ack_lifetime, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(dyn_ack_lifetime), 0, - "Lifetime of dyn. rules for acks"); -SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, dyn_syn_lifetime, + "Lifetime of dynamic states for TCP ACK."); +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, dyn_syn_lifetime, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(dyn_syn_lifetime), 0, - "Lifetime of dyn. rules for syn"); -SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, dyn_fin_lifetime, + "Lifetime of dynamic states for TCP SYN."); +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, dyn_fin_lifetime, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(dyn_fin_lifetime), 0, - "Lifetime of dyn. rules for fin"); -SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, dyn_rst_lifetime, + "Lifetime of dynamic states for TCP FIN."); +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, dyn_rst_lifetime, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(dyn_rst_lifetime), 0, - "Lifetime of dyn. rules for rst"); -SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, dyn_udp_lifetime, + "Lifetime of dynamic states for TCP RST."); +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, dyn_udp_lifetime, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(dyn_udp_lifetime), 0, - "Lifetime of dyn. rules for UDP"); -SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, dyn_short_lifetime, + "Lifetime of dynamic states for UDP."); +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, dyn_short_lifetime, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(dyn_short_lifetime), 0, - "Lifetime of dyn. rules for other situations"); -SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, dyn_keepalive, + "Lifetime of dynamic states for other situations."); +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, dyn_keepalive, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(dyn_keepalive), 0, - "Enable keepalives for dyn. rules"); -SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, dyn_keep_states, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(dyn_keep_states), 0, - "Do not flush dynamic states on rule deletion"); + "Enable keepalives for dynamic states."); -SYSEND +#ifdef IPFIREWALL_DYNDEBUG +#define DYN_DEBUG(fmt, ...) do { \ + printf("%s: " fmt "\n", __func__, __VA_ARGS__); \ +} while (0) +#else +#define DYN_DEBUG(fmt, ...) +#endif /* !IPFIREWALL_DYNDEBUG */ -#endif /* SYSCTL_NODE */ - - #ifdef INET6 -static __inline int -hash_packet6(const struct ipfw_flow_id *id) -{ - u_int32_t i; - i = (id->dst_ip6.__u6_addr.__u6_addr32[2]) ^ - (id->dst_ip6.__u6_addr.__u6_addr32[3]) ^ - (id->src_ip6.__u6_addr.__u6_addr32[2]) ^ - (id->src_ip6.__u6_addr.__u6_addr32[3]); - return ntohl(i); -} -#endif +/* Functions to work with IPv6 states */ +static struct dyn_ipv6_state *dyn_lookup_ipv6_state( + const struct ipfw_flow_id *, uint32_t, const void *, + struct ipfw_dyn_info *, int); +static int dyn_lookup_ipv6_state_locked(const struct ipfw_flow_id *, + uint32_t, const void *, int, const void *, uint32_t, uint16_t, uint32_t, + uint16_t); +static struct dyn_ipv6_state *dyn_alloc_ipv6_state( + const struct ipfw_flow_id *, uint32_t, uint16_t, uint8_t); +static int dyn_add_ipv6_state(void *, uint32_t, uint16_t, uint8_t, + const struct ipfw_flow_id *, uint32_t, const void *, int, uint32_t, + struct ipfw_dyn_info *, uint16_t, uint16_t, uint8_t); +static void dyn_export_ipv6_state(const struct dyn_ipv6_state *, + ipfw_dyn_rule *); -/* - * IMPORTANT: the hash function for dynamic rules must be commutative - * in source and destination (ip,port), because rules are bidirectional - * and we want to find both in the same bucket. - */ -static __inline int -hash_packet(const struct ipfw_flow_id *id, int buckets) -{ - u_int32_t i; +static uint32_t dyn_getscopeid(const struct ip_fw_args *); +static void dyn_make_keepalive_ipv6(struct mbuf *, const struct in6_addr *, + const struct in6_addr *, uint32_t, uint32_t, uint32_t, uint16_t, + uint16_t); +static void dyn_enqueue_keepalive_ipv6(struct mbufq *, + const struct dyn_ipv6_state *); +static void dyn_send_keepalive_ipv6(struct ip_fw_chain *); -#ifdef INET6 - if (IS_IP6_FLOW_ID(id)) - i = hash_packet6(id); - else +static struct dyn_ipv6_state *dyn_lookup_ipv6_parent( + const struct ipfw_flow_id *, uint32_t, const void *, uint32_t, uint16_t, + uint32_t); +static struct dyn_ipv6_state *dyn_lookup_ipv6_parent_locked( + const struct ipfw_flow_id *, uint32_t, const void *, uint32_t, uint16_t, + uint32_t); +static struct dyn_ipv6_state *dyn_add_ipv6_parent(void *, uint32_t, uint16_t, + uint8_t, const struct ipfw_flow_id *, uint32_t, uint32_t, uint32_t, + uint16_t); #endif /* INET6 */ - i = (id->dst_ip) ^ (id->src_ip); - i ^= (id->dst_port) ^ (id->src_port); - return (i & (buckets - 1)); -} -#if 0 -#define DYN_DEBUG(fmt, ...) do { \ - printf("%s: " fmt "\n", __func__, __VA_ARGS__); \ -} while (0) -#else -#define DYN_DEBUG(fmt, ...) -#endif +/* Functions to work with limit states */ +static void *dyn_get_parent_state(const struct ipfw_flow_id *, uint32_t, + struct ip_fw *, uint32_t, uint32_t, uint16_t); +static struct dyn_ipv4_state *dyn_lookup_ipv4_parent( + const struct ipfw_flow_id *, const void *, uint32_t, uint16_t, uint32_t); +static struct dyn_ipv4_state *dyn_lookup_ipv4_parent_locked( + const struct ipfw_flow_id *, const void *, uint32_t, uint16_t, uint32_t); +static struct dyn_parent *dyn_alloc_parent(void *, uint32_t, uint16_t, + uint8_t, uint32_t); +static struct dyn_ipv4_state *dyn_add_ipv4_parent(void *, uint32_t, uint16_t, + uint8_t, const struct ipfw_flow_id *, uint32_t, uint32_t, uint16_t); +static void dyn_tick(void *); +static void dyn_expire_states(struct ip_fw_chain *, ipfw_range_tlv *); +static void dyn_free_states(struct ip_fw_chain *); +static void dyn_export_parent(const struct dyn_parent *, uint16_t, + ipfw_dyn_rule *); +static void dyn_export_data(const struct dyn_data *, uint16_t, uint8_t, + ipfw_dyn_rule *); +static uint32_t dyn_update_tcp_state(struct dyn_data *, + const struct ipfw_flow_id *, const struct tcphdr *, int); +static void dyn_update_proto_state(struct dyn_data *, + const struct ipfw_flow_id *, const void *, int, int); + +/* Functions to work with IPv4 states */ +struct dyn_ipv4_state *dyn_lookup_ipv4_state(const struct ipfw_flow_id *, + const void *, struct ipfw_dyn_info *, int); +static int dyn_lookup_ipv4_state_locked(const struct ipfw_flow_id *, + const void *, int, const void *, uint32_t, uint16_t, uint32_t, uint16_t); +static struct dyn_ipv4_state *dyn_alloc_ipv4_state( + const struct ipfw_flow_id *, uint16_t, uint8_t); +static int dyn_add_ipv4_state(void *, uint32_t, uint16_t, uint8_t, + const struct ipfw_flow_id *, const void *, int, uint32_t, + struct ipfw_dyn_info *, uint16_t, uint16_t, uint8_t); +static void dyn_export_ipv4_state(const struct dyn_ipv4_state *, + ipfw_dyn_rule *); + +/* + * Named states support. + */ static char *default_state_name = "default"; struct dyn_state_obj { struct named_object no; @@ -438,7 +707,6 @@ dyn_destroy(struct ip_fw_chain *ch, struct named_objec KASSERT(no->refcnt == 1, ("Destroying object '%s' (type %u, idx %u) with refcnt %u", no->name, no->etlv, no->kidx, no->refcnt)); - DYN_DEBUG("kidx %d", no->kidx); obj = SRV_OBJECT(ch, no->kidx); SRV_OBJECT(ch, no->kidx) = NULL; @@ -474,7 +742,137 @@ static struct opcode_obj_rewrite dyn_opcodes[] = { dyn_create, dyn_destroy }, }; -/** + +/* + * IMPORTANT: the hash function for dynamic rules must be commutative + * in source and destination (ip,port), because rules are bidirectional + * and we want to find both in the same bucket. + */ +#ifndef IPFIREWALL_JENKINSHASH +static __inline uint32_t +hash_packet(const struct ipfw_flow_id *id) +{ + uint32_t i; + +#ifdef INET6 + if (IS_IP6_FLOW_ID(id)) + i = ntohl((id->dst_ip6.__u6_addr.__u6_addr32[2]) ^ + (id->dst_ip6.__u6_addr.__u6_addr32[3]) ^ + (id->src_ip6.__u6_addr.__u6_addr32[2]) ^ + (id->src_ip6.__u6_addr.__u6_addr32[3])); + else +#endif /* INET6 */ + i = (id->dst_ip) ^ (id->src_ip); + i ^= (id->dst_port) ^ (id->src_port); + return (i); +} + +static __inline uint32_t +hash_parent(const struct ipfw_flow_id *id, const void *rule) +{ + + return (hash_packet(id) ^ ((uintptr_t)rule)); +} + +#else /* IPFIREWALL_JENKINSHASH */ + +static VNET_DEFINE(uint32_t, dyn_hashseed); +#define V_dyn_hashseed VNET(dyn_hashseed) + +static __inline int +addrcmp4(const struct ipfw_flow_id *id) +{ + + if (id->src_ip < id->dst_ip) + return (0); + if (id->src_ip > id->dst_ip) + return (1); + if (id->src_port <= id->dst_port) + return (0); + return (1); +} + +#ifdef INET6 +static __inline int +addrcmp6(const struct ipfw_flow_id *id) +{ + int ret; + + ret = memcmp(&id->src_ip6, &id->dst_ip6, sizeof(struct in6_addr)); + if (ret < 0) + return (0); + if (ret > 0) + return (1); + if (id->src_port <= id->dst_port) + return (0); + return (1); +} + +static __inline uint32_t +hash_packet6(const struct ipfw_flow_id *id) +{ + struct tuple6 { + struct in6_addr addr[2]; + uint16_t port[2]; + } t6; + + if (addrcmp6(id) == 0) { + t6.addr[0] = id->src_ip6; + t6.addr[1] = id->dst_ip6; + t6.port[0] = id->src_port; + t6.port[1] = id->dst_port; + } else { + t6.addr[0] = id->dst_ip6; + t6.addr[1] = id->src_ip6; + t6.port[0] = id->dst_port; + t6.port[1] = id->src_port; + } + return (jenkins_hash32((const uint32_t *)&t6, + sizeof(t6) / sizeof(uint32_t), V_dyn_hashseed)); +} +#endif + +static __inline uint32_t +hash_packet(const struct ipfw_flow_id *id) +{ + struct tuple4 { + in_addr_t addr[2]; + uint16_t port[2]; + } t4; + + if (IS_IP4_FLOW_ID(id)) { + /* All fields are in host byte order */ + if (addrcmp4(id) == 0) { + t4.addr[0] = id->src_ip; + t4.addr[1] = id->dst_ip; + t4.port[0] = id->src_port; + t4.port[1] = id->dst_port; + } else { + t4.addr[0] = id->dst_ip; + t4.addr[1] = id->src_ip; + t4.port[0] = id->dst_port; + t4.port[1] = id->src_port; + } + return (jenkins_hash32((const uint32_t *)&t4, + sizeof(t4) / sizeof(uint32_t), V_dyn_hashseed)); + } else +#ifdef INET6 + if (IS_IP6_FLOW_ID(id)) + return (hash_packet6(id)); +#endif + return (0); +} + +static __inline uint32_t +hash_parent(const struct ipfw_flow_id *id, const void *rule) +{ + + return (jenkins_hash32((const uint32_t *)&rule, + sizeof(rule) / sizeof(uint32_t), hash_packet(id))); +} +#endif /* IPFIREWALL_JENKINSHASH */ + +/* * Print customizable flow id description via log(9) facility. */ static void @@ -502,903 +900,1809 @@ print_dyn_rule_flags(const struct ipfw_flow_id *id, in } log(log_flags, "ipfw: %s type %d %s %d -> %s %d, %d %s\n", prefix, dyn_type, src, id->src_port, dst, - id->dst_port, DYN_COUNT, postfix); + id->dst_port, V_dyn_count, postfix); } #define print_dyn_rule(id, dtype, prefix, postfix) \ print_dyn_rule_flags(id, dtype, LOG_DEBUG, prefix, postfix) -#define TIME_LEQ(a,b) ((int)((a)-(b)) <= 0) -#define TIME_LE(a,b) ((int)((a)-(b)) < 0) +#define TIME_LEQ(a,b) ((int)((a)-(b)) <= 0) +#define TIME_LE(a,b) ((int)((a)-(b)) < 0) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Feb 7 19:12:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC993F1E208; Wed, 7 Feb 2018 19:12:05 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 838FB79C99; Wed, 7 Feb 2018 19:12:05 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 793C22F91; Wed, 7 Feb 2018 19:12:05 +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 w17JC54B068459; Wed, 7 Feb 2018 19:12:05 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17JC5rt068458; Wed, 7 Feb 2018 19:12:05 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201802071912.w17JC5rt068458@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 7 Feb 2018 19:12:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328989 - head/sys/netpfil/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netpfil/ipfw X-SVN-Commit-Revision: 328989 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 19:12:06 -0000 Author: ae Date: Wed Feb 7 19:12:05 2018 New Revision: 328989 URL: https://svnweb.freebsd.org/changeset/base/328989 Log: Remove duplicate #include . 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 Feb 7 18:59:54 2018 (r328988) +++ head/sys/netpfil/ipfw/ip_fw_dynamic.c Wed Feb 7 19:12:05 2018 (r328989) @@ -60,7 +60,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include From owner-svn-src-all@freebsd.org Wed Feb 7 19:21:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E27F4F1EB9C; Wed, 7 Feb 2018 19:20:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 94ABE7A097; Wed, 7 Feb 2018 19:20:59 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F9722FDB; Wed, 7 Feb 2018 19:20: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 w17JKxjC071171; Wed, 7 Feb 2018 19:20:59 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17JKx8m071168; Wed, 7 Feb 2018 19:20:59 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802071920.w17JKx8m071168@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 7 Feb 2018 19:20:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328990 - in head/stand/usb: . test X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/stand/usb: . test X-SVN-Commit-Revision: 328990 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 19:21:00 -0000 Author: hselasky Date: Wed Feb 7 19:20:59 2018 New Revision: 328990 URL: https://svnweb.freebsd.org/changeset/base/328990 Log: Move the stand/usb test loader into its own directory. Fix its Makefile to build correctly. MFC after: 1 week Sponsored by: Mellanox Technologies Added: head/stand/usb/test/ head/stand/usb/test/Makefile - copied, changed from r328989, head/stand/usb/Makefile.test head/stand/usb/test/bsd_usbloader_test.c - copied unchanged from r328989, head/stand/usb/bsd_usbloader_test.c Deleted: head/stand/usb/Makefile.test head/stand/usb/bsd_usbloader_test.c Copied and modified: head/stand/usb/test/Makefile (from r328989, head/stand/usb/Makefile.test) ============================================================================== --- head/stand/usb/Makefile.test Wed Feb 7 19:12:05 2018 (r328989, copy source) +++ head/stand/usb/test/Makefile Wed Feb 7 19:20:59 2018 (r328990) @@ -30,6 +30,7 @@ # .PATH: ${.CURDIR} +.SUFFIXES: .a PROG= usbloader SRCS= @@ -45,12 +46,15 @@ LDFLAGS+= -Wl,--gc-sections SRCS+= bsd_usbloader_test.c -LDADD+= libusbboot.a -DPADD+= libusbboot.a +USBLIB?= ${.OBJDIR}/../libusbboot.a +LDADD+= ${USBLIB} +DPADD+= ${USBLIB} + +MAN= + .include -${PROG}: libusbboot.a +${USBLIB}: + make -C ${.CURDIR}/.. USBCOREDIR=${.CURDIR}/.. -libusbboot.a: - make -f Makefile Copied: head/stand/usb/test/bsd_usbloader_test.c (from r328989, head/stand/usb/bsd_usbloader_test.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/usb/test/bsd_usbloader_test.c Wed Feb 7 19:20:59 2018 (r328990, copy of r328989, head/stand/usb/bsd_usbloader_test.c) @@ -0,0 +1,101 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2013 Hans Petter Selasky. 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 +#include +#include +#include + +extern int usleep(int); +extern void callout_process(int); +extern void usb_idle(void); +extern void usb_init(void); +extern void usb_uninit(void); + +#define hz 1000 + +#ifdef HAVE_MALLOC +void * +usb_malloc(size_t size) +{ + return (malloc(size)); +} + +void +usb_free(void *ptr) +{ + free(ptr); +} +#endif + +void +DELAY(unsigned int delay) +{ + usleep(delay); +} + +void +delay(unsigned int delay) +{ + usleep(delay); +} + +int +pause(const char *what, int timeout) +{ + if (timeout == 0) + timeout = 1; + + usleep((1000000 / hz) * timeout); + + return (0); +} + +int +main(int argc, char **argv) +{ + uint32_t time; + + usb_init(); + + time = 0; + + while (1) { + + usb_idle(); + + usleep(1000); + + if (++time >= (1000 / hz)) { + time = 0; + callout_process(1); + } + } + + usb_uninit(); + + return (0); +} From owner-svn-src-all@freebsd.org Wed Feb 7 19:45:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8816F20986; Wed, 7 Feb 2018 19:45:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7B4CA7B6E2; Wed, 7 Feb 2018 19:45:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B347348D; Wed, 7 Feb 2018 19:45:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w17JjOFY086218; Wed, 7 Feb 2018 19:45:24 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17JjORS086216; Wed, 7 Feb 2018 19:45:24 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802071945.w17JjORS086216@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 7 Feb 2018 19:45:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328991 - stable/11/tools/boot X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/tools/boot X-SVN-Commit-Revision: 328991 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 19:45:25 -0000 Author: kevans Date: Wed Feb 7 19:45:23 2018 New Revision: 328991 URL: https://svnweb.freebsd.org/changeset/base/328991 Log: MFC r326873,r326874,r326875,r326883,r326884,r326885,r326954,r328865 r326873: Script that knows how to put boot blocks onto a device. r326874: Script to generate minimal boot images for each of the 24 supported r326875: Add missing of=/dev/${dev}s${s} when installing zfsboot. r326883: For now, make the gpart commands verbose r326884: Be a little verbose and list the loader files we're putting on r326885: Use -h -D in preference to -D so that the serial port gets the interactive console. r326954: Support more images (but still no geli) r328865: Flesh out the creation of sparc64 UFS images. Added: stable/11/tools/boot/install-boot.sh - copied, changed from r326873, head/tools/boot/install-boot.sh stable/11/tools/boot/rootgen.sh - copied, changed from r326874, head/tools/boot/rootgen.sh Modified: Directory Properties: stable/11/ (props changed) Copied and modified: stable/11/tools/boot/install-boot.sh (from r326873, head/tools/boot/install-boot.sh) ============================================================================== --- head/tools/boot/install-boot.sh Fri Dec 15 06:34:11 2017 (r326873, copy source) +++ stable/11/tools/boot/install-boot.sh Wed Feb 7 19:45:23 2018 (r328991) @@ -15,6 +15,11 @@ die() { exit 1 } +doit() { + echo $* + eval $* +} + find-part() { dev=$1 part=$2 @@ -30,7 +35,7 @@ boot_nogeli_gpt_zfs_legacy() { if [ -z "$idx" ] ; then die "No freebsd-boot partition found" fi - gpart bootcode -b ${gpt0} -p ${gpt2} -i $idx $dev + doit gpart bootcode -b ${gpt0} -p ${gptzfs2} -i $idx $dev exit 0 } @@ -42,7 +47,7 @@ boot_nogeli_gpt_ufs_legacy() { if [ -z "$idx" ] ; then die "No freebsd-boot partition found" fi - gpart bootcode -b ${gpt0} -p ${gpt2} -i $idx $dev + doit gpart bootcode -b ${gpt0} -p ${gpt2} -i $idx $dev exit 0 } @@ -58,9 +63,9 @@ boot_nogeli_mbr_zfs_legacy() { # search to find the freebsd-zfs partition within the slice # Or just assume it is 'a' because it has to be since it fails otherwise dd if=${dst}/boot/zfsboot of=/tmp/zfsboot1 count=1 - gpart bootcode -b /tmp/zfsboo1 ${dev}s${s} # Put boot1 into the start of part - sysctl kern.geom.debugflags=0x10 - dd if=${dst}/boot/zfsboot iseek=1 seek=1024 # Put boot2 into ZFS boot slot + doit gpart bootcode -b /tmp/zfsboo1 ${dev}s${s} # Put boot1 into the start of part + sysctl kern.geom.debugflags=0x10 # Put boot2 into ZFS boot slot + doit dd if=${dst}/boot/zfsboot of=/dev/${dev}s${s} iseek=1 seek=1024 sysctl kern.geom.debugflags=0x0 exit 0 @@ -70,15 +75,25 @@ boot_nogeli_mbr_ufs_legacy() { dev=$1 dst=$2 - gpart bootcode -b ${mbr0} ${dev} + doit gpart bootcode -b ${mbr0} ${dev} s=$(findpart $dev "freebsd-ufs") if [ -z "$s" ] ; then - die "No freebsd-zfs slice found" + die "No freebsd-ufs slice found" fi - gpart bootcode -p ${mbr2} ${dev}s${s} + doit gpart bootcode -p ${mbr2} ${dev}s${s} exit 0 } +boot_nogeli_vtoc8_ufs_ofw() { + dev=$1 + dst=$2 + + # For non-native builds, ensure that geom_part(4) supports VTOC8. + kldload geom_part_vtoc8.ko + doit gpart bootcode -p ${vtoc8} ${dev} + exit 0 +} + DESTDIR=/ # Note: we really don't support geli boot in this script yet. @@ -122,6 +137,9 @@ gptzfs2=${DESTDIR}/boot/gptzfsboot # For MBR, we have lots of choices, but select boot0 mbr0=${DESTDIR}/boot/boot0 mbr2=${DESTDIR}/boot/boot + +# VTOC8 +vtoc8=${DESTDIR}/boot/boot1 # sanity check here Copied and modified: stable/11/tools/boot/rootgen.sh (from r326874, head/tools/boot/rootgen.sh) ============================================================================== --- head/tools/boot/rootgen.sh Fri Dec 15 06:34:27 2017 (r326874, copy source) +++ stable/11/tools/boot/rootgen.sh Wed Feb 7 19:45:23 2018 (r328991) @@ -33,28 +33,41 @@ mk_nogeli_gpt_ufs_legacy() { src=$1 img=$2 - rm -f ${img} ${img}.p2 + cat > ${src}/etc/fstab < ${src}/etc/fstab < ${src}/etc/fstab < ${src}/etc/fstab < ${src}/etc/fstab < $sh +# https://wiki.freebsd.org/arm64/QEMU also has +# -device virtio-net-device,netdev=net0 +# -netdev user,id=net0 +} + +# Amd64 qemu +qemu_amd64_legacy() +{ + img=$1 + sh=$2 + + echo "qemu-system-x86_64 --drive file=${img},format=raw ${qser}" > $sh +} + +qemu_amd64_uefi() +{ + img=$1 + sh=$2 + + echo "qemu-system-x86_64 -bios ~/bios/OVMF-X64.fd --drive file=${img},format=raw ${qser}" > $sh +} + +qemu_amd64_both() +{ + img=$1 + sh=$2 + + echo "qemu-system-x86_64 --drive file=${img},format=raw ${qser}" > $sh + echo "qemu-system-x86_64 -bios ~/bios/OVMF-X64.fd --drive file=${img},format=raw ${qser}" > $sh +} + +# arm +# nothing listed? + +# i386 +qemu_i386_legacy() +{ + img=$1 + sh=$2 + + echo "qemu-system-i386 --drive file=${img},format=raw ${qser}" > $sh +} + +# Not yet supported +qemu_i386_uefi() +{ + img=$1 + sh=$2 + + echo "qemu-system-i386 -bios ~/bios/OVMF-X32.fd --drive file=${img},format=raw ${qser}" > $sh +} + +# Needs UEFI to be supported +qemu_i386_both() +{ + img=$1 + sh=$2 + + echo "qemu-system-i386 --drive file=${img},format=raw ${qser}" > $sh + echo "qemu-system-i386 -bios ~/bios/OVMF-X32.fd --drive file=${img},format=raw ${qser}" > $sh +} + +# mips +# qemu-system-mips -kernel /path/to/rootfs/boot/kernel/kernel -nographic -hda /path/to/disk.img -m 2048 + +# Powerpc -- doesn't work but maybe it would enough for testing -- needs details +# powerpc64 +# qemu-system-ppc64 -drive file=/path/to/disk.img,format=raw + +# sparc64 +# qemu-system-sparc64 -drive file=/path/to/disk.img,format=raw + # Misc variables SRCTOP=$(make -v SRCTOP) cd ${SRCTOP}/stand @@ -181,33 +314,127 @@ DESTDIR=${OBJDIR}/boot-tree rm -rf ${DESTDIR} mkdir -p ${DESTDIR}/boot/defaults mkdir -p ${DESTDIR}/boot/kernel +# XXX boot1 exists only on sparc64 +cp /boot/boot1 ${DESTDIR}/boot +cp /boot/loader ${DESTDIR}/boot cp /boot/kernel/kernel ${DESTDIR}/boot/kernel -echo -D -S115200 > ${DESTDIR}/boot.config +echo -h -D -S115200 > ${DESTDIR}/boot.config # XXX cp /boot/device.hints ${DESTDIR}/boot/device.hints # Assume we're already built make install DESTDIR=${DESTDIR} MK_MAN=no MK_INSTALL_AS_USER=yes -# Copy init, /bin/sh and minimal libraries -mkdir -p ${DESTDIR}/sbin ${DESTDIR}/bin ${DESTDIR}/lib ${DESTDIR}/libexec -for f in /sbin/init /bin/sh $(ldd /bin/sh | awk 'NF == 4 { print $3; }') /libexec/ld-elf.so.1; do +# Copy init, /bin/sh, minimal libraries and testing /etc/rc +mkdir -p ${DESTDIR}/sbin ${DESTDIR}/bin \ + ${DESTDIR}/lib ${DESTDIR}/libexec \ + ${DESTDIR}/etc ${DESTDIR}/dev +for f in /sbin/halt /sbin/init /bin/sh $(ldd /bin/sh | awk 'NF == 4 { print $3; }') /libexec/ld-elf.so.1; do cp $f ${DESTDIR}/$f done -mkdir ${DESTDIR}/dev +cat > ${DESTDIR}/etc/rc < Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74975F20DC0; Wed, 7 Feb 2018 19:49:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 236257B990; Wed, 7 Feb 2018 19:49:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19C2C348E; Wed, 7 Feb 2018 19:49:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w17Jn77p086407; Wed, 7 Feb 2018 19:49:07 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17Jn79C086406; Wed, 7 Feb 2018 19:49:07 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802071949.w17Jn79C086406@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 7 Feb 2018 19:49:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328992 - stable/11/tools/boot X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/tools/boot X-SVN-Commit-Revision: 328992 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 19:49:08 -0000 Author: kevans Date: Wed Feb 7 19:49:07 2018 New Revision: 328992 URL: https://svnweb.freebsd.org/changeset/base/328992 Log: Fix rootgen.sh to reflect proper bootloader paths This is a direct commit to stable/11 to use sys/boot instead of stand/. It will be reverted once the move from sys/boot to stand/ gets an MFC. Modified: stable/11/tools/boot/rootgen.sh Modified: stable/11/tools/boot/rootgen.sh ============================================================================== --- stable/11/tools/boot/rootgen.sh Wed Feb 7 19:45:23 2018 (r328991) +++ stable/11/tools/boot/rootgen.sh Wed Feb 7 19:49:07 2018 (r328992) @@ -303,7 +303,7 @@ qemu_i386_both() # Misc variables SRCTOP=$(make -v SRCTOP) -cd ${SRCTOP}/stand +cd ${SRCTOP}/sys/boot OBJDIR=$(make -v .OBJDIR) IMGDIR=${OBJDIR}/boot-images mkdir -p ${IMGDIR} From owner-svn-src-all@freebsd.org Wed Feb 7 20:13:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DBC9EC9D7F; Wed, 7 Feb 2018 20:13:09 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C37A17D056; Wed, 7 Feb 2018 20:13:08 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BE54F3D91; Wed, 7 Feb 2018 20:13:08 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w17KD8jG002509; Wed, 7 Feb 2018 20:13:08 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17KD8a0002508; Wed, 7 Feb 2018 20:13:08 GMT (envelope-from np@FreeBSD.org) Message-Id: <201802072013.w17KD8a0002508@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 7 Feb 2018 20:13:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328994 - head/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/iw_cxgbe X-SVN-Commit-Revision: 328994 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 20:13:09 -0000 Author: np Date: Wed Feb 7 20:13:08 2018 New Revision: 328994 URL: https://svnweb.freebsd.org/changeset/base/328994 Log: iw_cxgbe: Remove declaration of a function that no longer exists. Modified: head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Modified: head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Wed Feb 7 19:53:14 2018 (r328993) +++ head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Wed Feb 7 20:13:08 2018 (r328994) @@ -964,7 +964,6 @@ void c4iw_pblpool_free(struct c4iw_rdev *rdev, u32 add int c4iw_ofld_send(struct c4iw_rdev *rdev, struct mbuf *m); void c4iw_flush_hw_cq(struct c4iw_cq *cq); void c4iw_count_rcqes(struct t4_cq *cq, struct t4_wq *wq, int *count); -void c4iw_count_scqes(struct t4_cq *cq, struct t4_wq *wq, int *count); int c4iw_ep_disconnect(struct c4iw_ep *ep, int abrupt, gfp_t gfp); int __c4iw_ep_disconnect(struct c4iw_ep *ep, int abrupt, gfp_t gfp); int c4iw_flush_rq(struct t4_wq *wq, struct t4_cq *cq, int count); From owner-svn-src-all@freebsd.org Wed Feb 7 20:36:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 683D9ED6CF1; Wed, 7 Feb 2018 20:36:38 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 17F467DE30; Wed, 7 Feb 2018 20:36:38 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E464412D; Wed, 7 Feb 2018 20:36:38 +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 w17KabUS012261; Wed, 7 Feb 2018 20:36:37 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17KabqK012260; Wed, 7 Feb 2018 20:36:37 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201802072036.w17KabqK012260@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 7 Feb 2018 20:36:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328995 - head/usr.bin/sort X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.bin/sort X-SVN-Commit-Revision: 328995 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 20:36:38 -0000 Author: markj Date: Wed Feb 7 20:36:37 2018 New Revision: 328995 URL: https://svnweb.freebsd.org/changeset/base/328995 Log: Fix the WITH_SORT_THREADS build. PR: 201664 MFC after: 1 week Modified: head/usr.bin/sort/radixsort.c Modified: head/usr.bin/sort/radixsort.c ============================================================================== --- head/usr.bin/sort/radixsort.c Wed Feb 7 20:13:08 2018 (r328994) +++ head/usr.bin/sort/radixsort.c Wed Feb 7 20:36:37 2018 (r328995) @@ -129,6 +129,14 @@ have_sort_left(void) #endif /* SORT_THREADS */ +static void +_push_ls(struct level_stack *ls) +{ + + ls->next = g_ls; + g_ls = ls; +} + /* * Push sort level to the stack */ @@ -141,22 +149,14 @@ push_ls(struct sort_level *sl) new_ls->sl = sl; #if defined(SORT_THREADS) - if (nthreads > 1) + if (nthreads > 1) { pthread_mutex_lock(&g_ls_mutex); -#endif - - new_ls->next = g_ls; - g_ls = new_ls; - -#if defined(SORT_THREADS) - if (nthreads > 1) + _push_ls(new_ls); pthread_cond_signal(&g_ls_cond); -#endif - -#if defined(SORT_THREADS) - if (nthreads > 1) pthread_mutex_unlock(&g_ls_mutex); + } else #endif + _push_ls(new_ls); } /* From owner-svn-src-all@freebsd.org Wed Feb 7 21:52:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE2A8EDCCA3; Wed, 7 Feb 2018 21:52:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6479880E20; Wed, 7 Feb 2018 21:52: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F6084DCF; Wed, 7 Feb 2018 21:52:00 +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 w17Lq0PB048729; Wed, 7 Feb 2018 21:52:00 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17Lq0gd048728; Wed, 7 Feb 2018 21:52:00 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802072152.w17Lq0gd048728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 7 Feb 2018 21:52:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328996 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 328996 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 21:52:00 -0000 Author: avg Date: Wed Feb 7 21:51:59 2018 New Revision: 328996 URL: https://svnweb.freebsd.org/changeset/base/328996 Log: exec_map_first_page: fix an inverse condition introduced in r254138 While the bug itself was serious, as we could either pass a non-busied page to vm_pager_get_pages() or leak a busy page, it could only be triggered under a very rare condition where the page is already inserted into the object, but it is not valid yet. Reviewed by: kib MFC after: 2 weeks Modified: head/sys/kern/kern_exec.c Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Wed Feb 7 20:36:37 2018 (r328995) +++ head/sys/kern/kern_exec.c Wed Feb 7 21:51:59 2018 (r328996) @@ -1009,7 +1009,7 @@ exec_map_first_page(imgp) if ((ma[i] = vm_page_next(ma[i - 1])) != NULL) { if (ma[i]->valid) break; - if (vm_page_tryxbusy(ma[i])) + if (!vm_page_tryxbusy(ma[i])) break; } else { ma[i] = vm_page_alloc(object, i, From owner-svn-src-all@freebsd.org Wed Feb 7 22:26:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA606EDF143; Wed, 7 Feb 2018 22:26:31 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.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 666568213A; Wed, 7 Feb 2018 22:26:31 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id E6B5B10A7DB; Wed, 7 Feb 2018 17:26:29 -0500 (EST) From: John Baldwin To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328985 - head/sys/dev/usb/template Date: Wed, 07 Feb 2018 14:25:14 -0800 Message-ID: <2147494.gDNdGGi869@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201802071846.w17Ik894055491@repo.freebsd.org> References: <201802071846.w17Ik894055491@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.4.3 (mail.baldwin.cx); Wed, 07 Feb 2018 17:26:30 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 22:26:31 -0000 On Wednesday, February 07, 2018 06:46:08 PM Hans Petter Selasky wrote: > Author: hselasky > Date: Wed Feb 7 18:46:08 2018 > New Revision: 328985 > URL: https://svnweb.freebsd.org/changeset/base/328985 > > Log: > Give USB template SYSUNINIT()'s a uniq name to avoid symbol name collision > when building stand/usb. Regression after r328194. This seems like a bug in the USB bits in stand instead. In the kernel SYSINIT and SYSUNINIT use separate namespace by appending different suffixes to the first parameter: DATA_SET(sysinit_set,uniquifier ## _sys_init) vs. DATA_SET(sysuninit_set,uniquifier ## _sys_uninit) The bug is in stand/kshim/bsd_kernel.h: #define SYSINIT(uniq, subs, order, _func, _data) \ const struct sysinit UNIQ_NAME(sysinit_##uniq) = { \ .func = (_func), \ .data = __DECONST(void *, _data) \ }; \ SYSINIT_ENTRY(uniq##_entry, "sysinit", (subs), \ (order), "const struct sysinit", \ UNIQ_NAME_STR(sysinit_##uniq), "SYSINIT") #define SYSUNINIT(uniq, subs, order, _func, _data) \ const struct sysinit UNIQ_NAME(sysuninit_##uniq) = { \ .func = (_func), \ .data = __DECONST(void *, _data) \ }; \ SYSINIT_ENTRY(uniq##_entry, "sysuninit", (subs), \ (order), "const struct sysuninit", \ UNIQ_NAME_STR(sysuninit_##uniq), "SYSUNINIT") This should be using uniq##_uninit_entry or some such for the first argument to SYSINIT_ENTRY(). -- John Baldwin From owner-svn-src-all@freebsd.org Wed Feb 7 22:41:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98AA0EE02C2 for ; Wed, 7 Feb 2018 22:41:33 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) 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 1000582B6D for ; Wed, 7 Feb 2018 22:41:33 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by mail-wm0-x22d.google.com with SMTP id v71so6339897wmv.2 for ; Wed, 07 Feb 2018 14:41:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=Vd6FHw8IOpwL0ej68WA3M77rvMOZ7UbiOYuJYbWiSMU=; b=HS2JwDE6OflnyvrLgc39Tv5j5d9d6mb9YGplBcX1Y6QnsZxMZ7wHiszOG4IL9yYzJL b+Gv5Nn6axh8pt151WF+yN92TmZQEuwk0yLVwMBJcbkcXgnf1A+NnMkO9DSgIQ48a6aI ivzfT3AEzC62FXSmlgNw1lQ7AqOibiplJfD3cn9HRme/e4l26U/RBj3v3aZTSE0Ckn5f 5dLVdmqYgSQX+JfSVGfRPI8BwJLGv6gevjdWMYHhX59A1l79rHQvQ7fwMjEQ7K+3DH8b aPkzkOIyjSS3GCcHFj98k+0jWXBxfb3f49IaO4amCUPK3K5LicqQ9PAlebpxvLgghJtL TTHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=Vd6FHw8IOpwL0ej68WA3M77rvMOZ7UbiOYuJYbWiSMU=; b=r8oTXn+goxZUKHUv1HTU5r5mlxbd1P+YKqCNGiypWuzXt44YXivP/nJaSdQPb38Ofv 9XftS3Kq7FiRUj5TT28RyzggR34WR/0Pc1NAqnMOfnDrdSguHYs98z4sk0B8t7UZW+GL Zzfgjm4yEkRMSUbjWM909dqvCHIVSPhqp2g3rIHsO6eZLmJuFuIhGt3CYxCCPRmLQvEB ng8jFcBeKFo9HG2NX24ghAkbzVzkRbhoMA3Lrpv8Gj+vDEhOmZ67TurffdbXPcy08K9s wkrzvMf1XTP1XjcqwzK/LQGhe7AayMiwc60WQLfuWSern47PSgaW2Ttm2jU1q3rXaZ9Z CbZA== X-Gm-Message-State: APf1xPD0WZmFBCQqHPxaGKfEbHfYQACTH6RJz1FhKrhG3L1cBMamRPyp 3eZdnEhJjI4eoqqBePEV+XBN0w== X-Google-Smtp-Source: AH8x224liSkiGBr9YGwDK5SlkGbkpKE8ghuhWBqBnuUEUN1+qyW72itVA2qS88EDrO9VsM/n//6C9g== X-Received: by 10.28.186.132 with SMTP id k126mr5669452wmf.159.1518043291875; Wed, 07 Feb 2018 14:41:31 -0800 (PST) Received: from [10.10.1.111] ([185.97.61.1]) by smtp.gmail.com with ESMTPSA id y52sm5541891wrb.52.2018.02.07.14.41.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Feb 2018 14:41:30 -0800 (PST) Subject: Re: svn commit: r328996 - head/sys/kern To: Andriy Gapon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201802072152.w17Lq0gd048728@repo.freebsd.org> From: Steven Hartland Message-ID: <1076365a-db07-0b28-9f97-3a7cc2a73dd6@multiplay.co.uk> Date: Wed, 7 Feb 2018 22:41:32 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <201802072152.w17Lq0gd048728@repo.freebsd.org> Content-Language: en-US Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 22:41:33 -0000 What would be the expected behavior if this was triggered, app crash or kernel panic...? On 07/02/2018 21:52, Andriy Gapon wrote: > Author: avg > Date: Wed Feb 7 21:51:59 2018 > New Revision: 328996 > URL: https://svnweb.freebsd.org/changeset/base/328996 > > Log: > exec_map_first_page: fix an inverse condition introduced in r254138 > > While the bug itself was serious, as we could either pass a non-busied > page to vm_pager_get_pages() or leak a busy page, it could only be > triggered under a very rare condition where the page is already inserted > into the object, but it is not valid yet. > > Reviewed by: kib > MFC after: 2 weeks > > Modified: > head/sys/kern/kern_exec.c > > Modified: head/sys/kern/kern_exec.c > ============================================================================== > --- head/sys/kern/kern_exec.c Wed Feb 7 20:36:37 2018 (r328995) > +++ head/sys/kern/kern_exec.c Wed Feb 7 21:51:59 2018 (r328996) > @@ -1009,7 +1009,7 @@ exec_map_first_page(imgp) > if ((ma[i] = vm_page_next(ma[i - 1])) != NULL) { > if (ma[i]->valid) > break; > - if (vm_page_tryxbusy(ma[i])) > + if (!vm_page_tryxbusy(ma[i])) > break; > } else { > ma[i] = vm_page_alloc(object, i, > From owner-svn-src-all@freebsd.org Wed Feb 7 22:50:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BF47EE0C68; Wed, 7 Feb 2018 22:50:11 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2BC5B830C9; Wed, 7 Feb 2018 22:50:11 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 26997562F; Wed, 7 Feb 2018 22:50:11 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w17MoAQr077256; Wed, 7 Feb 2018 22:50:10 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17MoAIS077255; Wed, 7 Feb 2018 22:50:10 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201802072250.w17MoAIS077255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Wed, 7 Feb 2018 22:50: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: r328997 - stable/10/sys/kern X-SVN-Group: stable-10 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: stable/10/sys/kern X-SVN-Commit-Revision: 328997 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 22:50:11 -0000 Author: mckusick Date: Wed Feb 7 22:50:10 2018 New Revision: 328997 URL: https://svnweb.freebsd.org/changeset/base/328997 Log: Adjust MFC in r328946 to stable/10. This is a direct commit to the branch. Modified: stable/10/sys/kern/vfs_subr.c Modified: stable/10/sys/kern/vfs_subr.c ============================================================================== --- stable/10/sys/kern/vfs_subr.c Wed Feb 7 21:51:59 2018 (r328996) +++ stable/10/sys/kern/vfs_subr.c Wed Feb 7 22:50:10 2018 (r328997) @@ -3030,7 +3030,7 @@ vn_printf(struct vnode *vp, const char *fmt, ...) printf(" rdev %p\n", vp->v_rdev); break; case VSOCK: - printf(" socket %p\n", vp->v_unpcb); + printf(" socket %p\n", vp->v_socket); break; case VFIFO: printf(" fifoinfo %p\n", vp->v_fifoinfo); From owner-svn-src-all@freebsd.org Wed Feb 7 22:53:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36446EE13CE; Wed, 7 Feb 2018 22:53:54 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D3A87835EF; Wed, 7 Feb 2018 22:53:53 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CEA6A57D6; Wed, 7 Feb 2018 22:53:53 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w17Mrrg3081741; Wed, 7 Feb 2018 22:53:53 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17MrrrH081740; Wed, 7 Feb 2018 22:53:53 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201802072253.w17MrrrH081740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Wed, 7 Feb 2018 22:53:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r328998 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: erj X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 328998 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 22:53:54 -0000 Author: erj Date: Wed Feb 7 22:53:53 2018 New Revision: 328998 URL: https://svnweb.freebsd.org/changeset/base/328998 Log: Add Jeb Cramer (jeb@) as a src committer. He will be working primarily on the Intel Ethernet drivers, on behalf of Intel. Approved by: core@ Modified: svnadmin/conf/access Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Wed Feb 7 22:50:10 2018 (r328997) +++ svnadmin/conf/access Wed Feb 7 22:53:53 2018 (r328998) @@ -103,6 +103,7 @@ jasone jceel jch jchandra +jeb jeff jhb jhibbits From owner-svn-src-all@freebsd.org Wed Feb 7 22:54:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA856EE14B5; Wed, 7 Feb 2018 22:54:31 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A60683721; Wed, 7 Feb 2018 22:54:31 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (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 899B52600EC; Wed, 7 Feb 2018 23:54:29 +0100 (CET) Subject: Re: svn commit: r328985 - head/sys/dev/usb/template To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201802071846.w17Ik894055491@repo.freebsd.org> <2147494.gDNdGGi869@ralph.baldwin.cx> From: Hans Petter Selasky Message-ID: <43ece2af-5259-554e-c5f1-6fd947b587eb@selasky.org> Date: Wed, 7 Feb 2018 23:51:33 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <2147494.gDNdGGi869@ralph.baldwin.cx> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 22:54:32 -0000 On 02/07/18 23:25, John Baldwin wrote: > On Wednesday, February 07, 2018 06:46:08 PM Hans Petter Selasky wrote: >> Author: hselasky >> Date: Wed Feb 7 18:46:08 2018 >> New Revision: 328985 >> URL: https://svnweb.freebsd.org/changeset/base/328985 >> >> Log: >> Give USB template SYSUNINIT()'s a uniq name to avoid symbol name collision >> when building stand/usb. Regression after r328194. > > This seems like a bug in the USB bits in stand instead. In the kernel > SYSINIT and SYSUNINIT use separate namespace by appending different suffixes > to the first parameter: > > DATA_SET(sysinit_set,uniquifier ## _sys_init) > > vs. > > DATA_SET(sysuninit_set,uniquifier ## _sys_uninit) > > The bug is in stand/kshim/bsd_kernel.h: > > #define SYSINIT(uniq, subs, order, _func, _data) \ > const struct sysinit UNIQ_NAME(sysinit_##uniq) = { \ > .func = (_func), \ > .data = __DECONST(void *, _data) \ > }; \ > SYSINIT_ENTRY(uniq##_entry, "sysinit", (subs), \ > (order), "const struct sysinit", \ > UNIQ_NAME_STR(sysinit_##uniq), "SYSINIT") > > #define SYSUNINIT(uniq, subs, order, _func, _data) \ > const struct sysinit UNIQ_NAME(sysuninit_##uniq) = { \ > .func = (_func), \ > .data = __DECONST(void *, _data) \ > }; \ > SYSINIT_ENTRY(uniq##_entry, "sysuninit", (subs), \ > (order), "const struct sysuninit", \ > UNIQ_NAME_STR(sysuninit_##uniq), "SYSUNINIT") > > This should be using uniq##_uninit_entry or some such for the first argument > to SYSINIT_ENTRY(). > It can be fixed either way. Feel free to fix the SYSINIT KSHIM macros. You can test by running make in stand/usb/test . --HPS From owner-svn-src-all@freebsd.org Wed Feb 7 23:27:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52F75EE3B64; Wed, 7 Feb 2018 23:27:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 012DA84A8E; Wed, 7 Feb 2018 23:27: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E64E35CB0; Wed, 7 Feb 2018 23:27:25 +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 w17NRPgb096735; Wed, 7 Feb 2018 23:27:25 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17NRPDG096732; Wed, 7 Feb 2018 23:27:25 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802072327.w17NRPDG096732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 7 Feb 2018 23:27:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328999 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 328999 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 23:27:26 -0000 Author: imp Date: Wed Feb 7 23:27:25 2018 New Revision: 328999 URL: https://svnweb.freebsd.org/changeset/base/328999 Log: Fix indentation to FreeBSD standard for interp files Modified: head/stand/common/interp.c head/stand/common/interp_forth.c head/stand/common/interp_simple.c Modified: head/stand/common/interp.c ============================================================================== --- head/stand/common/interp.c Wed Feb 7 22:53:53 2018 (r328998) +++ head/stand/common/interp.c Wed Feb 7 23:27:25 2018 (r328999) @@ -45,32 +45,32 @@ __FBSDID("$FreeBSD$"); void interact(void) { - static char input[256]; /* big enough? */ + static char input[256]; /* big enough? */ - interp_init(); + interp_init(); - printf("\n"); + printf("\n"); - /* - * Before interacting, we might want to autoboot. - */ - autoboot_maybe(); + /* + * Before interacting, we might want to autoboot. + */ + autoboot_maybe(); - /* - * Not autobooting, go manual - */ - printf("\nType '?' for a list of commands, 'help' for more detailed help.\n"); - if (getenv("prompt") == NULL) - setenv("prompt", "${interpret}", 1); - if (getenv("interpret") == NULL) - setenv("interpret", "OK", 1); + /* + * Not autobooting, go manual + */ + printf("\nType '?' for a list of commands, 'help' for more detailed help.\n"); + if (getenv("prompt") == NULL) + setenv("prompt", "${interpret}", 1); + if (getenv("interpret") == NULL) + setenv("interpret", "OK", 1); - for (;;) { - input[0] = '\0'; - interp_emit_prompt(); - ngets(input, sizeof(input)); - interp_run(input); - } + for (;;) { + input[0] = '\0'; + interp_emit_prompt(); + ngets(input, sizeof(input)); + interp_run(input); + } } /* @@ -87,26 +87,26 @@ COMMAND_SET(include, "include", "read commands from a static int command_include(int argc, char *argv[]) { - int i; - int res; - char **argvbuf; + int i; + int res; + char **argvbuf; - /* - * Since argv is static, we need to save it here. - */ - argvbuf = (char**) calloc((u_int)argc, sizeof(char*)); - for (i = 0; i < argc; i++) - argvbuf[i] = strdup(argv[i]); + /* + * Since argv is static, we need to save it here. + */ + argvbuf = (char**) calloc((u_int)argc, sizeof(char*)); + for (i = 0; i < argc; i++) + argvbuf[i] = strdup(argv[i]); - res=CMD_OK; - for (i = 1; (i < argc) && (res == CMD_OK); i++) - res = interp_include(argvbuf[i]); + res=CMD_OK; + for (i = 1; (i < argc) && (res == CMD_OK); i++) + res = interp_include(argvbuf[i]); - for (i = 0; i < argc; i++) - free(argvbuf[i]); - free(argvbuf); + for (i = 0; i < argc; i++) + free(argvbuf[i]); + free(argvbuf); - return(res); + return(res); } /* @@ -116,26 +116,26 @@ command_include(int argc, char *argv[]) void interp_emit_prompt(void) { - char *pr, *p, *cp, *ev; + char *pr, *p, *cp, *ev; - if ((cp = getenv("prompt")) == NULL) - cp = ">"; - pr = p = strdup(cp); + if ((cp = getenv("prompt")) == NULL) + cp = ">"; + pr = p = strdup(cp); - while (*p != 0) { - if ((*p == '$') && (*(p+1) == '{')) { - for (cp = p + 2; (*cp != 0) && (*cp != '}'); cp++) - ; - *cp = 0; - ev = getenv(p + 2); + while (*p != 0) { + if ((*p == '$') && (*(p+1) == '{')) { + for (cp = p + 2; (*cp != 0) && (*cp != '}'); cp++) + ; + *cp = 0; + ev = getenv(p + 2); - if (ev != NULL) - printf("%s", ev); - p = cp + 1; - continue; + if (ev != NULL) + printf("%s", ev); + p = cp + 1; + continue; + } + putchar(*p++); } - putchar(*p++); - } - putchar(' '); - free(pr); + putchar(' '); + free(pr); } Modified: head/stand/common/interp_forth.c ============================================================================== --- head/stand/common/interp_forth.c Wed Feb 7 22:53:53 2018 (r328998) +++ head/stand/common/interp_forth.c Wed Feb 7 23:27:25 2018 (r328999) @@ -71,91 +71,91 @@ FICL_VM *bf_vm; static void bf_command(FICL_VM *vm) { - char *name, *line, *tail, *cp; - size_t len; - struct bootblk_command **cmdp; - bootblk_cmd_t *cmd; - int nstrings, i; - int argc, result; - char **argv; + char *name, *line, *tail, *cp; + size_t len; + struct bootblk_command **cmdp; + bootblk_cmd_t *cmd; + int nstrings, i; + int argc, result; + char **argv; - /* Get the name of the current word */ - name = vm->runningWord->name; + /* Get the name of the current word */ + name = vm->runningWord->name; - /* Find our command structure */ - cmd = NULL; - SET_FOREACH(cmdp, Xcommand_set) { - if (((*cmdp)->c_name != NULL) && !strcmp(name, (*cmdp)->c_name)) - cmd = (*cmdp)->c_fn; - } - if (cmd == NULL) - panic("callout for unknown command '%s'", name); + /* Find our command structure */ + cmd = NULL; + SET_FOREACH(cmdp, Xcommand_set) { + if (((*cmdp)->c_name != NULL) && !strcmp(name, (*cmdp)->c_name)) + cmd = (*cmdp)->c_fn; + } + if (cmd == NULL) + panic("callout for unknown command '%s'", name); - /* Check whether we have been compiled or are being interpreted */ - if (stackPopINT(vm->pStack)) { - /* - * Get parameters from stack, in the format: - * an un ... a2 u2 a1 u1 n -- - * Where n is the number of strings, a/u are pairs of - * address/size for strings, and they will be concatenated - * in LIFO order. - */ - nstrings = stackPopINT(vm->pStack); - for (i = 0, len = 0; i < nstrings; i++) - len += stackFetch(vm->pStack, i * 2).i + 1; - line = malloc(strlen(name) + len + 1); - strcpy(line, name); + /* Check whether we have been compiled or are being interpreted */ + if (stackPopINT(vm->pStack)) { + /* + * Get parameters from stack, in the format: + * an un ... a2 u2 a1 u1 n -- + * Where n is the number of strings, a/u are pairs of + * address/size for strings, and they will be concatenated + * in LIFO order. + */ + nstrings = stackPopINT(vm->pStack); + for (i = 0, len = 0; i < nstrings; i++) + len += stackFetch(vm->pStack, i * 2).i + 1; + line = malloc(strlen(name) + len + 1); + strcpy(line, name); - if (nstrings) - for (i = 0; i < nstrings; i++) { - len = stackPopINT(vm->pStack); - cp = stackPopPtr(vm->pStack); - strcat(line, " "); - strncat(line, cp, len); - } - } else { - /* Get remainder of invocation */ - tail = vmGetInBuf(vm); - for (cp = tail, len = 0; cp != vm->tib.end && *cp != 0 && *cp != '\n'; cp++, len++) - ; + if (nstrings) + for (i = 0; i < nstrings; i++) { + len = stackPopINT(vm->pStack); + cp = stackPopPtr(vm->pStack); + strcat(line, " "); + strncat(line, cp, len); + } + } else { + /* Get remainder of invocation */ + tail = vmGetInBuf(vm); + for (cp = tail, len = 0; cp != vm->tib.end && *cp != 0 && *cp != '\n'; cp++, len++) + ; - line = malloc(strlen(name) + len + 2); - strcpy(line, name); - if (len > 0) { - strcat(line, " "); - strncat(line, tail, len); - vmUpdateTib(vm, tail + len); + line = malloc(strlen(name) + len + 2); + strcpy(line, name); + if (len > 0) { + strcat(line, " "); + strncat(line, tail, len); + vmUpdateTib(vm, tail + len); + } } - } - DEBUG("cmd '%s'", line); + DEBUG("cmd '%s'", line); - command_errmsg = command_errbuf; - command_errbuf[0] = 0; - if (!parse(&argc, &argv, line)) { - result = (cmd)(argc, argv); - free(argv); - } else { - result=BF_PARSE; - } + command_errmsg = command_errbuf; + command_errbuf[0] = 0; + if (!parse(&argc, &argv, line)) { + result = (cmd)(argc, argv); + free(argv); + } else { + result=BF_PARSE; + } - switch (result) { - case CMD_CRIT: - printf("%s\n", command_errmsg); - break; - case CMD_FATAL: - panic("%s\n", command_errmsg); - } + switch (result) { + case CMD_CRIT: + printf("%s\n", command_errmsg); + break; + case CMD_FATAL: + panic("%s\n", command_errmsg); + } - free(line); - /* - * If there was error during nested ficlExec(), we may no longer have - * valid environment to return. Throw all exceptions from here. - */ - if (result != CMD_OK) - vmThrow(vm, result); + free(line); + /* + * If there was error during nested ficlExec(), we may no longer have + * valid environment to return. Throw all exceptions from here. + */ + if (result != CMD_OK) + vmThrow(vm, result); - /* This is going to be thrown!!! */ - stackPushINT(vm->pStack,result); + /* This is going to be thrown!!! */ + stackPushINT(vm->pStack,result); } /* @@ -226,25 +226,25 @@ bf_command(FICL_VM *vm) * (if you edit this definition, pay attention to trailing spaces after * each word -- I warned you! :-) ) */ -#define BUILTIN_CONSTRUCTOR \ -": builtin: " \ - ">in @ " /* save the tib index pointer */ \ - "' " /* get next word's xt */ \ - "swap >in ! " /* point again to next word */ \ - "create " /* create a new definition of the next word */ \ - ", " /* save previous definition's xt */ \ - "immediate " /* make the new definition an immediate word */ \ - \ - "does> " /* Now, the *new* definition will: */ \ - "state @ if " /* if in compiling state: */ \ - "1 postpone literal " /* pass 1 flag to indicate compile */ \ - "@ compile, " /* compile in previous definition */ \ - "postpone throw " /* throw stack-returned result */ \ - "else " /* if in interpreting state: */ \ - "0 swap " /* pass 0 flag to indicate interpret */ \ - "@ execute " /* call previous definition */ \ - "throw " /* throw stack-returned result */ \ - "then ; " +#define BUILTIN_CONSTRUCTOR \ + ": builtin: " \ + ">in @ " /* save the tib index pointer */ \ + "' " /* get next word's xt */ \ + "swap >in ! " /* point again to next word */ \ + "create " /* create a new definition of the next word */ \ + ", " /* save previous definition's xt */ \ + "immediate " /* make the new definition an immediate word */ \ + \ + "does> " /* Now, the *new* definition will: */ \ + "state @ if " /* if in compiling state: */ \ + "1 postpone literal " /* pass 1 flag to indicate compile */ \ + "@ compile, " /* compile in previous definition */ \ + "postpone throw " /* throw stack-returned result */ \ + "else " /* if in interpreting state: */ \ + "0 swap " /* pass 0 flag to indicate interpret */ \ + "@ execute " /* call previous definition */ \ + "throw " /* throw stack-returned result */ \ + "then ; " /* * Initialise the Forth interpreter, create all our commands as words. @@ -252,38 +252,38 @@ bf_command(FICL_VM *vm) void bf_init(void) { - struct bootblk_command **cmdp; - char create_buf[41]; /* 31 characters-long builtins */ - int fd; + struct bootblk_command **cmdp; + char create_buf[41]; /* 31 characters-long builtins */ + int fd; - bf_sys = ficlInitSystem(BF_DICTSIZE); - bf_vm = ficlNewVM(bf_sys); + bf_sys = ficlInitSystem(BF_DICTSIZE); + bf_vm = ficlNewVM(bf_sys); - /* Put all private definitions in a "builtins" vocabulary */ - ficlExec(bf_vm, "vocabulary builtins also builtins definitions"); + /* Put all private definitions in a "builtins" vocabulary */ + ficlExec(bf_vm, "vocabulary builtins also builtins definitions"); - /* Builtin constructor word */ - ficlExec(bf_vm, BUILTIN_CONSTRUCTOR); + /* Builtin constructor word */ + ficlExec(bf_vm, BUILTIN_CONSTRUCTOR); - /* make all commands appear as Forth words */ - SET_FOREACH(cmdp, Xcommand_set) { - ficlBuild(bf_sys, (char *)(*cmdp)->c_name, bf_command, FW_DEFAULT); - ficlExec(bf_vm, "forth definitions builtins"); - sprintf(create_buf, "builtin: %s", (*cmdp)->c_name); - ficlExec(bf_vm, create_buf); - ficlExec(bf_vm, "builtins definitions"); - } - ficlExec(bf_vm, "only forth definitions"); + /* make all commands appear as Forth words */ + SET_FOREACH(cmdp, Xcommand_set) { + ficlBuild(bf_sys, (char *)(*cmdp)->c_name, bf_command, FW_DEFAULT); + ficlExec(bf_vm, "forth definitions builtins"); + sprintf(create_buf, "builtin: %s", (*cmdp)->c_name); + ficlExec(bf_vm, create_buf); + ficlExec(bf_vm, "builtins definitions"); + } + ficlExec(bf_vm, "only forth definitions"); - /* Export some version numbers so that code can detect the loader/host version */ - ficlSetEnv(bf_sys, "FreeBSD_version", __FreeBSD_version); - ficlSetEnv(bf_sys, "loader_version", bootprog_rev); + /* Export some version numbers so that code can detect the loader/host version */ + ficlSetEnv(bf_sys, "FreeBSD_version", __FreeBSD_version); + ficlSetEnv(bf_sys, "loader_version", bootprog_rev); - /* try to load and run init file if present */ - if ((fd = open("/boot/boot.4th", O_RDONLY)) != -1) { - (void)ficlExecFD(bf_vm, fd); - close(fd); - } + /* try to load and run init file if present */ + if ((fd = open("/boot/boot.4th", O_RDONLY)) != -1) { + (void)ficlExecFD(bf_vm, fd); + close(fd); + } } /* @@ -292,45 +292,45 @@ bf_init(void) static int bf_run(const char *line) { - int result; + int result; - /* - * ficl would require extensive changes to accept a const char * - * interface. Instead, cast it away here and hope for the best. - * We know at the present time the caller for us in the boot - * forth loader can tolerate the string being modified because - * the string is passed in here and then not touched again. - */ - result = ficlExec(bf_vm, __DECONST(char *, line)); + /* + * ficl would require extensive changes to accept a const char * + * interface. Instead, cast it away here and hope for the best. + * We know at the present time the caller for us in the boot + * forth loader can tolerate the string being modified because + * the string is passed in here and then not touched again. + */ + result = ficlExec(bf_vm, __DECONST(char *, line)); - DEBUG("ficlExec '%s' = %d", line, result); - switch (result) { - case VM_OUTOFTEXT: - case VM_ABORTQ: - case VM_QUIT: - case VM_ERREXIT: - break; - case VM_USEREXIT: - printf("No where to leave to!\n"); - break; - case VM_ABORT: - printf("Aborted!\n"); - break; - case BF_PARSE: - printf("Parse error!\n"); - break; - default: - if (command_errmsg != NULL) { - printf("%s\n", command_errmsg); - command_errmsg = NULL; + DEBUG("ficlExec '%s' = %d", line, result); + switch (result) { + case VM_OUTOFTEXT: + case VM_ABORTQ: + case VM_QUIT: + case VM_ERREXIT: + break; + case VM_USEREXIT: + printf("No where to leave to!\n"); + break; + case VM_ABORT: + printf("Aborted!\n"); + break; + case BF_PARSE: + printf("Parse error!\n"); + break; + default: + if (command_errmsg != NULL) { + printf("%s\n", command_errmsg); + command_errmsg = NULL; + } } - } - if (result == VM_USEREXIT) - panic("interpreter exit"); - setenv("interpret", bf_vm->state ? "" : "OK", 1); + if (result == VM_USEREXIT) + panic("interpreter exit"); + setenv("interpret", bf_vm->state ? "" : "OK", 1); - return (result); + return (result); } void @@ -357,87 +357,86 @@ interp_run(const char *input) */ struct includeline { - struct includeline *next; - char text[0]; + struct includeline *next; + char text[0]; }; int interp_include(const char *filename) { - struct includeline *script, *se, *sp; - char input[256]; /* big enough? */ - int res; - char *cp; - int prevsrcid, fd, line; + struct includeline *script, *se, *sp; + char input[256]; /* big enough? */ + int res; + char *cp; + int prevsrcid, fd, line; - if (((fd = open(filename, O_RDONLY)) == -1)) { - snprintf(command_errbuf, sizeof(command_errbuf), - "can't open '%s': %s", filename, strerror(errno)); - return(CMD_ERROR); - } + if (((fd = open(filename, O_RDONLY)) == -1)) { + snprintf(command_errbuf, sizeof(command_errbuf), + "can't open '%s': %s", filename, strerror(errno)); + return(CMD_ERROR); + } - /* - * Read the script into memory. - */ - script = se = NULL; - line = 0; - - while (fgetstr(input, sizeof(input), fd) >= 0) { - line++; - cp = input; - /* Allocate script line structure and copy line, flags */ - if (*cp == '\0') - continue; /* ignore empty line, save memory */ - sp = malloc(sizeof(struct includeline) + strlen(cp) + 1); - /* On malloc failure (it happens!), free as much as possible and exit */ - if (sp == NULL) { - while (script != NULL) { - se = script; - script = script->next; - free(se); + /* + * Read the script into memory. + */ + script = se = NULL; + line = 0; + + while (fgetstr(input, sizeof(input), fd) >= 0) { + line++; + cp = input; + /* Allocate script line structure and copy line, flags */ + if (*cp == '\0') + continue; /* ignore empty line, save memory */ + sp = malloc(sizeof(struct includeline) + strlen(cp) + 1); + /* On malloc failure (it happens!), free as much as possible and exit */ + if (sp == NULL) { + while (script != NULL) { + se = script; + script = script->next; + free(se); + } + snprintf(command_errbuf, sizeof(command_errbuf), + "file '%s' line %d: memory allocation failure - aborting", + filename, line); + close(fd); + return (CMD_ERROR); } - snprintf(command_errbuf, sizeof(command_errbuf), - "file '%s' line %d: memory allocation failure - aborting", - filename, line); - close(fd); - return (CMD_ERROR); + strcpy(sp->text, cp); + sp->next = NULL; + + if (script == NULL) { + script = sp; + } else { + se->next = sp; + } + se = sp; } - strcpy(sp->text, cp); - sp->next = NULL; + close(fd); - if (script == NULL) { - script = sp; - } else { - se->next = sp; + /* + * Execute the script + */ + prevsrcid = bf_vm->sourceID.i; + bf_vm->sourceID.i = fd; + res = CMD_OK; + for (sp = script; sp != NULL; sp = sp->next) { + res = bf_run(sp->text); + if (res != VM_OUTOFTEXT) { + snprintf(command_errbuf, sizeof(command_errbuf), + "Error while including %s, in the line:\n%s", + filename, sp->text); + res = CMD_ERROR; + break; + } else + res = CMD_OK; } - se = sp; - } - close(fd); + bf_vm->sourceID.i = prevsrcid; - /* - * Execute the script - */ - prevsrcid = bf_vm->sourceID.i; - bf_vm->sourceID.i = fd; - res = CMD_OK; - for (sp = script; sp != NULL; sp = sp->next) { - - res = bf_run(sp->text); - if (res != VM_OUTOFTEXT) { - snprintf(command_errbuf, sizeof(command_errbuf), - "Error while including %s, in the line:\n%s", - filename, sp->text); - res = CMD_ERROR; - break; - } else - res = CMD_OK; - } - bf_vm->sourceID.i = prevsrcid; - - while (script != NULL) { - se = script; - script = script->next; - free(se); - } - return(res); + while (script != NULL) { + se = script; + script = script->next; + free(se); + } + return(res); } Modified: head/stand/common/interp_simple.c ============================================================================== --- head/stand/common/interp_simple.c Wed Feb 7 22:53:53 2018 (r328998) +++ head/stand/common/interp_simple.c Wed Feb 7 23:27:25 2018 (r328999) @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); static int perform(int argc, char *argv[]) { - int result; + int result; struct bootblk_command **cmdp; bootblk_cmd_t *cmd; @@ -78,8 +78,8 @@ interp_init(void) int interp_run(const char *input) { - int argc; - char **argv; + int argc; + char **argv; if (parse(&argc, &argv, input)) { printf("parse error\n"); From owner-svn-src-all@freebsd.org Wed Feb 7 23:27:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C9C7EE3BDC; Wed, 7 Feb 2018 23:27:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 20B4484B89; Wed, 7 Feb 2018 23:27:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B94E5CB1; Wed, 7 Feb 2018 23:27:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w17NRcPd096795; Wed, 7 Feb 2018 23:27:38 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17NRc5T096792; Wed, 7 Feb 2018 23:27:38 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802072327.w17NRc5T096792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 7 Feb 2018 23:27:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329000 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 329000 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 23:27:39 -0000 Author: imp Date: Wed Feb 7 23:27:38 2018 New Revision: 329000 URL: https://svnweb.freebsd.org/changeset/base/329000 Log: Move simple interpreter 'perform' into interp.c and call it interp_builtin_cmd(). Modified: head/stand/common/bootstrap.h head/stand/common/interp.c head/stand/common/interp_simple.c Modified: head/stand/common/bootstrap.h ============================================================================== --- head/stand/common/bootstrap.h Wed Feb 7 23:27:25 2018 (r328999) +++ head/stand/common/bootstrap.h Wed Feb 7 23:27:38 2018 (r329000) @@ -47,6 +47,8 @@ extern char command_errbuf[COMMAND_ERRBUFSZ]; /* interp.c */ void interact(void); void interp_emit_prompt(void); +int interp_builtin_cmd(int argc, char *argv[]); + /* Called by interp.c for interp_*.c embedded interpreters */ int interp_include(const char *filename); /* Execute commands from filename */ void interp_init(void); /* Initialize interpreater */ Modified: head/stand/common/interp.c ============================================================================== --- head/stand/common/interp.c Wed Feb 7 23:27:25 2018 (r328999) +++ head/stand/common/interp.c Wed Feb 7 23:27:38 2018 (r329000) @@ -139,3 +139,35 @@ interp_emit_prompt(void) putchar(' '); free(pr); } + +/* + * Perform a builtin command + */ +int +interp_builtin_cmd(int argc, char *argv[]) +{ + int result; + struct bootblk_command **cmdp; + bootblk_cmd_t *cmd; + + if (argc < 1) + return(CMD_OK); + + /* set return defaults; a successful command will override these */ + command_errmsg = command_errbuf; + strcpy(command_errbuf, "no error message"); + cmd = NULL; + result = CMD_ERROR; + + /* search the command set for the command */ + SET_FOREACH(cmdp, Xcommand_set) { + if (((*cmdp)->c_name != NULL) && !strcmp(argv[0], (*cmdp)->c_name)) + cmd = (*cmdp)->c_fn; + } + if (cmd != NULL) { + result = (cmd)(argc, argv); + } else { + command_errmsg = "unknown command"; + } + return(result); +} Modified: head/stand/common/interp_simple.c ============================================================================== --- head/stand/common/interp_simple.c Wed Feb 7 23:27:25 2018 (r328999) +++ head/stand/common/interp_simple.c Wed Feb 7 23:27:38 2018 (r329000) @@ -35,38 +35,6 @@ __FBSDID("$FreeBSD$"); #include #include "bootstrap.h" -/* - * Perform the command - */ -static int -perform(int argc, char *argv[]) -{ - int result; - struct bootblk_command **cmdp; - bootblk_cmd_t *cmd; - - if (argc < 1) - return(CMD_OK); - - /* set return defaults; a successful command will override these */ - command_errmsg = command_errbuf; - strcpy(command_errbuf, "no error message"); - cmd = NULL; - result = CMD_ERROR; - - /* search the command set for the command */ - SET_FOREACH(cmdp, Xcommand_set) { - if (((*cmdp)->c_name != NULL) && !strcmp(argv[0], (*cmdp)->c_name)) - cmd = (*cmdp)->c_fn; - } - if (cmd != NULL) { - result = (cmd)(argc, argv); - } else { - command_errmsg = "unknown command"; - } - return(result); -} - void interp_init(void) { @@ -86,7 +54,7 @@ interp_run(const char *input) return CMD_ERROR; } - if (perform(argc, argv)) { + if (interp_builtin_cmd(argc, argv)) { printf("%s: %s\n", argv[0], command_errmsg); free(argv); return CMD_ERROR; @@ -195,7 +163,7 @@ interp_include(const char *filename) /* Parse the command */ if (!parse(&argc, &argv, sp->text)) { - if ((argc > 0) && (perform(argc, argv) != 0)) { + if ((argc > 0) && (interp_builtin_cmd(argc, argv) != 0)) { /* normal command */ printf("%s: %s\n", argv[0], command_errmsg); if (!(sp->flags & SL_IGNOREERR)) { From owner-svn-src-all@freebsd.org Wed Feb 7 23:45:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D6B7EE4EDC; Wed, 7 Feb 2018 23:45:14 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B3F6B8598C; Wed, 7 Feb 2018 23:45:13 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A723E5FE3; Wed, 7 Feb 2018 23:45:13 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w17NjDrU006584; Wed, 7 Feb 2018 23:45:13 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17NjDmD006583; Wed, 7 Feb 2018 23:45:13 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201802072345.w17NjDmD006583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 7 Feb 2018 23:45:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329001 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 329001 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 23:45:14 -0000 Author: brooks Date: Wed Feb 7 23:45:13 2018 New Revision: 329001 URL: https://svnweb.freebsd.org/changeset/base/329001 Log: Remove part of a comment reverting to nonexistant struct members. Modified: head/sys/sys/msg.h Modified: head/sys/sys/msg.h ============================================================================== --- head/sys/sys/msg.h Wed Feb 7 23:27:38 2018 (r329000) +++ head/sys/sys/msg.h Wed Feb 7 23:45:13 2018 (r329001) @@ -81,7 +81,7 @@ struct msqid_ds_old { /* * XXX there seems to be no prefix reserved for this header, so the name * "msg" in "struct msg" and the names of all of the nonstandard members - * (mainly "msg_pad*) are namespace pollution. + * are namespace pollution. */ struct msqid_ds { From owner-svn-src-all@freebsd.org Wed Feb 7 23:58:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76B18EE5E83; Wed, 7 Feb 2018 23:58:01 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A09A860F2; Wed, 7 Feb 2018 23:58:01 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A8116172; Wed, 7 Feb 2018 23:58:01 +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 w17Nw0UB011854; Wed, 7 Feb 2018 23:58:00 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17Nw0e1011853; Wed, 7 Feb 2018 23:58:00 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201802072358.w17Nw0e1011853@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 7 Feb 2018 23:58:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329002 - head/usr.bin/clang/lld X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/clang/lld X-SVN-Commit-Revision: 329002 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 07 Feb 2018 23:58:01 -0000 Author: emaste Date: Wed Feb 7 23:58:00 2018 New Revision: 329002 URL: https://svnweb.freebsd.org/changeset/base/329002 Log: Update ld.lld.1 based on the version committed upstream Modified: head/usr.bin/clang/lld/ld.lld.1 Modified: head/usr.bin/clang/lld/ld.lld.1 ============================================================================== --- head/usr.bin/clang/lld/ld.lld.1 Wed Feb 7 23:45:13 2018 (r329001) +++ head/usr.bin/clang/lld/ld.lld.1 Wed Feb 7 23:58:00 2018 (r329002) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 10, 2018 +.Dd February 7, 2018 .Dt LD.LLD 1 .Os .Sh NAME @@ -50,7 +50,8 @@ as GNU linkers. These options are available: .Bl -tag -width indent .It Fl -allow-multiple-definition -Allow multiple definitions. +Do not error if a symbol is defined multiple times. +The first definition will be used. .It Fl -as-needed Only set .Dv DT_NEEDED @@ -69,18 +70,56 @@ Bind defined function symbols locally. Bind defined symbols locally. .It Fl -build-id= Ns Ar value Generate a build ID note. +.Ar value +may be one of +.Cm md5 , +.Cm sha1 , +.Cm tree , +.Cm uuid , +.Cm 0x Ns Ar hex-string , +and +.Cm none . +.Cm tree +is an alias for +.Cm sha1 . +Build-IDs of type +.Cm md5 , +.Cm sha1 , +and +.Cm tree +are calculated from the object contents. .It Fl -build-id Generate a build ID note. .It Fl -color-diagnostics= Ns Ar value Use colors in diagnostics. +.Ar value +may be one of +.Cm always , +.Cm auto , +and +.Cm never . +.Cm auto +enables color if and only if output is to a terminal. .It Fl -color-diagnostics -Use colors in diagnostics. +Alias for +.Fl -color-diagnostics= Ns Cm auto . .It Fl -compress-debug-sections= Ns Ar value Compress DWARF debug sections. +.Ar value +may be +.Cm none +or +.Cm zlib . .It Fl -define-common Assign space to common symbols. -.It Fl -defsym= Ns Ar value +.It Fl -defsym= Ns Ar symbol= Ns Ar expression Define a symbol alias. +.Ar expression +may be another symbol or a linker script expression. +For example, +.Fl -defsym= Ns Cm foo= Ns Cm bar +or +.Fl -defsym= Ns Cm foo= Ns Cm bar+0x100 . .It Fl -demangle Demangle symbol names. .It Fl -disable-new-dtags @@ -95,8 +134,9 @@ Keep all symbols in the symbol table. Specify the dynamic linker to be used for a dynamically linked executable. This is recorded in an ELF segment of type .Dv PT_INTERP . -.It Fl -dynamic-list Ar value -Read a list of dynamic symbols. +.It Fl -dynamic-list Ar file +Read a list of dynamic symbols from +.Ar file . .It Fl -eh-frame-hdr Request creation of .Li .eh_frame_hdr @@ -119,8 +159,10 @@ A value of zero indicates that there is no limit. Report unresolved symbols as errors. .It Fl -exclude-libs Ar value Exclude static libraries from automatic export. -.It Fl -export-dynamic-symbol Ar value -Put a symbol in the dynamic symbol table. +.It Fl -export-dynamic-symbol Ar symbol +Include +.Ar symbol +in the dynamic symbol table. .It Fl -export-dynamic Put symbols in the dynamic symbol table. .It Fl -fatal-warnings @@ -132,10 +174,16 @@ field to the specified value. .It Fl -fini Ar symbol Specify a finalizer function. .It Fl -format= Ns Ar input-format -Change the input format of the inputs following this option. -.It Fl -full-shutdown -Perform a full shutdown instead of calling -.Fn _exit . +Specify the format of the inputs following this option. +.Ar input-format +may be one of +.Cm binary , +.Cm elf , +and +.Cm default . +.Cm default +is a synonym for +.Cm elf . .It Fl -gc-sections Enable garbage collection of unused sections. .It Fl -gdb-index @@ -143,7 +191,15 @@ Generate .Li .gdb_index section. .It Fl -hash-style Ar value -Specify hash style (sysv, gnu or both). +Specify hash style. +.Ar value +may be +.Cm sysv , +.Cm gnu , +or +.Cm both . +.Cm both +is the default. .It Fl -help Print a usage message. .It Fl -icf=all @@ -169,8 +225,9 @@ Number of LTO codegen partitions. Add a directory to the library search path. .It Fl l Ar libName Root name of library to use. -.It Fl -Map Ar value -Print a link map to the specified file. +.It Fl -Map Ar file +Print a link map to +.Ar file . .It Fl m Ar value Set target emulation. .It Fl -no-as-needed @@ -203,20 +260,38 @@ Report unresolved symbols even if the linker is creati Restores the default behavior of loading archive members. .It Fl -noinhibit-exec Retain the executable output file whenever it is still usable. -.It Fl -nopie +.It Fl -no-pie Do not create a position independent executable. .It Fl -nostdlib Only search directories specified on the command line. .It Fl -oformat Ar format -Specify the binary format for the output object file. +Specify the format for the output object file. +The only supported +.Ar format +is +.Cm binary , +which produces output with no ELF header. .It Fl -omagic Set the text and data sections to be readable and writable. -.It Fl -opt-remarks-filename Ar value -YAML output file for optimization remarks. +.It Fl -opt-remarks-filename Ar file +Write optimization remarks in YAML format to +.Ar file . .It Fl -opt-remarks-with-hotness Include hotness information in the optimization remarks file. .It Fl O Ar value Optimize output file size. +.Ar value +may be: +.Bl -tag -width indent +.It Cm O0 +Disable string merging. +.It Cm O1 +Enable string merging. +.It Cm O2 +Enable string tail merging. +.El +.Cm O1 +is the default. .It Fl o Ar path Write the output executable, library, or object to .Ar path . @@ -245,9 +320,9 @@ The supported values are .Ar windows and .Ar posix . -.It Fl -script Ar value -Read linker script from the path -.Ar value . +.It Fl -script Ar file +Read linker script from +.Ar file . .It Fl -section-start Ar address Set address of section. .It Fl -shared @@ -266,8 +341,9 @@ in an archive. Strip all symbols. .It Fl -strip-debug Strip debugging information. -.It Fl -symbol-ordering-file Ar value -Lay out sections in the order specified by the symbol file. +.It Fl -symbol-ordering-file Ar file +Lay out sections in the order specified by +.Ar file . .It Fl -sysroot= Ns Ar value Set the system root. .It Fl -target1-abs @@ -312,8 +388,10 @@ Pruning policy for the ThinLTO cache. Number of ThinLTO jobs. .It Fl -threads Run the linker multi-threaded. -.It Fl -trace-symbol Ar value -Trace references to symbols. +This option is enabled by default. +.It Fl -trace-symbol Ar symbol +Trace references to +.Ar symbol . .It Fl -trace Print the names of the input files. .It Fl -Ttext Ar value @@ -322,14 +400,17 @@ Same as with .Li .text as the sectionname. -.It Fl -undefined Ar value -Force undefined symbol during linking. +.It Fl -undefined Ar symbol +Force +.Ar symbol +to be an undefined symbol during linking. .It Fl -unresolved-symbols= Ns Ar value Determine how to handle unresolved symbols. .It Fl -verbose Verbose mode. -.It Fl -version-script Ar value -Read a version script. +.It Fl -version-script Ar file +Read version script from +.Ar file . .It Fl V , Fl -version Display the version number and exit. .It Fl v @@ -346,19 +427,75 @@ Use wrapper functions for symbol. .It Fl z Ar option Linker option extensions. .Bl -tag -width indent +.It Cm execstack +Make the main stack executable. +Stack permissions are recorded in the +.Dv PT_GNU_STACK +segment. +.It Cm muldefs +Do not error if a symbol is defined multiple times. +The first definition will be used. +This is a synonym for +.Fl -allow-multiple-definition. +.It Cm nocombreloc +Disable combining and sorting multiple relocation sections. +.It Cm nocopyreloc +Disable the creation of copy relocations. +.It Cm nodelete +Set the +.Dv DF_1_NODELETE +flag to indicate that the object cannot be unloaded from a process. +.It Cm nodlopen +Set the +.Dv DF_1_NOOPEN +flag to indcate that the object may not be opened by +.Xr dlopen 3 . +.It Cm norelro +Do not indicate that portions of the object shold be mapped read-only +after initial relocation processing. +The object will omit the +.Dv PT_GNU_RELRO +segment. .It Cm notext Allow relocations against read-only segments. Sets the .Dv DT_TEXTREL flag in the .Dv DYNAMIC section. +.It Cm now +Set the +.Dv DF_BIND_NOW +flag to indicate that the run-time loader should perform all relocation +processing as part of object initialization. +By default relocations may be performed on demand. +.It Cm origin +Set the +.Dv DF_ORIGIN +flag to indicate that the object requires +$ORIGIN +processing. +.It Cm retpolineplt +Emit retpoline format PLT entries as a mitigation for CVE-2017-5715. +.It Cm rodynamic +Make the +.Li .dynamic +section read-only. +The +.Dv DT_DEBUG +tag will not be emitted. +.It Cm stack-size= Ns Ar size +Set the main thread's stack size to +.Ar size . +The stack size is recorded as the size of the +.Ar size . +.Dv PT_GNU_STACK +program segment. .It Cm text Do not allow relocations against read-only segments. This is the default. +.It Cm wxneeded +Create a +.Dv PT_OPENBSD_WXNEEDED +segment. .El .El -.Sh IMPLEMENTATION NOTES -The targets supported by -.Nm -are: -elf32-i386 elf32-iamcu elf32-littlearm elf32-ntradbigmips elf32-ntradlittlemips elf32-powerpc elf32-tradbigmips elf32-tradlittlemips elf32-x86-64 elf64-amdgpu elf64-littleaarch64 elf64-powerpc elf64-tradbigmips elf64-tradlittlemips elf64-x86-64 From owner-svn-src-all@freebsd.org Thu Feb 8 00:09:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63AECEE6BC0; Thu, 8 Feb 2018 00:09:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 11D4786771; Thu, 8 Feb 2018 00:09:18 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 024E6631D; Thu, 8 Feb 2018 00:09:18 +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 w1809HcO016638; Thu, 8 Feb 2018 00:09:17 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1809Hjb016637; Thu, 8 Feb 2018 00:09:17 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201802080009.w1809Hjb016637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 8 Feb 2018 00:09:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329003 - head/usr.bin/clang/lld X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/clang/lld X-SVN-Commit-Revision: 329003 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Feb 2018 00:09:18 -0000 Author: emaste Date: Thu Feb 8 00:09:17 2018 New Revision: 329003 URL: https://svnweb.freebsd.org/changeset/base/329003 Log: ld.lld.1: explain long options may use one or two dashes Modified: head/usr.bin/clang/lld/ld.lld.1 Modified: head/usr.bin/clang/lld/ld.lld.1 ============================================================================== --- head/usr.bin/clang/lld/ld.lld.1 Wed Feb 7 23:58:00 2018 (r329002) +++ head/usr.bin/clang/lld/ld.lld.1 Thu Feb 8 00:09:17 2018 (r329003) @@ -47,6 +47,17 @@ is a drop-in replacement for the GNU BFD and gold link It accepts most of the same command line arguments and linker scripts as GNU linkers. .Pp +Many options have both a single-letter and long form. +When using the long form options other than those beginning with the +letter +.Cm o +may be specified using either one or two dashes preceeding the option name. +Long options beginning with +.Cm o +require two dashes to avoid confusion with the +.Fl o Ar path +option. +.Pp These options are available: .Bl -tag -width indent .It Fl -allow-multiple-definition From owner-svn-src-all@freebsd.org Thu Feb 8 00:14:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97D0FEE71CE; Thu, 8 Feb 2018 00:14:21 +0000 (UTC) (envelope-from jeb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46A3686C7C; Thu, 8 Feb 2018 00:14:21 +0000 (UTC) (envelope-from jeb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D23E64AC; Thu, 8 Feb 2018 00:14:21 +0000 (UTC) (envelope-from jeb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w180ELpv021336; Thu, 8 Feb 2018 00:14:21 GMT (envelope-from jeb@FreeBSD.org) Received: (from jeb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w180ELRH021335; Thu, 8 Feb 2018 00:14:21 GMT (envelope-from jeb@FreeBSD.org) Message-Id: <201802080014.w180ELRH021335@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeb set sender to jeb@FreeBSD.org using -f From: Jeb Cramer Date: Thu, 8 Feb 2018 00:14:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329004 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: jeb X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 329004 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Feb 2018 00:14:21 -0000 Author: jeb Date: Thu Feb 8 00:14:20 2018 New Revision: 329004 URL: https://svnweb.freebsd.org/changeset/base/329004 Log: Add myself to committers-src.dot Reviewed by: erj (mentor) Approved by: erj (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Thu Feb 8 00:09:17 2018 (r329003) +++ head/share/misc/committers-src.dot Thu Feb 8 00:14:20 2018 (r329004) @@ -197,6 +197,7 @@ jasone [label="Jason Evans\njasone@FreeBSD.org\n1999/0 jceel [label="Jakub Klama\njceel@FreeBSD.org\n2011/09/25"] jch [label="Julien Charbon\njch@FreeBSD.org\n2014/09/24"] jchandra [label="Jayachandran C.\njchandra@FreeBSD.org\n2010/05/19"] +jeb [label="Jeb Cramer\njeb@FreeBSD.org\n2018/01/25"] jeff [label="Jeff Roberson\njeff@FreeBSD.org\n2002/02/21"] jh [label="Jaakko Heinonen\njh@FreeBSD.org\n2009/10/02"] jhb [label="John Baldwin\njhb@FreeBSD.org\n1999/08/23"] @@ -485,6 +486,8 @@ emaste -> rstone emax -> markus +erj -> jeb + fjoe -> versus gallatin -> ticso @@ -773,6 +776,7 @@ sam -> benjsc sam -> sephe sbruno -> hiren +sbruno -> jeb sbruno -> jimharris sbruno -> shurd From owner-svn-src-all@freebsd.org Thu Feb 8 00:40:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F284EE8D01; Thu, 8 Feb 2018 00:40:57 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C854E87894; Thu, 8 Feb 2018 00:40:56 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C34EB67FC; Thu, 8 Feb 2018 00:40:56 +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 w180euH8031639; Thu, 8 Feb 2018 00:40:56 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w180eu5x031638; Thu, 8 Feb 2018 00:40:56 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201802080040.w180eu5x031638@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 8 Feb 2018 00:40:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329005 - stable/11/share/vt/keymaps X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/share/vt/keymaps X-SVN-Commit-Revision: 329005 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Feb 2018 00:40:57 -0000 Author: emaste Date: Thu Feb 8 00:40:56 2018 New Revision: 329005 URL: https://svnweb.freebsd.org/changeset/base/329005 Log: MFC r328412: vt: add Ctrl+/ key mapping This matches Xorg's handling of Ctrl+/ and may be useful as a tmux escape. PR: 212197 Submitted by: martin at sugioarto.com Relnotes: Yes Modified: stable/11/share/vt/keymaps/us.kbd Directory Properties: stable/11/ (props changed) Modified: stable/11/share/vt/keymaps/us.kbd ============================================================================== --- stable/11/share/vt/keymaps/us.kbd Thu Feb 8 00:14:20 2018 (r329004) +++ stable/11/share/vt/keymaps/us.kbd Thu Feb 8 00:40:56 2018 (r329005) @@ -56,7 +56,7 @@ 050 'm' 'M' cr cr 'm' 'M' cr cr C 051 ',' '<' nop nop ',' '<' nop nop O 052 '.' '>' nop nop '.' '>' nop nop O - 053 '/' '?' nop nop '/' '?' nop nop O + 053 '/' '?' 0x1f nop '/' '?' nop nop O 054 rshift rshift rshift rshift rshift rshift rshift rshift O 055 '*' '*' '*' '*' '*' '*' '*' '*' O 056 lalt lalt lalt lalt lalt lalt lalt lalt O From owner-svn-src-all@freebsd.org Thu Feb 8 00:42:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BCFEEE8F63; Thu, 8 Feb 2018 00:42:03 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 052A987BF6; Thu, 8 Feb 2018 00:42:03 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 00292694F; Thu, 8 Feb 2018 00:42:03 +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 w180g2QY035386; Thu, 8 Feb 2018 00:42:02 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w180g2F4035385; Thu, 8 Feb 2018 00:42:02 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201802080042.w180g2F4035385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 8 Feb 2018 00:42: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: r329006 - stable/10/share/vt/keymaps X-SVN-Group: stable-10 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/10/share/vt/keymaps X-SVN-Commit-Revision: 329006 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Feb 2018 00:42:03 -0000 Author: emaste Date: Thu Feb 8 00:42:02 2018 New Revision: 329006 URL: https://svnweb.freebsd.org/changeset/base/329006 Log: MFC r328412: vt: add Ctrl+/ key mapping This matches Xorg's handling of Ctrl+/ and may be useful as a tmux escape. PR: 212197 Submitted by: martin at sugioarto.com Modified: stable/10/share/vt/keymaps/us.kbd Directory Properties: stable/10/ (props changed) Modified: stable/10/share/vt/keymaps/us.kbd ============================================================================== --- stable/10/share/vt/keymaps/us.kbd Thu Feb 8 00:40:56 2018 (r329005) +++ stable/10/share/vt/keymaps/us.kbd Thu Feb 8 00:42:02 2018 (r329006) @@ -56,7 +56,7 @@ 050 'm' 'M' cr cr 'm' 'M' cr cr C 051 ',' '<' nop nop ',' '<' nop nop O 052 '.' '>' nop nop '.' '>' nop nop O - 053 '/' '?' nop nop '/' '?' nop nop O + 053 '/' '?' 0x1f nop '/' '?' nop nop O 054 rshift rshift rshift rshift rshift rshift rshift rshift O 055 '*' '*' '*' '*' '*' '*' '*' '*' O 056 lalt lalt lalt lalt lalt lalt lalt lalt O From owner-svn-src-all@freebsd.org Thu Feb 8 00:42:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 392A5EE9039; Thu, 8 Feb 2018 00:42:29 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E03D787D99; Thu, 8 Feb 2018 00:42:28 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C17F06976; Thu, 8 Feb 2018 00:42:28 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w180gS29036151; Thu, 8 Feb 2018 00:42:28 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w180gSTk036148; Thu, 8 Feb 2018 00:42:28 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201802080042.w180gSTk036148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 8 Feb 2018 00:42:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329007 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 329007 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Feb 2018 00:42:29 -0000 Author: brooks Date: Thu Feb 8 00:42:28 2018 New Revision: 329007 URL: https://svnweb.freebsd.org/changeset/base/329007 Log: style(9): use a type for each member in struct defintions. Shorten a comment to fit in 80 columns. Modified: head/sys/sys/msg.h head/sys/sys/sem.h Modified: head/sys/sys/msg.h ============================================================================== --- head/sys/sys/msg.h Thu Feb 8 00:42:02 2018 (r329006) +++ head/sys/sys/msg.h Thu Feb 8 00:42:28 2018 (r329007) @@ -138,12 +138,12 @@ struct msg { * two between 8 and 1024 inclusive (and panic's if it isn't). */ struct msginfo { - int msgmax, /* max chars in a message */ - msgmni, /* max message queue identifiers */ - msgmnb, /* max chars in a queue */ - msgtql, /* max messages in system */ - msgssz, /* size of a message segment (see notes above) */ - msgseg; /* number of message segments */ + int msgmax; /* max chars in a message */ + int msgmni; /* max message queue identifiers */ + int msgmnb; /* max chars in a queue */ + int msgtql; /* max messages in system */ + int msgssz; /* size of a message segment (see note) */ + int msgseg; /* number of message segments */ }; extern struct msginfo msginfo; Modified: head/sys/sys/sem.h ============================================================================== --- head/sys/sys/sem.h Thu Feb 8 00:42:02 2018 (r329006) +++ head/sys/sys/sem.h Thu Feb 8 00:42:28 2018 (r329007) @@ -107,15 +107,15 @@ union semun { * semaphore info struct */ struct seminfo { - int semmni, /* # of semaphore identifiers */ - semmns, /* # of semaphores in system */ - semmnu, /* # of undo structures in system */ - semmsl, /* max # of semaphores per id */ - semopm, /* max # of operations per semop call */ - semume, /* max # of undo entries per process */ - semusz, /* size in bytes of undo structure */ - semvmx, /* semaphore maximum value */ - semaem; /* adjust on exit max value */ + int semmni; /* # of semaphore identifiers */ + int semmns; /* # of semaphores in system */ + int semmnu; /* # of undo structures in system */ + int semmsl; /* max # of semaphores per id */ + int semopm; /* max # of operations per semop call */ + int semume; /* max # of undo entries per process */ + int semusz; /* size in bytes of undo structure */ + int semvmx; /* semaphore maximum value */ + int semaem; /* adjust on exit max value */ }; extern struct seminfo seminfo; From owner-svn-src-all@freebsd.org Thu Feb 8 00:59:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3399EEA2E5; Thu, 8 Feb 2018 00:59:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CAB6468874; Thu, 8 Feb 2018 00:59:58 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D9D26B0E; Thu, 8 Feb 2018 00:59:57 +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 w180xu4o042782; Thu, 8 Feb 2018 00:59:56 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w180xuLN042781; Thu, 8 Feb 2018 00:59:56 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201802080059.w180xuLN042781@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 8 Feb 2018 00:59:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329008 - stable/11/tests/sys/opencrypto X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/11/tests/sys/opencrypto X-SVN-Commit-Revision: 329008 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Feb 2018 01:00:00 -0000 Author: jhb Date: Thu Feb 8 00:59:56 2018 New Revision: 329008 URL: https://svnweb.freebsd.org/changeset/base/329008 Log: MFC 319454: Honor the requested crid when running a test. Otherwise, the kernel is free to choose an aribtrary crypto device rather than the requested device subverting tests that force the use of a specific device. Modified: stable/11/tests/sys/opencrypto/cryptodev.py Directory Properties: stable/11/ (props changed) Modified: stable/11/tests/sys/opencrypto/cryptodev.py ============================================================================== --- stable/11/tests/sys/opencrypto/cryptodev.py Thu Feb 8 00:42:28 2018 (r329007) +++ stable/11/tests/sys/opencrypto/cryptodev.py Thu Feb 8 00:59:56 2018 (r329008) @@ -173,10 +173,7 @@ class Crypto: if not cipher and not mac: raise ValueError('one of cipher or mac MUST be specified.') - ses.crid = CRYPTOCAP_F_SOFTWARE | CRYPTOCAP_F_HARDWARE - #ses.crid = CRYPTOCAP_F_HARDWARE - #ses.crid = CRYPTOCAP_F_SOFTWARE - #ses.crid = 0 + ses.crid = crid #print `ses` s = array.array('B', ses.pack_hdr()) #print `s` From owner-svn-src-all@freebsd.org Thu Feb 8 01:34:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4EB40EEC9F4; Thu, 8 Feb 2018 01:34:36 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F42326A2BC; Thu, 8 Feb 2018 01:34:35 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EEB82726E; Thu, 8 Feb 2018 01:34:35 +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 w181YZ8R062345; Thu, 8 Feb 2018 01:34:35 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w181YZ2O062344; Thu, 8 Feb 2018 01:34:35 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802080134.w181YZ2O062344@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 8 Feb 2018 01:34:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329009 - head/usr.sbin/mountd X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/usr.sbin/mountd X-SVN-Commit-Revision: 329009 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Feb 2018 01:34:36 -0000 Author: cem Date: Thu Feb 8 01:34:35 2018 New Revision: 329009 URL: https://svnweb.freebsd.org/changeset/base/329009 Log: mountd(8): Produce vaguely meaningful error messages Sponsored by: Dell EMC Isilon Modified: head/usr.sbin/mountd/mountd.c Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Thu Feb 8 00:59:56 2018 (r329008) +++ head/usr.sbin/mountd/mountd.c Thu Feb 8 01:34:35 2018 (r329009) @@ -201,7 +201,7 @@ static struct hostlist *get_ht(void); static int get_line(void); static void get_mountlist(void); static int get_net(char *, struct netmsk *, int); -static void getexp_err(struct exportlist *, struct grouplist *); +static void getexp_err(struct exportlist *, struct grouplist *, const char *); static struct grouplist *get_grp(void); static void hang_dirp(struct dirlist *, struct grouplist *, struct exportlist *, int); @@ -1450,12 +1450,13 @@ get_exportlist_one(void) tgrp = grp = get_grp(); while (len > 0) { if (len > MNTNAMLEN) { - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, "mountpoint too long"); goto nextline; } if (*cp == '-') { if (ep == (struct exportlist *)NULL) { - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, + "flag before export path definition"); goto nextline; } if (debug) @@ -1463,7 +1464,7 @@ get_exportlist_one(void) got_nondir = 1; if (do_opt(&cp, &endcp, ep, grp, &has_host, &exflags, &anon)) { - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, NULL); goto nextline; } } else if (*cp == '/') { @@ -1471,8 +1472,7 @@ get_exportlist_one(void) *endcp = '\0'; if (v4root_phase > 1) { if (dirp != NULL) { - syslog(LOG_ERR, "Multiple V4 dirs"); - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, "Multiple V4 dirs"); goto nextline; } } @@ -1482,14 +1482,12 @@ get_exportlist_one(void) syslog(LOG_ERR, "Warning: exporting of " "automounted fs %s not supported", cp); if (got_nondir) { - syslog(LOG_ERR, "dirs must be first"); - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, "dirs must be first"); goto nextline; } if (v4root_phase == 1) { if (dirp != NULL) { - syslog(LOG_ERR, "Multiple V4 dirs"); - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, "Multiple V4 dirs"); goto nextline; } if (strlen(v4root_dirpath) == 0) { @@ -1499,7 +1497,7 @@ get_exportlist_one(void) != 0) { syslog(LOG_ERR, "different V4 dirpath %s", cp); - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, NULL); goto nextline; } dirp = cp; @@ -1512,7 +1510,8 @@ get_exportlist_one(void) fsb.f_fsid.val[0] || ep->ex_fs.val[1] != fsb.f_fsid.val[1]) { - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, + "fsid mismatch"); goto nextline; } } else { @@ -1545,7 +1544,8 @@ get_exportlist_one(void) dirplen = len; } } else { - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, + "symbolic link in export path or statfs failed"); goto nextline; } *endcp = savedc; @@ -1554,7 +1554,8 @@ get_exportlist_one(void) *endcp = '\0'; got_nondir = 1; if (ep == (struct exportlist *)NULL) { - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, + "host(s) before export path definition"); goto nextline; } @@ -1592,7 +1593,7 @@ get_exportlist_one(void) len = endcp - cp; } if (check_options(dirhead)) { - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, NULL); goto nextline; } if (!has_host) { @@ -1605,8 +1606,7 @@ get_exportlist_one(void) * host(s) on the same line. */ } else if ((opt_flags & OP_NET) && tgrp->gr_next) { - syslog(LOG_ERR, "network/host conflict"); - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, "network/host conflict"); goto nextline; /* @@ -1618,14 +1618,13 @@ get_exportlist_one(void) while (grp && grp->gr_type == GT_IGNORE) grp = grp->gr_next; if (! grp) { - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, "no valid entries"); goto nextline; } } if (v4root_phase == 1) { - syslog(LOG_ERR, "V4:root, no dirp, ignored"); - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, "V4:root, no dirp, ignored"); goto nextline; } @@ -1638,7 +1637,7 @@ get_exportlist_one(void) do { if (do_mount(ep, grp, exflags, &anon, dirp, dirplen, &fsb)) { - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, NULL); goto nextline; } } while (grp->gr_next && (grp = grp->gr_next)); @@ -1880,12 +1879,17 @@ get_grp(void) * Clean up upon an error in get_exportlist(). */ static void -getexp_err(struct exportlist *ep, struct grouplist *grp) +getexp_err(struct exportlist *ep, struct grouplist *grp, const char *reason) { struct grouplist *tgrp; - if (!(opt_flags & OP_QUIET)) - syslog(LOG_ERR, "bad exports list line %s", line); + if (!(opt_flags & OP_QUIET)) { + if (reason != NULL) + syslog(LOG_ERR, "bad exports list line '%s': %s", line, + reason); + else + syslog(LOG_ERR, "bad exports list line '%s'", line); + } if (ep && (ep->ex_flag & EX_LINKED) == 0) free_exp(ep); while (grp) { From owner-svn-src-all@freebsd.org Thu Feb 8 02:50:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 864ECEF2453; Thu, 8 Feb 2018 02:50:50 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 337F86DCC2; Thu, 8 Feb 2018 02:50:50 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E4C77F86; Thu, 8 Feb 2018 02:50:50 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w182ooZ8097906; Thu, 8 Feb 2018 02:50:50 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w182olh7097879; Thu, 8 Feb 2018 02:50:47 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802080250.w182olh7097879@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 8 Feb 2018 02:50:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329011 - in stable/11: sys/boot sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/efi/loader/arch/amd64 sys/boot/efi/loader/arch/arm sys/boot/efi/loader/arch/arm64 sys/b... X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11: sys/boot sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/efi/loader/arch/amd64 sys/boot/efi/loader/arch/arm sys/boot/efi/loader/arch/arm64 sys/boot/efi/loader/arch/i386 ... X-SVN-Commit-Revision: 329011 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Feb 2018 02:50:51 -0000 Author: kevans Date: Thu Feb 8 02:50:47 2018 New Revision: 329011 URL: https://svnweb.freebsd.org/changeset/base/329011 Log: MFC r307322,r307323,r307324,r307326,r307327,r307338,r307879,r307908,r307911, r307942,r307950,r307951,r307954,r307955,r308125,r308195,r308476,r308534, r308535,r308776,r308843,r310236,r310726: Loader fixes, 2016q4 r307322: Remove /boot/boot.conf, deprecated for 16 years r307323: Remove fetching of pInterp. r307324: Create a new linker set, Xficl_compile_set which contains a list of functions to call to register new forth words. r307326: In UEFI mode expose the SMBIOS anchor base address via kenv r307327: Update i386 build of loader.efi (but leave it disabled) so that we at least build it now. r307338: Create a pcibios-version environment FORTH word. r307879: Preliminary support for EFI in boot loader. r307908: Fix the build on both arm64 and when WITHOUT_FORTH is defined. r307911: Add better comment... r307942: Really make WITHOUT_FORTH (MK_FORTH==no) work. r307950: Add it (Makefile.ficl) to the right place r307951: Fix two backwards tests. r307954: Back out the move to the loader script from -N. r307955: LIBSTAND goes last, so put it last here too. r308125: In loader.efi, instead of exiting directly, try to fallback. r308195: efinet_dev_print should honor verbose option. r308476: boot/forth spelling issue in forth word r308534: The file_loadraw function grew an argument, update install function r308535: Add support for LOADER_RC setting in the pkgfs manifes r308776: loader: zfs toplevel vdev must have spa set. r308843: loader: smbios version check is not correct r310236: Renumber license clauses to avoid skipping #3 r310726: cdboot: add explict suffix to ambiguous or instruction PR: 214375 Added: stable/11/sys/boot/Makefile.ficl - copied unchanged from r307950, head/sys/boot/Makefile.ficl stable/11/sys/boot/forth/efi.4th - copied unchanged from r307879, head/sys/boot/forth/efi.4th Deleted: stable/11/sys/boot/ficl/efi.c Modified: stable/11/sys/boot/common/Makefile.inc stable/11/sys/boot/common/bootstrap.h stable/11/sys/boot/common/install.c stable/11/sys/boot/common/interp.c stable/11/sys/boot/common/interp_forth.c stable/11/sys/boot/common/loader.8 stable/11/sys/boot/common/newvers.sh stable/11/sys/boot/common/pnp.c stable/11/sys/boot/efi/libefi/Makefile stable/11/sys/boot/efi/libefi/efinet.c stable/11/sys/boot/efi/libefi/env.c stable/11/sys/boot/efi/loader/Makefile stable/11/sys/boot/efi/loader/arch/amd64/ldscript.amd64 stable/11/sys/boot/efi/loader/arch/arm/ldscript.arm stable/11/sys/boot/efi/loader/arch/arm64/ldscript.arm64 stable/11/sys/boot/efi/loader/arch/i386/efimd.c stable/11/sys/boot/efi/loader/arch/i386/elf32_freebsd.c stable/11/sys/boot/efi/loader/arch/i386/exec.c stable/11/sys/boot/efi/loader/arch/i386/ldscript.i386 stable/11/sys/boot/efi/loader/main.c stable/11/sys/boot/ficl/Makefile stable/11/sys/boot/ficl/ficl.h stable/11/sys/boot/ficl/i386/sysdep.c stable/11/sys/boot/ficl/loader.c stable/11/sys/boot/ficl32/Makefile stable/11/sys/boot/forth/Makefile.inc stable/11/sys/boot/forth/loader.4th stable/11/sys/boot/forth/support.4th stable/11/sys/boot/i386/Makefile.inc stable/11/sys/boot/i386/cdboot/cdboot.S stable/11/sys/boot/i386/gptboot/Makefile stable/11/sys/boot/i386/gptzfsboot/Makefile stable/11/sys/boot/i386/libi386/Makefile stable/11/sys/boot/i386/libi386/biospci.c stable/11/sys/boot/i386/libi386/libi386.h stable/11/sys/boot/i386/libi386/smbios.c stable/11/sys/boot/i386/loader/Makefile stable/11/sys/boot/mips/beri/loader/loader.ldscript stable/11/sys/boot/pc98/libpc98/Makefile stable/11/sys/boot/zfs/zfsimpl.c stable/11/targets/pseudo/userland/misc/Makefile.depend Directory Properties: stable/11/ (props changed) Copied: stable/11/sys/boot/Makefile.ficl (from r307950, head/sys/boot/Makefile.ficl) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/boot/Makefile.ficl Thu Feb 8 02:50:47 2018 (r329011, copy of r307950, head/sys/boot/Makefile.ficl) @@ -0,0 +1,43 @@ +# $FreeBSD$ + +# Common flags to build FICL related files + +FICLDIR?= ${SRCTOP}/sys/boot/ficl + +.if ${MACHINE_CPUARCH} == "amd64" && defined(FICL32) +FICL_CPUARCH= i386 +.elif ${MACHINE_ARCH} == "mips64" || ${MACHINE_ARCH} == "mips64el" +FICL_CPUARCH= mips64 +.else +FICL_CPUARCH= ${MACHINE_CPUARCH} +.endif + +.PATH: ${FICLDIR} ${FICLDIR}/${FICL_CPUARCH} + +.if ${MACHINE_CPUARCH} == "amd64" +.if defined(FICL32) +CFLAGS+= -m32 -I. +.else +CFLAGS+= -fPIC +.endif +.endif + +.if ${MACHINE_ARCH} == "powerpc64" +CFLAGS+= -m32 -mcpu=powerpc -I. +.endif + +CFLAGS+= -I${FICLDIR} -I${FICLDIR}/${FICL_CPUARCH} \ + -I${FICLDIR}/../common + +.if ${MACHINE_CPUARCH} == "amd64" && defined(FICL32) +.if !exists(machine) +${SRCS:M*.c:R:S/$/.o/g}: machine + +beforedepend ${OBJS}: machine +.endif + +machine: .NOMETA + ln -sf ${.CURDIR}/../../i386/include machine + +CLEANFILES+= machine +.endif Modified: stable/11/sys/boot/common/Makefile.inc ============================================================================== --- stable/11/sys/boot/common/Makefile.inc Thu Feb 8 02:44:21 2018 (r329010) +++ stable/11/sys/boot/common/Makefile.inc Thu Feb 8 02:50:47 2018 (r329011) @@ -65,6 +65,7 @@ SRCS+= pnp.c # Forth interpreter .if defined(BOOT_FORTH) SRCS+= interp_forth.c +.include "${SRCTOP}/sys/boot/Makefile.ficl" .endif .if defined(BOOT_PROMPT_123) Modified: stable/11/sys/boot/common/bootstrap.h ============================================================================== --- stable/11/sys/boot/common/bootstrap.h Thu Feb 8 02:44:21 2018 (r329010) +++ stable/11/sys/boot/common/bootstrap.h Thu Feb 8 02:50:47 2018 (r329011) @@ -142,8 +142,6 @@ struct pnpinfo STAILQ_HEAD(pnpinfo_stql, pnpinfo); -extern struct pnpinfo_stql pnp_devices; - extern struct pnphandler *pnphandlers[]; /* provided by MD code */ void pnp_addident(struct pnpinfo *pi, char *ident); Modified: stable/11/sys/boot/common/install.c ============================================================================== --- stable/11/sys/boot/common/install.c Thu Feb 8 02:44:21 2018 (r329010) +++ stable/11/sys/boot/common/install.c Thu Feb 8 02:50:47 2018 (r329011) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" -extern struct in_addr rootip; extern struct in_addr servip; extern int pkgfs_init(const char *, struct fs_ops *); @@ -50,6 +49,7 @@ COMMAND_SET(install, "install", "install software pack static char *inst_kernel; static char **inst_modules; static char *inst_rootfs; +static char *inst_loader_rc; static int setpath(char **what, char *val) @@ -146,6 +146,8 @@ read_metatags(int fd) error = setmultipath(&inst_modules, val); else if (strcmp(tag, "ROOTFS") == 0) error = setpath(&inst_rootfs, val); + else if (strcmp(tag, "LOADER_RC") == 0) + error = setpath(&inst_loader_rc, val); tag = p; } @@ -173,6 +175,10 @@ cleanup(void) free(inst_rootfs); inst_rootfs = NULL; } + if (inst_loader_rc != NULL) { + free(inst_loader_rc); + inst_loader_rc = NULL; + } pkgfs_cleanup(); } @@ -275,6 +281,16 @@ install(char *pkgname) goto fail; } + /* If there is a loader.rc in the package, execute it */ + s = (inst_loader_rc == NULL) ? "/loader.rc" : inst_loader_rc; + fd = open(s, O_RDONLY); + if (fd != -1) { + close(fd); + error = include(s); + if (error == CMD_ERROR) + goto fail; + } + i = 0; while (inst_modules != NULL && inst_modules[i] != NULL) { error = mod_loadkld(inst_modules[i], 0, NULL); @@ -286,7 +302,7 @@ install(char *pkgname) } s = (inst_rootfs == NULL) ? "/install.iso" : inst_rootfs; - if (file_loadraw(s, "mfs_root") == NULL) { + if (file_loadraw(s, "mfs_root", 1) == NULL) { error = errno; command_errmsg = "cannot load root file system"; goto fail; Modified: stable/11/sys/boot/common/interp.c ============================================================================== --- stable/11/sys/boot/common/interp.c Thu Feb 8 02:44:21 2018 (r329010) +++ stable/11/sys/boot/common/interp.c Thu Feb 8 02:50:47 2018 (r329011) @@ -104,8 +104,7 @@ interact(const char *rc) if (rc == NULL) { /* Read our default configuration. */ - if (include("/boot/loader.rc") != CMD_OK) - include("/boot/boot.conf"); + include("/boot/loader.rc"); } else if (*rc != '\0') include(rc); Modified: stable/11/sys/boot/common/interp_forth.c ============================================================================== --- stable/11/sys/boot/common/interp_forth.c Thu Feb 8 02:44:21 2018 (r329010) +++ stable/11/sys/boot/common/interp_forth.c Thu Feb 8 02:50:47 2018 (r329011) @@ -63,7 +63,6 @@ extern unsigned bootprog_rev; FICL_SYSTEM *bf_sys; FICL_VM *bf_vm; -FICL_WORD *pInterp; /* * Shim for taking commands from BF and passing them out to 'standard' @@ -280,8 +279,6 @@ bf_init(const char *rc) ficlSetEnv(bf_sys, "FreeBSD_version", __FreeBSD_version); ficlSetEnv(bf_sys, "loader_version", bootprog_rev); - pInterp = ficlLookup(bf_sys, "interpret"); - /* try to load and run init file if present */ if (rc == NULL) rc = "/boot/boot.4th"; @@ -292,9 +289,6 @@ bf_init(const char *rc) close(fd); } } - - /* Do this again, so that interpret can be redefined. */ - pInterp = ficlLookup(bf_sys, "interpret"); } /* Modified: stable/11/sys/boot/common/loader.8 ============================================================================== --- stable/11/sys/boot/common/loader.8 Thu Feb 8 02:44:21 2018 (r329010) +++ stable/11/sys/boot/common/loader.8 Thu Feb 8 02:50:47 2018 (r329011) @@ -90,9 +90,7 @@ which is default. After that, .Pa /boot/loader.rc -is processed if available, and, failing that, -.Pa /boot/boot.conf -is read for historical reasons. +is processed if available. These files are processed through the .Ic include command, which reads all of them into memory before processing them, @@ -957,10 +955,6 @@ itself. Additional .Tn FICL initialization. -.It Pa /boot/boot.conf -.Nm -bootstrapping script. -Deprecated. .It Pa /boot/defaults/loader.conf .It Pa /boot/loader.conf .It Pa /boot/loader.conf.local Modified: stable/11/sys/boot/common/newvers.sh ============================================================================== --- stable/11/sys/boot/common/newvers.sh Thu Feb 8 02:44:21 2018 (r329010) +++ stable/11/sys/boot/common/newvers.sh Thu Feb 8 02:50:47 2018 (r329011) @@ -14,7 +14,7 @@ # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. -# 4. Neither the name of the University nor the names of its contributors +# 3. Neither the name of the University nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # Modified: stable/11/sys/boot/common/pnp.c ============================================================================== --- stable/11/sys/boot/common/pnp.c Thu Feb 8 02:44:21 2018 (r329010) +++ stable/11/sys/boot/common/pnp.c Thu Feb 8 02:50:47 2018 (r329011) @@ -17,8 +17,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef BOOT_FORTH +#include "ficl.h" +#endif -struct pnpinfo_stql pnp_devices; +static struct pnpinfo_stql pnp_devices; static int pnp_devices_initted = 0; static void pnp_discard(void); @@ -185,3 +188,49 @@ pnp_eisaformat(u_int8_t *data) return(idbuf); } +#ifdef BOOT_FORTH +void +ficlPnpdevices(FICL_VM *pVM) +{ + static int pnp_devices_initted = 0; +#if FICL_ROBUST > 1 + vmCheckStack(pVM, 0, 1); +#endif + + if(!pnp_devices_initted) { + STAILQ_INIT(&pnp_devices); + pnp_devices_initted = 1; + } + + stackPushPtr(pVM->pStack, &pnp_devices); + + return; +} + +void +ficlPnphandlers(FICL_VM *pVM) +{ +#if FICL_ROBUST > 1 + vmCheckStack(pVM, 0, 1); +#endif + + stackPushPtr(pVM->pStack, pnphandlers); + + return; +} + +/* + * Glue function to add the appropriate forth words to access pnp BIOS + * functionality. + */ +static void ficlCompilePnp(FICL_SYSTEM *pSys) +{ + FICL_DICT *dp = pSys->dp; + assert (dp); + + dictAppendWord(dp, "pnpdevices",ficlPnpdevices, FW_DEFAULT); + dictAppendWord(dp, "pnphandlers",ficlPnphandlers, FW_DEFAULT); +} + +FICL_COMPILE_SET(ficlCompilePnp); +#endif Modified: stable/11/sys/boot/efi/libefi/Makefile ============================================================================== --- stable/11/sys/boot/efi/libefi/Makefile Thu Feb 8 02:44:21 2018 (r329010) +++ stable/11/sys/boot/efi/libefi/Makefile Thu Feb 8 02:50:47 2018 (r329011) @@ -1,16 +1,25 @@ # $FreeBSD$ +.include + +.if ${MK_FORTH} != "no" +.include "${.CURDIR}/../../Makefile.ficl" +.endif + LIB= efi INTERNALLIB= WARNS?= 2 -SRCS= delay.c devpath.c efi_console.c efinet.c efipart.c env.c errno.c \ +SRCS= delay.c devpath.c efi_console.c efinet.c efipart.c errno.c \ handles.c libefi.c .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" SRCS+= time.c .elif ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" SRCS+= time_event.c +.endif +.if ${MK_FORTH} != "no" +SRCS+= env.c .endif # We implement a slightly non-standard %S in that it always takes a Modified: stable/11/sys/boot/efi/libefi/efinet.c ============================================================================== --- stable/11/sys/boot/efi/libefi/efinet.c Thu Feb 8 02:44:21 2018 (r329010) +++ stable/11/sys/boot/efi/libefi/efinet.c Thu Feb 8 02:50:47 2018 (r329011) @@ -360,10 +360,12 @@ efinet_dev_print(int verbose) for (unit = 0, h = efi_find_handle(&efinet_dev, 0); h != NULL; h = efi_find_handle(&efinet_dev, ++unit)) { printf(" %s%d:", efinet_dev.dv_name, unit); - text = efi_devpath_name(efi_lookup_devpath(h)); - if (text != NULL) { - printf(" %S", text); - efi_free_devpath_name(text); + if (verbose) { + text = efi_devpath_name(efi_lookup_devpath(h)); + if (text != NULL) { + printf(" %S", text); + efi_free_devpath_name(text); + } } if ((ret = pager_output("\n")) != 0) break; Modified: stable/11/sys/boot/efi/libefi/env.c ============================================================================== --- stable/11/sys/boot/efi/libefi/env.c Thu Feb 8 02:44:21 2018 (r329010) +++ stable/11/sys/boot/efi/libefi/env.c Thu Feb 8 02:50:47 2018 (r329011) @@ -26,9 +26,16 @@ #include __FBSDID("$FreeBSD$"); +#include +#include #include #include +#include +#include "bootstrap.h" +#include "ficl.h" +int efi_variable_support = 1; + /* * Simple wrappers to the underlying UEFI functions. * See http://wiki.phoenix.com/wiki/index.php/EFI_RUNTIME_SERVICES @@ -53,3 +60,175 @@ efi_set_variable(CHAR16 *variable_name, EFI_GUID *vend { return RS->SetVariable(variable_name, vendor_guid, attributes, data_size, data); } + +/* + * 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 = NULL, *guid = NULL; + CHAR16 *name = NULL; + int i; +#endif + char *namep, *valuep, *guidp; + int names, values, guids, attr; + int status; + uuid_t u; + uint32_t ustatus; + +#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); + uuid_from_string(guid, &u, &ustatus); + if (ustatus != uuid_s_ok) { + stackPushINT(pVM->pStack, -1); + goto out; + } + + name = (CHAR16 *)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, (EFI_GUID *)&u, attr, values, value); + if (status == EFI_SUCCESS) + stackPushINT(pVM->pStack, 0); + else + stackPushINT(pVM->pStack, -1); +out: + 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 == NULL) + 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 == NULL) + vmThrowErr(pVM, "Error: out of memory"); + strncpy(name, namep, names); + name[names] = '\0'; + + unsetenv(name); + ficlFree(name); +#endif + + return; +} + +/************************************************************************** +** Add FreeBSD UEFI 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); + + /* Would like to export the EFI version, but this will do for now */ + ficlSetEnv(pSys, "efi-boot", 1); + + return; +} + +FICL_COMPILE_SET(ficlEfiCompilePlatform); Modified: stable/11/sys/boot/efi/loader/Makefile ============================================================================== --- stable/11/sys/boot/efi/loader/Makefile Thu Feb 8 02:44:21 2018 (r329010) +++ stable/11/sys/boot/efi/loader/Makefile Thu Feb 8 02:50:47 2018 (r329011) @@ -146,6 +146,7 @@ loader.efi: ${PROG} ${OBJCOPY} -j .peheader -j .text -j .sdata -j .data \ -j .dynamic -j .dynsym -j .rel.dyn \ -j .rela.dyn -j .reloc -j .eh_frame -j set_Xcommand_set \ + -j set_Xficl_compile_set \ --output-target=${EFI_TARGET} ${.ALLSRC} ${.TARGET} LIBEFI= ${.OBJDIR}/../libefi/libefi.a Modified: stable/11/sys/boot/efi/loader/arch/amd64/ldscript.amd64 ============================================================================== --- stable/11/sys/boot/efi/loader/arch/amd64/ldscript.amd64 Thu Feb 8 02:44:21 2018 (r329010) +++ stable/11/sys/boot/efi/loader/arch/amd64/ldscript.amd64 Thu Feb 8 02:50:47 2018 (r329011) @@ -40,6 +40,11 @@ SECTIONS *(set_Xcommand_set) __stop_set_Xcommand_set = .; } + set_Xficl_compile_set : { + __start_set_Xficl_compile_set = .; + *(set_Xficl_compile_set) + __stop_set_Xficl_compile_set = .; + } . = ALIGN(4096); __gp = .; .sdata : { Modified: stable/11/sys/boot/efi/loader/arch/arm/ldscript.arm ============================================================================== --- stable/11/sys/boot/efi/loader/arch/arm/ldscript.arm Thu Feb 8 02:44:21 2018 (r329010) +++ stable/11/sys/boot/efi/loader/arch/arm/ldscript.arm Thu Feb 8 02:50:47 2018 (r329011) @@ -47,6 +47,11 @@ SECTIONS *(set_Xcommand_set) __stop_set_Xcommand_set = .; } + set_Xficl_compile_set : { + __start_set_Xficl_compile_set = .; + *(set_Xficl_compile_set) + __stop_set_Xficl_compile_set = .; + } __gp = .; .plt : { *(.plt) } .dynamic : { *(.dynamic) } Modified: stable/11/sys/boot/efi/loader/arch/arm64/ldscript.arm64 ============================================================================== --- stable/11/sys/boot/efi/loader/arch/arm64/ldscript.arm64 Thu Feb 8 02:44:21 2018 (r329010) +++ stable/11/sys/boot/efi/loader/arch/arm64/ldscript.arm64 Thu Feb 8 02:50:47 2018 (r329011) @@ -43,6 +43,11 @@ SECTIONS *(set_Xcommand_set) __stop_set_Xcommand_set = .; } + set_Xficl_compile_set : { + __start_set_Xficl_compile_set = .; + *(set_Xficl_compile_set) + __stop_set_Xficl_compile_set = .; + } . = ALIGN(16); __gp = .; .sdata : { Modified: stable/11/sys/boot/efi/loader/arch/i386/efimd.c ============================================================================== --- stable/11/sys/boot/efi/loader/arch/i386/efimd.c Thu Feb 8 02:44:21 2018 (r329010) +++ stable/11/sys/boot/efi/loader/arch/i386/efimd.c Thu Feb 8 02:50:47 2018 (r329011) @@ -48,7 +48,10 @@ static EFI_GUID hcdp_guid = HCDP_TABLE_GUID; static UINTN mapkey; -uint64_t +int ldr_bootinfo(struct bootinfo *, uint64_t *); +int ldr_enter(const char *); + +static uint64_t ldr_alloc(vm_offset_t va) { Modified: stable/11/sys/boot/efi/loader/arch/i386/elf32_freebsd.c ============================================================================== --- stable/11/sys/boot/efi/loader/arch/i386/elf32_freebsd.c Thu Feb 8 02:44:21 2018 (r329010) +++ stable/11/sys/boot/efi/loader/arch/i386/elf32_freebsd.c Thu Feb 8 02:50:47 2018 (r329011) @@ -35,13 +35,17 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #include "bootstrap.h" #include "../libi386/libi386.h" #include "../btx/lib/btxv86.h" extern void __exec(caddr_t addr, ...); +extern int bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp); +extern int ldr_enter(const char *kernel); - static int elf32_exec(struct preloaded_file *amp); static int elf32_obj_exec(struct preloaded_file *amp); @@ -72,14 +76,14 @@ elf32_exec(struct preloaded_file *fp) ehdr = (Elf_Ehdr *)&(md->md_data); efi_time_fini(); - err = bi_load(fp->f_args, &boothowto, &bootdev, &bootinfop, &modulep, &kernend); + err = bi_load(fp->f_args, &modulep, &kernend); if (err != 0) { efi_time_init(); return(err); } entry = ehdr->e_entry & 0xffffff; - printf("Start @ 0x%lx ...\n", entry); + printf("Start @ 0x%x ...\n", entry); ldr_enter(fp->f_name); Modified: stable/11/sys/boot/efi/loader/arch/i386/exec.c ============================================================================== --- stable/11/sys/boot/efi/loader/arch/i386/exec.c Thu Feb 8 02:44:21 2018 (r329010) +++ stable/11/sys/boot/efi/loader/arch/i386/exec.c Thu Feb 8 02:50:47 2018 (r329011) @@ -36,6 +36,12 @@ __FBSDID("$FreeBSD$"); uint32_t __base; struct __v86 __v86; +/* XXX - Needed a definition here to implicitly define exit(); do not remove. */ +static void +exit(int x) +{ +} + void __v86int() { Modified: stable/11/sys/boot/efi/loader/arch/i386/ldscript.i386 ============================================================================== --- stable/11/sys/boot/efi/loader/arch/i386/ldscript.i386 Thu Feb 8 02:44:21 2018 (r329010) +++ stable/11/sys/boot/efi/loader/arch/i386/ldscript.i386 Thu Feb 8 02:50:47 2018 (r329011) @@ -35,6 +35,11 @@ SECTIONS *(set_Xcommand_set) __stop_set_Xcommand_set = .; } + set_Xficl_compile_set : { + __start_set_Xficl_compile_set = .; + *(set_Xficl_compile_set) + __stop_set_Xficl_compile_set = .; + } . = ALIGN(4096); __gp = .; .sdata : { Modified: stable/11/sys/boot/efi/loader/main.c ============================================================================== --- stable/11/sys/boot/efi/loader/main.c Thu Feb 8 02:44:21 2018 (r329010) +++ stable/11/sys/boot/efi/loader/main.c Thu Feb 8 02:50:47 2018 (r329011) @@ -52,6 +52,22 @@ __FBSDID("$FreeBSD$"); extern char bootprog_info[]; +#ifdef BOOT_FORTH +/* + * Normally, efi.o from libefi.a would be brought in due to a function we call + * there that's defined there. However, none of its functions are callable from + * here since it just adds words to the FORTH environment or implement those + * words. So, add a reference to a symbol in efi.o to force it to be be brought + * in so the init function there gets added to the "compile" linker set happens + * correctly. + * + * This assumes there's no global analysys that notices dummy1 isn't used + * anywhere and tries to eliminate it. + */ +extern int efi_variable_support; +int *dummy1 = &efi_variable_support; +#endif + struct arch_switch archsw; /* MI/MD interface boundary */ EFI_GUID acpi = ACPI_TABLE_GUID; @@ -218,6 +234,11 @@ find_currdev(EFI_LOADED_IMAGE *img, struct devsw **dev } } + /* Try to fallback on first device */ + if (devsw[0] != NULL) { + *dev = devsw[0]; + return (0); + } return (ENOENT); } @@ -232,6 +253,7 @@ main(int argc, CHAR16 *argv[]) uint64_t pool_guid; UINTN k; int has_kbd; + char buf[40]; archsw.arch_autoload = efi_autoload; archsw.arch_getdev = efi_getdev; @@ -442,6 +464,9 @@ main(int argc, CHAR16 *argv[]) for (k = 0; k < ST->NumberOfTableEntries; k++) { guid = &ST->ConfigurationTable[k].VendorGuid; if (!memcmp(guid, &smbios, sizeof(EFI_GUID))) { + snprintf(buf, sizeof(buf), "%p", + ST->ConfigurationTable[k].VendorTable); + setenv("hint.smbios.0.mem", buf, 1); smbios_detect(ST->ConfigurationTable[k].VendorTable); break; } @@ -613,7 +638,8 @@ command_configuration(int argc, char *argv[]) else if (!memcmp(guid, &acpi20, sizeof(EFI_GUID))) printf("ACPI 2.0 Table"); else if (!memcmp(guid, &smbios, sizeof(EFI_GUID))) - printf("SMBIOS Table"); + printf("SMBIOS Table %p", + ST->ConfigurationTable[i].VendorTable); else if (!memcmp(guid, &dxe, sizeof(EFI_GUID))) printf("DXE Table"); else if (!memcmp(guid, &hoblist, sizeof(EFI_GUID))) @@ -915,8 +941,8 @@ command_efi_show(int argc, char *argv[]) return (rv); } - if (argc != 0) { - printf("Too many args\n"); + if (argc > 0) { + printf("Too many args %d\n", argc); pager_close(); return (CMD_ERROR); } Modified: stable/11/sys/boot/ficl/Makefile ============================================================================== --- stable/11/sys/boot/ficl/Makefile Thu Feb 8 02:44:21 2018 (r329010) +++ stable/11/sys/boot/ficl/Makefile Thu Feb 8 02:50:47 2018 (r329011) @@ -1,15 +1,8 @@ # $FreeBSD$ # -FICLDIR?= ${.CURDIR} +.include "${.CURDIR}/../Makefile.ficl" -.if defined(FICL32) -.PATH: ${FICLDIR}/${MACHINE_CPUARCH:S/amd64/i386/} -.elif ${MACHINE_ARCH} == "mips64" || ${MACHINE_ARCH} == "mips64el" -.PATH: ${FICLDIR}/mips64 -.else -.PATH: ${FICLDIR}/${MACHINE_CPUARCH} -.endif BASE_SRCS= dict.c ficl.c fileaccess.c float.c loader.c math64.c \ prefix.c search.c stack.c tools.c vm.c words.c @@ -41,42 +34,6 @@ SOFTWORDS= softcore.fr jhlocal.fr marker.fr freebsd.fr # Optional OO extension softwords #SOFTWORDS+= oo.fr classes.fr -.if ${MACHINE_CPUARCH} == "amd64" -.if defined(FICL32) -CFLAGS+= -m32 -I. -.else -CFLAGS+= -fPIC -.endif -.endif - -.if ${MACHINE_ARCH} == "powerpc64" -CFLAGS+= -m32 -mcpu=powerpc -I. -.endif - -.if ${MACHINE_CPUARCH} == "amd64" && defined(FICL32) -FICL_CPUARCH= i386 -.elif ${MACHINE_ARCH} == "mips64" || ${MACHINE_ARCH} == "mips64el" -FICL_CPUARCH= mips64 -.else -FICL_CPUARCH= ${MACHINE_CPUARCH} -.endif - -CFLAGS+= -I${FICLDIR} -I${FICLDIR}/${FICL_CPUARCH} \ - -I${FICLDIR}/../common - softcore.c: ${SOFTWORDS} softcore.awk (cd ${FICLDIR}/softwords; cat ${SOFTWORDS} \ | awk -f softcore.awk -v datestamp="`LC_ALL=C date`") > ${.TARGET} - -.if ${MACHINE_CPUARCH} == "amd64" && defined(FICL32) -.if !exists(machine) -${SRCS:M*.c:R:S/$/.o/g}: machine - -beforedepend ${OBJS}: machine -.endif - -machine: .NOMETA - ln -sf ${.CURDIR}/../../i386/include machine - -CLEANFILES+= machine -.endif Modified: stable/11/sys/boot/ficl/ficl.h ============================================================================== --- stable/11/sys/boot/ficl/ficl.h Thu Feb 8 02:44:21 2018 (r329010) +++ stable/11/sys/boot/ficl/ficl.h Thu Feb 8 02:50:47 2018 (r329011) @@ -1150,6 +1150,13 @@ typedef struct ficlFILE } ficlFILE; #endif +#include + +typedef void ficlCompileFcn(FICL_SYSTEM *); +#define FICL_COMPILE_SET(func) \ + DATA_SET(Xficl_compile_set, func) +SET_DECLARE(Xficl_compile_set, ficlCompileFcn); + #ifdef __cplusplus } #endif Modified: stable/11/sys/boot/ficl/i386/sysdep.c ============================================================================== --- stable/11/sys/boot/ficl/i386/sysdep.c Thu Feb 8 02:44:21 2018 (r329010) +++ stable/11/sys/boot/ficl/i386/sysdep.c Thu Feb 8 02:50:47 2018 (r329011) @@ -81,7 +81,6 @@ void ficlFree (void *p) } #ifndef TESTMAIN -#ifdef __i386__ /* * outb ( port# c -- ) * Store a byte to I/O port number port# @@ -111,7 +110,22 @@ ficlInb(FICL_VM *pVM) c=inb(port); stackPushINT(pVM->pStack,c); } -#endif + +/* + * Glue function to add the appropriate forth words to access x86 special cpu + * functionality. + */ +static void ficlCompileCpufunc(FICL_SYSTEM *pSys) +{ + FICL_DICT *dp = pSys->dp; + assert (dp); + + dictAppendWord(dp, "outb", ficlOutb, FW_DEFAULT); + dictAppendWord(dp, "inb", ficlInb, FW_DEFAULT); +} + +FICL_COMPILE_SET(ficlCompileCpufunc); + #endif /* Modified: stable/11/sys/boot/ficl/loader.c ============================================================================== --- stable/11/sys/boot/ficl/loader.c Thu Feb 8 02:44:21 2018 (r329010) +++ stable/11/sys/boot/ficl/loader.c Thu Feb 8 02:50:47 2018 (r329011) @@ -287,44 +287,7 @@ ficlFindfile(FICL_VM *pVM) return; } -#ifndef TESTMAIN -#ifdef HAVE_PNP - void -ficlPnpdevices(FICL_VM *pVM) -{ - static int pnp_devices_initted = 0; -#if FICL_ROBUST > 1 - vmCheckStack(pVM, 0, 1); -#endif - - if(!pnp_devices_initted) { - STAILQ_INIT(&pnp_devices); - pnp_devices_initted = 1; - } - - stackPushPtr(pVM->pStack, &pnp_devices); - - return; -} - -void -ficlPnphandlers(FICL_VM *pVM) -{ -#if FICL_ROBUST > 1 - vmCheckStack(pVM, 0, 1); -#endif - - stackPushPtr(pVM->pStack, pnphandlers); - - return; -} - -#endif - -#endif /* ndef TESTMAIN */ - -void ficlCcall(FICL_VM *pVM) { int (*func)(int, ...); @@ -800,142 +763,7 @@ static void fkey(FICL_VM *pVM) } -#ifdef __i386__ /* - * pcibios-device-count (devid -- count) - * - * Returns the PCI BIOS' count of how many devices matching devid are in the system. - * devid is the 32-bit vendor + device. - */ -static void -ficlPciBiosCountDevices(FICL_VM *pVM) -{ - uint32_t devid; - int i; - - devid = stackPopINT(pVM->pStack); - - i = biospci_count_device_type(devid); - - stackPushINT(pVM->pStack, i); -} - -/* - * pcibios-write-config (locator offset width value -- ) - * - * Writes the specified config register. - * Locator is bus << 8 | device << 3 | fuction - * offset is the pci config register - * width is 0 for byte, 1 for word, 2 for dword - * value is the value to write - */ -static void -ficlPciBiosWriteConfig(FICL_VM *pVM) -{ - uint32_t value, width, offset, locator; - - value = stackPopINT(pVM->pStack); - width = stackPopINT(pVM->pStack); - offset = stackPopINT(pVM->pStack); - locator = stackPopINT(pVM->pStack); - - biospci_write_config(locator, offset, width, value); -} - -/* - * pcibios-read-config (locator offset width -- value) - * - * Reads the specified config register. - * Locator is bus << 8 | device << 3 | fuction - * offset is the pci config register - * width is 0 for byte, 1 for word, 2 for dword - * value is the value to read from the register - */ -static void -ficlPciBiosReadConfig(FICL_VM *pVM) -{ - uint32_t value, width, offset, locator; - - width = stackPopINT(pVM->pStack); - offset = stackPopINT(pVM->pStack); - locator = stackPopINT(pVM->pStack); - - biospci_read_config(locator, offset, width, &value); - - stackPushINT(pVM->pStack, value); -} - -/* - * pcibios-find-devclass (class index -- locator) - * - * Finds the index'th instance of class in the pci tree. - * must be an exact match. - * class is the class to search for. - * index 0..N (set to 0, increment until error) - * - * Locator is bus << 8 | device << 3 | fuction (or -1 on error) - */ -static void -ficlPciBiosFindDevclass(FICL_VM *pVM) -{ - uint32_t index, class, locator; - - index = stackPopINT(pVM->pStack); - class = stackPopINT(pVM->pStack); - - if (biospci_find_devclass(class, index, &locator)) - locator = 0xffffffff; - - stackPushINT(pVM->pStack, locator); -} - -/* - * pcibios-find-device(devid index -- locator) - * - * Finds the index'th instance of devid in the pci tree. - * must be an exact match. - * class is the class to search for. - * index 0..N (set to 0, increment until error) - * - * Locator is bus << 8 | device << 3 | fuction (or -1 on error) - */ -static void -ficlPciBiosFindDevice(FICL_VM *pVM) -{ - uint32_t index, devid, locator; - - index = stackPopINT(pVM->pStack); - devid = stackPopINT(pVM->pStack); - - if (biospci_find_device(devid, index, &locator)) - locator = 0xffffffff; - - stackPushINT(pVM->pStack, locator); -} - *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Feb 8 02:44:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 596E4EF1F9D; Thu, 8 Feb 2018 02:44:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0AE836D989; Thu, 8 Feb 2018 02:44:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 058E37F43; Thu, 8 Feb 2018 02:44:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w182iPOo096758; Thu, 8 Feb 2018 02:44:25 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w182iMIH096727; Thu, 8 Feb 2018 02:44:22 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802080244.w182iMIH096727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 8 Feb 2018 02:44:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329010 - in stable/11/sys/boot: common efi/boot1 efi/libefi efi/loader efi/loader/arch/amd64 fdt forth i386 i386/boot0 i386/boot2 i386/btx/btx i386/btx/btxldr i386/cdboot i386/gptboot ... X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/sys/boot: common efi/boot1 efi/libefi efi/loader efi/loader/arch/amd64 fdt forth i386 i386/boot0 i386/boot2 i386/btx/btx i386/btx/btxldr i386/cdboot i386/gptboot i386/gptzfsboot i386/libi... X-SVN-Commit-Revision: 329010 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Feb 2018 02:44:25 -0000 Author: kevans Date: Thu Feb 8 02:44:21 2018 New Revision: 329010 URL: https://svnweb.freebsd.org/changeset/base/329010 Log: MFC r303555,r303556,r303936,r303962,r304317,r304532,r305026,r305107,r305132, r305178,r305353,r305814,r306159,r306380,r306504: Loader fixes, 2016q3 r303555: bcache should support reads shorter than sector size r303556: Improve boot loader quote parsing r303936: Add kernel environment variables under smbios.system r303962: Add the missing space between .asciz directive and opening quote for some lines with #ifdef BTXLDR_VERBOSE/#endif r304317: boot1.efi Free() should check for NULL to provide consistent behavior r304532: Replace sprintf -> snprintf for command_errbuf provisioned from dynamic content. r305026: Emulate efi_cons_poll when WaitForKey is not available r305107: Create a hook 'post-initialize' for people that want to define something to read in .conf files after all other .conf files for the purpose of overriding. r305132: Remove accidentally committed stray comment. r305178: bd_int13probe() should check extended info if sector info is bad r305353: Don't use -N to set the OMAGIC with data and text writeable and data not page aligned. r305814: ufsread: Do not cast struct direct from void * r306159: Consistently declare getsecs(void) with proper return type and void when no arguments are present. r306380: loader command interpreter should reset command_errmsg r306504: Fix a cluster of bugs in list EFI environment variables PR: 204602, 211958, 211958 Relnotes: yes ("Improve boot loader quote parsing") Added: stable/11/sys/boot/i386/boot.ldscript - copied unchanged from r305353, head/sys/boot/i386/boot.ldscript Modified: stable/11/sys/boot/common/bcache.c stable/11/sys/boot/common/boot.c stable/11/sys/boot/common/bootstrap.h stable/11/sys/boot/common/commands.c stable/11/sys/boot/common/interp.c stable/11/sys/boot/common/interp_forth.c stable/11/sys/boot/common/interp_parse.c stable/11/sys/boot/common/ls.c stable/11/sys/boot/common/module.c stable/11/sys/boot/common/ufsread.c stable/11/sys/boot/efi/boot1/boot1.c stable/11/sys/boot/efi/libefi/efi_console.c stable/11/sys/boot/efi/libefi/time.c stable/11/sys/boot/efi/libefi/time_event.c stable/11/sys/boot/efi/loader/arch/amd64/framebuffer.c stable/11/sys/boot/efi/loader/main.c stable/11/sys/boot/fdt/fdt_loader_cmd.c stable/11/sys/boot/forth/loader.4th stable/11/sys/boot/i386/Makefile.inc stable/11/sys/boot/i386/boot0/Makefile stable/11/sys/boot/i386/boot2/Makefile stable/11/sys/boot/i386/btx/btx/Makefile stable/11/sys/boot/i386/btx/btxldr/Makefile stable/11/sys/boot/i386/btx/btxldr/btxldr.S stable/11/sys/boot/i386/cdboot/Makefile stable/11/sys/boot/i386/gptboot/Makefile stable/11/sys/boot/i386/gptzfsboot/Makefile stable/11/sys/boot/i386/libi386/biosdisk.c stable/11/sys/boot/i386/libi386/pxe.c stable/11/sys/boot/i386/libi386/smbios.c stable/11/sys/boot/i386/mbr/Makefile stable/11/sys/boot/i386/pmbr/Makefile stable/11/sys/boot/i386/pxeldr/Makefile stable/11/sys/boot/i386/zfsboot/Makefile stable/11/sys/boot/ofw/libofw/ofw_time.c stable/11/sys/boot/pc98/Makefile.inc stable/11/sys/boot/pc98/boot0/Makefile stable/11/sys/boot/pc98/boot2/Makefile stable/11/sys/boot/pc98/btx/btx/Makefile stable/11/sys/boot/pc98/btx/btxldr/Makefile stable/11/sys/boot/pc98/cdboot/Makefile stable/11/sys/boot/powerpc/kboot/main.c stable/11/sys/boot/powerpc/ps3/main.c stable/11/sys/boot/uboot/lib/time.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/common/bcache.c ============================================================================== --- stable/11/sys/boot/common/bcache.c Thu Feb 8 01:34:35 2018 (r329009) +++ stable/11/sys/boot/common/bcache.c Thu Feb 8 02:44:21 2018 (r329010) @@ -302,7 +302,9 @@ read_strategy(void *devdata, int rw, daddr_t blk, size break; } - size = i * bcache_blksize; + if (size > i * bcache_blksize) + size = i * bcache_blksize; + if (size != 0) { bcopy(bc->bcache_data + (bcache_blksize * BHASH(bc, blk)), buf, size); result = 0; Modified: stable/11/sys/boot/common/boot.c ============================================================================== --- stable/11/sys/boot/common/boot.c Thu Feb 8 01:34:35 2018 (r329009) +++ stable/11/sys/boot/common/boot.c Thu Feb 8 02:44:21 2018 (r329010) @@ -61,7 +61,8 @@ command_boot(int argc, char *argv[]) /* XXX maybe we should discard everything and start again? */ if (file_findfile(NULL, NULL) != NULL) { - sprintf(command_errbuf, "can't boot '%s', kernel module already loaded", argv[1]); + snprintf(command_errbuf, sizeof(command_errbuf), + "can't boot '%s', kernel module already loaded", argv[1]); return(CMD_ERROR); } @@ -129,7 +130,8 @@ command_autoboot(int argc, char *argv[]) case 2: howlong = strtol(argv[1], &cp, 0); if (*cp != 0) { - sprintf(command_errbuf, "bad delay '%s'", argv[1]); + snprintf(command_errbuf, sizeof(command_errbuf), + "bad delay '%s'", argv[1]); return(CMD_ERROR); } /* FALLTHROUGH */ Modified: stable/11/sys/boot/common/bootstrap.h ============================================================================== --- stable/11/sys/boot/common/bootstrap.h Thu Feb 8 01:34:35 2018 (r329009) +++ stable/11/sys/boot/common/bootstrap.h Thu Feb 8 02:44:21 2018 (r329010) @@ -35,8 +35,9 @@ /* Commands and return values; nonzero return sets command_errmsg != NULL */ typedef int (bootblk_cmd_t)(int argc, char *argv[]); +#define COMMAND_ERRBUFSZ (256) extern char *command_errmsg; -extern char command_errbuf[]; /* XXX blah, length */ +extern char command_errbuf[COMMAND_ERRBUFSZ]; #define CMD_OK 0 #define CMD_WARN 1 #define CMD_ERROR 2 Modified: stable/11/sys/boot/common/commands.c ============================================================================== --- stable/11/sys/boot/common/commands.c Thu Feb 8 01:34:35 2018 (r329009) +++ stable/11/sys/boot/common/commands.c Thu Feb 8 02:44:21 2018 (r329010) @@ -33,7 +33,8 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" char *command_errmsg; -char command_errbuf[256]; /* XXX should have procedural interface for setting, size limit? */ +/* XXX should have procedural interface for setting, size limit? */ +char command_errbuf[COMMAND_ERRBUFSZ]; static int page_file(char *filename); @@ -196,7 +197,8 @@ command_help(int argc, char *argv[]) pager_close(); close(hfd); if (!matched) { - sprintf(command_errbuf, "no help available for '%s'", topic); + snprintf(command_errbuf, sizeof(command_errbuf), + "no help available for '%s'", topic); free(topic); if (subtopic) free(subtopic); @@ -276,7 +278,8 @@ command_show(int argc, char *argv[]) if ((cp = getenv(argv[1])) != NULL) { printf("%s\n", cp); } else { - sprintf(command_errbuf, "variable '%s' not found", argv[1]); + snprintf(command_errbuf, sizeof(command_errbuf), + "variable '%s' not found", argv[1]); return(CMD_ERROR); } } @@ -386,7 +389,8 @@ command_read(int argc, char *argv[]) case 't': timeout = strtol(optarg, &cp, 0); if (cp == optarg) { - sprintf(command_errbuf, "bad timeout '%s'", optarg); + snprintf(command_errbuf, sizeof(command_errbuf), + "bad timeout '%s'", optarg); return(CMD_ERROR); } break; @@ -454,8 +458,10 @@ page_file(char *filename) result = pager_file(filename); - if (result == -1) - sprintf(command_errbuf, "error showing %s", filename); + if (result == -1) { + snprintf(command_errbuf, sizeof(command_errbuf), + "error showing %s", filename); + } return result; } Modified: stable/11/sys/boot/common/interp.c ============================================================================== --- stable/11/sys/boot/common/interp.c Thu Feb 8 01:34:35 2018 (r329009) +++ stable/11/sys/boot/common/interp.c Thu Feb 8 02:44:21 2018 (r329010) @@ -214,7 +214,8 @@ include(const char *filename) #endif if (((fd = open(filename, O_RDONLY)) == -1)) { - sprintf(command_errbuf,"can't open '%s': %s", filename, strerror(errno)); + snprintf(command_errbuf, sizeof(command_errbuf), + "can't open '%s': %s", filename, strerror(errno)); return(CMD_ERROR); } @@ -256,8 +257,9 @@ include(const char *filename) script = script->next; free(se); } - sprintf(command_errbuf, "file '%s' line %d: memory allocation " - "failure - aborting", filename, line); + snprintf(command_errbuf, sizeof(command_errbuf), + "file '%s' line %d: memory allocation failure - aborting", + filename, line); return (CMD_ERROR); } strcpy(sp->text, cp); @@ -291,7 +293,9 @@ include(const char *filename) #ifdef BOOT_FORTH res = bf_run(sp->text); if (res != VM_OUTOFTEXT) { - sprintf(command_errbuf, "Error while including %s, in the line:\n%s", filename, sp->text); + snprintf(command_errbuf, sizeof(command_errbuf), + "Error while including %s, in the line:\n%s", + filename, sp->text); res = CMD_ERROR; break; } else Modified: stable/11/sys/boot/common/interp_forth.c ============================================================================== --- stable/11/sys/boot/common/interp_forth.c Thu Feb 8 01:34:35 2018 (r329009) +++ stable/11/sys/boot/common/interp_forth.c Thu Feb 8 02:44:21 2018 (r329010) @@ -324,13 +324,15 @@ bf_run(char *line) printf("Parse error!\n"); break; default: - /* Hopefully, all other codes filled this buffer */ - printf("%s\n", command_errmsg); + if (command_errmsg != NULL) { + printf("%s\n", command_errmsg); + command_errmsg = NULL; + } } if (result == VM_USEREXIT) panic("interpreter exit"); setenv("interpret", bf_vm->state ? "" : "OK", 1); - return result; + return (result); } Modified: stable/11/sys/boot/common/interp_parse.c ============================================================================== --- stable/11/sys/boot/common/interp_parse.c Thu Feb 8 01:34:35 2018 (r329009) +++ stable/11/sys/boot/common/interp_parse.c Thu Feb 8 02:44:21 2018 (r329010) @@ -72,20 +72,26 @@ isdelim(int ch) static int isquote(int ch) { - return (ch == '\'' || ch == '"'); + return (ch == '\''); } +static int +isdquote(int ch) +{ + return (ch == '"'); +} + int parse(int *argc, char ***argv, char *str) { int ac; char *val, *p, *q, *copy = NULL; size_t i = 0; - char token, tmp, quote, *buf; + char token, tmp, quote, dquote, *buf; enum { STR, VAR, WHITE } state; ac = *argc = 0; - quote = 0; + dquote = quote = 0; if (!str || (p = copy = backslash(str)) == NULL) return 1; @@ -105,9 +111,19 @@ parse(int *argc, char ***argv, char *str) buf[i++] = *p++; } else if (isquote(*p)) { quote = quote ? 0 : *p; - ++p; - } - else if (isspace(*p) && !quote) { + if (dquote) { /* keep quote */ + PARSE_FAIL(i == (PARSE_BUFSIZE - 1)); + buf[i++] = *p++; + } else + ++p; + } else if (isdquote(*p)) { + dquote = dquote ? 0 : *p; + if (quote) { /* keep dquote */ + PARSE_FAIL(i == (PARSE_BUFSIZE - 1)); + buf[i++] = *p++; + } else + ++p; + } else if (isspace(*p) && !quote && !dquote) { state = WHITE; if (i) { buf[i] = '\0'; @@ -115,7 +131,7 @@ parse(int *argc, char ***argv, char *str) i = 0; } ++p; - } else if (*p == '$') { + } else if (*p == '$' && !quote) { token = isdelim(*(p + 1)); if (token) p += 2; @@ -157,6 +173,8 @@ parse(int *argc, char ***argv, char *str) break; } } + /* missing terminating ' or " */ + PARSE_FAIL(quote || dquote); /* If at end of token, add it */ if (i && state == STR) { buf[i] = '\0'; Modified: stable/11/sys/boot/common/ls.c ============================================================================== --- stable/11/sys/boot/common/ls.c Thu Feb 8 01:34:35 2018 (r329009) +++ stable/11/sys/boot/common/ls.c Thu Feb 8 02:44:21 2018 (r329010) @@ -149,7 +149,8 @@ ls_getdir(char **pathp) /* Make sure the path is respectable to begin with */ if (archsw.arch_getdev(NULL, path, &cp)) { - sprintf(command_errbuf, "bad path '%s'", path); + snprintf(command_errbuf, sizeof(command_errbuf), + "bad path '%s'", path); goto out; } @@ -159,15 +160,18 @@ ls_getdir(char **pathp) fd = open(path, O_RDONLY); if (fd < 0) { - sprintf(command_errbuf, "open '%s' failed: %s", path, strerror(errno)); + snprintf(command_errbuf, sizeof(command_errbuf), + "open '%s' failed: %s", path, strerror(errno)); goto out; } if (fstat(fd, &sb) < 0) { - sprintf(command_errbuf, "stat failed: %s", strerror(errno)); + snprintf(command_errbuf, sizeof(command_errbuf), + "stat failed: %s", strerror(errno)); goto out; } if (!S_ISDIR(sb.st_mode)) { - sprintf(command_errbuf, "%s: %s", path, strerror(ENOTDIR)); + snprintf(command_errbuf, sizeof(command_errbuf), + "%s: %s", path, strerror(ENOTDIR)); goto out; } Modified: stable/11/sys/boot/common/module.c ============================================================================== --- stable/11/sys/boot/common/module.c Thu Feb 8 01:34:35 2018 (r329009) +++ stable/11/sys/boot/common/module.c Thu Feb 8 02:44:21 2018 (r329010) @@ -143,7 +143,8 @@ command_load(int argc, char *argv[]) fp = file_findfile(argv[1], typestr); if (fp) { - sprintf(command_errbuf, "warning: file '%s' already loaded", argv[1]); + snprintf(command_errbuf, sizeof(command_errbuf), + "warning: file '%s' already loaded", argv[1]); return (CMD_WARN); } @@ -162,7 +163,8 @@ command_load(int argc, char *argv[]) if (dokld || file_havepath(argv[1])) { error = mod_loadkld(argv[1], argc - 2, argv + 2); if (error == EEXIST) { - sprintf(command_errbuf, "warning: KLD '%s' already loaded", argv[1]); + snprintf(command_errbuf, sizeof(command_errbuf), + "warning: KLD '%s' already loaded", argv[1]); return (CMD_WARN); } @@ -173,7 +175,8 @@ command_load(int argc, char *argv[]) */ error = mod_load(argv[1], NULL, argc - 2, argv + 2); if (error == EEXIST) { - sprintf(command_errbuf, "warning: module '%s' already loaded", argv[1]); + snprintf(command_errbuf, sizeof(command_errbuf), + "warning: module '%s' already loaded", argv[1]); return (CMD_WARN); } @@ -203,7 +206,8 @@ command_load_geli(int argc, char *argv[]) case 'n': num = strtol(optarg, &cp, 0); if (cp == optarg) { - sprintf(command_errbuf, "bad key index '%s'", optarg); + snprintf(command_errbuf, sizeof(command_errbuf), + "bad key index '%s'", optarg); return(CMD_ERROR); } break; @@ -342,8 +346,8 @@ file_load(char *filename, vm_offset_t dest, struct pre if (error == EFTYPE) continue; /* Unknown to this handler? */ if (error) { - sprintf(command_errbuf, "can't load file '%s': %s", - filename, strerror(error)); + snprintf(command_errbuf, sizeof(command_errbuf), + "can't load file '%s': %s", filename, strerror(error)); break; } } @@ -379,8 +383,8 @@ file_load_dependencies(struct preloaded_file *base_fil */ mp = file_findmodule(NULL, dmodname, verinfo); if (mp == NULL) { - sprintf(command_errbuf, "module '%s' exists but with wrong version", - dmodname); + snprintf(command_errbuf, sizeof(command_errbuf), + "module '%s' exists but with wrong version", dmodname); error = ENOENT; break; } @@ -419,12 +423,14 @@ file_loadraw(const char *fname, char *type, int insert /* locate the file on the load path */ name = file_search(fname, NULL); if (name == NULL) { - sprintf(command_errbuf, "can't find '%s'", fname); + snprintf(command_errbuf, sizeof(command_errbuf), + "can't find '%s'", fname); return(NULL); } if ((fd = open(name, O_RDONLY)) < 0) { - sprintf(command_errbuf, "can't open '%s': %s", name, strerror(errno)); + snprintf(command_errbuf, sizeof(command_errbuf), + "can't open '%s': %s", name, strerror(errno)); free(name); return(NULL); } @@ -441,7 +447,8 @@ file_loadraw(const char *fname, char *type, int insert if (got == 0) /* end of file */ break; if (got < 0) { /* error */ - sprintf(command_errbuf, "error reading '%s': %s", name, strerror(errno)); + snprintf(command_errbuf, sizeof(command_errbuf), + "error reading '%s': %s", name, strerror(errno)); free(name); close(fd); return(NULL); @@ -495,13 +502,15 @@ mod_load(char *modname, struct mod_depend *verinfo, in free(mp->m_args); mp->m_args = unargv(argc, argv); #endif - sprintf(command_errbuf, "warning: module '%s' already loaded", mp->m_name); + snprintf(command_errbuf, sizeof(command_errbuf), + "warning: module '%s' already loaded", mp->m_name); return (0); } /* locate file with the module on the search path */ filename = mod_searchmodule(modname, verinfo); if (filename == NULL) { - sprintf(command_errbuf, "can't find '%s'", modname); + snprintf(command_errbuf, sizeof(command_errbuf), + "can't find '%s'", modname); return (ENOENT); } err = mod_loadkld(filename, argc, argv); @@ -524,7 +533,8 @@ mod_loadkld(const char *kldname, int argc, char *argv[ */ filename = file_search(kldname, kld_ext_list); if (filename == NULL) { - sprintf(command_errbuf, "can't find '%s'", kldname); + snprintf(command_errbuf, sizeof(command_errbuf), + "can't find '%s'", kldname); return (ENOENT); } /* @@ -532,7 +542,8 @@ mod_loadkld(const char *kldname, int argc, char *argv[ */ fp = file_findfile(filename, NULL); if (fp) { - sprintf(command_errbuf, "warning: KLD '%s' already loaded", filename); + snprintf(command_errbuf, sizeof(command_errbuf), + "warning: KLD '%s' already loaded", filename); free(filename); return (0); } @@ -556,8 +567,10 @@ mod_loadkld(const char *kldname, int argc, char *argv[ break; } } while(0); - if (err == EFTYPE) - sprintf(command_errbuf, "don't know how to load module '%s'", filename); + if (err == EFTYPE) { + snprintf(command_errbuf, sizeof(command_errbuf), + "don't know how to load module '%s'", filename); + } if (err && fp) file_discard(fp); free(filename); Modified: stable/11/sys/boot/common/ufsread.c ============================================================================== --- stable/11/sys/boot/common/ufsread.c Thu Feb 8 01:34:35 2018 (r329009) +++ stable/11/sys/boot/common/ufsread.c Thu Feb 8 02:44:21 2018 (r329010) @@ -97,21 +97,21 @@ static __inline uint8_t fsfind(const char *name, ufs_ino_t * ino) { static char buf[DEV_BSIZE]; - struct direct *d; + static struct direct d; char *s; ssize_t n; fs_off = 0; while ((n = fsread(*ino, buf, DEV_BSIZE)) > 0) for (s = buf; s < buf + DEV_BSIZE;) { - d = (void *)s; + memcpy(&d, s, sizeof(struct direct)); if (ls) - printf("%s ", d->d_name); - else if (!strcmp(name, d->d_name)) { - *ino = d->d_ino; - return d->d_type; + printf("%s ", d.d_name); + else if (!strcmp(name, d.d_name)) { + *ino = d.d_ino; + return d.d_type; } - s += d->d_reclen; + s += d.d_reclen; } if (n != -1 && ls) printf("\n"); Modified: stable/11/sys/boot/efi/boot1/boot1.c ============================================================================== --- stable/11/sys/boot/efi/boot1/boot1.c Thu Feb 8 01:34:35 2018 (r329009) +++ stable/11/sys/boot/efi/boot1/boot1.c Thu Feb 8 02:44:21 2018 (r329010) @@ -77,7 +77,8 @@ Malloc(size_t len, const char *file __unused, int line void Free(void *buf, const char *file __unused, int line __unused) { - (void)bs->FreePool(buf); + if (buf != NULL) + (void)bs->FreePool(buf); } /* Modified: stable/11/sys/boot/efi/libefi/efi_console.c ============================================================================== --- stable/11/sys/boot/efi/libefi/efi_console.c Thu Feb 8 01:34:35 2018 (r329009) +++ stable/11/sys/boot/efi/libefi/efi_console.c Thu Feb 8 02:44:21 2018 (r329010) @@ -51,6 +51,9 @@ void HO(void); void end_term(void); #endif +static EFI_INPUT_KEY key_cur; +static int key_pending; + static void efi_cons_probe(struct console *); static int efi_cons_init(int); void efi_cons_putchar(int); @@ -436,14 +439,20 @@ efi_cons_getchar() EFI_STATUS status; UINTN junk; - /* Try to read a key stroke. We wait for one if none is pending. */ - status = conin->ReadKeyStroke(conin, &key); - while (status == EFI_NOT_READY) { - /* Some EFI implementation (u-boot for example) do not support WaitForKey */ - if (conin->WaitForKey != NULL) - BS->WaitForEvent(1, &conin->WaitForKey, &junk); + if (key_pending) { + key = key_cur; + key_pending = 0; + } else { + /* Try to read a key stroke. We wait for one if none is pending. */ status = conin->ReadKeyStroke(conin, &key); + while (status == EFI_NOT_READY) { + /* Some EFI implementation (u-boot for example) do not support WaitForKey */ + if (conin->WaitForKey != NULL) + BS->WaitForEvent(1, &conin->WaitForKey, &junk); + status = conin->ReadKeyStroke(conin, &key); + } } + switch (key.ScanCode) { case 0x17: /* ESC */ return (0x1b); /* esc */ @@ -456,9 +465,20 @@ efi_cons_getchar() int efi_cons_poll() { + EFI_INPUT_KEY key; + EFI_STATUS status; - if (conin->WaitForKey == NULL) - return (1); + if (conin->WaitForKey == NULL) { + if (key_pending) + return (1); + status = conin->ReadKeyStroke(conin, &key); + if (status == EFI_SUCCESS) { + key_cur = key; + key_pending = 1; + } + return (key_pending); + } + /* This can clear the signaled state. */ return (BS->CheckEvent(conin->WaitForKey) == EFI_SUCCESS); } Modified: stable/11/sys/boot/efi/libefi/time.c ============================================================================== --- stable/11/sys/boot/efi/libefi/time.c Thu Feb 8 01:34:35 2018 (r329009) +++ stable/11/sys/boot/efi/libefi/time.c Thu Feb 8 02:44:21 2018 (r329010) @@ -228,7 +228,7 @@ time(time_t *tloc) } time_t -getsecs() +getsecs(void) { return time(0); } Modified: stable/11/sys/boot/efi/libefi/time_event.c ============================================================================== --- stable/11/sys/boot/efi/libefi/time_event.c Thu Feb 8 01:34:35 2018 (r329009) +++ stable/11/sys/boot/efi/libefi/time_event.c Thu Feb 8 02:44:21 2018 (r329010) @@ -76,7 +76,7 @@ time(time_t *tloc) } time_t -getsecs() +getsecs(void) { return time(0); } Modified: stable/11/sys/boot/efi/loader/arch/amd64/framebuffer.c ============================================================================== --- stable/11/sys/boot/efi/loader/arch/amd64/framebuffer.c Thu Feb 8 01:34:35 2018 (r329009) +++ stable/11/sys/boot/efi/loader/arch/amd64/framebuffer.c Thu Feb 8 02:44:21 2018 (r329010) @@ -474,8 +474,9 @@ command_gop(int argc, char *argv[]) status = BS->LocateProtocol(&gop_guid, NULL, (VOID **)&gop); if (EFI_ERROR(status)) { - sprintf(command_errbuf, "%s: Graphics Output Protocol not " - "present (error=%lu)", argv[0], EFI_ERROR_CODE(status)); + snprintf(command_errbuf, sizeof(command_errbuf), + "%s: Graphics Output Protocol not present (error=%lu)", + argv[0], EFI_ERROR_CODE(status)); return (CMD_ERROR); } @@ -494,9 +495,9 @@ command_gop(int argc, char *argv[]) } status = gop->SetMode(gop, mode); if (EFI_ERROR(status)) { - sprintf(command_errbuf, "%s: Unable to set mode to " - "%u (error=%lu)", argv[0], mode, - EFI_ERROR_CODE(status)); + snprintf(command_errbuf, sizeof(command_errbuf), + "%s: Unable to set mode to %u (error=%lu)", + argv[0], mode, EFI_ERROR_CODE(status)); return (CMD_ERROR); } } else if (!strcmp(argv[1], "get")) { @@ -526,8 +527,8 @@ command_gop(int argc, char *argv[]) return (CMD_OK); usage: - sprintf(command_errbuf, "usage: %s [list | get | set ]", - argv[0]); + snprintf(command_errbuf, sizeof(command_errbuf), + "usage: %s [list | get | set ]", argv[0]); return (CMD_ERROR); } @@ -542,8 +543,9 @@ command_uga(int argc, char *argv[]) status = BS->LocateProtocol(&uga_guid, NULL, (VOID **)&uga); if (EFI_ERROR(status)) { - sprintf(command_errbuf, "%s: UGA Protocol not present " - "(error=%lu)", argv[0], EFI_ERROR_CODE(status)); + snprintf(command_errbuf, sizeof(command_errbuf), + "%s: UGA Protocol not present (error=%lu)", + argv[0], EFI_ERROR_CODE(status)); return (CMD_ERROR); } @@ -551,8 +553,8 @@ command_uga(int argc, char *argv[]) goto usage; if (efifb_from_uga(&efifb, uga) != CMD_OK) { - sprintf(command_errbuf, "%s: Unable to get UGA information", - argv[0]); + snprintf(command_errbuf, sizeof(command_errbuf), + "%s: Unable to get UGA information", argv[0]); return (CMD_ERROR); } @@ -561,6 +563,6 @@ command_uga(int argc, char *argv[]) return (CMD_OK); usage: - sprintf(command_errbuf, "usage: %s", argv[0]); + snprintf(command_errbuf, sizeof(command_errbuf), "usage: %s", argv[0]); return (CMD_ERROR); } Modified: stable/11/sys/boot/efi/loader/main.c ============================================================================== --- stable/11/sys/boot/efi/loader/main.c Thu Feb 8 01:34:35 2018 (r329009) +++ stable/11/sys/boot/efi/loader/main.c Thu Feb 8 02:44:21 2018 (r329010) @@ -828,8 +828,10 @@ command_efi_show(int argc, char *argv[]) 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 *varname; + CHAR16 *newnm; CHAR16 varnamearg[128]; + UINTN varalloc; UINTN varsz; while ((ch = getopt(argc, argv, "ag:lv:")) != -1) { @@ -924,10 +926,33 @@ command_efi_show(int argc, char *argv[]) * to specify the initial call must be a poiner to a NULL * character. */ - varsz = nitems(varname); + varalloc = 1024; + varname = malloc(varalloc); + if (varname == NULL) { + printf("Can't allocate memory to get variables\n"); + pager_close(); + return (CMD_ERROR); + } varname[0] = 0; - while ((status = RS->GetNextVariableName(&varsz, varname, &varguid)) != - EFI_NOT_FOUND) { + while (1) { + varsz = varalloc; + status = RS->GetNextVariableName(&varsz, varname, &varguid); + if (status == EFI_BUFFER_TOO_SMALL) { + varalloc = varsz; + newnm = malloc(varalloc); + if (newnm == NULL) { + printf("Can't allocate memory to get variables\n"); + free(varname); + pager_close(); + return (CMD_ERROR); + } + memcpy(newnm, varname, varsz); + free(varname); + varname = newnm; + continue; /* Try again with bigger buffer */ + } + if (status != EFI_SUCCESS) + break; if (aflag) { if (efi_print_var(varname, &varguid, lflag) != CMD_OK) break; @@ -948,6 +973,7 @@ command_efi_show(int argc, char *argv[]) } } } + free(varname); pager_close(); return (CMD_OK); Modified: stable/11/sys/boot/fdt/fdt_loader_cmd.c ============================================================================== --- stable/11/sys/boot/fdt/fdt_loader_cmd.c Thu Feb 8 01:34:35 2018 (r329009) +++ stable/11/sys/boot/fdt/fdt_loader_cmd.c Thu Feb 8 02:44:21 2018 (r329010) @@ -195,14 +195,14 @@ fdt_load_dtb(vm_offset_t va) COPYOUT(va, &header, sizeof(header)); err = fdt_check_header(&header); if (err < 0) { - if (err == -FDT_ERR_BADVERSION) - sprintf(command_errbuf, + if (err == -FDT_ERR_BADVERSION) { + snprintf(command_errbuf, sizeof(command_errbuf), "incompatible blob version: %d, should be: %d", fdt_version(fdtp), FDT_LAST_SUPPORTED_VERSION); - - else - sprintf(command_errbuf, "error validating blob: %s", - fdt_strerror(err)); + } else { + snprintf(command_errbuf, sizeof(command_errbuf), + "error validating blob: %s", fdt_strerror(err)); + } return (1); } @@ -237,8 +237,8 @@ fdt_load_dtb_addr(struct fdt_header *header) fdtp_size = fdt_totalsize(header); err = fdt_check_header(header); if (err < 0) { - sprintf(command_errbuf, "error validating blob: %s", - fdt_strerror(err)); + snprintf(command_errbuf, sizeof(command_errbuf), + "error validating blob: %s", fdt_strerror(err)); return (err); } free(fdtp); @@ -264,7 +264,8 @@ fdt_load_dtb_file(const char * filename) /* Attempt to load and validate a new dtb from a file. */ if ((bfp = file_loadraw(filename, "dtb", 1)) == NULL) { - sprintf(command_errbuf, "failed to load file '%s'", filename); + snprintf(command_errbuf, sizeof(command_errbuf), + "failed to load file '%s'", filename); return (1); } if ((err = fdt_load_dtb(bfp->f_addr)) != 0) { @@ -659,7 +660,8 @@ fdt_fixup_memory(struct fdt_mem_region *region, size_t /* Create proper '/memory' node. */ memory = fdt_add_subnode(fdtp, root, "memory"); if (memory <= 0) { - sprintf(command_errbuf, "Could not fixup '/memory' " + snprintf(command_errbuf, sizeof(command_errbuf), + "Could not fixup '/memory' " "node, error code : %d!\n", memory); return; } @@ -676,7 +678,8 @@ fdt_fixup_memory(struct fdt_mem_region *region, size_t size_cellsp = (uint32_t *)fdt_getprop(fdtp, root, "#size-cells", NULL); if (addr_cellsp == NULL || size_cellsp == NULL) { - sprintf(command_errbuf, "Could not fixup '/memory' node : " + snprintf(command_errbuf, sizeof(command_errbuf), + "Could not fixup '/memory' node : " "%s %s property not found in root node!\n", (!addr_cellsp) ? "#address-cells" : "", (!size_cellsp) ? "#size-cells" : ""); @@ -975,7 +978,8 @@ fdt_cmd_addr(int argc, char *argv[]) hdr = (struct fdt_header *)strtoul(addr, &cp, 16); if (cp == addr) { - sprintf(command_errbuf, "Invalid address: %s", addr); + snprintf(command_errbuf, sizeof(command_errbuf), + "Invalid address: %s", addr); return (CMD_ERROR); } @@ -1014,7 +1018,8 @@ fdt_cmd_cd(int argc, char *argv[]) o = fdt_path_offset(fdtp, path); if (o < 0) { - sprintf(command_errbuf, "could not find node: '%s'", path); + snprintf(command_errbuf, sizeof(command_errbuf), + "could not find node: '%s'", path); return (CMD_ERROR); } @@ -1022,8 +1027,8 @@ fdt_cmd_cd(int argc, char *argv[]) return (CMD_OK); fail: - sprintf(command_errbuf, "path too long: %d, max allowed: %d", - len, FDT_CWD_LEN - 1); + snprintf(command_errbuf, sizeof(command_errbuf), + "path too long: %d, max allowed: %d", len, FDT_CWD_LEN - 1); return (CMD_ERROR); } @@ -1106,7 +1111,8 @@ fdt_cmd_ls(int argc, char *argv[]) o = fdt_path_offset(fdtp, path); if (o < 0) { - sprintf(command_errbuf, "could not find node: '%s'", path); + snprintf(command_errbuf, sizeof(command_errbuf), + "could not find node: '%s'", path); return (CMD_ERROR); } @@ -1552,7 +1558,8 @@ fdt_extract_nameloc(char **pathp, char **namep, int *n return (1); } if (o < 0) { - sprintf(command_errbuf, "could not find node: '%s'", path); + snprintf(command_errbuf, sizeof(command_errbuf), + "could not find node: '%s'", path); return (1); } *namep = name; @@ -1599,7 +1606,8 @@ fdt_cmd_prop(int argc, char *argv[]) o = fdt_path_offset(fdtp, path); if (o < 0) { - sprintf(command_errbuf, "could not find node: '%s'", path); + snprintf(command_errbuf, sizeof(command_errbuf), + "could not find node: '%s'", path); rv = CMD_ERROR; goto out; } @@ -1692,8 +1700,9 @@ fdt_cmd_rm(int argc, char *argv[]) return (CMD_ERROR); if ((rv = fdt_delprop(fdtp, o, propname)) != 0) { - sprintf(command_errbuf, "could not delete" - "%s\n", (rv == -FDT_ERR_NOTFOUND) ? + snprintf(command_errbuf, sizeof(command_errbuf), + "could not delete %s\n", + (rv == -FDT_ERR_NOTFOUND) ? "(property/node does not exist)" : ""); return (CMD_ERROR); Modified: stable/11/sys/boot/forth/loader.4th ============================================================================== --- stable/11/sys/boot/forth/loader.4th Thu Feb 8 01:34:35 2018 (r329009) +++ stable/11/sys/boot/forth/loader.4th Thu Feb 8 02:44:21 2018 (r329010) @@ -143,6 +143,8 @@ only forth definitions also support-functions s" /boot/defaults/loader.conf" initialize include_conf_files include_nextboot_file + \ If the user defined a post-initialize hook, call it now + s" post-initialize" sfind if execute else drop then \ Will *NOT* try to load kernel and modules if no configuration file \ was successfully loaded! any_conf_read? if @@ -165,12 +167,14 @@ only forth definitions also support-functions \ \ Overrides support.4th initialization word with one that does \ everything start one does, short of loading the kernel and -\ modules. Returns a flag +\ modules. Returns a flag. : initialize ( -- flag ) s" /boot/defaults/loader.conf" initialize include_conf_files include_nextboot_file + \ If the user defined a post-initialize hook, call it now + s" post-initialize" sfind if execute else drop then any_conf_read? ; Modified: stable/11/sys/boot/i386/Makefile.inc ============================================================================== --- stable/11/sys/boot/i386/Makefile.inc Thu Feb 8 01:34:35 2018 (r329009) +++ stable/11/sys/boot/i386/Makefile.inc Thu Feb 8 02:44:21 2018 (r329010) @@ -28,4 +28,9 @@ BTXLDR= ${BTXDIR}/btxldr/btxldr BTXKERN= ${BTXDIR}/btx/btx BTXCRT= ${BTXDIR}/lib/crt0.o +# compact binary with no padding between text, data, bss +LDSCRIPT= ${SRCTOP}/sys/boot/i386/boot.ldscript +LDFLAGS_BIN=-e start -Ttext ${ORG} -Wl,-T,${LDSCRIPT},-S,--oformat,binary +LD_FLAGS_BIN=-static -T ${LDSCRIPT} --gc-sections + .include "../Makefile.inc" Copied: stable/11/sys/boot/i386/boot.ldscript (from r305353, head/sys/boot/i386/boot.ldscript) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/boot/i386/boot.ldscript Thu Feb 8 02:44:21 2018 (r329010, copy of r305353, head/sys/boot/i386/boot.ldscript) @@ -0,0 +1,11 @@ +/* $FreeBSD$ */ +/* Merge text, data and bss together almost no padding */ +OUTPUT_FORMAT("elf32-i386-freebsd") +OUTPUT_ARCH(i386) +ENTRY(_start) +SECTIONS { + . = 0x08048000 + SIZEOF_HEADERS; + .text : { *(.text) } =0x90909090 /* Pad with nops, if needed */ + .data : { *(.data) } _edata = .; + .bss : { *(.bss) } _end = .; +} Modified: stable/11/sys/boot/i386/boot0/Makefile ============================================================================== --- stable/11/sys/boot/i386/boot0/Makefile Thu Feb 8 01:34:35 2018 (r329009) +++ stable/11/sys/boot/i386/boot0/Makefile Thu Feb 8 02:44:21 2018 (r329010) @@ -40,6 +40,7 @@ BOOT_BOOT0_TICKS?= 0xb6 # The base address that we the boot0 code to to run it. Don't change this # unless you are glutton for punishment. BOOT_BOOT0_ORG?= 0x600 +ORG=${BOOT_BOOT0_ORG} # Comm settings for boot0sio. # Bit(s) Description @@ -74,7 +75,7 @@ CFLAGS+=-DFLAGS=${BOOT_BOOT0_FLAGS} \ -DTICKS=${BOOT_BOOT0_TICKS} \ -DCOMSPEED=${BOOT_BOOT0_COMCONSOLE_SPEED} -LDFLAGS=-e start -Ttext ${BOOT_BOOT0_ORG} -Wl,-N,-S,--oformat,binary +LDFLAGS=${LDFLAGS_BIN} .include Modified: stable/11/sys/boot/i386/boot2/Makefile ============================================================================== --- stable/11/sys/boot/i386/boot2/Makefile Thu Feb 8 01:34:35 2018 (r329009) +++ stable/11/sys/boot/i386/boot2/Makefile Thu Feb 8 02:44:21 2018 (r329010) @@ -49,7 +49,7 @@ CFLAGS.gcc+= -mno-align-long-strings CFLAGS.clang+= -Oz ${CLANG_OPT_SMALL} -LD_FLAGS=-static -N --gc-sections +LD_FLAGS=${LD_FLAGS_BIN} # Pick up ../Makefile.inc early. .include Modified: stable/11/sys/boot/i386/btx/btx/Makefile ============================================================================== --- stable/11/sys/boot/i386/btx/btx/Makefile Thu Feb 8 01:34:35 2018 (r329009) +++ stable/11/sys/boot/i386/btx/btx/Makefile Thu Feb 8 02:44:21 2018 (r329010) @@ -25,7 +25,7 @@ CFLAGS+=-DBTX_SERIAL -DSIOPRT=${BOOT_COMCONSOLE_PORT} ORG= 0x9000 -LDFLAGS=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary +LDFLAGS=${LDFLAGS_BIN} .include Modified: stable/11/sys/boot/i386/btx/btxldr/Makefile ============================================================================== --- stable/11/sys/boot/i386/btx/btxldr/Makefile Thu Feb 8 01:34:35 2018 (r329009) +++ stable/11/sys/boot/i386/btx/btxldr/Makefile Thu Feb 8 02:44:21 2018 (r329010) @@ -12,7 +12,8 @@ CFLAGS+=-I${.CURDIR}/../../common CFLAGS+=-DBTXLDR_VERBOSE .endif -LDFLAGS=-e start -Ttext ${LOADER_ADDRESS} -Wl,-N,-S,--oformat,binary +ORG=${LOADER_ADDRESS} +LDFLAGS=${LDFLAGS_BIN} .include Modified: stable/11/sys/boot/i386/btx/btxldr/btxldr.S ============================================================================== --- stable/11/sys/boot/i386/btx/btxldr/btxldr.S Thu Feb 8 01:34:35 2018 (r329009) +++ stable/11/sys/boot/i386/btx/btxldr/btxldr.S Thu Feb 8 02:44:21 2018 (r329010) @@ -376,12 +376,12 @@ e_fmt: .asciz "Error: Client format not supported\n" #ifdef BTXLDR_VERBOSE m_mem: .asciz "Starting in protected mode (base mem=\0)\n" m_esp: .asciz "Arguments passed (esp=\0):\n" -m_args: .asciz"\n" +m_args: .asciz "\n" m_rel_bi: .asciz "Relocated bootinfo (size=48) to \0\n" m_rel_args: .asciz "Relocated arguments (size=18) to \0\n" m_rel_btx: .asciz "Relocated kernel (size=\0) to \0\n" Modified: stable/11/sys/boot/i386/cdboot/Makefile ============================================================================== --- stable/11/sys/boot/i386/cdboot/Makefile Thu Feb 8 01:34:35 2018 (r329009) +++ stable/11/sys/boot/i386/cdboot/Makefile Thu Feb 8 02:44:21 2018 (r329010) @@ -10,7 +10,7 @@ CFLAGS+=-I${.CURDIR}/../common ORG= 0x7c00 -LDFLAGS=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary +LDFLAGS=${LDFLAGS_BIN} .include Modified: stable/11/sys/boot/i386/gptboot/Makefile ============================================================================== --- stable/11/sys/boot/i386/gptboot/Makefile Thu Feb 8 01:34:35 2018 (r329009) +++ stable/11/sys/boot/i386/gptboot/Makefile Thu Feb 8 02:44:21 2018 (r329010) @@ -47,7 +47,7 @@ LIBGELIBOOT= ${.OBJDIR}/../../geli/libgeliboot.a OPENCRYPTO_XTS= xform_aes_xts.o .endif -LD_FLAGS=-static -N --gc-sections +LD_FLAGS=${LD_FLAGS_BIN} LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a Modified: stable/11/sys/boot/i386/gptzfsboot/Makefile ============================================================================== --- stable/11/sys/boot/i386/gptzfsboot/Makefile Thu Feb 8 01:34:35 2018 (r329009) +++ stable/11/sys/boot/i386/gptzfsboot/Makefile Thu Feb 8 02:44:21 2018 (r329010) @@ -56,7 +56,7 @@ OPENCRYPTO_XTS= xform_aes_xts.o CFLAGS.gcc+= --param max-inline-insns-single=100 -LD_FLAGS=-static -N --gc-sections +LD_FLAGS=${LD_FLAGS_BIN} LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a Modified: stable/11/sys/boot/i386/libi386/biosdisk.c ============================================================================== --- stable/11/sys/boot/i386/libi386/biosdisk.c Thu Feb 8 01:34:35 2018 (r329009) +++ stable/11/sys/boot/i386/libi386/biosdisk.c Thu Feb 8 02:44:21 2018 (r329010) @@ -244,6 +244,7 @@ static int bd_int13probe(struct bdinfo *bd) { struct edd_params params; + int ret = 1; /* assume success */ v86.ctl = V86_FLAGS; v86.addr = 0x13; @@ -251,11 +252,14 @@ bd_int13probe(struct bdinfo *bd) v86.edx = bd->bd_unit; v86int(); + /* Don't error out if we get bad sector number, try EDD as well */ if (V86_CY(v86.efl) || /* carry set */ - (v86.ecx & 0x3f) == 0 || /* absurd sector number */ (v86.edx & 0xff) <= (unsigned)(bd->bd_unit & 0x7f)) /* unit # bad */ return (0); /* skip device */ + if ((v86.ecx & 0x3f) == 0) /* absurd sector number */ + ret = 0; /* set error */ + /* Convert max cyl # -> # of cylinders */ bd->bd_cyl = ((v86.ecx & 0xc0) << 2) + ((v86.ecx & 0xff00) >> 8) + 1; /* Convert max head # -> # of heads */ @@ -280,7 +284,8 @@ bd_int13probe(struct bdinfo *bd) if (V86_CY(v86.efl) || /* carry set */ (v86.ebx & 0xffff) != 0xaa55 || /* signature */ (v86.ecx & EDD_INTERFACE_FIXED_DISK) == 0) - return (1); + return (ret); /* return code from int13 AH=08 */ + /* EDD supported */ bd->bd_flags |= BD_MODEEDD1; if ((v86.eax & 0xff00) >= 0x3000) @@ -295,12 +300,22 @@ bd_int13probe(struct bdinfo *bd) v86.esi = VTOPOFF(¶ms); v86int(); if (!V86_CY(v86.efl)) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Feb 8 03:22:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 165BBEF467C for ; Thu, 8 Feb 2018 03:22:08 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-lf0-f54.google.com (mail-lf0-f54.google.com [209.85.215.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 80CDC6FB1A for ; Thu, 8 Feb 2018 03:22:07 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-lf0-f54.google.com with SMTP id t139so4376983lff.0 for ; Wed, 07 Feb 2018 19:22:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:cc; bh=UeOgJeO1ZPsTb+ZhdbJcfsNdWmR5SmysfG0KahQE2mE=; b=mXMhAkVdccDP+SeMGjVQCIVqvYl7gQxqkj5PXz9ADD+w/1B+Y3G6uSV8PblE84tgO/ VksmY65rtfZX8eD10JBvTwHTThKKA6FlL9MlZts3+2k83YlOvxEIszrN5IHxATmgoRba qffPnG/pPD5NArXftqG3FCJZiOuB5+nWMVNbrbX1j4Rm1N4E5LBBT1vdGtfqMQfirGKY c+eOvesdZbAaI4kCNM+yEftZDhK1F2pZNUAXjxPjyJIcq+pBoHoGSDcfk55Fws+vCA3Y VqJ9nmZUPP3nRWUGz/h+x8UJS2AESuVa43xlJ5p87NvXj7g/cY2kUqm9VzSjy9I0NuC2 7W8A== X-Gm-Message-State: APf1xPC0mSjtJkx8VkjsAlWMVigw08mRGpuUrXVsZf5cpQT9kuyFHngc dQK3S+cLhEloZFWNlGh38v0Yi8S+ X-Google-Smtp-Source: AH8x225ljt4ac3VHWQ7mQAvnHOJ6PqoDWWyUj3OQnItWqHh1GFr0ognimhZdU7EqYVyVdojIbdI54g== X-Received: by 10.25.215.72 with SMTP id o69mr5673589lfg.103.1518059803599; Wed, 07 Feb 2018 19:16:43 -0800 (PST) Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com. [209.85.215.48]) by smtp.gmail.com with ESMTPSA id b13sm608650lfb.27.2018.02.07.19.16.43 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Feb 2018 19:16:43 -0800 (PST) Received: by mail-lf0-f48.google.com with SMTP id q17so4337661lfa.9 for ; Wed, 07 Feb 2018 19:16:43 -0800 (PST) X-Received: by 10.46.80.9 with SMTP id e9mt6531562ljb.61.1518059803046; Wed, 07 Feb 2018 19:16:43 -0800 (PST) MIME-Version: 1.0 Received: by 10.46.106.8 with HTTP; Wed, 7 Feb 2018 19:16:22 -0800 (PST) In-Reply-To: <201802080250.w182olh7097879@repo.freebsd.org> References: <201802080250.w182olh7097879@repo.freebsd.org> From: Kyle Evans Date: Wed, 7 Feb 2018 21:16:22 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r329011 - in stable/11: sys/boot sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/efi/loader/arch/amd64 sys/boot/efi/loader/arch/arm sys/boot/efi/loader/arch/arm64 sys/b... Cc: src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Feb 2018 03:22:08 -0000 On Wed, Feb 7, 2018 at 8:50 PM, Kyle Evans wrote: > Author: kevans > Date: Thu Feb 8 02:50:47 2018 > New Revision: 329011 > URL: https://svnweb.freebsd.org/changeset/base/329011 > > Log: > MFC r307322,r307323,r307324,r307326,r307327,r307338,r307879,r307908,r307911, > r307942,r307950,r307951,r307954,r307955,r308125,r308195,r308476,r308534, > r308535,r308776,r308843,r310236,r310726: Loader fixes, 2016q4 > > r307322: Remove /boot/boot.conf, deprecated for 16 years > > r307323: Remove fetching of pInterp. > > r307324: Create a new linker set, Xficl_compile_set which contains a list of > functions to call to register new forth words. > > r307326: In UEFI mode expose the SMBIOS anchor base address via kenv > > r307327: Update i386 build of loader.efi (but leave it disabled) so that we > at least build it now. > > r307338: Create a pcibios-version environment FORTH word. > > r307879: Preliminary support for EFI in boot loader. > > r307908: Fix the build on both arm64 and when WITHOUT_FORTH is defined. > > r307911: Add better comment... > > r307942: Really make WITHOUT_FORTH (MK_FORTH==no) work. > > r307950: Add it (Makefile.ficl) to the right place > > r307951: Fix two backwards tests. > > r307954: Back out the move to the loader script from -N. > > r307955: LIBSTAND goes last, so put it last here too. > > r308125: In loader.efi, instead of exiting directly, try to fallback. > > r308195: efinet_dev_print should honor verbose option. > > r308476: boot/forth spelling issue in forth word > > r308534: The file_loadraw function grew an argument, update install function > > r308535: Add support for LOADER_RC setting in the pkgfs manifes > > r308776: loader: zfs toplevel vdev must have spa set. > > r308843: loader: smbios version check is not correct > > r310236: Renumber license clauses to avoid skipping #3 > > r310726: cdboot: add explict suffix to ambiguous or instruction > > PR: 214375 > Just as an FYI- this is the format that I intend to do these MFC's of sys/boot work in. The intention is to batch these up by fiscal quarter while we're playing catch up since there are so many (450+) commits that need to make it back before we hit 2018Q1. I will be preparing batches and committing every couple of days, two batches at a time. Please do speak up before the next batches (likely to be committed in the Friday/Saturday time frame) if this format is particularly appalling. From owner-svn-src-all@freebsd.org Thu Feb 8 05:18:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFA09F03980; Thu, 8 Feb 2018 05:18:30 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8600A73773; Thu, 8 Feb 2018 05:18:30 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 810A01191D; Thu, 8 Feb 2018 05:18:30 +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 w185IUiw071677; Thu, 8 Feb 2018 05:18:30 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w185IUxl071676; Thu, 8 Feb 2018 05:18:30 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201802080518.w185IUxl071676@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 8 Feb 2018 05:18:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329013 - head/usr.bin/vmstat X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/usr.bin/vmstat X-SVN-Commit-Revision: 329013 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Feb 2018 05:18:31 -0000 Author: jhibbits Date: Thu Feb 8 05:18:30 2018 New Revision: 329013 URL: https://svnweb.freebsd.org/changeset/base/329013 Log: Temporarily widen count for interrupt rate calculations on 32-bit archs If the interrupt count is very high (greater than ~42M), notably on one-shot execution on long running systems, the intermediate multiplication step in the rate calculation will overflow the width of a 32-bit architecture long (32 bits), causing the rest of the calculation to calculate with a truncated value, and report very low rates (sometimes 0). MFC after: 2 weeks Modified: head/usr.bin/vmstat/vmstat.c Modified: head/usr.bin/vmstat/vmstat.c ============================================================================== --- head/usr.bin/vmstat/vmstat.c Thu Feb 8 03:12:25 2018 (r329012) +++ head/usr.bin/vmstat/vmstat.c Thu Feb 8 05:18:30 2018 (r329013) @@ -1304,7 +1304,7 @@ print_intrcnts(unsigned long *intrcnts, unsigned long for (i = 0, intrcnt=intrcnts, old_intrcnt=old_intrcnts; i < nintr; i++) { if (intrname[0] != '\0' && (*intrcnt != 0 || aflag)) { count = *intrcnt - *old_intrcnt; - rate = (count * 1000 + period_ms / 2) / period_ms; + rate = ((uint64_t)count * 1000 + period_ms / 2) / period_ms; xo_open_instance("interrupt"); xo_emit("{d:name/%-*s}{ket:name/%s} " "{:total/%20lu} {:rate/%10lu}\n", From owner-svn-src-all@freebsd.org Thu Feb 8 06:17:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A7BDF066CD for ; Thu, 8 Feb 2018 06:17:15 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x230.google.com (mail-it0-x230.google.com [IPv6:2607:f8b0:4001:c0b::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 9E5FE7550D for ; Thu, 8 Feb 2018 06:17:14 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x230.google.com with SMTP id b66so5291039itd.5 for ; Wed, 07 Feb 2018 22:17:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=rW4MdzbfNZJnEED8dTqBakCc/jPY74pEaBbqi3Diydw=; b=ZXpF77t5GwSLu6Me/nkJULo2xmaut5DqgMWRCsYzV0dL+Bk1rQfD6Cul69qI7QCuY+ TVb9pu0HVL/iE25H7fftcB8HrHl0hghB/Lw2bMnOl9sMauCSSapZFOTQEf7f1RbxdqeG sXAL59peB42dz2Xt4gDEzUfDNWI4/4Ig13hp88kWsKh7wt3SVUPKqnzBHZOMTJ/A21Y7 4dFfTgp6Q3XRNBTmZ0AdnnnHax/DcMRWt86S6M25ekCnilfAmfengT5NUOvMWB/mIDQE pL1TSXiJ02hFLzPSCvSPqAe68iHWEXT4nCxKuWDwHkbTo4EOhvWuNvuifWtmdlBW7wV8 a7nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=rW4MdzbfNZJnEED8dTqBakCc/jPY74pEaBbqi3Diydw=; b=JR2Ty+qi2cKJ58ioxXXX6CYlLLRkclqWn2kwD7WW6pkhTlnRRG1UP7RFkj9xazxlkz ifk0KtTXwb0lqWuS+qZYpAv8vZXpZrECHnpQbta4ycaW4w9MJBIu2s8liZEH0thK1s5c LN59jdfSnVUcLxs/745FKo7uczaGEkye2uy5Fa8sWAGU8OmE1aaecWwQUNmzEwf8E2Pv EqzPMZLfbCyG06hedqt89gjmfZoWNLQtG8aQAmLo4wwmK3Q6KqwqXZPbRTdw7c/oKThi RWT+EdsawZGmXhVmzYhtIrUJjt9zzxPVlWG84a8US13JZaB6ftm3+EiKczoKVC0wRE0r PORg== X-Gm-Message-State: APf1xPBYmnxK5YK8NfrRY0rH8gGXvO8n/BpFVypKZRmV22nICD3x/7nP 1g4GbQ5XirRLK5SjPsVaGGoSL2PUBsTfxUqE+pKw5g== X-Google-Smtp-Source: AH8x225XZGjzIGjKmUKCU2/BaVwnNAIKAgW/GI9HnnIDng/586Q/20fmvK9S1J+OE7GByQjPoMPJkZpsEMRxQuqXl4o= X-Received: by 10.36.250.193 with SMTP id v184mr10241ith.64.1518070633803; Wed, 07 Feb 2018 22:17:13 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Wed, 7 Feb 2018 22:17:12 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:c81d:c97b:c7cd:ac64] Received: by 10.79.201.67 with HTTP; Wed, 7 Feb 2018 22:17:12 -0800 (PST) In-Reply-To: References: <201802080250.w182olh7097879@repo.freebsd.org> From: Warner Losh Date: Wed, 7 Feb 2018 23:17:12 -0700 X-Google-Sender-Auth: wDZ5aO-NFtI1OUlHZqbWxAwVCbM Message-ID: Subject: Re: svn commit: r329011 - in stable/11: sys/boot sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/efi/loader/arch/amd64 sys/boot/efi/loader/arch/arm sys/boot/efi/loader/arch/arm64 sys/b... To: Kyle Evans Cc: src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Feb 2018 06:17:15 -0000 On Feb 7, 2018 8:23 PM, "Kyle Evans" wrote: On Wed, Feb 7, 2018 at 8:50 PM, Kyle Evans wrote: > Author: kevans > Date: Thu Feb 8 02:50:47 2018 > New Revision: 329011 > URL: https://svnweb.freebsd.org/changeset/base/329011 > > Log: > MFC r307322,r307323,r307324,r307326,r307327,r307338, r307879,r307908,r307911, > r307942,r307950,r307951,r307954,r307955,r308125,r308195,r308476,r308534, > r308535,r308776,r308843,r310236,r310726: Loader fixes, 2016q4 > > r307322: Remove /boot/boot.conf, deprecated for 16 years > > r307323: Remove fetching of pInterp. > > r307324: Create a new linker set, Xficl_compile_set which contains a list of > functions to call to register new forth words. > > r307326: In UEFI mode expose the SMBIOS anchor base address via kenv > > r307327: Update i386 build of loader.efi (but leave it disabled) so that we > at least build it now. > > r307338: Create a pcibios-version environment FORTH word. > > r307879: Preliminary support for EFI in boot loader. > > r307908: Fix the build on both arm64 and when WITHOUT_FORTH is defined. > > r307911: Add better comment... > > r307942: Really make WITHOUT_FORTH (MK_FORTH==no) work. > > r307950: Add it (Makefile.ficl) to the right place > > r307951: Fix two backwards tests. > > r307954: Back out the move to the loader script from -N. > > r307955: LIBSTAND goes last, so put it last here too. > > r308125: In loader.efi, instead of exiting directly, try to fallback. > > r308195: efinet_dev_print should honor verbose option. > > r308476: boot/forth spelling issue in forth word > > r308534: The file_loadraw function grew an argument, update install function > > r308535: Add support for LOADER_RC setting in the pkgfs manifes > > r308776: loader: zfs toplevel vdev must have spa set. > > r308843: loader: smbios version check is not correct > > r310236: Renumber license clauses to avoid skipping #3 > > r310726: cdboot: add explict suffix to ambiguous or instruction > > PR: 214375 > Just as an FYI- this is the format that I intend to do these MFC's of sys/boot work in. The intention is to batch these up by fiscal quarter while we're playing catch up since there are so many (450+) commits that need to make it back before we hit 2018Q1. I will be preparing batches and committing every couple of days, two batches at a time. Please do speak up before the next batches (likely to be committed in the Friday/Saturday time frame) if this format is particularly appalling. Thanks for tackling this. It means we might just have Lau as an option for the boot loader in 11.2. Warner From owner-svn-src-all@freebsd.org Thu Feb 8 07:02:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E68CF08659; Thu, 8 Feb 2018 07:02:39 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf0-f67.google.com (mail-lf0-f67.google.com [209.85.215.67]) (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 DDE5076D92; Thu, 8 Feb 2018 07:02:38 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf0-f67.google.com with SMTP id f137so4916475lfe.4; Wed, 07 Feb 2018 23:02:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=fE66gdnEto4YEQZDvxg/dWstwreQv9Kmtzo9FlPe9K4=; b=I1pBtbhhSGo12kQLqXL8zxZLiD/cXxPEcOy2XSpiB4SAWmrlcZxBK1aGBCOgKgS4ig MgFc+YNTRd0V3iU883IhJdCwPKX6dk45wIbHLHDQSJS6/1RB3TatHuE0hKnNf64g60mw y5EViprv+ZjhXmZ9jcHkbuOfQbUm0ptIbmr3XlRCNUXxUuIsirnRmsZUIOu/NRmdtAOT m7mtmjWEwaAvyYfWblXarLFwxO5s6XM2Xg0swktQg/8FpiFp8URvG4IrqhhFcwx5R1QP YwraQVydanCYWMN1EaUSd1+ZllCeKs1kIVCGWf8un2we6N2Ffb24W+rFbAWR+eNtIx1T HjlA== X-Gm-Message-State: APf1xPCNU7Te87p1g5k2WJPanw2EB6LZneW/WMYUmNhn4KFf22uvI0/f xI/ZtuP858s1scy2wwqJqCxPnZBO X-Google-Smtp-Source: AH8x226VS5iO8yClbUDh+lbQcUw55pBS2QtF0AtHUJ4zI9ykkf8ZbBiND3NHGV8uN+xRnuKFNUd9WA== X-Received: by 10.25.22.234 with SMTP id 103mr6339828lfw.70.1518071800190; Wed, 07 Feb 2018 22:36:40 -0800 (PST) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id a197sm685542lfe.88.2018.02.07.22.36.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Feb 2018 22:36:39 -0800 (PST) Subject: Re: svn commit: r328996 - head/sys/kern To: Steven Hartland , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201802072152.w17Lq0gd048728@repo.freebsd.org> <1076365a-db07-0b28-9f97-3a7cc2a73dd6@multiplay.co.uk> From: Andriy Gapon Message-ID: <4b73bfc1-9b08-11e6-85a6-2b8e4d689a81@FreeBSD.org> Date: Thu, 8 Feb 2018 08:36:38 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1076365a-db07-0b28-9f97-3a7cc2a73dd6@multiplay.co.uk> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Feb 2018 07:02:39 -0000 On 08/02/2018 00:41, Steven Hartland wrote: > What would be the expected behavior if this was triggered, app crash or kernel > panic...? To be honest, I haven't analyzed it much. I would expect either a crash when trying to unbusy a page that is not busy or hanging while forever waiting for a leaked page to get unbusied or hitting some KASSERT. > On 07/02/2018 21:52, Andriy Gapon wrote: >> Author: avg >> Date: Wed Feb 7 21:51:59 2018 >> New Revision: 328996 >> URL: https://svnweb.freebsd.org/changeset/base/328996 >> >> Log: >> exec_map_first_page: fix an inverse condition introduced in r254138 >> >> While the bug itself was serious, as we could either pass a non-busied >> page to vm_pager_get_pages() or leak a busy page, it could only be >> triggered under a very rare condition where the page is already inserted >> into the object, but it is not valid yet. >> >> Reviewed by: kib >> MFC after: 2 weeks >> >> Modified: >> head/sys/kern/kern_exec.c >> >> Modified: head/sys/kern/kern_exec.c >> ============================================================================== >> --- head/sys/kern/kern_exec.c Wed Feb 7 20:36:37 2018 (r328995) >> +++ head/sys/kern/kern_exec.c Wed Feb 7 21:51:59 2018 (r328996) >> @@ -1009,7 +1009,7 @@ exec_map_first_page(imgp) >> if ((ma[i] = vm_page_next(ma[i - 1])) != NULL) { >> if (ma[i]->valid) >> break; >> - if (vm_page_tryxbusy(ma[i])) >> + if (!vm_page_tryxbusy(ma[i])) >> break; >> } else { >> ma[i] = vm_page_alloc(object, i, >> > -- Andriy Gapon From owner-svn-src-all@freebsd.org Thu Feb 8 09:24:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85321F1245C; Thu, 8 Feb 2018 09:24:24 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 335C87CE33; Thu, 8 Feb 2018 09:24:24 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E2E4141BC; Thu, 8 Feb 2018 09:24:24 +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 w189OOVv095299; Thu, 8 Feb 2018 09:24:24 GMT (envelope-from rpokala@FreeBSD.org) Received: (from rpokala@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w189OOtd095298; Thu, 8 Feb 2018 09:24:24 GMT (envelope-from rpokala@FreeBSD.org) Message-Id: <201802080924.w189OOtd095298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpokala set sender to rpokala@FreeBSD.org using -f From: Ravi Pokala Date: Thu, 8 Feb 2018 09:24:24 +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: r329015 - stable/10/sys/dev/jedec_ts X-SVN-Group: stable-10 X-SVN-Commit-Author: rpokala X-SVN-Commit-Paths: stable/10/sys/dev/jedec_ts X-SVN-Commit-Revision: 329015 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Feb 2018 09:24:24 -0000 Author: rpokala Date: Thu Feb 8 09:24:23 2018 New Revision: 329015 URL: https://svnweb.freebsd.org/changeset/base/329015 Log: jedec_ts(4) uses a sysctl format specifier of "IK4", to indicate that it reports milliKelvin. However, sysctl(8) on stable/10 only knows about "IK", without a numeric suffix, which represents deciKelvin. Adjust the format specifier, and round the temperature value reported. Reviewed by: avg Sponsored by: Panasas Differential Revision: https://reviews.freebsd.org/D14055 Modified: stable/10/sys/dev/jedec_ts/jedec_ts.c Modified: stable/10/sys/dev/jedec_ts/jedec_ts.c ============================================================================== --- stable/10/sys/dev/jedec_ts/jedec_ts.c Thu Feb 8 07:52:30 2018 (r329014) +++ stable/10/sys/dev/jedec_ts/jedec_ts.c Thu Feb 8 09:24:23 2018 (r329015) @@ -192,6 +192,10 @@ ts_temp_sysctl(SYSCTL_HANDLER_ARGS) if ((val & 0x1000) != 0) temp = -temp; temp = temp * 625 + 2731500; + + /* sysctl(8) reports deciKelvin, so round accordingly. */ + temp = (temp + 500) / 1000; + err = sysctl_handle_int(oidp, &temp, 0, req); return (err); } @@ -245,7 +249,7 @@ ts_attach(device_t dev) tree = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "temp", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, dev, 0, - ts_temp_sysctl, "IK4", "Current temperature"); + ts_temp_sysctl, "IK", "Current temperature"); return (0); } From owner-svn-src-all@freebsd.org Thu Feb 8 09:32:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 324F0F1310A; Thu, 8 Feb 2018 09:32:41 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9AC5F7D7D4; Thu, 8 Feb 2018 09:32:39 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w189WSD0025126; Thu, 8 Feb 2018 01:32:28 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w189WMHZ025125; Thu, 8 Feb 2018 01:32:22 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201802080932.w189WMHZ025125@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r329011 - in stable/11: sys/boot sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/efi/loader/arch/amd64 sys/boot/efi/loader/arch/arm sys/boot/efi/loader/arch/arm64 sys/b... In-Reply-To: To: Kyle Evans Date: Thu, 8 Feb 2018 01:32:22 -0800 (PST) CC: src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Feb 2018 09:32:41 -0000 > On Wed, Feb 7, 2018 at 8:50 PM, Kyle Evans wrote: > > Author: kevans > > Date: Thu Feb 8 02:50:47 2018 > > New Revision: 329011 > > URL: https://svnweb.freebsd.org/changeset/base/329011 > > > > Log: Log: MFC Loader fixes, 2016q4: r307322,r307323,... This helps to see things easier in the websvn interface, otherwise your just seeing a long list not telling you much. > > MFC r307322,r307323,r307324,r307326,r307327,r307338,r307879,r307908,r307911, > > r307942,r307950,r307951,r307954,r307955,r308125,r308195,r308476,r308534, > > r308535,r308776,r308843,r310236,r310726: Loader fixes, 2016q4 > > > > r307322: Remove /boot/boot.conf, deprecated for 16 years ... > > Just as an FYI- this is the format that I intend to do these MFC's of > sys/boot work in. The intention is to batch these up by fiscal quarter > while we're playing catch up since there are so many (450+) commits > that need to make it back before we hit 2018Q1. I will be preparing > batches and committing every couple of days, two batches at a time. > Please do speak up before the next batches (likely to be committed in > the Friday/Saturday time frame) if this format is particularly > appalling. This format is particualarly pleasing from the apperance here in the email, though the slight change above would make it a bit easier to know what one is looking at in the svnweb interface. The very first line of a Log: is what one sees when walking down the hierarchy in svnweb. Go here to see a sample of why I would like to have you re-order the text: https://svnweb.freebsd.org/base/stable/11/sys/boot/efi/ Thanks, -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu Feb 8 13:22:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FDBFF035F2; Thu, 8 Feb 2018 13:22:41 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1440387D3D; Thu, 8 Feb 2018 13:22: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F021168EF; Thu, 8 Feb 2018 13:22: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 w18DMeWC017480; Thu, 8 Feb 2018 13:22:40 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w18DMeQt017479; Thu, 8 Feb 2018 13:22:40 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802081322.w18DMeQt017479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 8 Feb 2018 13:22:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329016 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 329016 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Feb 2018 13:22:41 -0000 Author: avg Date: Thu Feb 8 13:22:40 2018 New Revision: 329016 URL: https://svnweb.freebsd.org/changeset/base/329016 Log: remove a duplicate assignment There should be no functional change. MFC after: 1 week 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 Thu Feb 8 09:24:23 2018 (r329015) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Feb 8 13:22:40 2018 (r329016) @@ -4700,7 +4700,6 @@ zfs_putpages(struct vnode *vp, vm_page_t *ma, size_t l } if (zp->z_blksz < PAGE_SIZE) { - i = 0; for (i = 0; len > 0; off += tocopy, len -= tocopy, i++) { tocopy = len > PAGE_SIZE ? PAGE_SIZE : len; va = zfs_map_page(ma[i], &sf); From owner-svn-src-all@freebsd.org Thu Feb 8 13:56:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00370F05C49; Thu, 8 Feb 2018 13:56:55 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-lf0-f43.google.com (mail-lf0-f43.google.com [209.85.215.43]) (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 6568A692ED; Thu, 8 Feb 2018 13:56:55 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-lf0-f43.google.com with SMTP id o89so6506078lfg.10; Thu, 08 Feb 2018 05:56:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Ca0t/iVoRdrmEsBwkeQf6zY3enNr5wV0C581IJGktT0=; b=aUjsnbWABMz0Rk7Mo/zpmfNBlMH1iM/SauNJA2ZEc4noJ2/T/s5E9co5W6M87H4NgP XrsFilDzCJkUwWIo7A/9arrI6kbsvaqFRSqECWM4FDqMSrlbEOLdafNYUsdxjRy9sEDC 4QS9/9c3w0b/46fz7NXiGo5Qh7cHQ/mX7/Lr7AtjgZPNPOACpWnwyg7wqOcdumSPPBym admIgFBlHqf/3nlblHIn8OZWiUuV5d1F3GV6RTUJmTx+ZN32+U2x89jzWwf6M5le8ZpL skOmLohEbWbzACYSzQ/K+ZLBnbwZdkR1T+2Jrjdvr95p2IUSLph0btwyYxP403f15j3p wzAA== X-Gm-Message-State: APf1xPD/M8bCT+wzvTfohHsP78Iyj7TrWxCiVJEThuVH23nxj3mUQNRY KBmtnKMskY6YQNUt1uG4cBoYh1cY X-Google-Smtp-Source: AH8x2253BMda6QhmZaaNtKG6wQa64s6lvIYL+6eDzUW/hPg8IBC2AS6uSWcdkVjYgshMSZ2PVt8IHg== X-Received: by 10.25.205.148 with SMTP id d142mr602703lfg.9.1518098213424; Thu, 08 Feb 2018 05:56:53 -0800 (PST) Received: from mail-lf0-f49.google.com (mail-lf0-f49.google.com. [209.85.215.49]) by smtp.gmail.com with ESMTPSA id m18sm7421lfj.34.2018.02.08.05.56.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Feb 2018 05:56:53 -0800 (PST) Received: by mail-lf0-f49.google.com with SMTP id q194so6501374lfe.13; Thu, 08 Feb 2018 05:56:53 -0800 (PST) X-Received: by 10.46.23.215 with SMTP id 84mr558754ljx.29.1518098212867; Thu, 08 Feb 2018 05:56:52 -0800 (PST) MIME-Version: 1.0 Received: by 10.46.106.8 with HTTP; Thu, 8 Feb 2018 05:56:32 -0800 (PST) In-Reply-To: <201802080932.w189WMHZ025125@pdx.rh.CN85.dnsmgr.net> References: <201802080932.w189WMHZ025125@pdx.rh.CN85.dnsmgr.net> From: Kyle Evans Date: Thu, 8 Feb 2018 07:56:32 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r329011 - in stable/11: sys/boot sys/boot/common sys/boot/efi/libefi sys/boot/efi/loader sys/boot/efi/loader/arch/amd64 sys/boot/efi/loader/arch/arm sys/boot/efi/loader/arch/arm64 sys/b... To: rgrimes@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Feb 2018 13:56:56 -0000 On Thu, Feb 8, 2018 at 3:32 AM, Rodney W. Grimes wrote: >> On Wed, Feb 7, 2018 at 8:50 PM, Kyle Evans wrote: >> > Author: kevans >> > Date: Thu Feb 8 02:50:47 2018 >> > New Revision: 329011 >> > URL: https://svnweb.freebsd.org/changeset/base/329011 >> > >> > Log: > Log: > MFC Loader fixes, 2016q4: r307322,r307323,... > > This helps to see things easier in the websvn interface, otherwise > your just seeing a long list not telling you much. > > >> > MFC r307322,r307323,r307324,r307326,r307327,r307338,r307879,r307908,r307911, >> > r307942,r307950,r307951,r307954,r307955,r308125,r308195,r308476,r308534, >> > r308535,r308776,r308843,r310236,r310726: Loader fixes, 2016q4 >> > >> > r307322: Remove /boot/boot.conf, deprecated for 16 years > ... > >> >> Just as an FYI- this is the format that I intend to do these MFC's of >> sys/boot work in. The intention is to batch these up by fiscal quarter >> while we're playing catch up since there are so many (450+) commits >> that need to make it back before we hit 2018Q1. I will be preparing >> batches and committing every couple of days, two batches at a time. >> Please do speak up before the next batches (likely to be committed in >> the Friday/Saturday time frame) if this format is particularly >> appalling. > > This format is particualarly pleasing from the apperance here in the email, > though the slight change above would make it a bit easier to know what > one is looking at in the svnweb interface. > > The very first line of a Log: is what one sees when walking down the > hierarchy in svnweb. > > Go here to see a sample of why I would like to have you re-order the > text: > https://svnweb.freebsd.org/base/stable/11/sys/boot/efi/ > Right, I see what you mean- that's even more worthless than "Loader fixes, 2016q4" as far as context goes. I'll adjust future batch messages accordingly. Thanks! From owner-svn-src-all@freebsd.org Thu Feb 8 14:39:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19EB2F08E29; Thu, 8 Feb 2018 14:39:08 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BAF2D6AF05; Thu, 8 Feb 2018 14:39:07 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B5AED17444; Thu, 8 Feb 2018 14:39:07 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w18Ed7MC052551; Thu, 8 Feb 2018 14:39:07 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w18Ed7jO052547; Thu, 8 Feb 2018 14:39:07 GMT (envelope-from np@FreeBSD.org) Message-Id: <201802081439.w18Ed7jO052547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 8 Feb 2018 14:39:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329017 - stable/11/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe/iw_cxgbe X-SVN-Commit-Revision: 329017 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Feb 2018 14:39:08 -0000 Author: np Date: Thu Feb 8 14:39:07 2018 New Revision: 329017 URL: https://svnweb.freebsd.org/changeset/base/329017 Log: iw_cxgbe: Manually backport changes related to QP flush. This fixes a panic where poll_cq sees an empty RQ while processing an incoming SEND for a QP that is being taken down. This is a direct commit to stable/11. Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/cq.c stable/11/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h stable/11/sys/dev/cxgbe/iw_cxgbe/qp.c stable/11/sys/dev/cxgbe/iw_cxgbe/t4.h Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/cq.c ============================================================================== --- stable/11/sys/dev/cxgbe/iw_cxgbe/cq.c Thu Feb 8 13:22:40 2018 (r329016) +++ stable/11/sys/dev/cxgbe/iw_cxgbe/cq.c Thu Feb 8 14:39:07 2018 (r329017) @@ -245,137 +245,82 @@ static void insert_sq_cqe(struct t4_wq *wq, struct t4_ t4_swcq_produce(cq); } -int c4iw_flush_sq(struct t4_wq *wq, struct t4_cq *cq, int count) +static void advance_oldest_read(struct t4_wq *wq); + +int c4iw_flush_sq(struct c4iw_qp *qhp) { int flushed = 0; - struct t4_swsqe *swsqe = &wq->sq.sw_sq[wq->sq.cidx + count]; - int in_use = wq->sq.in_use - count; + struct t4_wq *wq = &qhp->wq; + struct c4iw_cq *chp = to_c4iw_cq(qhp->ibqp.send_cq); + struct t4_cq *cq = &chp->cq; + int idx; + struct t4_swsqe *swsqe; - BUG_ON(in_use < 0); - while (in_use--) { - swsqe->signaled = 0; + if (wq->sq.flush_cidx == -1) + wq->sq.flush_cidx = wq->sq.cidx; + idx = wq->sq.flush_cidx; + BUG_ON(idx >= wq->sq.size); + while (idx != wq->sq.pidx) { + swsqe = &wq->sq.sw_sq[idx]; + BUG_ON(swsqe->flushed); + swsqe->flushed = 1; insert_sq_cqe(wq, cq, swsqe); - swsqe++; - if (swsqe == (wq->sq.sw_sq + wq->sq.size)) - swsqe = wq->sq.sw_sq; + if (wq->sq.oldest_read == swsqe) { + BUG_ON(swsqe->opcode != FW_RI_READ_REQ); + advance_oldest_read(wq); + } flushed++; + if (++idx == wq->sq.size) + idx = 0; } + wq->sq.flush_cidx += flushed; + if (wq->sq.flush_cidx >= wq->sq.size) + wq->sq.flush_cidx -= wq->sq.size; return flushed; } -/* - * Move all CQEs from the HWCQ into the SWCQ. - */ -void c4iw_flush_hw_cq(struct t4_cq *cq) -{ - struct t4_cqe *cqe = NULL, *swcqe; - int ret; - - CTR3(KTR_IW_CXGBE, "%s cq %p cqid 0x%x", __func__, cq, cq->cqid); - ret = t4_next_hw_cqe(cq, &cqe); - while (!ret) { - CTR3(KTR_IW_CXGBE, "%s flushing hwcq cidx 0x%x swcq pidx 0x%x", - __func__, cq->cidx, cq->sw_pidx); - swcqe = &cq->sw_queue[cq->sw_pidx]; - *swcqe = *cqe; - swcqe->header |= cpu_to_be32(V_CQE_SWCQE(1)); - t4_swcq_produce(cq); - t4_hwcq_consume(cq); - ret = t4_next_hw_cqe(cq, &cqe); - } -} - -static int cqe_completes_wr(struct t4_cqe *cqe, struct t4_wq *wq) -{ - if (CQE_OPCODE(cqe) == FW_RI_TERMINATE) - return 0; - - if ((CQE_OPCODE(cqe) == FW_RI_RDMA_WRITE) && RQ_TYPE(cqe)) - return 0; - - if ((CQE_OPCODE(cqe) == FW_RI_READ_RESP) && SQ_TYPE(cqe)) - return 0; - - if (CQE_SEND_OPCODE(cqe) && RQ_TYPE(cqe) && t4_rq_empty(wq)) - return 0; - return 1; -} - -void c4iw_count_scqes(struct t4_cq *cq, struct t4_wq *wq, int *count) -{ - struct t4_cqe *cqe; - u32 ptr; - - *count = 0; - ptr = cq->sw_cidx; - while (ptr != cq->sw_pidx) { - cqe = &cq->sw_queue[ptr]; - if ((SQ_TYPE(cqe) || ((CQE_OPCODE(cqe) == FW_RI_READ_RESP) && - wq->sq.oldest_read)) && - (CQE_QPID(cqe) == wq->sq.qid)) - (*count)++; - if (++ptr == cq->size) - ptr = 0; - } - CTR3(KTR_IW_CXGBE, "%s cq %p count %d", __func__, cq, *count); -} - -void c4iw_count_rcqes(struct t4_cq *cq, struct t4_wq *wq, int *count) -{ - struct t4_cqe *cqe; - u32 ptr; - - *count = 0; - CTR2(KTR_IW_CXGBE, "%s count zero %d", __func__, *count); - ptr = cq->sw_cidx; - while (ptr != cq->sw_pidx) { - cqe = &cq->sw_queue[ptr]; - if (RQ_TYPE(cqe) && (CQE_OPCODE(cqe) != FW_RI_READ_RESP) && - (CQE_QPID(cqe) == wq->sq.qid) && cqe_completes_wr(cqe, wq)) - (*count)++; - if (++ptr == cq->size) - ptr = 0; - } - CTR3(KTR_IW_CXGBE, "%s cq %p count %d", __func__, cq, *count); -} - static void flush_completed_wrs(struct t4_wq *wq, struct t4_cq *cq) { struct t4_swsqe *swsqe; - u16 ptr = wq->sq.cidx; - int count = wq->sq.in_use; - int unsignaled = 0; + int cidx; - swsqe = &wq->sq.sw_sq[ptr]; - while (count--) + if (wq->sq.flush_cidx == -1) + wq->sq.flush_cidx = wq->sq.cidx; + cidx = wq->sq.flush_cidx; + BUG_ON(cidx > wq->sq.size); + + while (cidx != wq->sq.pidx) { + swsqe = &wq->sq.sw_sq[cidx]; if (!swsqe->signaled) { - if (++ptr == wq->sq.size) - ptr = 0; - swsqe = &wq->sq.sw_sq[ptr]; - unsignaled++; + if (++cidx == wq->sq.size) + cidx = 0; } else if (swsqe->complete) { + BUG_ON(swsqe->flushed); + /* * Insert this completed cqe into the swcq. */ CTR3(KTR_IW_CXGBE, - "%s moving cqe into swcq sq idx %u cq idx %u", - __func__, ptr, cq->sw_pidx); + "%s moving cqe into swcq sq idx %u cq idx %u\n", + __func__, cidx, cq->sw_pidx); swsqe->cqe.header |= htonl(V_CQE_SWCQE(1)); cq->sw_queue[cq->sw_pidx] = swsqe->cqe; t4_swcq_produce(cq); - swsqe->signaled = 0; - wq->sq.in_use -= unsignaled; - break; + swsqe->flushed = 1; + if (++cidx == wq->sq.size) + cidx = 0; + wq->sq.flush_cidx = cidx; } else break; + } } static void create_read_req_cqe(struct t4_wq *wq, struct t4_cqe *hw_cqe, struct t4_cqe *read_cqe) { read_cqe->u.scqe.cidx = wq->sq.oldest_read->idx; - read_cqe->len = cpu_to_be32(wq->sq.oldest_read->read_len); + read_cqe->len = htonl(wq->sq.oldest_read->read_len); read_cqe->header = htonl(V_CQE_QPID(CQE_QPID(hw_cqe)) | V_CQE_SWCQE(SW_CQE(hw_cqe)) | V_CQE_OPCODE(FW_RI_READ_REQ) | @@ -383,9 +328,6 @@ static void create_read_req_cqe(struct t4_wq *wq, stru read_cqe->bits_type_ts = hw_cqe->bits_type_ts; } -/* - * Return a ptr to the next read wr in the SWSQ or NULL. - */ static void advance_oldest_read(struct t4_wq *wq) { @@ -405,6 +347,128 @@ static void advance_oldest_read(struct t4_wq *wq) } /* + * Move all CQEs from the HWCQ into the SWCQ. + * Deal with out-of-order and/or completions that complete + * prior unsignalled WRs. + */ +void c4iw_flush_hw_cq(struct c4iw_cq *chp) +{ + struct t4_cqe *hw_cqe, *swcqe, read_cqe; + struct c4iw_qp *qhp; + struct t4_swsqe *swsqe; + int ret; + + CTR3(KTR_IW_CXGBE, "%s c4iw_cq %p cqid 0x%x", __func__, chp, + chp->cq.cqid); + ret = t4_next_hw_cqe(&chp->cq, &hw_cqe); + + /* + * This logic is similar to poll_cq(), but not quite the same + * unfortunately. Need to move pertinent HW CQEs to the SW CQ but + * also do any translation magic that poll_cq() normally does. + */ + while (!ret) { + qhp = get_qhp(chp->rhp, CQE_QPID(hw_cqe)); + + /* + * drop CQEs with no associated QP + */ + if (qhp == NULL) + goto next_cqe; + + if (CQE_OPCODE(hw_cqe) == FW_RI_TERMINATE) + goto next_cqe; + + if (CQE_OPCODE(hw_cqe) == FW_RI_READ_RESP) { + + /* + * If we have reached here because of async + * event or other error, and have egress error + * then drop + */ + if (CQE_TYPE(hw_cqe) == 1) { + goto next_cqe; + } + + /* + * drop peer2peer RTR reads. + */ + if (CQE_WRID_STAG(hw_cqe) == 1) + goto next_cqe; + + /* + * Eat completions for unsignaled read WRs. + */ + if (!qhp->wq.sq.oldest_read->signaled) { + advance_oldest_read(&qhp->wq); + goto next_cqe; + } + + /* + * Don't write to the HWCQ, create a new read req CQE + * in local memory and move it into the swcq. + */ + create_read_req_cqe(&qhp->wq, hw_cqe, &read_cqe); + hw_cqe = &read_cqe; + advance_oldest_read(&qhp->wq); + } + + /* if its a SQ completion, then do the magic to move all the + * unsignaled and now in-order completions into the swcq. + */ + if (SQ_TYPE(hw_cqe)) { + swsqe = &qhp->wq.sq.sw_sq[CQE_WRID_SQ_IDX(hw_cqe)]; + swsqe->cqe = *hw_cqe; + swsqe->complete = 1; + flush_completed_wrs(&qhp->wq, &chp->cq); + } else { + swcqe = &chp->cq.sw_queue[chp->cq.sw_pidx]; + *swcqe = *hw_cqe; + swcqe->header |= cpu_to_be32(V_CQE_SWCQE(1)); + t4_swcq_produce(&chp->cq); + } +next_cqe: + t4_hwcq_consume(&chp->cq); + ret = t4_next_hw_cqe(&chp->cq, &hw_cqe); + } +} + +static int cqe_completes_wr(struct t4_cqe *cqe, struct t4_wq *wq) +{ + if (CQE_OPCODE(cqe) == FW_RI_TERMINATE) + return 0; + + if ((CQE_OPCODE(cqe) == FW_RI_RDMA_WRITE) && RQ_TYPE(cqe)) + return 0; + + if ((CQE_OPCODE(cqe) == FW_RI_READ_RESP) && SQ_TYPE(cqe)) + return 0; + + if (CQE_SEND_OPCODE(cqe) && RQ_TYPE(cqe) && t4_rq_empty(wq)) + return 0; + return 1; +} + +void c4iw_count_rcqes(struct t4_cq *cq, struct t4_wq *wq, int *count) +{ + struct t4_cqe *cqe; + u32 ptr; + + *count = 0; + CTR2(KTR_IW_CXGBE, "%s count zero %d", __func__, *count); + ptr = cq->sw_cidx; + while (ptr != cq->sw_pidx) { + cqe = &cq->sw_queue[ptr]; + if (RQ_TYPE(cqe) && (CQE_OPCODE(cqe) != FW_RI_READ_RESP) && + (CQE_QPID(cqe) == wq->sq.qid) && cqe_completes_wr(cqe, wq)) + (*count)++; + if (++ptr == cq->size) + ptr = 0; + } + CTR3(KTR_IW_CXGBE, "%s cq %p count %d", __func__, cq, *count); +} + +/* * poll_cq * * Caller must: @@ -450,6 +514,22 @@ static int poll_cq(struct t4_wq *wq, struct t4_cq *cq, } /* + * skip hw cqe's if the wq is flushed. + */ + if (wq->flushed && !SW_CQE(hw_cqe)) { + ret = -EAGAIN; + goto skip_cqe; + } + + /* + * skip TERMINATE cqes... + */ + if (CQE_OPCODE(hw_cqe) == FW_RI_TERMINATE) { + ret = -EAGAIN; + goto skip_cqe; + } + + /* * Special cqe for drain WR completions... */ if (CQE_OPCODE(hw_cqe) == C4IW_DRAIN_OPCODE) { @@ -467,12 +547,22 @@ static int poll_cq(struct t4_wq *wq, struct t4_cq *cq, */ if (RQ_TYPE(hw_cqe) && (CQE_OPCODE(hw_cqe) == FW_RI_READ_RESP)) { - /* - * If this is an unsolicited read response, then the read + /* If we have reached here because of async + * event or other error, and have egress error + * then drop + */ + if (CQE_TYPE(hw_cqe) == 1) { + if (CQE_STATUS(hw_cqe)) + t4_set_wq_in_error(wq); + ret = -EAGAIN; + goto skip_cqe; + } + + /* If this is an unsolicited read response, then the read * was generated by the kernel driver as part of peer-2-peer * connection setup. So ignore the completion. */ - if (!wq->sq.oldest_read) { + if (CQE_WRID_STAG(hw_cqe) == 1) { if (CQE_STATUS(hw_cqe)) t4_set_wq_in_error(wq); ret = -EAGAIN; @@ -480,6 +570,15 @@ static int poll_cq(struct t4_wq *wq, struct t4_cq *cq, } /* + * Eat completions for unsignaled read WRs. + */ + if (!wq->sq.oldest_read->signaled) { + advance_oldest_read(wq); + ret = -EAGAIN; + goto skip_cqe; + } + + /* * Don't write to the HWCQ, so create a new read req CQE * in local memory. */ @@ -489,16 +588,10 @@ static int poll_cq(struct t4_wq *wq, struct t4_cq *cq, } if (CQE_STATUS(hw_cqe) || t4_wq_in_error(wq)) { - *cqe_flushed = t4_wq_in_error(wq); + *cqe_flushed = (CQE_STATUS(hw_cqe) == T4_ERR_SWFLUSH); t4_set_wq_in_error(wq); - goto proc_cqe; } - if (CQE_OPCODE(hw_cqe) == FW_RI_TERMINATE) { - ret = -EAGAIN; - goto skip_cqe; - } - /* * RECV completion. */ @@ -510,12 +603,7 @@ static int poll_cq(struct t4_wq *wq, struct t4_cq *cq, * then we complete this with T4_ERR_MSN and mark the wq in * error. */ - - if (t4_rq_empty(wq)) { - t4_set_wq_in_error(wq); - ret = -EAGAIN; - goto skip_cqe; - } + BUG_ON(t4_rq_empty(wq)); if (unlikely((CQE_WRID_MSN(hw_cqe) != (wq->rq.msn)))) { t4_set_wq_in_error(wq); hw_cqe->header |= htonl(V_CQE_STATUS(T4_ERR_MSN)); @@ -556,9 +644,26 @@ proc_cqe: * completion. */ if (SQ_TYPE(hw_cqe)) { - wq->sq.cidx = CQE_WRID_SQ_IDX(hw_cqe); - CTR2(KTR_IW_CXGBE, "%s completing sq idx %u", - __func__, wq->sq.cidx); + int idx = CQE_WRID_SQ_IDX(hw_cqe); + BUG_ON(idx >= wq->sq.size); + + /* + * Account for any unsignaled completions completed by + * this signaled completion. In this case, cidx points + * to the first unsignaled one, and idx points to the + * signaled one. So adjust in_use based on this delta. + * if this is not completing any unsigned wrs, then the + * delta will be 0. Handle wrapping also! + */ + if (idx < wq->sq.cidx) + wq->sq.in_use -= wq->sq.size + idx - wq->sq.cidx; + else + wq->sq.in_use -= idx - wq->sq.cidx; + BUG_ON(wq->sq.in_use <= 0 || wq->sq.in_use >= wq->sq.size); + + wq->sq.cidx = (uint16_t)idx; + CTR2(KTR_IW_CXGBE, "%s completing sq idx %u\n", + __func__, wq->sq.cidx); *cookie = wq->sq.sw_sq[wq->sq.cidx].wr_id; t4_sq_consume(wq); } else { @@ -567,6 +672,7 @@ proc_cqe: *cookie = wq->rq.sw_rq[wq->rq.cidx].wr_id; BUG_ON(t4_rq_empty(wq)); t4_rq_consume(wq); + goto skip_cqe; } flush_wq: Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h ============================================================================== --- stable/11/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Thu Feb 8 13:22:40 2018 (r329016) +++ stable/11/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Thu Feb 8 14:39:07 2018 (r329017) @@ -926,12 +926,11 @@ void c4iw_rqtpool_free(struct c4iw_rdev *rdev, u32 add u32 c4iw_pblpool_alloc(struct c4iw_rdev *rdev, int size); void c4iw_pblpool_free(struct c4iw_rdev *rdev, u32 addr, int size); int c4iw_ofld_send(struct c4iw_rdev *rdev, struct mbuf *m); -void c4iw_flush_hw_cq(struct t4_cq *cq); +void c4iw_flush_hw_cq(struct c4iw_cq *chp); void c4iw_count_rcqes(struct t4_cq *cq, struct t4_wq *wq, int *count); -void c4iw_count_scqes(struct t4_cq *cq, struct t4_wq *wq, int *count); int c4iw_ep_disconnect(struct c4iw_ep *ep, int abrupt, gfp_t gfp); int c4iw_flush_rq(struct t4_wq *wq, struct t4_cq *cq, int count); -int c4iw_flush_sq(struct t4_wq *wq, struct t4_cq *cq, int count); +int c4iw_flush_sq(struct c4iw_qp *qhp); int c4iw_ev_handler(struct sge_iq *, const struct rsp_ctrl *); u16 c4iw_rqes_posted(struct c4iw_qp *qhp); int c4iw_post_terminate(struct c4iw_qp *qhp, struct t4_cqe *err_cqe); Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/qp.c ============================================================================== --- stable/11/sys/dev/cxgbe/iw_cxgbe/qp.c Thu Feb 8 13:22:40 2018 (r329016) +++ stable/11/sys/dev/cxgbe/iw_cxgbe/qp.c Thu Feb 8 14:39:07 2018 (r329017) @@ -734,6 +734,7 @@ int c4iw_post_send(struct ib_qp *ibqp, struct ib_send_ swsqe->complete = 0; swsqe->signaled = (wr->send_flags & IB_SEND_SIGNALED) || qhp->sq_sig_all; + swsqe->flushed = 0; swsqe->wr_id = wr->wr_id; init_wr_hdr(wqe, qhp->wq.sq.pidx, fw_opcode, fw_flags, len16); @@ -1010,10 +1011,18 @@ static void __flush_qp(struct c4iw_qp *qhp, struct c4i CTR4(KTR_IW_CXGBE, "%s qhp %p rchp %p schp %p", __func__, qhp, rchp, schp); - /* locking hierarchy: cq lock first, then qp lock. */ + /* locking heirarchy: cq lock first, then qp lock. */ spin_lock_irqsave(&rchp->lock, flag); spin_lock(&qhp->lock); - c4iw_flush_hw_cq(&rchp->cq); + + if (qhp->wq.flushed) { + spin_unlock(&qhp->lock); + spin_unlock_irqrestore(&rchp->lock, flag); + return; + } + qhp->wq.flushed = 1; + + c4iw_flush_hw_cq(rchp); c4iw_count_rcqes(&rchp->cq, &qhp->wq, &count); flushed = c4iw_flush_rq(&qhp->wq, &rchp->cq, count); spin_unlock(&qhp->lock); @@ -1024,12 +1033,11 @@ static void __flush_qp(struct c4iw_qp *qhp, struct c4i spin_unlock_irqrestore(&rchp->comp_handler_lock, flag); } - /* locking hierarchy: cq lock first, then qp lock. */ + /* locking heirarchy: cq lock first, then qp lock. */ spin_lock_irqsave(&schp->lock, flag); spin_lock(&qhp->lock); - c4iw_flush_hw_cq(&schp->cq); - c4iw_count_scqes(&schp->cq, &qhp->wq, &count); - flushed = c4iw_flush_sq(&qhp->wq, &schp->cq, count); + c4iw_flush_hw_cq(schp); + flushed = c4iw_flush_sq(qhp); spin_unlock(&qhp->lock); spin_unlock_irqrestore(&schp->lock, flag); if (flushed && schp->ibcq.comp_handler) { @@ -1047,8 +1055,8 @@ static void flush_qp(struct c4iw_qp *qhp) rchp = get_chp(qhp->rhp, qhp->attr.rcq); schp = get_chp(qhp->rhp, qhp->attr.scq); + t4_set_wq_in_error(&qhp->wq); if (qhp->ibqp.uobject) { - t4_set_wq_in_error(&qhp->wq); t4_set_cq_in_error(&rchp->cq); spin_lock_irqsave(&rchp->comp_handler_lock, flag); (*rchp->ibcq.comp_handler)(&rchp->ibcq, rchp->ibcq.cq_context); @@ -1339,6 +1347,7 @@ int c4iw_modify_qp(struct c4iw_dev *rhp, struct c4iw_q switch (attrs->next_state) { case C4IW_QP_STATE_CLOSING: BUG_ON(atomic_read(&qhp->ep->com.kref.refcount) < 2); + t4_set_wq_in_error(&qhp->wq); set_state(qhp, C4IW_QP_STATE_CLOSING); ep = qhp->ep; if (!internal) { @@ -1346,18 +1355,15 @@ int c4iw_modify_qp(struct c4iw_dev *rhp, struct c4iw_q disconnect = 1; c4iw_get_ep(&qhp->ep->com); } - if (qhp->ibqp.uobject) - t4_set_wq_in_error(&qhp->wq); ret = rdma_fini(rhp, qhp, ep); if (ret) goto err; break; case C4IW_QP_STATE_TERMINATE: + t4_set_wq_in_error(&qhp->wq); set_state(qhp, C4IW_QP_STATE_TERMINATE); qhp->attr.layer_etype = attrs->layer_etype; qhp->attr.ecode = attrs->ecode; - if (qhp->ibqp.uobject) - t4_set_wq_in_error(&qhp->wq); ep = qhp->ep; if (!internal) terminate = 1; @@ -1365,9 +1371,8 @@ int c4iw_modify_qp(struct c4iw_dev *rhp, struct c4iw_q c4iw_get_ep(&qhp->ep->com); break; case C4IW_QP_STATE_ERROR: + t4_set_wq_in_error(&qhp->wq); set_state(qhp, C4IW_QP_STATE_ERROR); - if (qhp->ibqp.uobject) - t4_set_wq_in_error(&qhp->wq); if (!internal) { abort = 1; disconnect = 1; @@ -1558,6 +1563,7 @@ c4iw_create_qp(struct ib_pd *pd, struct ib_qp_init_att qhp->wq.sq.size = sqsize; qhp->wq.sq.memsize = (sqsize + spg_ndesc) * sizeof *qhp->wq.sq.queue + 16 * sizeof(__be64); + qhp->wq.sq.flush_cidx = -1; qhp->wq.rq.size = rqsize; qhp->wq.rq.memsize = (rqsize + spg_ndesc) * sizeof *qhp->wq.rq.queue; Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/t4.h ============================================================================== --- stable/11/sys/dev/cxgbe/iw_cxgbe/t4.h Thu Feb 8 13:22:40 2018 (r329016) +++ stable/11/sys/dev/cxgbe/iw_cxgbe/t4.h Thu Feb 8 14:39:07 2018 (r329017) @@ -289,6 +289,7 @@ struct t4_swsqe { int complete; int signaled; u16 idx; + int flushed; }; struct t4_sq { @@ -307,6 +308,7 @@ struct t4_sq { u16 pidx; u16 wq_pidx; u16 flags; + short flush_cidx; }; struct t4_swrqe { @@ -337,6 +339,7 @@ struct t4_wq { void __iomem *db; void __iomem *gts; struct c4iw_rdev *rdev; + int flushed; }; static inline int t4_rqes_posted(struct t4_wq *wq) @@ -414,6 +417,9 @@ static inline void t4_sq_produce(struct t4_wq *wq, u8 static inline void t4_sq_consume(struct t4_wq *wq) { + BUG_ON(wq->sq.in_use < 1); + if (wq->sq.cidx == wq->sq.flush_cidx) + wq->sq.flush_cidx = -1; wq->sq.in_use--; if (++wq->sq.cidx == wq->sq.size) wq->sq.cidx = 0; @@ -492,12 +498,14 @@ static inline int t4_arm_cq(struct t4_cq *cq, int se) static inline void t4_swcq_produce(struct t4_cq *cq) { cq->sw_in_use++; + BUG_ON(cq->sw_in_use >= cq->size); if (++cq->sw_pidx == cq->size) cq->sw_pidx = 0; } static inline void t4_swcq_consume(struct t4_cq *cq) { + BUG_ON(cq->sw_in_use < 1); cq->sw_in_use--; if (++cq->sw_cidx == cq->size) cq->sw_cidx = 0; @@ -540,6 +548,7 @@ static inline int t4_next_hw_cqe(struct t4_cq *cq, str cq->error = 1; printk(KERN_ERR MOD "cq overflow cqid %u\n", cq->cqid); } else if (t4_valid_cqe(cq, &cq->queue[cq->cidx])) { + rmb(); *cqe = &cq->queue[cq->cidx]; ret = 0; } else From owner-svn-src-all@freebsd.org Thu Feb 8 14:53:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D1CCF09FAC; Thu, 8 Feb 2018 14:53:35 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F76D6BBAE; Thu, 8 Feb 2018 14:53: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A6E617798; Thu, 8 Feb 2018 14:53: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 w18ErY4m062230; Thu, 8 Feb 2018 14:53:34 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w18ErYam062228; Thu, 8 Feb 2018 14:53:34 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201802081453.w18ErYam062228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 8 Feb 2018 14:53:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329018 - in head: lib/libc/rpc usr.sbin/ypserv X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: in head: lib/libc/rpc usr.sbin/ypserv X-SVN-Commit-Revision: 329018 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Feb 2018 14:53:35 -0000 Author: pfg Date: Thu Feb 8 14:53:34 2018 New Revision: 329018 URL: https://svnweb.freebsd.org/changeset/base/329018 Log: su_data: correct macro expansion. Protect su_data() users from strange macro expansion. Obtained from: linux libtirpc Modified: head/lib/libc/rpc/svc_dg.c head/usr.sbin/ypserv/yp_svc_udp.c Modified: head/lib/libc/rpc/svc_dg.c ============================================================================== --- head/lib/libc/rpc/svc_dg.c Thu Feb 8 14:39:07 2018 (r329017) +++ head/lib/libc/rpc/svc_dg.c Thu Feb 8 14:53:34 2018 (r329018) @@ -68,7 +68,7 @@ __FBSDID("$FreeBSD$"); #include "rpc_com.h" #include "mt_misc.h" -#define su_data(xprt) ((struct svc_dg_data *)(xprt->xp_p2)) +#define su_data(xprt) ((struct svc_dg_data *)((xprt)->xp_p2)) #define rpc_buffer(xprt) ((xprt)->xp_p1) #ifndef MAX Modified: head/usr.sbin/ypserv/yp_svc_udp.c ============================================================================== --- head/usr.sbin/ypserv/yp_svc_udp.c Thu Feb 8 14:39:07 2018 (r329017) +++ head/usr.sbin/ypserv/yp_svc_udp.c Thu Feb 8 14:53:34 2018 (r329018) @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include "yp_extern.h" -#define su_data(xprt) ((struct svc_dg_data *)(xprt->xp_p2)) +#define su_data(xprt) ((struct svc_dg_data *)((xprt)->xp_p2)) /* * We need to be able to manually set the transaction ID in the From owner-svn-src-all@freebsd.org Thu Feb 8 16:07:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51525F0F676; Thu, 8 Feb 2018 16:07:03 +0000 (UTC) (envelope-from royger@gmail.com) Received: from mail-wm0-x22f.google.com (mail-wm0-x22f.google.com [IPv6:2a00:1450:400c:c09::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 A9DFF6EC78; Thu, 8 Feb 2018 16:07:02 +0000 (UTC) (envelope-from royger@gmail.com) Received: by mail-wm0-x22f.google.com with SMTP id v123so10955078wmd.5; Thu, 08 Feb 2018 08:07:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=xJAmm1c4l0VIlgSn2nb7lpyAGQP6xPkvZQTsgWk9jzM=; b=vYzQ7eqJXzKEaXyEjD2tFrBCeZ44DghKfnnihjlO+NN4wqGgpAsw63XjaLH88QIRRC YqV1hwyx9jUzyLYIBYF8KYjhFiGF4vd5DT/449LA/3j9CiMqU7JHKnCOPMobAj2bm5aD +pcMVhPV7Di9uK65DCGHF2imdrblOmK820HuqKJ9DXpqJ9Bw3w0U7mjWV6RSUiw7cxyz cxSKZ8gsZoiLHJgxSXSZsmOmBWrDy6Y67xHwbF8hgNr7mBJPVilvW0ZUcfHEX0Wh26/O GJWZRZPUhzonaCjwf6ZWJ/czLQb6kMYrysQ9f079O2thgQAx/RsmgJ7j4s3zzm0Bu/ZZ +0rQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=xJAmm1c4l0VIlgSn2nb7lpyAGQP6xPkvZQTsgWk9jzM=; b=cHZj0We4TYsZbA7jYOQ8Nz7MD8tLBUgQGRZtTWpsB2BtiL9p0PmdqXaZW/pXeKnxlM 8MhsYB0nafBLKmQUp77+LsCkJjge9lKGcxa2tZkEq9y6A6QCGzUqSr7/2Vo0xGIDGQe0 Q2SoJw2PaQHf3eEiqH86SfmuKRk5F4qdS6L09hdbaG1Rtuq04VYwUW1xB0xtGDJKVSm1 0k02E5gP9mgT0g61G1+qQ1tS7J3KOkHLbyF2pn2gar4jzD2EfN3HN33Ld1Kw9ZU1E0/O QrqdXlr7UiuBcoiDlqFZbl4G6NcnvBqVcLzD3uopmwxYM5qhY+dovx9v/w64g7s45ZyA 5O6w== X-Gm-Message-State: APf1xPBlXrnf8OyW6lJJ+PpoONO8C7KMuOS+zm3q+MlQMTsKaKw8DEig 6y8YcDiXQnLa0417MRGWOfOONw== X-Google-Smtp-Source: AH8x225GNT6KCpZEsWtzTL8m0/MTGCHu8pgsYWfHFtv0BQf/zYgu7rqy+BUC0+dUhKOMb6LzVvFmww== X-Received: by 10.80.186.5 with SMTP id g5mr2224719edc.12.1518106021295; Thu, 08 Feb 2018 08:07:01 -0800 (PST) Received: from localhost (default-46-102-197-194.interdsl.co.uk. [46.102.197.194]) by smtp.gmail.com with ESMTPSA id p32sm122038eda.69.2018.02.08.08.06.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Feb 2018 08:06:59 -0800 (PST) Sender: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Date: Thu, 8 Feb 2018 16:06:49 +0000 From: Roger Pau =?iso-8859-1?Q?Monn=E9?= To: Wojciech Macek Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328536 - in head/stand: common powerpc/kboot Message-ID: <20180208160649.pmkg42i63eipdgiv@MacBook-Pro-de-Roger.local> References: <20180131151823.fwigjbd5uubhshpj@MacBook-Pro-de-Roger.local> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180131151823.fwigjbd5uubhshpj@MacBook-Pro-de-Roger.local> User-Agent: NeoMutt/20171208 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Feb 2018 16:07:03 -0000 Ping? Ed committed a band-aid, but we need to get this fixed. On Wed, Jan 31, 2018 at 03:20:46PM +0000, Roger Pau Monné wrote: > On Mon, Jan 29, 2018 at 09:24:28AM +0000, Wojciech Macek wrote: > > Modified: head/stand/common/load_elf.c > > ============================================================================== > > --- head/stand/common/load_elf.c Mon Jan 29 09:21:08 2018 (r328535) > > +++ head/stand/common/load_elf.c Mon Jan 29 09:24:28 2018 (r328536) > > @@ -29,6 +29,7 @@ > > __FBSDID("$FreeBSD$"); > > > > #include > > +#include > > #include > > #include > > #include > > @@ -118,15 +119,72 @@ __elfN(load_elf_header)(char *filename, elf_file_t ef) > > err = EFTYPE; > > goto error; > > } > > + > > if (ehdr->e_ident[EI_CLASS] != ELF_TARG_CLASS || /* Layout ? */ > > ehdr->e_ident[EI_DATA] != ELF_TARG_DATA || > > So here you force EI_DATA == ELF_TARG_DATA in order to continue... > > > - ehdr->e_ident[EI_VERSION] != EV_CURRENT || /* Version ? */ > > - ehdr->e_version != EV_CURRENT || > > - ehdr->e_machine != ELF_TARG_MACH) { /* Machine ? */ > > + ehdr->e_ident[EI_VERSION] != EV_CURRENT) /* Version ? */ { > > err = EFTYPE; > > goto error; > > } > > > > + /* > > + * Fixup ELF endianness. > > + * > > + * The Xhdr structure was loaded using block read call to > > + * optimize file accesses. It might happen, that the endianness > > + * of the system memory is different that endianness of > > + * the ELF header. > > + * Swap fields here to guarantee that Xhdr always contain > > + * valid data regardless of architecture. > > + */ > > + if (ehdr->e_ident[EI_DATA] == ELFDATA2MSB) { > > + ehdr->e_type = be16toh(ehdr->e_type); > > ... yet here you check for EI_DATA == ELFDATA2MSB which AFAICT it's not > possible given the check above, so the following if branch is dead > code. > > > + ehdr->e_machine = be16toh(ehdr->e_machine); > > + ehdr->e_version = be32toh(ehdr->e_version); > > + if (ehdr->e_ident[EI_CLASS] == ELFCLASS64) { > > + ehdr->e_entry = be64toh(ehdr->e_entry); > > + ehdr->e_phoff = be64toh(ehdr->e_phoff); > > + ehdr->e_shoff = be64toh(ehdr->e_shoff); > > + } else { > > + ehdr->e_entry = be32toh(ehdr->e_entry); > > + ehdr->e_phoff = be32toh(ehdr->e_phoff); > > + ehdr->e_shoff = be32toh(ehdr->e_shoff); > > + } > > + ehdr->e_flags = be32toh(ehdr->e_flags); > > + ehdr->e_ehsize = be16toh(ehdr->e_ehsize); > > + ehdr->e_phentsize = be16toh(ehdr->e_phentsize); > > + ehdr->e_phnum = be16toh(ehdr->e_phnum); > > + ehdr->e_shentsize = be16toh(ehdr->e_shentsize); > > + ehdr->e_shnum = be16toh(ehdr->e_shnum); > > + ehdr->e_shstrndx = be16toh(ehdr->e_shstrndx); > > + > > + } else { > > + ehdr->e_type = le16toh(ehdr->e_type); > > + ehdr->e_machine = le16toh(ehdr->e_machine); > > + ehdr->e_version = le32toh(ehdr->e_version); > > + if (ehdr->e_ident[EI_CLASS] == ELFCLASS64) { > > + ehdr->e_entry = le64toh(ehdr->e_entry); > > + ehdr->e_phoff = le64toh(ehdr->e_phoff); > > + ehdr->e_shoff = le64toh(ehdr->e_shoff); > > + } else { > > + ehdr->e_entry = le32toh(ehdr->e_entry); > > + ehdr->e_phoff = le32toh(ehdr->e_phoff); > > + ehdr->e_shoff = le32toh(ehdr->e_shoff); > > + } > > + ehdr->e_flags = le32toh(ehdr->e_flags); > > + ehdr->e_ehsize = le16toh(ehdr->e_ehsize); > > + ehdr->e_phentsize = le16toh(ehdr->e_phentsize); > > + ehdr->e_phnum = le16toh(ehdr->e_phnum); > > + ehdr->e_shentsize = le16toh(ehdr->e_shentsize); > > + ehdr->e_shnum = le16toh(ehdr->e_shnum); > > + ehdr->e_shstrndx = le16toh(ehdr->e_shstrndx); > > + } > > I think this chunk (and all the similar ones below) should be put on a > macro in order to avoid such big chunks of code repetition. It's also > fairly easy to forget to change one of the branches in the future. > > Roger. > From owner-svn-src-all@freebsd.org Thu Feb 8 17:07:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 249E3F13C88; Thu, 8 Feb 2018 17:07:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CD1307157C; Thu, 8 Feb 2018 17:07:27 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C7CF418D23; Thu, 8 Feb 2018 17:07: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 w18H7RLs027412; Thu, 8 Feb 2018 17:07:27 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w18H7Rnv027408; Thu, 8 Feb 2018 17:07:27 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802081707.w18H7Rnv027408@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 8 Feb 2018 17:07:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329019 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 329019 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Feb 2018 17:07:28 -0000 Author: imp Date: Thu Feb 8 17:07:27 2018 New Revision: 329019 URL: https://svnweb.freebsd.org/changeset/base/329019 Log: Move to tabs for indentation and to 8-space notches, per style(9). 4 space indentation with a mix of tabs and spaces is a hassle. Update to project-standard hard-tabs with 8-space indentation in these files. This matches the new code coming in better as well. Modified: head/stand/common/boot.c head/stand/common/interp_backslash.c head/stand/common/interp_parse.c Modified: head/stand/common/boot.c ============================================================================== --- head/stand/common/boot.c Thu Feb 8 14:53:34 2018 (r329018) +++ head/stand/common/boot.c Thu Feb 8 17:07:27 2018 (r329019) @@ -52,60 +52,60 @@ COMMAND_SET(boot, "boot", "boot a file or loaded kerne static int command_boot(int argc, char *argv[]) { - struct preloaded_file *fp; + struct preloaded_file *fp; - /* - * See if the user has specified an explicit kernel to boot. - */ - if ((argc > 1) && (argv[1][0] != '-')) { + /* + * See if the user has specified an explicit kernel to boot. + */ + if ((argc > 1) && (argv[1][0] != '-')) { - /* XXX maybe we should discard everything and start again? */ - if (file_findfile(NULL, NULL) != NULL) { - snprintf(command_errbuf, sizeof(command_errbuf), - "can't boot '%s', kernel module already loaded", argv[1]); - return(CMD_ERROR); + /* XXX maybe we should discard everything and start again? */ + if (file_findfile(NULL, NULL) != NULL) { + snprintf(command_errbuf, sizeof(command_errbuf), + "can't boot '%s', kernel module already loaded", argv[1]); + return(CMD_ERROR); + } + + /* find/load the kernel module */ + if (mod_loadkld(argv[1], argc - 2, argv + 2) != 0) + return(CMD_ERROR); + /* we have consumed all arguments */ + argc = 1; } - /* find/load the kernel module */ - if (mod_loadkld(argv[1], argc - 2, argv + 2) != 0) - return(CMD_ERROR); - /* we have consumed all arguments */ - argc = 1; - } + /* + * See if there is a kernel module already loaded + */ + if (file_findfile(NULL, NULL) == NULL) + if (loadakernel(0, argc - 1, argv + 1)) + /* we have consumed all arguments */ + argc = 1; - /* - * See if there is a kernel module already loaded - */ - if (file_findfile(NULL, NULL) == NULL) - if (loadakernel(0, argc - 1, argv + 1)) - /* we have consumed all arguments */ - argc = 1; + /* + * Loaded anything yet? + */ + if ((fp = file_findfile(NULL, NULL)) == NULL) { + command_errmsg = "no bootable kernel"; + return(CMD_ERROR); + } - /* - * Loaded anything yet? - */ - if ((fp = file_findfile(NULL, NULL)) == NULL) { - command_errmsg = "no bootable kernel"; - return(CMD_ERROR); - } + /* + * If we were given arguments, discard any previous. + * XXX should we merge arguments? Hard to DWIM. + */ + if (argc > 1) { + if (fp->f_args != NULL) + free(fp->f_args); + fp->f_args = unargv(argc - 1, argv + 1); + } - /* - * If we were given arguments, discard any previous. - * XXX should we merge arguments? Hard to DWIM. - */ - if (argc > 1) { - if (fp->f_args != NULL) - free(fp->f_args); - fp->f_args = unargv(argc - 1, argv + 1); - } + /* Hook for platform-specific autoloading of modules */ + if (archsw.arch_autoload() != 0) + return(CMD_ERROR); - /* Hook for platform-specific autoloading of modules */ - if (archsw.arch_autoload() != 0) + /* Call the exec handler from the loader matching the kernel */ + file_formats[fp->f_loader]->l_exec(fp); return(CMD_ERROR); - - /* Call the exec handler from the loader matching the kernel */ - file_formats[fp->f_loader]->l_exec(fp); - return(CMD_ERROR); } @@ -118,29 +118,29 @@ COMMAND_SET(autoboot, "autoboot", "boot automatically static int command_autoboot(int argc, char *argv[]) { - int howlong; - char *cp, *prompt; + int howlong; + char *cp, *prompt; - prompt = NULL; - howlong = -1; - switch(argc) { - case 3: - prompt = argv[2]; - /* FALLTHROUGH */ - case 2: - howlong = strtol(argv[1], &cp, 0); - if (*cp != 0) { - snprintf(command_errbuf, sizeof(command_errbuf), - "bad delay '%s'", argv[1]); - return(CMD_ERROR); + prompt = NULL; + howlong = -1; + switch(argc) { + case 3: + prompt = argv[2]; + /* FALLTHROUGH */ + case 2: + howlong = strtol(argv[1], &cp, 0); + if (*cp != 0) { + snprintf(command_errbuf, sizeof(command_errbuf), + "bad delay '%s'", argv[1]); + return(CMD_ERROR); + } + /* FALLTHROUGH */ + case 1: + return(autoboot(howlong, prompt)); } - /* FALLTHROUGH */ - case 1: - return(autoboot(howlong, prompt)); - } - command_errmsg = "too many arguments"; - return(CMD_ERROR); + command_errmsg = "too many arguments"; + return(CMD_ERROR); } /* @@ -150,103 +150,103 @@ command_autoboot(int argc, char *argv[]) void autoboot_maybe() { - char *cp; + char *cp; - cp = getenv("autoboot_delay"); - if ((autoboot_tried == 0) && ((cp == NULL) || strcasecmp(cp, "NO"))) - autoboot(-1, NULL); /* try to boot automatically */ + cp = getenv("autoboot_delay"); + if ((autoboot_tried == 0) && ((cp == NULL) || strcasecmp(cp, "NO"))) + autoboot(-1, NULL); /* try to boot automatically */ } int autoboot(int timeout, char *prompt) { - time_t when, otime, ntime; - int c, yes; - char *argv[2], *cp, *ep; - char *kernelname; + time_t when, otime, ntime; + int c, yes; + char *argv[2], *cp, *ep; + char *kernelname; #ifdef BOOT_PROMPT_123 - const char *seq = "123", *p = seq; + const char *seq = "123", *p = seq; #endif - autoboot_tried = 1; + autoboot_tried = 1; - if (timeout == -1) { - timeout = 10; - /* try to get a delay from the environment */ - if ((cp = getenv("autoboot_delay"))) { - timeout = strtol(cp, &ep, 0); - if (cp == ep) - timeout = 10; /* Unparseable? Set default! */ + if (timeout == -1) { + timeout = 10; + /* try to get a delay from the environment */ + if ((cp = getenv("autoboot_delay"))) { + timeout = strtol(cp, &ep, 0); + if (cp == ep) + timeout = 10; /* Unparseable? Set default! */ + } } - } - kernelname = getenv("kernelname"); - if (kernelname == NULL) { - argv[0] = NULL; - loadakernel(0, 0, argv); kernelname = getenv("kernelname"); if (kernelname == NULL) { - command_errmsg = "no valid kernel found"; - return(CMD_ERROR); + argv[0] = NULL; + loadakernel(0, 0, argv); + kernelname = getenv("kernelname"); + if (kernelname == NULL) { + command_errmsg = "no valid kernel found"; + return(CMD_ERROR); + } } - } - if (timeout >= 0) { - otime = time(NULL); - when = otime + timeout; /* when to boot */ + if (timeout >= 0) { + otime = time(NULL); + when = otime + timeout; /* when to boot */ - yes = 0; + yes = 0; #ifdef BOOT_PROMPT_123 - printf("%s\n", (prompt == NULL) ? "Hit [Enter] to boot immediately, or " - "1 2 3 sequence for command prompt." : prompt); + printf("%s\n", (prompt == NULL) ? "Hit [Enter] to boot immediately, or " + "1 2 3 sequence for command prompt." : prompt); #else - printf("%s\n", (prompt == NULL) ? "Hit [Enter] to boot immediately, or any other key for command prompt." : prompt); + printf("%s\n", (prompt == NULL) ? "Hit [Enter] to boot immediately, or any other key for command prompt." : prompt); #endif - for (;;) { - if (ischar()) { - c = getchar(); + for (;;) { + if (ischar()) { + c = getchar(); #ifdef BOOT_PROMPT_123 - if ((c == '\r') || (c == '\n')) { - yes = 1; - break; - } else if (c != *p++) - p = seq; - if (*p == 0) - break; + if ((c == '\r') || (c == '\n')) { + yes = 1; + break; + } else if (c != *p++) + p = seq; + if (*p == 0) + break; #else - if ((c == '\r') || (c == '\n')) - yes = 1; - break; + if ((c == '\r') || (c == '\n')) + yes = 1; + break; #endif - } - ntime = time(NULL); - if (ntime >= when) { - yes = 1; - break; - } + } + ntime = time(NULL); + if (ntime >= when) { + yes = 1; + break; + } - if (ntime != otime) { - printf("\rBooting [%s] in %d second%s... ", - kernelname, (int)(when - ntime), - (when-ntime)==1?"":"s"); - otime = ntime; - } - } - } else { - yes = 1; - } + if (ntime != otime) { + printf("\rBooting [%s] in %d second%s... ", + kernelname, (int)(when - ntime), + (when-ntime)==1?"":"s"); + otime = ntime; + } + } + } else { + yes = 1; + } - if (yes) - printf("\rBooting [%s]... ", kernelname); - putchar('\n'); - if (yes) { - argv[0] = "boot"; - argv[1] = NULL; - return(command_boot(1, argv)); - } - return(CMD_OK); + if (yes) + printf("\rBooting [%s]... ", kernelname); + putchar('\n'); + if (yes) { + argv[0] = "boot"; + argv[1] = NULL; + return(command_boot(1, argv)); + } + return(CMD_OK); } /* @@ -255,43 +255,43 @@ autoboot(int timeout, char *prompt) static char * getbootfile(int try) { - static char *name = NULL; - const char *spec, *ep; - size_t len; + static char *name = NULL; + const char *spec, *ep; + size_t len; - /* we use dynamic storage */ - if (name != NULL) { - free(name); - name = NULL; - } + /* we use dynamic storage */ + if (name != NULL) { + free(name); + name = NULL; + } - /* - * Try $bootfile, then try our builtin default - */ - if ((spec = getenv("bootfile")) == NULL) - spec = default_bootfiles; + /* + * Try $bootfile, then try our builtin default + */ + if ((spec = getenv("bootfile")) == NULL) + spec = default_bootfiles; - while ((try > 0) && (spec != NULL)) { - spec = strchr(spec, ';'); - if (spec) - spec++; /* skip over the leading ';' */ - try--; - } - if (spec != NULL) { - if ((ep = strchr(spec, ';')) != NULL) { - len = ep - spec; - } else { - len = strlen(spec); + while ((try > 0) && (spec != NULL)) { + spec = strchr(spec, ';'); + if (spec) + spec++; /* skip over the leading ';' */ + try--; } - name = malloc(len + 1); - strncpy(name, spec, len); - name[len] = 0; - } - if (name && name[0] == 0) { - free(name); - name = NULL; - } - return(name); + if (spec != NULL) { + if ((ep = strchr(spec, ';')) != NULL) { + len = ep - spec; + } else { + len = strlen(spec); + } + name = malloc(len + 1); + strncpy(name, spec, len); + name[len] = 0; + } + if (name && name[0] == 0) { + free(name); + name = NULL; + } + return(name); } /* @@ -307,109 +307,109 @@ getbootfile(int try) int getrootmount(char *rootdev) { - char lbuf[128], *cp, *ep, *dev, *fstyp, *options; - int fd, error; + char lbuf[128], *cp, *ep, *dev, *fstyp, *options; + int fd, error; - if (getenv("vfs.root.mountfrom") != NULL) - return(0); + if (getenv("vfs.root.mountfrom") != NULL) + return(0); - error = 1; - sprintf(lbuf, "%s/etc/fstab", rootdev); - if ((fd = open(lbuf, O_RDONLY)) < 0) - goto notfound; + error = 1; + sprintf(lbuf, "%s/etc/fstab", rootdev); + if ((fd = open(lbuf, O_RDONLY)) < 0) + goto notfound; - /* loop reading lines from /etc/fstab What was that about sscanf again? */ - fstyp = NULL; - dev = NULL; - while (fgetstr(lbuf, sizeof(lbuf), fd) >= 0) { - if ((lbuf[0] == 0) || (lbuf[0] == '#')) - continue; + /* loop reading lines from /etc/fstab What was that about sscanf again? */ + fstyp = NULL; + dev = NULL; + while (fgetstr(lbuf, sizeof(lbuf), fd) >= 0) { + if ((lbuf[0] == 0) || (lbuf[0] == '#')) + continue; - /* skip device name */ - for (cp = lbuf; (*cp != 0) && !isspace(*cp); cp++) - ; - if (*cp == 0) /* misformatted */ - continue; - /* delimit and save */ - *cp++ = 0; - free(dev); - dev = strdup(lbuf); + /* skip device name */ + for (cp = lbuf; (*cp != 0) && !isspace(*cp); cp++) + ; + if (*cp == 0) /* misformatted */ + continue; + /* delimit and save */ + *cp++ = 0; + free(dev); + dev = strdup(lbuf); - /* skip whitespace up to mountpoint */ - while ((*cp != 0) && isspace(*cp)) - cp++; - /* must have / to be root */ - if ((*cp == 0) || (*cp != '/') || !isspace(*(cp + 1))) - continue; - /* skip whitespace up to fstype */ - cp += 2; - while ((*cp != 0) && isspace(*cp)) - cp++; - if (*cp == 0) /* misformatted */ - continue; - /* skip text to end of fstype and delimit */ - ep = cp; - while ((*cp != 0) && !isspace(*cp)) - cp++; - *cp = 0; - free(fstyp); - fstyp = strdup(ep); + /* skip whitespace up to mountpoint */ + while ((*cp != 0) && isspace(*cp)) + cp++; + /* must have / to be root */ + if ((*cp == 0) || (*cp != '/') || !isspace(*(cp + 1))) + continue; + /* skip whitespace up to fstype */ + cp += 2; + while ((*cp != 0) && isspace(*cp)) + cp++; + if (*cp == 0) /* misformatted */ + continue; + /* skip text to end of fstype and delimit */ + ep = cp; + while ((*cp != 0) && !isspace(*cp)) + cp++; + *cp = 0; + free(fstyp); + fstyp = strdup(ep); - /* skip whitespace up to mount options */ - cp += 1; - while ((*cp != 0) && isspace(*cp)) - cp++; - if (*cp == 0) /* misformatted */ - continue; - /* skip text to end of mount options and delimit */ - ep = cp; - while ((*cp != 0) && !isspace(*cp)) - cp++; - *cp = 0; - options = strdup(ep); - /* Build the : and save it in vfs.root.mountfrom */ - sprintf(lbuf, "%s:%s", fstyp, dev); - setenv("vfs.root.mountfrom", lbuf, 0); + /* skip whitespace up to mount options */ + cp += 1; + while ((*cp != 0) && isspace(*cp)) + cp++; + if (*cp == 0) /* misformatted */ + continue; + /* skip text to end of mount options and delimit */ + ep = cp; + while ((*cp != 0) && !isspace(*cp)) + cp++; + *cp = 0; + options = strdup(ep); + /* Build the : and save it in vfs.root.mountfrom */ + sprintf(lbuf, "%s:%s", fstyp, dev); + setenv("vfs.root.mountfrom", lbuf, 0); - /* Don't override vfs.root.mountfrom.options if it is already set */ - if (getenv("vfs.root.mountfrom.options") == NULL) { - /* save mount options */ - setenv("vfs.root.mountfrom.options", options, 0); + /* Don't override vfs.root.mountfrom.options if it is already set */ + if (getenv("vfs.root.mountfrom.options") == NULL) { + /* save mount options */ + setenv("vfs.root.mountfrom.options", options, 0); + } + free(options); + error = 0; + break; } - free(options); - error = 0; - break; - } - close(fd); - free(dev); - free(fstyp); + close(fd); + free(dev); + free(fstyp); notfound: - if (error) { - const char *currdev; + if (error) { + const char *currdev; - currdev = getenv("currdev"); - if (currdev != NULL && strncmp("zfs:", currdev, 4) == 0) { - cp = strdup(currdev); - cp[strlen(cp) - 1] = '\0'; - setenv("vfs.root.mountfrom", cp, 0); - error = 0; - free(cp); + currdev = getenv("currdev"); + if (currdev != NULL && strncmp("zfs:", currdev, 4) == 0) { + cp = strdup(currdev); + cp[strlen(cp) - 1] = '\0'; + setenv("vfs.root.mountfrom", cp, 0); + error = 0; + free(cp); + } } - } - return(error); + return(error); } static int loadakernel(int try, int argc, char* argv[]) { - char *cp; + char *cp; for (try = 0; (cp = getbootfile(try)) != NULL; try++) - if (mod_loadkld(cp, argc - 1, argv + 1) != 0) - printf("can't load '%s'\n", cp); - else - return 1; + if (mod_loadkld(cp, argc - 1, argv + 1) != 0) + printf("can't load '%s'\n", cp); + else + return 1; return 0; } Modified: head/stand/common/interp_backslash.c ============================================================================== --- head/stand/common/interp_backslash.c Thu Feb 8 14:53:34 2018 (r329018) +++ head/stand/common/interp_backslash.c Thu Feb 8 17:07:27 2018 (r329019) @@ -30,138 +30,138 @@ __FBSDID("$FreeBSD$"); char * backslash(const char *str) { - /* - * Remove backslashes from the strings. Turn \040 etc. into a single - * character (we allow eight bit values). Currently NUL is not - * allowed. - * - * Turn "\n" and "\t" into '\n' and '\t' characters. Etc. - * - */ - char *new_str; - int seenbs = 0; - int i = 0; + /* + * Remove backslashes from the strings. Turn \040 etc. into a single + * character (we allow eight bit values). Currently NUL is not + * allowed. + * + * Turn "\n" and "\t" into '\n' and '\t' characters. Etc. + * + */ + char *new_str; + int seenbs = 0; + int i = 0; - if ((new_str = strdup(str)) == NULL) - return NULL; + if ((new_str = strdup(str)) == NULL) + return NULL; - while (*str) { - if (seenbs) { - seenbs = 0; - switch (*str) { - case '\\': - new_str[i++] = '\\'; - str++; - break; + while (*str) { + if (seenbs) { + seenbs = 0; + switch (*str) { + case '\\': + new_str[i++] = '\\'; + str++; + break; - /* preserve backslashed quotes, dollar signs */ - case '\'': - case '"': - case '$': - new_str[i++] = '\\'; - new_str[i++] = *str++; - break; + /* preserve backslashed quotes, dollar signs */ + case '\'': + case '"': + case '$': + new_str[i++] = '\\'; + new_str[i++] = *str++; + break; - case 'b': - new_str[i++] = '\b'; - str++; - break; + case 'b': + new_str[i++] = '\b'; + str++; + break; - case 'f': - new_str[i++] = '\f'; - str++; - break; + case 'f': + new_str[i++] = '\f'; + str++; + break; - case 'r': - new_str[i++] = '\r'; - str++; - break; + case 'r': + new_str[i++] = '\r'; + str++; + break; - case 'n': - new_str[i++] = '\n'; - str++; - break; + case 'n': + new_str[i++] = '\n'; + str++; + break; - case 's': - new_str[i++] = ' '; - str++; - break; + case 's': + new_str[i++] = ' '; + str++; + break; - case 't': - new_str[i++] = '\t'; - str++; - break; + case 't': + new_str[i++] = '\t'; + str++; + break; - case 'v': - new_str[i++] = '\13'; - str++; - break; + case 'v': + new_str[i++] = '\13'; + str++; + break; - case 'z': - str++; - break; + case 'z': + str++; + break; - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': { - char val; + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': { + char val; - /* Three digit octal constant? */ - if (*str >= '0' && *str <= '3' && - *(str + 1) >= '0' && *(str + 1) <= '7' && - *(str + 2) >= '0' && *(str + 2) <= '7') { + /* Three digit octal constant? */ + if (*str >= '0' && *str <= '3' && + *(str + 1) >= '0' && *(str + 1) <= '7' && + *(str + 2) >= '0' && *(str + 2) <= '7') { - val = (DIGIT(*str) << 6) + (DIGIT(*(str + 1)) << 3) + - DIGIT(*(str + 2)); + val = (DIGIT(*str) << 6) + (DIGIT(*(str + 1)) << 3) + + DIGIT(*(str + 2)); - /* Allow null value if user really wants to shoot - at feet, but beware! */ - new_str[i++] = val; - str += 3; - break; - } + /* Allow null value if user really wants to shoot + at feet, but beware! */ + new_str[i++] = val; + str += 3; + break; + } - /* One or two digit hex constant? - * If two are there they will both be taken. - * Use \z to split them up if this is not wanted. - */ - if (*str == '0' && - (*(str + 1) == 'x' || *(str + 1) == 'X') && - isxdigit(*(str + 2))) { - val = DIGIT(*(str + 2)); - if (isxdigit(*(str + 3))) { - val = (val << 4) + DIGIT(*(str + 3)); - str += 4; - } - else - str += 3; - /* Yep, allow null value here too */ - new_str[i++] = val; - break; - } - } - break; + /* One or two digit hex constant? + * If two are there they will both be taken. + * Use \z to split them up if this is not wanted. + */ + if (*str == '0' && + (*(str + 1) == 'x' || *(str + 1) == 'X') && + isxdigit(*(str + 2))) { + val = DIGIT(*(str + 2)); + if (isxdigit(*(str + 3))) { + val = (val << 4) + DIGIT(*(str + 3)); + str += 4; + } + else + str += 3; + /* Yep, allow null value here too */ + new_str[i++] = val; + break; + } + } + break; - default: - new_str[i++] = *str++; - break; - } + default: + new_str[i++] = *str++; + break; + } + } + else { + if (*str == '\\') { + seenbs = 1; + str++; + } + else + new_str[i++] = *str++; + } } - else { - if (*str == '\\') { - seenbs = 1; - str++; - } - else - new_str[i++] = *str++; - } - } - if (seenbs) { - /* - * The final character was a '\'. Put it in as a single backslash. - */ - new_str[i++] = '\\'; - } - new_str[i] = '\0'; - return new_str; + if (seenbs) { + /* + * The final character was a '\'. Put it in as a single backslash. + */ + new_str[i++] = '\\'; + } + new_str[i] = '\0'; + return new_str; } Modified: head/stand/common/interp_parse.c ============================================================================== --- head/stand/common/interp_parse.c Thu Feb 8 14:53:34 2018 (r329018) +++ head/stand/common/interp_parse.c Thu Feb 8 17:07:27 2018 (r329019) @@ -50,143 +50,146 @@ static char *args[MAXARGS]; */ #define PARSE_FAIL(expr) \ -if (expr) { \ - printf("fail at line %d\n", __LINE__); \ - clean(); \ - free(copy); \ - free(buf); \ - return 1; \ -} + if (expr) { \ + printf("fail at line %d\n", __LINE__); \ + clean(); \ + free(copy); \ + free(buf); \ + return 1; \ + } /* Accept the usual delimiters for a variable, returning counterpart */ static char isdelim(int ch) { - if (ch == '{') - return '}'; - else if (ch == '(') - return ')'; - return '\0'; + + if (ch == '{') + return '}'; + else if (ch == '(') + return ')'; + return '\0'; } static int isquote(int ch) { - return (ch == '\''); + + return (ch == '\''); } static int isdquote(int ch) { - return (ch == '"'); + + return (ch == '"'); } int parse(int *argc, char ***argv, const char *str) { - int ac; - char *val, *p, *q, *copy = NULL; - size_t i = 0; - char token, tmp, quote, dquote, *buf; - enum { STR, VAR, WHITE } state; + int ac; + char *val, *p, *q, *copy = NULL; + size_t i = 0; + char token, tmp, quote, dquote, *buf; + enum { STR, VAR, WHITE } state; - ac = *argc = 0; - dquote = quote = 0; - if (!str || (p = copy = backslash(str)) == NULL) - return 1; + ac = *argc = 0; + dquote = quote = 0; + if (!str || (p = copy = backslash(str)) == NULL) + return 1; - /* Initialize vector and state */ - clean(); - state = STR; - buf = (char *)malloc(PARSE_BUFSIZE); - token = 0; + /* Initialize vector and state */ + clean(); + state = STR; + buf = (char *)malloc(PARSE_BUFSIZE); + token = 0; - /* And awaaaaaaaaay we go! */ - while (*p) { - switch (state) { - case STR: - if ((*p == '\\') && p[1]) { - p++; - PARSE_FAIL(i == (PARSE_BUFSIZE - 1)); - buf[i++] = *p++; - } else if (isquote(*p)) { - quote = quote ? 0 : *p; - if (dquote) { /* keep quote */ - PARSE_FAIL(i == (PARSE_BUFSIZE - 1)); - buf[i++] = *p++; - } else - ++p; - } else if (isdquote(*p)) { - dquote = dquote ? 0 : *p; - if (quote) { /* keep dquote */ - PARSE_FAIL(i == (PARSE_BUFSIZE - 1)); - buf[i++] = *p++; - } else - ++p; - } else if (isspace(*p) && !quote && !dquote) { - state = WHITE; - if (i) { - buf[i] = '\0'; - PARSE_FAIL(insert(&ac, buf)); - i = 0; - } - ++p; - } else if (*p == '$' && !quote) { - token = isdelim(*(p + 1)); - if (token) - p += 2; - else - ++p; - state = VAR; - } else { - PARSE_FAIL(i == (PARSE_BUFSIZE - 1)); - buf[i++] = *p++; - } - break; + /* And awaaaaaaaaay we go! */ + while (*p) { + switch (state) { + case STR: + if ((*p == '\\') && p[1]) { + p++; + PARSE_FAIL(i == (PARSE_BUFSIZE - 1)); + buf[i++] = *p++; + } else if (isquote(*p)) { + quote = quote ? 0 : *p; + if (dquote) { /* keep quote */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Feb 8 17:14:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95F3BF144D2; Thu, 8 Feb 2018 17:14:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46E8171B21; Thu, 8 Feb 2018 17:14:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 41C0D18EC9; Thu, 8 Feb 2018 17:14:57 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w18HEvhB032194; Thu, 8 Feb 2018 17:14:57 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w18HEuWI032186; Thu, 8 Feb 2018 17:14:56 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802081714.w18HEuWI032186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 8 Feb 2018 17:14:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329020 - in stable/11/sys: fs/ext2fs kern sys ufs/ffs vm X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/sys: fs/ext2fs kern sys ufs/ffs vm X-SVN-Commit-Revision: 329020 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Feb 2018 17:14:57 -0000 Author: kevans Date: Thu Feb 8 17:14:56 2018 New Revision: 329020 URL: https://svnweb.freebsd.org/changeset/base/329020 Log: MFC r309062: Release laundered vnode pages to the head of the inactive queue. The swap pager enqueues laundered pages near the head of the inactive queue to avoid another trip through LRU before reclamation. This change adds support for this behaviour to the vnode pager and makes use of it in UFS and ext2fs. Some ioflag handling is consolidated into a common subroutine so that this support can be easily extended to other filesystems which make use of the buffer cache. No changes are needed for ZFS since its putpages routine always undirties the pages before returning, and the laundry thread requeues the pages appropriately in this case. Modified: stable/11/sys/fs/ext2fs/ext2_vnops.c stable/11/sys/kern/vfs_bio.c stable/11/sys/sys/buf.h stable/11/sys/sys/vnode.h stable/11/sys/ufs/ffs/ffs_vnops.c stable/11/sys/vm/vm_pageout.c stable/11/sys/vm/vm_pager.h stable/11/sys/vm/vnode_pager.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- stable/11/sys/fs/ext2fs/ext2_vnops.c Thu Feb 8 17:07:27 2018 (r329019) +++ stable/11/sys/fs/ext2fs/ext2_vnops.c Thu Feb 8 17:14:56 2018 (r329020) @@ -2061,15 +2061,6 @@ ext2_ind_read(struct vop_read_args *ap) } /* - * If IO_DIRECT then set B_DIRECT for the buffer. This - * will cause us to attempt to release the buffer later on - * and will cause the buffer cache to attempt to free the - * underlying pages. - */ - if (ioflag & IO_DIRECT) - bp->b_flags |= B_DIRECT; - - /* * We should only get non-zero b_resid when an I/O error * has occurred, which should cause us to break above. * However, if the short read did not cause an error, @@ -2086,25 +2077,7 @@ ext2_ind_read(struct vop_read_args *ap) (int)xfersize, uio); if (error) break; - - if (ioflag & (IO_VMIO|IO_DIRECT)) { - /* - * If it's VMIO or direct I/O, then we don't - * need the buf, mark it available for - * freeing. If it's non-direct VMIO, the VM has - * the data. - */ - bp->b_flags |= B_RELBUF; - brelse(bp); - } else { - /* - * Otherwise let whoever - * made the request take care of - * freeing it. We just queue - * it onto another list. - */ - bqrelse(bp); - } + vfs_bio_brelse(bp, ioflag); } /* @@ -2113,14 +2086,8 @@ ext2_ind_read(struct vop_read_args *ap) * completion has not set a new value into it. so it must have come * from a 'break' statement */ - if (bp != NULL) { - if (ioflag & (IO_VMIO|IO_DIRECT)) { - bp->b_flags |= B_RELBUF; - brelse(bp); - } else { - bqrelse(bp); - } - } + if (bp != NULL) + vfs_bio_brelse(bp, ioflag); if ((error == 0 || uio->uio_resid != orig_resid) && (vp->v_mount->mnt_flag & (MNT_NOATIME | MNT_RDONLY)) == 0) @@ -2378,9 +2345,8 @@ ext2_write(struct vop_write_args *ap) if (error != 0 && (bp->b_flags & B_CACHE) == 0 && fs->e2fs_bsize == xfersize) vfs_bio_clrbuf(bp); - if (ioflag & (IO_VMIO|IO_DIRECT)) { - bp->b_flags |= B_RELBUF; - } + + vfs_bio_set_flags(bp, ioflag); /* * If IO_SYNC each buffer is written synchronously. Otherwise Modified: stable/11/sys/kern/vfs_bio.c ============================================================================== --- stable/11/sys/kern/vfs_bio.c Thu Feb 8 17:07:27 2018 (r329019) +++ stable/11/sys/kern/vfs_bio.c Thu Feb 8 17:14:56 2018 (r329020) @@ -4452,6 +4452,45 @@ vfs_bio_bzero_buf(struct buf *bp, int base, int size) } /* + * Update buffer flags based on I/O request parameters, optionally releasing the + * buffer. If it's VMIO or direct I/O, the buffer pages are released to the VM, + * where they may be placed on a page queue (VMIO) or freed immediately (direct + * I/O). Otherwise the buffer is released to the cache. + */ +static void +b_io_dismiss(struct buf *bp, int ioflag, bool release) +{ + + KASSERT((ioflag & IO_NOREUSE) == 0 || (ioflag & IO_VMIO) != 0, + ("buf %p non-VMIO noreuse", bp)); + + if ((ioflag & IO_DIRECT) != 0) + bp->b_flags |= B_DIRECT; + if ((ioflag & (IO_VMIO | IO_DIRECT)) != 0 && LIST_EMPTY(&bp->b_dep)) { + bp->b_flags |= B_RELBUF; + if ((ioflag & IO_NOREUSE) != 0) + bp->b_flags |= B_NOREUSE; + if (release) + brelse(bp); + } else if (release) + bqrelse(bp); +} + +void +vfs_bio_brelse(struct buf *bp, int ioflag) +{ + + b_io_dismiss(bp, ioflag, true); +} + +void +vfs_bio_set_flags(struct buf *bp, int ioflag) +{ + + b_io_dismiss(bp, ioflag, false); +} + +/* * vm_hold_load_pages and vm_hold_free_pages get pages into * a buffers address space. The pages are anonymous and are * not associated with a file object. Modified: stable/11/sys/sys/buf.h ============================================================================== --- stable/11/sys/sys/buf.h Thu Feb 8 17:07:27 2018 (r329019) +++ stable/11/sys/sys/buf.h Thu Feb 8 17:14:56 2018 (r329020) @@ -526,9 +526,11 @@ int cluster_read(struct vnode *, u_quad_t, daddr_t, lo struct ucred *, long, int, int, struct buf **); int cluster_wbuild(struct vnode *, long, daddr_t, int, int); void cluster_write(struct vnode *, struct buf *, u_quad_t, int, int); +void vfs_bio_brelse(struct buf *bp, int ioflags); void vfs_bio_bzero_buf(struct buf *bp, int base, int size); -void vfs_bio_set_valid(struct buf *, int base, int size); void vfs_bio_clrbuf(struct buf *); +void vfs_bio_set_flags(struct buf *bp, int ioflags); +void vfs_bio_set_valid(struct buf *, int base, int size); void vfs_busy_pages(struct buf *, int clear_modify); void vfs_unbusy_pages(struct buf *); int vmapbuf(struct buf *, int); Modified: stable/11/sys/sys/vnode.h ============================================================================== --- stable/11/sys/sys/vnode.h Thu Feb 8 17:07:27 2018 (r329019) +++ stable/11/sys/sys/vnode.h Thu Feb 8 17:14:56 2018 (r329020) @@ -303,6 +303,7 @@ struct vattr { #define IO_INVAL 0x0040 /* invalidate after I/O */ #define IO_SYNC 0x0080 /* do I/O synchronously */ #define IO_DIRECT 0x0100 /* attempt to bypass buffer cache */ +#define IO_NOREUSE 0x0200 /* VMIO data won't be reused */ #define IO_EXT 0x0400 /* operate on external attributes */ #define IO_NORMAL 0x0800 /* operate on regular data */ #define IO_NOMACCHECK 0x1000 /* MAC checks unnecessary */ Modified: stable/11/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- stable/11/sys/ufs/ffs/ffs_vnops.c Thu Feb 8 17:07:27 2018 (r329019) +++ stable/11/sys/ufs/ffs/ffs_vnops.c Thu Feb 8 17:14:56 2018 (r329020) @@ -601,15 +601,6 @@ ffs_read(ap) } /* - * If IO_DIRECT then set B_DIRECT for the buffer. This - * will cause us to attempt to release the buffer later on - * and will cause the buffer cache to attempt to free the - * underlying pages. - */ - if (ioflag & IO_DIRECT) - bp->b_flags |= B_DIRECT; - - /* * We should only get non-zero b_resid when an I/O error * has occurred, which should cause us to break above. * However, if the short read did not cause an error, @@ -633,25 +624,7 @@ ffs_read(ap) if (error) break; - if ((ioflag & (IO_VMIO|IO_DIRECT)) && - (LIST_EMPTY(&bp->b_dep))) { - /* - * If there are no dependencies, and it's VMIO, - * then we don't need the buf, mark it available - * for freeing. For non-direct VMIO reads, the VM - * has the data. - */ - bp->b_flags |= B_RELBUF; - brelse(bp); - } else { - /* - * Otherwise let whoever - * made the request take care of - * freeing it. We just queue - * it onto another list. - */ - bqrelse(bp); - } + vfs_bio_brelse(bp, ioflag); } /* @@ -660,15 +633,8 @@ ffs_read(ap) * and on normal completion has not set a new value into it. * so it must have come from a 'break' statement */ - if (bp != NULL) { - if ((ioflag & (IO_VMIO|IO_DIRECT)) && - (LIST_EMPTY(&bp->b_dep))) { - bp->b_flags |= B_RELBUF; - brelse(bp); - } else { - bqrelse(bp); - } - } + if (bp != NULL) + vfs_bio_brelse(bp, ioflag); if ((error == 0 || uio->uio_resid != orig_resid) && (vp->v_mount->mnt_flag & (MNT_NOATIME | MNT_RDONLY)) == 0 && @@ -786,8 +752,6 @@ ffs_write(ap) vnode_pager_setsize(vp, ip->i_size); break; } - if (ioflag & IO_DIRECT) - bp->b_flags |= B_DIRECT; if ((ioflag & (IO_SYNC|IO_INVAL)) == (IO_SYNC|IO_INVAL)) bp->b_flags |= B_NOCACHE; @@ -827,11 +791,9 @@ ffs_write(ap) if (error != 0 && (bp->b_flags & B_CACHE) == 0 && fs->fs_bsize == xfersize) vfs_bio_clrbuf(bp); - if ((ioflag & (IO_VMIO|IO_DIRECT)) && - (LIST_EMPTY(&bp->b_dep))) { - bp->b_flags |= B_RELBUF; - } + vfs_bio_set_flags(bp, ioflag); + /* * If IO_SYNC each buffer is written synchronously. Otherwise * if we have a severe page deficiency write the buffer @@ -978,15 +940,6 @@ ffs_extread(struct vnode *vp, struct uio *uio, int iof } /* - * If IO_DIRECT then set B_DIRECT for the buffer. This - * will cause us to attempt to release the buffer later on - * and will cause the buffer cache to attempt to free the - * underlying pages. - */ - if (ioflag & IO_DIRECT) - bp->b_flags |= B_DIRECT; - - /* * We should only get non-zero b_resid when an I/O error * has occurred, which should cause us to break above. * However, if the short read did not cause an error, @@ -1004,26 +957,7 @@ ffs_extread(struct vnode *vp, struct uio *uio, int iof (int)xfersize, uio); if (error) break; - - if ((ioflag & (IO_VMIO|IO_DIRECT)) && - (LIST_EMPTY(&bp->b_dep))) { - /* - * If there are no dependencies, and it's VMIO, - * then we don't need the buf, mark it available - * for freeing. For non-direct VMIO reads, the VM - * has the data. - */ - bp->b_flags |= B_RELBUF; - brelse(bp); - } else { - /* - * Otherwise let whoever - * made the request take care of - * freeing it. We just queue - * it onto another list. - */ - bqrelse(bp); - } + vfs_bio_brelse(bp, ioflag); } /* @@ -1032,15 +966,8 @@ ffs_extread(struct vnode *vp, struct uio *uio, int iof * and on normal completion has not set a new value into it. * so it must have come from a 'break' statement */ - if (bp != NULL) { - if ((ioflag & (IO_VMIO|IO_DIRECT)) && - (LIST_EMPTY(&bp->b_dep))) { - bp->b_flags |= B_RELBUF; - brelse(bp); - } else { - bqrelse(bp); - } - } + if (bp != NULL) + vfs_bio_brelse(bp, ioflag); return (error); } @@ -1109,8 +1036,6 @@ ffs_extwrite(struct vnode *vp, struct uio *uio, int io */ if ((bp->b_flags & B_CACHE) == 0 && fs->fs_bsize <= xfersize) vfs_bio_clrbuf(bp); - if (ioflag & IO_DIRECT) - bp->b_flags |= B_DIRECT; if (uio->uio_offset + xfersize > dp->di_extsize) dp->di_extsize = uio->uio_offset + xfersize; @@ -1121,10 +1046,8 @@ ffs_extwrite(struct vnode *vp, struct uio *uio, int io error = uiomove((char *)bp->b_data + blkoffset, (int)xfersize, uio); - if ((ioflag & (IO_VMIO|IO_DIRECT)) && - (LIST_EMPTY(&bp->b_dep))) { - bp->b_flags |= B_RELBUF; - } + + vfs_bio_set_flags(bp, ioflag); /* * If IO_SYNC each buffer is written synchronously. Otherwise Modified: stable/11/sys/vm/vm_pageout.c ============================================================================== --- stable/11/sys/vm/vm_pageout.c Thu Feb 8 17:07:27 2018 (r329019) +++ stable/11/sys/vm/vm_pageout.c Thu Feb 8 17:14:56 2018 (r329020) @@ -441,8 +441,8 @@ more: if (ib != 0 && pageout_count < vm_pageout_page_count) goto more; - return (vm_pageout_flush(&mc[page_base], pageout_count, 0, 0, NULL, - NULL)); + return (vm_pageout_flush(&mc[page_base], pageout_count, + VM_PAGER_PUT_NOREUSE, 0, NULL, NULL)); } /* Modified: stable/11/sys/vm/vm_pager.h ============================================================================== --- stable/11/sys/vm/vm_pager.h Thu Feb 8 17:07:27 2018 (r329019) +++ stable/11/sys/vm/vm_pager.h Thu Feb 8 17:14:56 2018 (r329020) @@ -98,6 +98,7 @@ extern struct pagerops mgtdevicepagerops; #define VM_PAGER_PUT_SYNC 0x0001 #define VM_PAGER_PUT_INVAL 0x0002 +#define VM_PAGER_PUT_NOREUSE 0x0004 #define VM_PAGER_CLUSTER_OK 0x0008 #ifdef _KERNEL Modified: stable/11/sys/vm/vnode_pager.c ============================================================================== --- stable/11/sys/vm/vnode_pager.c Thu Feb 8 17:07:27 2018 (r329019) +++ stable/11/sys/vm/vnode_pager.c Thu Feb 8 17:14:56 2018 (r329020) @@ -1366,9 +1366,7 @@ vnode_pager_putpages_ioflags(int pager_flags) else if ((pager_flags & VM_PAGER_CLUSTER_OK) == 0) ioflags |= IO_ASYNC; ioflags |= (pager_flags & VM_PAGER_PUT_INVAL) != 0 ? IO_INVAL: 0; -#ifdef notyet ioflags |= (pager_flags & VM_PAGER_PUT_NOREUSE) != 0 ? IO_NOREUSE : 0; -#endif ioflags |= IO_SEQMAX << IO_SEQSHIFT; return (ioflags); } From owner-svn-src-all@freebsd.org Thu Feb 8 19:15:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 662E6F1D368; Thu, 8 Feb 2018 19:15:52 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 16346776C6; Thu, 8 Feb 2018 19:15:52 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB8A51A2F4; Thu, 8 Feb 2018 19:15:51 +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 w18JFpUF093570; Thu, 8 Feb 2018 19:15:51 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w18JFpWV093569; Thu, 8 Feb 2018 19:15:51 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201802081915.w18JFpWV093569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 8 Feb 2018 19:15:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r329021 - vendor-crypto/openssl/dist/doc/man3 X-SVN-Group: vendor-crypto X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: vendor-crypto/openssl/dist/doc/man3 X-SVN-Commit-Revision: 329021 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Feb 2018 19:15:52 -0000 Author: jkim Date: Thu Feb 8 19:15:51 2018 New Revision: 329021 URL: https://svnweb.freebsd.org/changeset/base/329021 Log: Belatedly remove an empty directory. It briefly appeared in 1.0.2l and removed in 1.0.2m. https://github.com/openssl/openssl/commit/720aa0f Deleted: vendor-crypto/openssl/dist/doc/man3/ From owner-svn-src-all@freebsd.org Thu Feb 8 19:23:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98314F1DBDF; Thu, 8 Feb 2018 19:23:13 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) by mx1.freebsd.org (Postfix) with ESMTP id 485B577CDD; Thu, 8 Feb 2018 19:23:13 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Subject: Re: svn commit: r329021 - vendor-crypto/openssl/dist/doc/man3 From: Jung-uk Kim To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org References: <201802081915.w18JFpWV093569@repo.freebsd.org> Message-ID: Date: Thu, 8 Feb 2018 14:23:13 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <201802081915.w18JFpWV093569@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Feb 2018 19:23:13 -0000 On 02/08/2018 14:15, Jung-uk Kim wrote: > Author: jkim > Date: Thu Feb 8 19:15:51 2018 > New Revision: 329021 > URL: https://svnweb.freebsd.org/changeset/base/329021 > > Log: > Belatedly remove an empty directory. > > It briefly appeared in 1.0.2l and removed in 1.0.2m. > > https://github.com/openssl/openssl/commit/720aa0f Sorry, the link was wrong. https://github.com/openssl/openssl/commit/9ebcb3a Jung-uk Kim From owner-svn-src-all@freebsd.org Thu Feb 8 19:26:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DD60F1DF60; Thu, 8 Feb 2018 19:26:53 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E819077F0E; Thu, 8 Feb 2018 19:26:52 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA5811A4A3; Thu, 8 Feb 2018 19:26:52 +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 w18JQq3e098466; Thu, 8 Feb 2018 19:26:52 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w18JQq41098465; Thu, 8 Feb 2018 19:26:52 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201802081926.w18JQq41098465@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 8 Feb 2018 19:26:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329022 - head/crypto/openssl/doc/man3 X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: head/crypto/openssl/doc/man3 X-SVN-Commit-Revision: 329022 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Feb 2018 19:26:53 -0000 Author: jkim Date: Thu Feb 8 19:26:52 2018 New Revision: 329022 URL: https://svnweb.freebsd.org/changeset/base/329022 Log: MFV: r329021 Belatedly remove an empty directory. Deleted: head/crypto/openssl/doc/man3/ Modified: Directory Properties: head/crypto/openssl/ (props changed) From owner-svn-src-all@freebsd.org Thu Feb 8 19:28:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83F30F1E1BF; Thu, 8 Feb 2018 19:28:53 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 363DC780E2; Thu, 8 Feb 2018 19:28:53 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 311271A4A6; Thu, 8 Feb 2018 19:28:53 +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 w18JSrvl098592; Thu, 8 Feb 2018 19:28:53 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w18JSq0a098582; Thu, 8 Feb 2018 19:28:52 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201802081928.w18JSq0a098582@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 8 Feb 2018 19:28:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329023 - in head/sys: amd64/amd64 arm64/arm64 i386/i386 mips/mips powerpc/powerpc riscv/riscv sparc64/sparc64 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: amd64/amd64 arm64/arm64 i386/i386 mips/mips powerpc/powerpc riscv/riscv sparc64/sparc64 X-SVN-Commit-Revision: 329023 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Feb 2018 19:28:53 -0000 Author: markj Date: Thu Feb 8 19:28:51 2018 New Revision: 329023 URL: https://svnweb.freebsd.org/changeset/base/329023 Log: Use vm_page_unwire_noq() instead of directly modifying page wire counts. No functional change intended. Reviewed by: alc, kib (previous revision) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D14266 Modified: head/sys/amd64/amd64/pmap.c head/sys/amd64/amd64/uma_machdep.c head/sys/arm64/arm64/pmap.c head/sys/arm64/arm64/uma_machdep.c head/sys/i386/i386/pmap.c head/sys/mips/mips/pmap.c head/sys/mips/mips/uma_machdep.c head/sys/powerpc/powerpc/uma_machdep.c head/sys/riscv/riscv/pmap.c head/sys/sparc64/sparc64/vm_machdep.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Thu Feb 8 19:26:52 2018 (r329022) +++ head/sys/amd64/amd64/pmap.c Thu Feb 8 19:28:51 2018 (r329023) @@ -2723,8 +2723,7 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, str /* Have to allocate a new pdp, recurse */ if (_pmap_allocpte(pmap, NUPDE + NUPDPE + pml4index, lockp) == NULL) { - --m->wire_count; - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_page_unwire_noq(m); vm_page_free_zero(m); return (NULL); } @@ -2756,8 +2755,7 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, str /* Have to allocate a new pd, recurse */ if (_pmap_allocpte(pmap, NUPDE + pdpindex, lockp) == NULL) { - --m->wire_count; - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_page_unwire_noq(m); vm_page_free_zero(m); return (NULL); } @@ -2770,9 +2768,7 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, str /* Have to allocate a new pd, recurse */ if (_pmap_allocpte(pmap, NUPDE + pdpindex, lockp) == NULL) { - --m->wire_count; - atomic_subtract_int(&vm_cnt.v_wire_count, - 1); + vm_page_unwire_noq(m); vm_page_free_zero(m); return (NULL); } @@ -2904,18 +2900,16 @@ pmap_release(pmap_t pmap) pmap->pm_pml4[DMPML4I + i] = 0; pmap->pm_pml4[PML4PML4I] = 0; /* Recursive Mapping */ - m->wire_count--; - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_page_unwire_noq(m); vm_page_free_zero(m); if (pmap->pm_pml4u != NULL) { m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pmap->pm_pml4u)); - m->wire_count--; - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_page_unwire_noq(m); vm_page_free(m); } } - + static int kvm_size(SYSCTL_HANDLER_ARGS) { @@ -7711,10 +7705,8 @@ pmap_pti_free_page(vm_page_t m) { KASSERT(m->wire_count > 0, ("page %p not wired", m)); - m->wire_count--; - if (m->wire_count != 0) + if (!vm_page_unwire_noq(m)) return (false); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); vm_page_free_zero(m); return (true); } Modified: head/sys/amd64/amd64/uma_machdep.c ============================================================================== --- head/sys/amd64/amd64/uma_machdep.c Thu Feb 8 19:26:52 2018 (r329022) +++ head/sys/amd64/amd64/uma_machdep.c Thu Feb 8 19:28:51 2018 (r329023) @@ -74,7 +74,6 @@ uma_small_free(void *mem, vm_size_t size, u_int8_t fla pa = DMAP_TO_PHYS((vm_offset_t)mem); dump_drop_page(pa); m = PHYS_TO_VM_PAGE(pa); - m->wire_count--; + vm_page_unwire_noq(m); vm_page_free(m); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); } Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Thu Feb 8 19:26:52 2018 (r329022) +++ head/sys/arm64/arm64/pmap.c Thu Feb 8 19:28:51 2018 (r329023) @@ -1362,12 +1362,7 @@ _pmap_unwire_l3(pmap_t pmap, vm_offset_t va, vm_page_t } pmap_invalidate_page(pmap, va); - /* - * This is a release store so that the ordinary store unmapping - * the page table page is globally performed before TLB shoot- - * down is begun. - */ - atomic_subtract_rel_int(&vm_cnt.v_wire_count, 1); + atomic_subtract_int(&vm_cnt.v_wire_count, 1); /* * Put page on a list so that it is released after @@ -1493,9 +1488,7 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, str /* recurse for allocating page dir */ if (_pmap_alloc_l3(pmap, NUL2E + NUL1E + l0index, lockp) == NULL) { - --m->wire_count; - /* XXX: release mem barrier? */ - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_page_unwire_noq(m); vm_page_free_zero(m); return (NULL); } @@ -1521,8 +1514,7 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, str /* recurse for allocating page dir */ if (_pmap_alloc_l3(pmap, NUL2E + l1index, lockp) == NULL) { - --m->wire_count; - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_page_unwire_noq(m); vm_page_free_zero(m); return (NULL); } @@ -1537,10 +1529,7 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, str /* recurse for allocating page dir */ if (_pmap_alloc_l3(pmap, NUL2E + l1index, lockp) == NULL) { - --m->wire_count; - /* XXX: release mem barrier? */ - atomic_subtract_int( - &vm_cnt.v_wire_count, 1); + vm_page_unwire_noq(m); vm_page_free_zero(m); return (NULL); } @@ -1648,8 +1637,7 @@ pmap_release(pmap_t pmap) m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pmap->pm_l0)); - m->wire_count--; - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_page_unwire_noq(m); vm_page_free_zero(m); } Modified: head/sys/arm64/arm64/uma_machdep.c ============================================================================== --- head/sys/arm64/arm64/uma_machdep.c Thu Feb 8 19:26:52 2018 (r329022) +++ head/sys/arm64/arm64/uma_machdep.c Thu Feb 8 19:28:51 2018 (r329023) @@ -72,7 +72,6 @@ uma_small_free(void *mem, vm_size_t size, u_int8_t fla pa = DMAP_TO_PHYS((vm_offset_t)mem); dump_drop_page(pa); m = PHYS_TO_VM_PAGE(pa); - m->wire_count--; + vm_page_unwire_noq(m); vm_page_free(m); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); } Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Thu Feb 8 19:26:52 2018 (r329022) +++ head/sys/i386/i386/pmap.c Thu Feb 8 19:28:51 2018 (r329023) @@ -2057,10 +2057,9 @@ pmap_release(pmap_t pmap) KASSERT(VM_PAGE_TO_PHYS(m) == (pmap->pm_pdpt[i] & PG_FRAME), ("pmap_release: got wrong ptd page")); #endif - m->wire_count--; + vm_page_unwire_noq(m); vm_page_free_zero(m); } - atomic_subtract_int(&vm_cnt.v_wire_count, NPGPTD); } static int Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Thu Feb 8 19:26:52 2018 (r329022) +++ head/sys/mips/mips/pmap.c Thu Feb 8 19:28:51 2018 (r329023) @@ -1159,8 +1159,7 @@ _pmap_allocpte(pmap_t pmap, unsigned ptepindex, u_int if (_pmap_allocpte(pmap, NUPDE + segindex, flags) == NULL) { /* alloc failed, release current */ - --m->wire_count; - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_page_unwire_noq(m); vm_page_free_zero(m); return (NULL); } @@ -1238,8 +1237,7 @@ pmap_release(pmap_t pmap) ptdva = (vm_offset_t)pmap->pm_segtab; ptdpg = PHYS_TO_VM_PAGE(MIPS_DIRECT_TO_PHYS(ptdva)); - ptdpg->wire_count--; - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_page_unwire_noq(ptdpg); vm_page_free_zero(ptdpg); } Modified: head/sys/mips/mips/uma_machdep.c ============================================================================== --- head/sys/mips/mips/uma_machdep.c Thu Feb 8 19:26:52 2018 (r329022) +++ head/sys/mips/mips/uma_machdep.c Thu Feb 8 19:28:51 2018 (r329023) @@ -94,7 +94,6 @@ uma_small_free(void *mem, vm_size_t size, u_int8_t fla pa = MIPS_DIRECT_TO_PHYS((vm_offset_t)mem); dump_drop_page(pa); m = PHYS_TO_VM_PAGE(pa); - m->wire_count--; + vm_page_unwire_noq(m); vm_page_free(m); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); } Modified: head/sys/powerpc/powerpc/uma_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/uma_machdep.c Thu Feb 8 19:26:52 2018 (r329022) +++ head/sys/powerpc/powerpc/uma_machdep.c Thu Feb 8 19:28:51 2018 (r329023) @@ -95,8 +95,7 @@ uma_small_free(void *mem, vm_size_t size, u_int8_t fla (vm_offset_t)mem + PAGE_SIZE); m = PHYS_TO_VM_PAGE((vm_offset_t)mem); - m->wire_count--; + vm_page_unwire_noq(m); vm_page_free(m); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); atomic_subtract_int(&hw_uma_mdpages, 1); } Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Thu Feb 8 19:26:52 2018 (r329022) +++ head/sys/riscv/riscv/pmap.c Thu Feb 8 19:28:51 2018 (r329023) @@ -1153,12 +1153,7 @@ _pmap_unwire_l3(pmap_t pmap, vm_offset_t va, vm_page_t } pmap_invalidate_page(pmap, va); - /* - * This is a release store so that the ordinary store unmapping - * the page table page is globally performed before TLB shoot- - * down is begun. - */ - atomic_subtract_rel_int(&vm_cnt.v_wire_count, 1); + atomic_subtract_int(&vm_cnt.v_wire_count, 1); /* * Put page on a list so that it is released after @@ -1302,8 +1297,7 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, str /* recurse for allocating page dir */ if (_pmap_alloc_l3(pmap, NUPDE + l1index, lockp) == NULL) { - --m->wire_count; - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_page_unwire_noq(m); vm_page_free_zero(m); return (NULL); } @@ -1388,8 +1382,7 @@ pmap_release(pmap_t pmap) pmap->pm_stats.resident_count)); m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pmap->pm_l1)); - m->wire_count--; - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_page_unwire_noq(m); vm_page_free_zero(m); /* Remove pmap from the allpmaps list */ Modified: head/sys/sparc64/sparc64/vm_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/vm_machdep.c Thu Feb 8 19:26:52 2018 (r329022) +++ head/sys/sparc64/sparc64/vm_machdep.c Thu Feb 8 19:28:51 2018 (r329023) @@ -429,9 +429,8 @@ uma_small_free(void *mem, vm_size_t size, u_int8_t fla PMAP_STATS_INC(uma_nsmall_free); m = PHYS_TO_VM_PAGE(TLB_DIRECT_TO_PHYS((vm_offset_t)mem)); - m->wire_count--; + vm_page_unwire_noq(m); vm_page_free(m); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); } void From owner-svn-src-all@freebsd.org Thu Feb 8 19:55:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB7AFF2007A; Thu, 8 Feb 2018 19:55:03 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9CD5D79883; Thu, 8 Feb 2018 19:55:03 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8FC761A9B0; Thu, 8 Feb 2018 19:55:03 +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 w18Jt3wf013604; Thu, 8 Feb 2018 19:55:03 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w18Jt34c013601; Thu, 8 Feb 2018 19:55:03 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201802081955.w18Jt34c013601@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 8 Feb 2018 19:55:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329024 - in head: . secure/lib/libcrypto secure/usr.bin/openssl secure/usr.bin/openssl/man X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in head: . secure/lib/libcrypto secure/usr.bin/openssl secure/usr.bin/openssl/man X-SVN-Commit-Revision: 329024 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Feb 2018 19:55:04 -0000 Author: jkim Date: Thu Feb 8 19:55:03 2018 New Revision: 329024 URL: https://svnweb.freebsd.org/changeset/base/329024 Log: Remove c_rehash(1) to not confuse users. We do not install the Perl script. MFC after: 3 days Deleted: head/secure/usr.bin/openssl/man/c_rehash.1 Modified: head/ObsoleteFiles.inc head/secure/lib/libcrypto/Makefile.inc head/secure/usr.bin/openssl/Makefile.man Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Feb 8 19:28:51 2018 (r329023) +++ head/ObsoleteFiles.inc Thu Feb 8 19:55:03 2018 (r329024) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20180208: remove c_rehash(1) +OLD_FILES+=usr/share/openssl/man/man1/c_rehash.1.gz # 20180206: remove gdbtui OLD_FILES+=usr/bin/gdbtui # 20180201: Obsolete forth files Modified: head/secure/lib/libcrypto/Makefile.inc ============================================================================== --- head/secure/lib/libcrypto/Makefile.inc Thu Feb 8 19:28:51 2018 (r329023) +++ head/secure/lib/libcrypto/Makefile.inc Thu Feb 8 19:55:03 2018 (r329024) @@ -64,14 +64,11 @@ MANDIR= ${SHAREDIR}/openssl/man/man .if defined(LIB) _docs= ${LIB} -.if ${LIB} == ssl -_docs+= man3 -.endif _skip= SSLeay_version des_modes _sec= 3 .else _docs= apps -_skip= config +_skip= c_rehash config _sec= 1 .endif Modified: head/secure/usr.bin/openssl/Makefile.man ============================================================================== --- head/secure/usr.bin/openssl/Makefile.man Thu Feb 8 19:28:51 2018 (r329023) +++ head/secure/usr.bin/openssl/Makefile.man Thu Feb 8 19:55:03 2018 (r329024) @@ -2,7 +2,6 @@ # DO NOT EDIT: generated from man-makefile-update target MAN+= CA.pl.1 MAN+= asn1parse.1 -MAN+= c_rehash.1 MAN+= ca.1 MAN+= ciphers.1 MAN+= cms.1 From owner-svn-src-all@freebsd.org Thu Feb 8 20:09:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E648CF003FF; Thu, 8 Feb 2018 20:09:42 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B52D7A850; Thu, 8 Feb 2018 20:09:42 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 862D91AB81; Thu, 8 Feb 2018 20:09:42 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w18K9gQW018966; Thu, 8 Feb 2018 20:09:42 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w18K9g0k018965; Thu, 8 Feb 2018 20:09:42 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201802082009.w18K9g0k018965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 8 Feb 2018 20:09:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329025 - head/sys/nfs X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/nfs X-SVN-Commit-Revision: 329025 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Feb 2018 20:09:43 -0000 Author: brooks Date: Thu Feb 8 20:09:42 2018 New Revision: 329025 URL: https://svnweb.freebsd.org/changeset/base/329025 Log: Modernize nfssvc(2) registartion. Use syscall_helper_register() to register syscalls and do it through the module interface rather than sysinit. This pattern is more common and easier to understand. Reviewed by: jhb Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14232 Modified: head/sys/nfs/nfs_nfssvc.c Modified: head/sys/nfs/nfs_nfssvc.c ============================================================================== --- head/sys/nfs/nfs_nfssvc.c Thu Feb 8 19:55:03 2018 (r329024) +++ head/sys/nfs/nfs_nfssvc.c Thu Feb 8 20:09:42 2018 (r329025) @@ -56,9 +56,10 @@ __FBSDID("$FreeBSD$"); #include -static int nfssvc_offset = SYS_nfssvc; -static struct sysent nfssvc_prev_sysent; -MAKE_SYSENT(nfssvc); +static struct syscall_helper_data nfssvc_syscalls[] = { + SYSCALL_INIT_HELPER(nfssvc), + SYSCALL_INIT_LAST +}; /* * This tiny module simply handles the nfssvc() system call. The other @@ -119,16 +120,12 @@ sys_nfssvc(struct thread *td, struct nfssvc_args *uap) static int nfssvc_modevent(module_t mod, int type, void *data) { - static int registered; int error = 0; switch (type) { case MOD_LOAD: - error = syscall_register(&nfssvc_offset, &nfssvc_sysent, - &nfssvc_prev_sysent, SY_THR_STATIC_KLD); - if (error) - break; - registered = 1; + error = syscall_helper_register(nfssvc_syscalls, + SY_THR_STATIC_KLD); break; case MOD_UNLOAD: @@ -137,9 +134,7 @@ nfssvc_modevent(module_t mod, int type, void *data) error = EBUSY; break; } - if (registered) - syscall_deregister(&nfssvc_offset, &nfssvc_prev_sysent); - registered = 0; + syscall_helper_unregister(nfssvc_syscalls); break; default: error = EOPNOTSUPP; From owner-svn-src-all@freebsd.org Thu Feb 8 21:11:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49AFCF0506D; Thu, 8 Feb 2018 21:11:49 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F27317DEBC; Thu, 8 Feb 2018 21:11:48 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D4D321B73A; Thu, 8 Feb 2018 21:11:48 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w18LBmvg061103; Thu, 8 Feb 2018 21:11:48 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w18LBmJt061100; Thu, 8 Feb 2018 21:11:48 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201802082111.w18LBmJt061100@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 8 Feb 2018 21:11:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329033 - in head: contrib/llvm/tools/clang/lib/CodeGen sys/sys X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head: contrib/llvm/tools/clang/lib/CodeGen sys/sys X-SVN-Commit-Revision: 329033 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Feb 2018 21:11:49 -0000 Author: dim Date: Thu Feb 8 21:11:48 2018 New Revision: 329033 URL: https://svnweb.freebsd.org/changeset/base/329033 Log: Pull in r324594 from upstream clang trunk (by Alexander Ivchenko): Fix for #31362 - ms_abi is implemented incorrectly for values >=16 bytes. Summary: This patch is a fix for following issue: https://bugs.llvm.org/show_bug.cgi?id=31362 The problem was caused by front end lowering C calling conventions without taking into account calling conventions enforced by attribute. In this case win64cc was no correctly lowered on targets other than Windows. Reviewed By: rnk (Reid Kleckner) Differential Revision: https://reviews.llvm.org/D43016 Author: belickim This fixes clang 6.0.0 assertions when building the emulators/wine and emulators/wine-devel ports, and should also make it use the correct Windows calling conventions. Bump __FreeBSD_version to make the fix easy to detect. PR: 224863 MFC after: 3 months X-MFC-With: r327952 Modified: head/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp head/sys/sys/param.h Modified: head/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp Thu Feb 8 21:06:30 2018 (r329032) +++ head/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp Thu Feb 8 21:11:48 2018 (r329033) @@ -3543,7 +3543,17 @@ ABIArgInfo X86_64ABIInfo::classifyRegCallStructType(Qu void X86_64ABIInfo::computeInfo(CGFunctionInfo &FI) const { - bool IsRegCall = FI.getCallingConvention() == llvm::CallingConv::X86_RegCall; + const unsigned CallingConv = FI.getCallingConvention(); + // It is possible to force Win64 calling convention on any x86_64 target by + // using __attribute__((ms_abi)). In such case to correctly emit Win64 + // compatible code delegate this call to WinX86_64ABIInfo::computeInfo. + if (CallingConv == llvm::CallingConv::Win64) { + WinX86_64ABIInfo Win64ABIInfo(CGT); + Win64ABIInfo.computeInfo(FI); + return; + } + + bool IsRegCall = CallingConv == llvm::CallingConv::X86_RegCall; // Keep track of the number of assigned registers. unsigned FreeIntRegs = IsRegCall ? 11 : 6; Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Thu Feb 8 21:06:30 2018 (r329032) +++ head/sys/sys/param.h Thu Feb 8 21:11:48 2018 (r329033) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200056 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200057 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Thu Feb 8 22:59:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37C2DF0D0F0; Thu, 8 Feb 2018 22:59:52 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DDF5683DDC; Thu, 8 Feb 2018 22:59:51 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D8C8B1C851; Thu, 8 Feb 2018 22:59:51 +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 w18MxpuQ015225; Thu, 8 Feb 2018 22:59:51 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w18MxpwL015223; Thu, 8 Feb 2018 22:59:51 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802082259.w18MxpwL015223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 8 Feb 2018 22:59:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329050 - in head/stand: . userboot/userboot X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/stand: . userboot/userboot X-SVN-Commit-Revision: 329050 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Feb 2018 22:59:52 -0000 Author: imp Date: Thu Feb 8 22:59:51 2018 New Revision: 329050 URL: https://svnweb.freebsd.org/changeset/base/329050 Log: Fix build of userboot.so Since it's not possible to unset a variable easily, create a new variable 'PIC' to signal that we are creating a shared object that we want to install. defs.mk refains from defining NO_PIC and ITNERALLIB when PIC is defined. This unbreaks userboot.so building. Modified: head/stand/defs.mk head/stand/userboot/userboot/Makefile Modified: head/stand/defs.mk ============================================================================== --- head/stand/defs.mk Thu Feb 8 22:38:39 2018 (r329049) +++ head/stand/defs.mk Thu Feb 8 22:59:51 2018 (r329050) @@ -10,9 +10,11 @@ __BOOT_DEFS_MK__=${MFILE} MK_CTF= no MK_SSP= no MK_PROFILE= no -NO_PIC= MAN= +.if !defined(PIC) +NO_PIC= INTERNALLIB= +.endif BOOTSRC= ${SRCTOP}/stand EFISRC= ${BOOTSRC}/efi Modified: head/stand/userboot/userboot/Makefile ============================================================================== --- head/stand/userboot/userboot/Makefile Thu Feb 8 22:38:39 2018 (r329049) +++ head/stand/userboot/userboot/Makefile Thu Feb 8 22:59:51 2018 (r329050) @@ -4,6 +4,7 @@ LOADER_MSDOS_SUPPORT?= yes LOADER_UFS_SUPPORT?= yes LOADER_CD9660_SUPPORT?= no LOADER_EXT2FS_SUPPORT?= no +PIC=yes .include From owner-svn-src-all@freebsd.org Thu Feb 8 23:06:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4930F0D868; Thu, 8 Feb 2018 23:06:59 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 749F6843A0; Thu, 8 Feb 2018 23:06:59 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F8121C9E6; Thu, 8 Feb 2018 23:06:59 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w18N6xLM020361; Thu, 8 Feb 2018 23:06:59 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w18N6wGT020355; Thu, 8 Feb 2018 23:06:58 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201802082306.w18N6wGT020355@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Thu, 8 Feb 2018 23:06:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329051 - in head: sbin/dumpfs sbin/fsck_ffs sbin/newfs sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in head: sbin/dumpfs sbin/fsck_ffs sbin/newfs sys/ufs/ffs X-SVN-Commit-Revision: 329051 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Feb 2018 23:07:00 -0000 Author: mckusick Date: Thu Feb 8 23:06:58 2018 New Revision: 329051 URL: https://svnweb.freebsd.org/changeset/base/329051 Log: The goal of this change is to prevent accidental foot shooting by folks running filesystems created on check-hash enabled kernels (which I will call "new") on a non-check-hash enabled kernels (which I will call "old). The idea here is to detect when a filesystem is run on an old kernel and flag the filesystem so that when it gets moved back to a new kernel, it will not start getting a slew of check-hash errors. Back when the UFS version 2 filesystem was created, it added a file flag FS_INDEXDIRS that was to be set on any filesystem that kept some sort of on-disk indexing for directories. The idea was precisely to solve the issue we have today. Specifically that a newer kernel that supported indexing would be able to tell that the filesystem had been run on an older non-indexing kernel and that the indexes should not be used until they had been rebuilt. Since we have never implemented on-disk directory indicies, the FS_INDEXDIRS flag is cleared every time any UFS version 2 filesystem ever created is mounted for writing. This commit repurposes the FS_INDEXDIRS flag as the FS_METACKHASH flag. Thus, the FS_METACKHASH is definitively known to have always been cleared. The FS_INDEXDIRS flag has been moved to a new block of flags that will always be cleared starting with this commit (until they get used to implement some future feature which needs to detect that the filesystem was mounted on a kernel that predates the new feature). If a filesystem with check-hashes enabled is mounted on an old kernel the FS_METACKHASH flag is cleared. When that filesystem is mounted on a new kernel it will see that the FS_METACKHASH has been cleared and clears all of the fs_metackhash flags. To get them re-enabled the user must run fsck (in interactive mode without the -y flag) which will ask for each supported check hash whether it should be rebuilt and enabled. When fsck is run in its default preen mode, it will just ignore the check hashes so they will remain disabled. The kernel has always disabled any check hash functions that it does not support, so as more types of check hashes are added, we will get a non-surprising result. Specifically if filesystems get moved to kernels supporting fewer of the check hashes, those that are not supported will be disabled. If the filesystem is moved back to a kernel with more of the check-hashes available and fsck is run interactively to rebuild them, then their checking will resume. Otherwise just the smaller subset will be checked. A side effect of this commit is that filesystems running with cylinder-group check hashes will stop having them checked until fsck is run to re-enable them (since none of them currently have the FS_METACKHASH flag set). So, if you want check hashes enabled on your filesystems after booting a kernel with these changes, you need to run fsck to enable them. Any newly created filesystems will have check hashes enabled. If in doubt as to whether you have check hashes emabled, run dumpfs and look at the list of enabled flags at the end of the superblock details. Modified: head/sbin/dumpfs/dumpfs.c head/sbin/fsck_ffs/pass5.c head/sbin/newfs/mkfs.c head/sys/ufs/ffs/ffs_vfsops.c head/sys/ufs/ffs/fs.h Modified: head/sbin/dumpfs/dumpfs.c ============================================================================== --- head/sbin/dumpfs/dumpfs.c Thu Feb 8 22:59:51 2018 (r329050) +++ head/sbin/dumpfs/dumpfs.c Thu Feb 8 23:06:58 2018 (r329051) @@ -257,9 +257,9 @@ dumpfs(const char *name) if (fsflags & FS_DOSOFTDEP) printf("soft-updates%s ", (fsflags & FS_SUJ) ? "+journal" : ""); if (fsflags & FS_NEEDSFSCK) - printf("needs fsck run "); + printf("needs-fsck-run "); if (fsflags & FS_INDEXDIRS) - printf("indexed directories "); + printf("indexed-directories "); if (fsflags & FS_ACLS) printf("acls "); if (fsflags & FS_MULTILABEL) @@ -267,31 +267,33 @@ dumpfs(const char *name) if (fsflags & FS_GJOURNAL) printf("gjournal "); if (fsflags & FS_FLAGS_UPDATED) - printf("fs_flags expanded "); + printf("fs_flags-expanded "); if (fsflags & FS_NFS4ACLS) printf("nfsv4acls "); if (fsflags & FS_TRIM) printf("trim "); - fsflags &= ~(FS_UNCLEAN | FS_DOSOFTDEP | FS_NEEDSFSCK | FS_INDEXDIRS | + fsflags &= ~(FS_UNCLEAN | FS_DOSOFTDEP | FS_NEEDSFSCK | FS_METACKHASH | FS_ACLS | FS_MULTILABEL | FS_GJOURNAL | FS_FLAGS_UPDATED | - FS_NFS4ACLS | FS_SUJ | FS_TRIM); + FS_NFS4ACLS | FS_SUJ | FS_TRIM | FS_INDEXDIRS); if (fsflags != 0) - printf("unknown flags (%#x)", fsflags); + printf("unknown-flags (%#x)", fsflags); putchar('\n'); - printf("check hashes\t"); - fsflags = afs.fs_metackhash; - if (fsflags == 0) - printf("none"); - if (fsflags & CK_SUPERBLOCK) - printf("superblock "); - if (fsflags & CK_CYLGRP) - printf("cylinder-groups "); - if (fsflags & CK_INODE) - printf("inodes "); - if (fsflags & CK_INDIR) - printf("indirect-blocks "); - if (fsflags & CK_DIR) - printf("directories "); + if (afs.fs_flags & FS_METACKHASH) { + printf("check hashes\t"); + fsflags = afs.fs_metackhash; + if (fsflags == 0) + printf("none"); + if (fsflags & CK_SUPERBLOCK) + printf("superblock "); + if (fsflags & CK_CYLGRP) + printf("cylinder-groups "); + if (fsflags & CK_INODE) + printf("inodes "); + if (fsflags & CK_INDIR) + printf("indirect-blocks "); + if (fsflags & CK_DIR) + printf("directories "); + } fsflags &= ~(CK_SUPERBLOCK | CK_CYLGRP | CK_INODE | CK_INDIR | CK_DIR); if (fsflags != 0) printf("unknown flags (%#x)", fsflags); Modified: head/sbin/fsck_ffs/pass5.c ============================================================================== --- head/sbin/fsck_ffs/pass5.c Thu Feb 8 22:59:51 2018 (r329050) +++ head/sbin/fsck_ffs/pass5.c Thu Feb 8 23:06:58 2018 (r329051) @@ -37,7 +37,6 @@ static const char sccsid[] = "@(#)pass5.c 8.9 (Berkele #include __FBSDID("$FreeBSD$"); -#define IN_RTLD /* So we pickup the P_OSREL defines */ #include #include @@ -63,7 +62,7 @@ pass5(void) int inomapsize, blkmapsize; struct fs *fs = &sblock; ufs2_daddr_t d, dbase, dmax, start; - int rewritecg = 0, cgckadd = 0; + int rewritecg = 0; struct csum *cs; struct csum_total cstotal; struct inodesc idesc[3]; @@ -74,13 +73,10 @@ pass5(void) inoinfo(UFS_WINO)->ino_state = USTATE; memset(newcg, 0, (size_t)fs->fs_cgsize); newcg->cg_niblk = fs->fs_ipg; - if (preen == 0 && yflag == 0 && fs->fs_magic == FS_UFS2_MAGIC && - fswritefd != -1 && (fs->fs_metackhash & CK_CYLGRP) == 0 && - getosreldate() >= P_OSREL_CK_CYLGRP && - reply("ADD CYLINDER GROUP CHECKSUM PROTECTION") != 0) { + /* check to see if we are to add a cylinder group check hash */ + if ((ckhashadd & CK_CYLGRP) != 0) { fs->fs_metackhash |= CK_CYLGRP; rewritecg = 1; - cgckadd = 1; sbdirty(); } if (cvtlevel >= 3) { @@ -178,14 +174,20 @@ pass5(void) cg = cgbp->b_un.b_cg; if (!cg_chkmagic(cg)) pfatal("CG %d: BAD MAGIC NUMBER\n", c); - if ((fs->fs_metackhash & CK_CYLGRP) != 0 && cgckadd == 0) { + /* + * If we have a cylinder group check hash and are not adding + * it for the first time, verify that it is good. + */ + if ((fs->fs_metackhash & CK_CYLGRP) != 0 && + (ckhashadd & CK_CYLGRP) == 0) { uint32_t ckhash, thishash; ckhash = cg->cg_ckhash; cg->cg_ckhash = 0; thishash = calculate_crc32c(~0L, cg, fs->fs_cgsize); if (ckhash != thishash) - pwarn("CG %d: BAD CHECKSUM %#x vs %#x", c, ckhash, thishash); + pwarn("CG %d: BAD CHECK-HASH %#x vs %#x", + c, ckhash, thishash); cg->cg_ckhash = ckhash; } newcg->cg_time = cg->cg_time; Modified: head/sbin/newfs/mkfs.c ============================================================================== --- head/sbin/newfs/mkfs.c Thu Feb 8 22:59:51 2018 (r329050) +++ head/sbin/newfs/mkfs.c Thu Feb 8 23:06:58 2018 (r329051) @@ -489,9 +489,15 @@ restart: } /* * Set flags for metadata that is being check-hashed. + * + * Metadata check hashes are not supported in the UFS version 1 + * filesystem to keep it as small and simple as possible. */ - if (Oflag > 1 && getosreldate() >= P_OSREL_CK_CYLGRP) - sblock.fs_metackhash = CK_CYLGRP; + if (Oflag > 1) { + sblock.fs_flags |= FS_METACKHASH; + if (getosreldate() >= P_OSREL_CK_CYLGRP) + sblock.fs_metackhash = CK_CYLGRP; + } /* * Dump out summary information about file system. Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Thu Feb 8 22:59:51 2018 (r329050) +++ head/sys/ufs/ffs/ffs_vfsops.c Thu Feb 8 23:06:58 2018 (r329051) @@ -809,10 +809,12 @@ ffs_mountfs(devvp, mp, td) if ((error = ffs_sbget(devvp, &fs, -1, M_UFSMNT, ffs_use_bread)) != 0) goto out; fs->fs_fmod = 0; - /* none of these types of check-hashes are maintained */ + /* if we ran on a kernel without metadata check hashes, disable them */ + if ((fs->fs_flags & FS_METACKHASH) == 0) + fs->fs_metackhash = 0; + /* none of these types of check-hashes are maintained by this kernel */ fs->fs_metackhash &= ~(CK_SUPERBLOCK | CK_INODE | CK_INDIR | CK_DIR); - /* no support for directory indices or any other undefined flags */ - fs->fs_flags &= ~FS_INDEXDIRS; + /* no support for any undefined flags */ fs->fs_flags &= FS_SUPPORTED; fs->fs_flags &= ~FS_UNCLEAN; if (fs->fs_clean == 0) { Modified: head/sys/ufs/ffs/fs.h ============================================================================== --- head/sys/ufs/ffs/fs.h Thu Feb 8 22:59:51 2018 (r329050) +++ head/sys/ufs/ffs/fs.h Thu Feb 8 23:06:58 2018 (r329051) @@ -433,18 +433,31 @@ CTASSERT(sizeof(struct fs) == 1376); * labels into extended attributes on the file system rather than maintain * a single mount label for all objects. */ -#define FS_UNCLEAN 0x0001 /* filesystem not clean at mount */ -#define FS_DOSOFTDEP 0x0002 /* filesystem using soft dependencies */ -#define FS_NEEDSFSCK 0x0004 /* filesystem needs sync fsck before mount */ -#define FS_SUJ 0x0008 /* Filesystem using softupdate journal */ -#define FS_ACLS 0x0010 /* file system has POSIX.1e ACLs enabled */ -#define FS_MULTILABEL 0x0020 /* file system is MAC multi-label */ -#define FS_GJOURNAL 0x0040 /* gjournaled file system */ -#define FS_FLAGS_UPDATED 0x0080 /* flags have been moved to new location */ -#define FS_NFS4ACLS 0x0100 /* file system has NFSv4 ACLs enabled */ -#define FS_INDEXDIRS 0x0200 /* kernel supports indexed directories */ -#define FS_TRIM 0x0400 /* issue BIO_DELETE for deleted blocks */ -#define FS_SUPPORTED 0xFFFF /* supported flags, others cleared at mount */ +#define FS_UNCLEAN 0x00000001 /* filesystem not clean at mount */ +#define FS_DOSOFTDEP 0x00000002 /* filesystem using soft dependencies */ +#define FS_NEEDSFSCK 0x00000004 /* filesystem needs sync fsck before mount */ +#define FS_SUJ 0x00000008 /* Filesystem using softupdate journal */ +#define FS_ACLS 0x00000010 /* file system has POSIX.1e ACLs enabled */ +#define FS_MULTILABEL 0x00000020 /* file system is MAC multi-label */ +#define FS_GJOURNAL 0x00000040 /* gjournaled file system */ +#define FS_FLAGS_UPDATED 0x0000080 /* flags have been moved to new location */ +#define FS_NFS4ACLS 0x00000100 /* file system has NFSv4 ACLs enabled */ +#define FS_METACKHASH 0x00000200 /* kernel supports metadata check hashes */ +#define FS_TRIM 0x00000400 /* issue BIO_DELETE for deleted blocks */ +#define FS_SUPPORTED 0x00FFFFFF /* supported flags, others cleared at mount*/ +/* + * Things that we may someday support, but currently do not. + * These flags are all cleared so we know if we ran on a kernel + * that does not support them. + */ +#define FS_INDEXDIRS 0x01000000 /* kernel supports indexed directories */ +#define FS_VARBLKSIZE 0x02000000 /* kernel supports variable block sizes */ +#define FS_COOLOPT1 0x04000000 /* kernel supports cool option 1 */ +#define FS_COOLOPT2 0x08000000 /* kernel supports cool option 2 */ +#define FS_COOLOPT3 0x10000000 /* kernel supports cool option 3 */ +#define FS_COOLOPT4 0x20000000 /* kernel supports cool option 4 */ +#define FS_COOLOPT5 0x40000000 /* kernel supports cool option 5 */ +#define FS_COOLOPT6 0x80000000 /* kernel supports cool option 6 */ /* * The fs_metackhash field indicates the types of metadata check-hash From owner-svn-src-all@freebsd.org Thu Feb 8 23:14:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6095F0E0C5; Thu, 8 Feb 2018 23:14:25 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8CB388497E; Thu, 8 Feb 2018 23:14:25 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 879271CB9C; Thu, 8 Feb 2018 23:14:25 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w18NEPV0025219; Thu, 8 Feb 2018 23:14:25 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w18NEP8F025216; Thu, 8 Feb 2018 23:14:25 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201802082314.w18NEP8F025216@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Thu, 8 Feb 2018 23:14:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329052 - head/sbin/fsck_ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sbin/fsck_ffs X-SVN-Commit-Revision: 329052 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 08 Feb 2018 23:14:26 -0000 Author: mckusick Date: Thu Feb 8 23:14:24 2018 New Revision: 329052 URL: https://svnweb.freebsd.org/changeset/base/329052 Log: Include files missed in 329051. Modified: head/sbin/fsck_ffs/fsck.h head/sbin/fsck_ffs/globs.c head/sbin/fsck_ffs/main.c Modified: head/sbin/fsck_ffs/fsck.h ============================================================================== --- head/sbin/fsck_ffs/fsck.h Thu Feb 8 23:06:58 2018 (r329051) +++ head/sbin/fsck_ffs/fsck.h Thu Feb 8 23:14:24 2018 (r329052) @@ -315,6 +315,7 @@ extern int Zflag; /* zero empty data blocks */ extern int inoopt; /* trim out unused inodes */ extern char ckclean; /* only do work if not cleanly unmounted */ extern int cvtlevel; /* convert to newer file system format */ +extern int ckhashadd; /* check hashes to be added */ extern int bkgrdcheck; /* determine if background check is possible */ extern int bkgrdsumadj; /* whether the kernel have ability to adjust superblock summary */ extern char usedsoftdep; /* just fix soft dependency inconsistencies */ Modified: head/sbin/fsck_ffs/globs.c ============================================================================== --- head/sbin/fsck_ffs/globs.c Thu Feb 8 23:06:58 2018 (r329051) +++ head/sbin/fsck_ffs/globs.c Thu Feb 8 23:14:24 2018 (r329052) @@ -87,6 +87,7 @@ int Zflag; /* zero empty data blocks */ int inoopt; /* trim out unused inodes */ char ckclean; /* only do work if not cleanly unmounted */ int cvtlevel; /* convert to newer file system format */ +int ckhashadd; /* check hashes to be added */ int bkgrdcheck; /* determine if background check is possible */ int bkgrdsumadj; /* whether the kernel have ability to adjust superblock summary */ char usedsoftdep; /* just fix soft dependency inconsistencies */ Modified: head/sbin/fsck_ffs/main.c ============================================================================== --- head/sbin/fsck_ffs/main.c Thu Feb 8 23:06:58 2018 (r329051) +++ head/sbin/fsck_ffs/main.c Thu Feb 8 23:14:24 2018 (r329052) @@ -43,6 +43,7 @@ static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/14 #include __FBSDID("$FreeBSD$"); +#define IN_RTLD /* So we pickup the P_OSREL defines */ #include #include #include @@ -440,7 +441,46 @@ checkfilesys(char *filesys) flush(fswritefd, &sblk); fsmodified = ofsmodified; } - + /* + * If the filesystem was run on an old kernel that did not + * support check hashes, clear the check-hash flags so that + * we do not try to verify them. + */ + if ((sblock.fs_flags & FS_METACKHASH) == 0) + sblock.fs_metackhash = 0; + /* + * If we are running on a kernel that can provide check hashes + * that are not yet enabled for the filesystem and we are + * running manually without the -y flag, offer to add any + * supported check hashes that are not already enabled. + */ + ckhashadd = 0; + if (preen == 0 && yflag == 0 && sblock.fs_magic != FS_UFS1_MAGIC && + fswritefd != -1 && getosreldate() >= P_OSREL_CK_CYLGRP) { + if ((sblock.fs_metackhash & CK_CYLGRP) == 0 && + reply("ADD CYLINDER GROUP CHECK-HASH PROTECTION") != 0) + ckhashadd |= CK_CYLGRP; +#ifdef notyet + if ((sblock.fs_metackhash & CK_SUPERBLOCK) == 0 && + getosreldate() >= P_OSREL_CK_SUPERBLOCK && + reply("ADD SUPERBLOCK CHECK-HASH PROTECTION") != 0) + ckhashadd |= CK_SUPERBLOCK; + if ((sblock.fs_metackhash & CK_INODE) == 0 && + getosreldate() >= P_OSREL_CK_INODE && + reply("ADD INODE CHECK-HASH PROTECTION") != 0) + ckhashadd |= CK_INODE; + if ((sblock.fs_metackhash & CK_INDIR) == 0 && + getosreldate() >= P_OSREL_CK_INDIR && + reply("ADD INDIRECT BLOCK CHECK-HASH PROTECTION") != 0) + ckhashadd |= CK_INDIR; + if ((sblock.fs_metackhash & CK_DIR) == 0 && + getosreldate() >= P_OSREL_CK_DIR && + reply("ADD DIRECTORY CHECK-HASH PROTECTION") != 0) + ckhashadd |= CK_DIR; +#endif /* notyet */ + if (ckhashadd != 0) + sblock.fs_flags |= FS_METACKHASH; + } /* * Cleared if any questions answered no. Used to decide if * the superblock should be marked clean. From owner-svn-src-all@freebsd.org Fri Feb 9 00:13:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 162CAF12557; Fri, 9 Feb 2018 00:13:06 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7649086FA9; Fri, 9 Feb 2018 00:13:05 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 716581D558; Fri, 9 Feb 2018 00:13:05 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w190D5UI054471; Fri, 9 Feb 2018 00:13:05 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w190D5lm054470; Fri, 9 Feb 2018 00:13:05 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201802090013.w190D5lm054470@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Fri, 9 Feb 2018 00:13:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329053 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 329053 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Feb 2018 00:13:06 -0000 Author: vangyzen Date: Fri Feb 9 00:13:05 2018 New Revision: 329053 URL: https://svnweb.freebsd.org/changeset/base/329053 Log: Fix ICMPv6 redirects icmp6_redirect_input() validates that a redirect packet came from the current gateway for the respective destination. To do this, it compares the source address, which has an embedded scope zone id, to the next-hop address, which does not. If the address is link-local, which should be the case, the comparison fails and the redirect is ignored. Insert the scope zone id into the next-hop address so the comparison is accurate. Unsurprisingly, this fixes 35 UNH IPv6 conformance test cases. Submitted by: Farrell Woods (initial revision) Reviewed by: ae melifaro dab MFC after: 1 week Relnotes: yes Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D14254 Modified: head/sys/netinet6/icmp6.c Modified: head/sys/netinet6/icmp6.c ============================================================================== --- head/sys/netinet6/icmp6.c Thu Feb 8 23:14:24 2018 (r329052) +++ head/sys/netinet6/icmp6.c Fri Feb 9 00:13:05 2018 (r329053) @@ -2305,6 +2305,14 @@ icmp6_redirect_input(struct mbuf *m, int off) goto bad; } + /* + * Embed scope zone id into next hop address, since + * fib6_lookup_nh_basic() returns address without embedded + * scope zone id. + */ + if (in6_setscope(&nh6.nh_addr, m->m_pkthdr.rcvif, NULL)) + goto freeit; + if (IN6_ARE_ADDR_EQUAL(&src6, &nh6.nh_addr) == 0) { nd6log((LOG_ERR, "ICMP6 redirect rejected; " From owner-svn-src-all@freebsd.org Fri Feb 9 00:36:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22D8FF13C02; Fri, 9 Feb 2018 00:36:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CE86787C46; Fri, 9 Feb 2018 00:36: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C947B1D8A7; Fri, 9 Feb 2018 00:36: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 w190atmv064447; Fri, 9 Feb 2018 00:36:55 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w190atVK064445; Fri, 9 Feb 2018 00:36:55 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802090036.w190atVK064445@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 9 Feb 2018 00:36:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329054 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 329054 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Feb 2018 00:36:56 -0000 Author: imp Date: Fri Feb 9 00:36:55 2018 New Revision: 329054 URL: https://svnweb.freebsd.org/changeset/base/329054 Log: Set script.lang in the environment to either 'forth' or 'simple' to reflect what scripting language was compiled into the loader. I anticipate that being able to find this out quickly from the OK prompt will be useful in troubleshooting in the future. Modified: head/stand/common/interp_forth.c head/stand/common/interp_simple.c Modified: head/stand/common/interp_forth.c ============================================================================== --- head/stand/common/interp_forth.c Fri Feb 9 00:13:05 2018 (r329053) +++ head/stand/common/interp_forth.c Fri Feb 9 00:36:55 2018 (r329054) @@ -337,6 +337,7 @@ void interp_init(void) { + setenv("script.lang", "forth", 1); bf_init(); /* Read our default configuration. */ interp_include("/boot/loader.rc"); Modified: head/stand/common/interp_simple.c ============================================================================== --- head/stand/common/interp_simple.c Fri Feb 9 00:13:05 2018 (r329053) +++ head/stand/common/interp_simple.c Fri Feb 9 00:36:55 2018 (r329054) @@ -39,6 +39,7 @@ void interp_init(void) { + setenv("script.lang", "simple", 1); /* Read our default configuration. */ interp_include("/boot/loader.rc"); } From owner-svn-src-all@freebsd.org Fri Feb 9 03:06:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CFEDF1E0E1; Fri, 9 Feb 2018 03:06:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 30A6A6D924; Fri, 9 Feb 2018 03:06:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B7081F1F1; Fri, 9 Feb 2018 03:06:46 +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 w1936jVV040107; Fri, 9 Feb 2018 03:06:45 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1936jhN040106; Fri, 9 Feb 2018 03:06:45 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201802090306.w1936jhN040106@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 9 Feb 2018 03:06:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329056 - stable/11/sys/dev/ntb X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/dev/ntb X-SVN-Commit-Revision: 329056 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Feb 2018 03:06:46 -0000 Author: mav Date: Fri Feb 9 03:06:45 2018 New Revision: 329056 URL: https://svnweb.freebsd.org/changeset/base/329056 Log: MFC r328450: Use bus_dmamem_alloc(9) KPI instead of contigmalloc(9). I suppose it should make this code NUMA-aware with recent NUMA drop-in, trying to allocate shared memory buffers from domain closer to NT-bridge. Modified: stable/11/sys/dev/ntb/ntb_transport.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ntb/ntb_transport.c ============================================================================== --- stable/11/sys/dev/ntb/ntb_transport.c Fri Feb 9 00:38:50 2018 (r329055) +++ stable/11/sys/dev/ntb/ntb_transport.c Fri Feb 9 03:06:45 2018 (r329056) @@ -182,6 +182,8 @@ struct ntb_transport_mw { size_t xlat_size; size_t buff_size; /* Rx buff is off virt_addr / dma_addr */ + bus_dma_tag_t dma_tag; + bus_dmamap_t dma_map; caddr_t virt_addr; bus_addr_t dma_addr; }; @@ -1147,10 +1149,25 @@ out: NTB_LINK_DOWN_TIMEOUT * hz / 1000, ntb_transport_link_work, nt); } +struct ntb_load_cb_args { + bus_addr_t addr; + int error; +}; + +static void +ntb_load_cb(void *xsc, bus_dma_segment_t *segs, int nsegs, int error) +{ + struct ntb_load_cb_args *cba = (struct ntb_load_cb_args *)xsc; + + if (!(cba->error = error)) + cba->addr = segs[0].ds_addr; +} + static int ntb_set_mw(struct ntb_transport_ctx *nt, int num_mw, size_t size) { struct ntb_transport_mw *mw = &nt->mw_vec[num_mw]; + struct ntb_load_cb_args cba; size_t xlat_size, buff_size; int rc; @@ -1171,30 +1188,36 @@ ntb_set_mw(struct ntb_transport_ctx *nt, int num_mw, s mw->xlat_size = xlat_size; mw->buff_size = buff_size; - mw->virt_addr = contigmalloc(mw->buff_size, M_NTB_T, M_ZERO, 0, - mw->addr_limit, mw->xlat_align, 0); - if (mw->virt_addr == NULL) { + if (bus_dma_tag_create(bus_get_dma_tag(nt->dev), mw->xlat_align, 0, + mw->addr_limit, BUS_SPACE_MAXADDR, + NULL, NULL, mw->buff_size, 1, mw->buff_size, + 0, NULL, NULL, &mw->dma_tag)) { + ntb_printf(0, "Unable to create MW tag of size %zu/%zu\n", + mw->buff_size, mw->xlat_size); + mw->xlat_size = 0; + mw->buff_size = 0; + return (ENOMEM); + } + if (bus_dmamem_alloc(mw->dma_tag, (void **)&mw->virt_addr, + BUS_DMA_WAITOK | BUS_DMA_ZERO, &mw->dma_map)) { + bus_dma_tag_destroy(mw->dma_tag); ntb_printf(0, "Unable to allocate MW buffer of size %zu/%zu\n", mw->buff_size, mw->xlat_size); mw->xlat_size = 0; mw->buff_size = 0; return (ENOMEM); } - /* TODO: replace with bus_space_* functions */ - mw->dma_addr = vtophys(mw->virt_addr); - - /* - * Ensure that the allocation from contigmalloc is aligned as - * requested. XXX: This may not be needed -- brought in for parity - * with the Linux driver. - */ - if (mw->dma_addr % mw->xlat_align != 0) { - ntb_printf(0, - "DMA memory 0x%jx not aligned to BAR size 0x%zx\n", - (uintmax_t)mw->dma_addr, size); - ntb_free_mw(nt, num_mw); + if (bus_dmamap_load(mw->dma_tag, mw->dma_map, mw->virt_addr, + mw->buff_size, ntb_load_cb, &cba, BUS_DMA_NOWAIT) || cba.error) { + bus_dmamem_free(mw->dma_tag, mw->virt_addr, mw->dma_map); + bus_dma_tag_destroy(mw->dma_tag); + ntb_printf(0, "Unable to load MW buffer of size %zu/%zu\n", + mw->buff_size, mw->xlat_size); + mw->xlat_size = 0; + mw->buff_size = 0; return (ENOMEM); } + mw->dma_addr = cba.addr; /* Notify HW the memory location of the receive buffer */ rc = ntb_mw_set_trans(nt->dev, num_mw, mw->dma_addr, mw->xlat_size); @@ -1216,7 +1239,9 @@ ntb_free_mw(struct ntb_transport_ctx *nt, int num_mw) return; ntb_mw_clear_trans(nt->dev, num_mw); - contigfree(mw->virt_addr, mw->xlat_size, M_NTB_T); + bus_dmamap_unload(mw->dma_tag, mw->dma_map); + bus_dmamem_free(mw->dma_tag, mw->virt_addr, mw->dma_map); + bus_dma_tag_destroy(mw->dma_tag); mw->xlat_size = 0; mw->buff_size = 0; mw->virt_addr = NULL; From owner-svn-src-all@freebsd.org Fri Feb 9 03:07:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FFC6F1E193; Fri, 9 Feb 2018 03:07:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 25BBB6DA52; Fri, 9 Feb 2018 03:07: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 209821F1F3; Fri, 9 Feb 2018 03:07: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 w1937D91040188; Fri, 9 Feb 2018 03:07:13 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1937DVm040187; Fri, 9 Feb 2018 03:07:13 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201802090307.w1937DVm040187@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 9 Feb 2018 03:07:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329057 - stable/11/sys/dev/ntb X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/dev/ntb X-SVN-Commit-Revision: 329057 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Feb 2018 03:07:13 -0000 Author: mav Date: Fri Feb 9 03:07:12 2018 New Revision: 329057 URL: https://svnweb.freebsd.org/changeset/base/329057 Log: MFC r328611: Try to preallocate receive memory early. We may not have enough contiguous memory later, when NTB connection get established. It is quite likely that NTB windows are symmetric and this allocation remain, but even if not, we will just reallocate it later. Modified: stable/11/sys/dev/ntb/ntb_transport.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ntb/ntb_transport.c ============================================================================== --- stable/11/sys/dev/ntb/ntb_transport.c Fri Feb 9 03:06:45 2018 (r329056) +++ stable/11/sys/dev/ntb/ntb_transport.c Fri Feb 9 03:07:12 2018 (r329057) @@ -332,7 +332,7 @@ ntb_transport_attach(device_t dev) struct ntb_transport_child **cpp = &nt->child; struct ntb_transport_child *nc; struct ntb_transport_mw *mw; - uint64_t db_bitmap; + uint64_t db_bitmap, size; int rc, i, db_count, spad_count, qp, qpu, qpo, qpt; char cfg[128] = ""; char buf[32]; @@ -383,6 +383,17 @@ ntb_transport_attach(device_t dev) rc = ntb_mw_set_wc(dev, i, VM_MEMATTR_WRITE_COMBINING); if (rc) ntb_printf(0, "Unable to set mw%d caching\n", i); + + /* + * Try to preallocate receive memory early, since there may + * be not enough contiguous memory later. It is quite likely + * that NTB windows are symmetric and this allocation remain, + * but even if not, we will just reallocate it later. + */ + size = mw->phys_size; + if (max_mw_size != 0 && size > max_mw_size) + size = max_mw_size; + ntb_set_mw(nt, i, size); } qpu = 0; From owner-svn-src-all@freebsd.org Fri Feb 9 04:45:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9594AF03382; Fri, 9 Feb 2018 04:45:40 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46317710D6; Fri, 9 Feb 2018 04:45:40 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 40A1F20292; Fri, 9 Feb 2018 04:45:40 +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 w194jenF089413; Fri, 9 Feb 2018 04:45:40 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w194jduj089409; Fri, 9 Feb 2018 04:45:39 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201802090445.w194jduj089409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 9 Feb 2018 04:45:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329058 - in head/sys: kern vm X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys: kern vm X-SVN-Commit-Revision: 329058 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Feb 2018 04:45:40 -0000 Author: glebius Date: Fri Feb 9 04:45:39 2018 New Revision: 329058 URL: https://svnweb.freebsd.org/changeset/base/329058 Log: Fix boot_pages exhaustion on machines with many domains and cores, where size of UMA zone allocation is greater than page size. In this case zone of zones can not use UMA_MD_SMALL_ALLOC, and we need to postpone switch off of this zone from startup_alloc() until full launch of VM. o Always supply number of VM zones to uma_startup_count(). On machines with UMA_MD_SMALL_ALLOC ignore it completely, unless zsize goes over a page. In the latter case account VM zones for number of allocations from the zone of zones. o Rewrite startup_alloc() so that it will immediately switch off from itself any zone that is already capable of running real alloc. In worst case scenario we may leak a single page here. See comment in uma_startup_count(). o Hardcode call to uma_startup2() into vm_mem_init(). Otherwise some extra SYSINITs, e.g. vm_page_init() may sneak in before. o While here, remove uma_boot_pages_mtx. With recent changes to boot pages calculation, we are guaranteed to use all of the boot_pages in the early single threaded stage. Reported & tested by: mav Modified: head/sys/kern/kern_malloc.c head/sys/vm/uma_core.c head/sys/vm/vm_init.c head/sys/vm/vm_page.c Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Fri Feb 9 03:07:12 2018 (r329057) +++ head/sys/kern/kern_malloc.c Fri Feb 9 04:45:39 2018 (r329058) @@ -96,8 +96,6 @@ __FBSDID("$FreeBSD$"); dtrace_malloc_probe_func_t dtrace_malloc_probe; #endif -extern void uma_startup2(void); - #if defined(INVARIANTS) || defined(MALLOC_MAKE_FAILURES) || \ defined(DEBUG_MEMGUARD) || defined(DEBUG_REDZONE) #define MALLOC_DEBUG 1 @@ -928,8 +926,6 @@ mallocinit(void *dummy) mtx_init(&malloc_mtx, "malloc", NULL, MTX_DEF); kmeminit(); - - uma_startup2(); if (kmem_zmax < PAGE_SIZE || kmem_zmax > KMEM_ZMAX) kmem_zmax = KMEM_ZMAX; Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Fri Feb 9 03:07:12 2018 (r329057) +++ head/sys/vm/uma_core.c Fri Feb 9 04:45:39 2018 (r329058) @@ -134,13 +134,10 @@ static struct rwlock_padalign __exclusive_cache_line u /* * Pointer and counter to pool of pages, that is preallocated at - * startup to bootstrap UMA. Early zones continue to use the pool - * until it is depleted, so allocations may happen after boot, thus - * we need a mutex to protect it. + * startup to bootstrap UMA. */ static char *bootmem; static int boot_pages; -static struct mtx uma_boot_pages_mtx; static struct sx uma_drain_lock; @@ -1081,37 +1078,46 @@ startup_alloc(uma_zone_t zone, vm_size_t bytes, int do int pages; keg = zone_first_keg(zone); - pages = howmany(bytes, PAGE_SIZE); - KASSERT(pages > 0, ("startup_alloc can't reserve 0 pages\n")); /* - * Check our small startup cache to see if it has pages remaining. + * If we are in BOOT_BUCKETS or higher, than switch to real + * allocator. Zones with page sized slabs switch at BOOT_PAGEALLOC. */ - mtx_lock(&uma_boot_pages_mtx); - if (pages <= boot_pages) { -#ifdef DIAGNOSTIC - printf("%s from \"%s\", %d boot pages left\n", __func__, - zone->uz_name, boot_pages); + switch (booted) { + case BOOT_COLD: + case BOOT_STRAPPED: + break; + case BOOT_PAGEALLOC: + if (keg->uk_ppera > 1) + break; + case BOOT_BUCKETS: + case BOOT_RUNNING: +#ifdef UMA_MD_SMALL_ALLOC + keg->uk_allocf = (keg->uk_ppera > 1) ? + page_alloc : uma_small_alloc; +#else + keg->uk_allocf = page_alloc; #endif - mem = bootmem; - boot_pages -= pages; - bootmem += pages * PAGE_SIZE; - mtx_unlock(&uma_boot_pages_mtx); - *pflag = UMA_SLAB_BOOT; - return (mem); + return keg->uk_allocf(zone, bytes, domain, pflag, wait); } - mtx_unlock(&uma_boot_pages_mtx); - if (booted < BOOT_PAGEALLOC) - panic("UMA zone \"%s\": Increase vm.boot_pages", zone->uz_name); + /* - * Now that we've booted reset these users to their real allocator. + * Check our small startup cache to see if it has pages remaining. */ -#ifdef UMA_MD_SMALL_ALLOC - keg->uk_allocf = (keg->uk_ppera > 1) ? page_alloc : uma_small_alloc; -#else - keg->uk_allocf = page_alloc; + pages = howmany(bytes, PAGE_SIZE); + KASSERT(pages > 0, ("%s can't reserve 0 pages", __func__)); + if (pages > boot_pages) + panic("UMA zone \"%s\": Increase vm.boot_pages", zone->uz_name); +#ifdef DIAGNOSTIC + printf("%s from \"%s\", %d boot pages left\n", __func__, zone->uz_name, + boot_pages); #endif - return keg->uk_allocf(zone, bytes, domain, pflag, wait); + mem = bootmem; + boot_pages -= pages; + bootmem += pages * PAGE_SIZE; + *pflag = UMA_SLAB_BOOT; + + return (mem); } /* @@ -1789,9 +1795,9 @@ zone_foreach(void (*zfunc)(uma_zone_t)) #define UMA_BOOT_ALIGN 32 static int zsize, ksize; int -uma_startup_count(int zones) +uma_startup_count(int vm_zones) { - int pages; + int zones, pages; ksize = sizeof(struct uma_keg) + (sizeof(struct uma_domain) * vm_ndomains); @@ -1806,12 +1812,17 @@ uma_startup_count(int zones) pages = howmany(roundup(zsize, CACHE_LINE_SIZE) * 2 + roundup(ksize, CACHE_LINE_SIZE), PAGE_SIZE); - zones += UMA_BOOT_ZONES; +#ifdef UMA_MD_SMALL_ALLOC + zones = UMA_BOOT_ZONES; +#else + zones = UMA_BOOT_ZONES + vm_zones; + vm_zones = 0; +#endif /* Memory for the rest of startup zones, UMA and VM, ... */ if (zsize > UMA_SLAB_SIZE) - pages += zones * howmany(roundup2(zsize, UMA_BOOT_ALIGN), - UMA_SLAB_SIZE); + pages += (zones + vm_zones) * + howmany(roundup2(zsize, UMA_BOOT_ALIGN), UMA_SLAB_SIZE); else pages += howmany(zones, UMA_SLAB_SPACE / roundup2(zsize, UMA_BOOT_ALIGN)); @@ -1872,7 +1883,6 @@ uma_startup(void *mem, int npages) args.flags = UMA_ZFLAG_INTERNAL; zone_ctor(kegs, zsize, &args, M_WAITOK); - mtx_init(&uma_boot_pages_mtx, "UMA boot pages", NULL, MTX_DEF); bootmem = mem; boot_pages = npages; @@ -1917,6 +1927,9 @@ void uma_startup2(void) { +#ifdef DIAGNOSTIC + printf("Entering %s with %d boot pages left\n", __func__, boot_pages); +#endif booted = BOOT_BUCKETS; sx_init(&uma_drain_lock, "umadrain"); bucket_enable(); Modified: head/sys/vm/vm_init.c ============================================================================== --- head/sys/vm/vm_init.c Fri Feb 9 03:07:12 2018 (r329057) +++ head/sys/vm/vm_init.c Fri Feb 9 04:45:39 2018 (r329058) @@ -95,6 +95,7 @@ __FBSDID("$FreeBSD$"); #include extern void uma_startup1(void); +extern void uma_startup2(void); extern void vm_radix_reserve_kva(void); #if VM_NRESERVLEVEL > 0 @@ -183,9 +184,9 @@ vm_mem_init(dummy) #ifndef UMA_MD_SMALL_ALLOC /* Set up radix zone to use noobj_alloc. */ vm_radix_reserve_kva(); - /* Announce page availability to UMA. */ - uma_startup1(); #endif + /* Announce full page availability to UMA. */ + uma_startup2(); kmem_init_zero_region(); pmap_init(); vm_pager_init(); Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Fri Feb 9 03:07:12 2018 (r329057) +++ head/sys/vm/vm_page.c Fri Feb 9 04:45:39 2018 (r329058) @@ -506,16 +506,13 @@ vm_page_startup(vm_offset_t vaddr) * Allocate memory for use when boot strapping the kernel memory * allocator. Tell UMA how many zones we are going to create * before going fully functional. UMA will add its zones. - */ -#ifdef UMA_MD_SMALL_ALLOC - boot_pages = uma_startup_count(0); -#else - /* + * * VM startup zones: vmem, vmem_btag, VM OBJECT, RADIX NODE, MAP, * KMAP ENTRY, MAP ENTRY, VMSPACE. */ boot_pages = uma_startup_count(8); +#ifndef UMA_MD_SMALL_ALLOC /* vmem_startup() calls uma_prealloc(). */ boot_pages += vmem_startup_count(); /* vm_map_startup() calls uma_prealloc(). */ From owner-svn-src-all@freebsd.org Fri Feb 9 05:29:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 821C6F05D72; Fri, 9 Feb 2018 05:29:17 +0000 (UTC) (envelope-from Andre.Albsmeier@siemens.com) Received: from goliath.siemens.de (goliath.siemens.de [192.35.17.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "goliath.siemens.de", Issuer "Siemens Issuing CA Internet Server 2017" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A595E7264A; Fri, 9 Feb 2018 05:29:16 +0000 (UTC) (envelope-from Andre.Albsmeier@siemens.com) Received: from mail3.siemens.de (mail3.siemens.de [139.25.208.14]) by goliath.siemens.de (8.15.2/8.15.2) with ESMTPS id w195PKdI029693 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 9 Feb 2018 06:25:20 +0100 Received: from curry.mchp.siemens.de (curry.mchp.siemens.de [139.25.40.130]) by mail3.siemens.de (8.15.2/8.15.2) with ESMTP id w195PKwg014191; Fri, 9 Feb 2018 06:25:20 +0100 Received: (from user@localhost) by curry.mchp.siemens.de (8.15.2/8.15.2) id w195PK5N039787; Date: Fri, 9 Feb 2018 06:25:20 +0100 From: Andre Albsmeier To: Alexander Motin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r328692 - in stable/11/sys: conf dev/nvme Message-ID: <20180209052520.GA19647@bali> References: <201802011653.w11Gr8p4031848@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201802011653.w11Gr8p4031848@repo.freebsd.org> User-Agent: Mutt/1.7.2 (2016-11-26) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Feb 2018 05:29:17 -0000 On Thu, 01-Feb-2018 at 16:53:08 +0000, Alexander Motin wrote: > Author: mav > Date: Thu Feb 1 16:53:08 2018 > New Revision: 328692 > URL: https://svnweb.freebsd.org/changeset/base/328692 > > Log: > MFC r322995 (by imp): > Add new compile-time option NVME_USE_NVD that sets the default value We probably need this one as well: me-2@buildbox:/usr/src>odiff sys/modules/nvme/Makefile --- sys/modules/nvme/Makefile.ORI 2017-05-31 06:17:35.982891000 +0200 +++ sys/modules/nvme/Makefile 2018-02-09 06:19:57.268173000 +0100 @@ -17,6 +17,7 @@ bus_if.h \ device_if.h \ opt_cam.h \ + opt_nvme.h \ pci_if.h .include -Andre From owner-svn-src-all@freebsd.org Fri Feb 9 09:15:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3343CF12873; Fri, 9 Feb 2018 09:15:45 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D8FEF799BA; Fri, 9 Feb 2018 09:15:44 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CFA2122E5D; Fri, 9 Feb 2018 09:15:44 +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 w199FimK022993; Fri, 9 Feb 2018 09:15:44 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w199FhKm022979; Fri, 9 Feb 2018 09:15:43 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201802090915.w199FhKm022979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 9 Feb 2018 09:15:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329059 - in stable/11/usr.bin/mkimg: . tests X-SVN-Group: stable-11 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in stable/11/usr.bin/mkimg: . tests X-SVN-Commit-Revision: 329059 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Feb 2018 09:15:45 -0000 Author: manu Date: Fri Feb 9 09:15:43 2018 New Revision: 329059 URL: https://svnweb.freebsd.org/changeset/base/329059 Log: MFC r306325, r306329-r306330, r306333, r306620-r306622, r307544, r307550, r318137, r319125, r319295 r306325 by marcel: Replace the use of linker sets with constructors for both the formats and schemes. Formats and schemes are registered at runtime now, rather than collected at link time. r306329 by marcel: Eliminate the use of EDOOFUS. The error code was used to signal programming errors, but is really a poor substitute for assert. And less portable as well. r306330 by marcel: Avoid depending on the header for le*enc and be*enc. Not only is the header unportable, the encoding/decoding functions are as well. Instead, duplicate the handful of small inlines we need into a private header called endian.h. Aside: an alternative approach is to move the encoding/decoding functions to a separate system header. While the header is still nonportable, such an approach would make it possible to re-use the definitions by playing games with include paths. This may be the preferred approach if more (build) utilities need this. This change does not preclude that. In fact, it makes it easier. r306333 by marcel: Portability changes: 1. macOS nor Linux have MAP_NOCORE nor MAP_NOSYNC. Define as 0. 2. macOS doesn't have SEEK_DATA nor SEEK_HOLE. Define as -1 so that lseek will return -1 (with errno set to EINVAL). 3. gcc correctly warns that error is assigned but not used in image_copyout_region(). Fix by returning on the first error. r306620 by marcel: Replace STAILQ with TAILQ. TAILQs are portable enough that they can be used on both macOS and Linux. STAILQs are not. In particular, STAILQ_LAST does not next on Linux. Since neither STAILQ_FOREACH_SAFE nor TAILQ_FOREACH_SAFE exist on Linux, replace its use with a regular TAILQ_FOREACH. The _SAFE variant was only used for having the next pointer in a local variable. r306621 by marcel: Prefer over . While here remove redundant inclusion of . Move the inclusion of the disk partitioning headers out of order and inbetween standard headers and local header. They will change in a subsequent commit. r306622 by marcel: Replace OFF_MAX with INT64_MAX. The former is defined on Linux. r307544 by marcel: o Provide a private definition for UUIDs (mkimg_uuid_t) because UUIDs are not portable. o Move mkimg_uuid() to a new file and merge both gpt_uuid_enc() and vhd_uuid_enc() into a single mkimg_uuid_enc() that lives in the same file. o Move the OS-specific implementation of generating a UUID to osdep_uuidgen() and provide the implementations for FreeBSD, macOS and Linux. o Expect the partitioning scheme headers to be found by having a search to the directory in which the headers live. This avoids conflicts on non-FreeBSD machines. r307550 by imp: Add a new flag to mkimg (-a num) to specify the active partition for those partitioning schemes that have this concept. Implement it as an override for mbr's setting 0x80 in the flags for the first partition when we have boot code. Differential Revision: https://reviews.freebsd.org/D4403 r318137: mkimg: Add -C argument to specify maximum capacity Add a -C option to specify a maximum capacity for the final image file. It is useful to control the size of the generated image for sdcard or when we will add dynamic size partition. Add --capacity which is a shorthand to define min and max capacity at the same time. Reviewed by: bapt, marcel, wblock (manpages) Sponsored by: Gandi.net Differential Revision: https://reviews.freebsd.org/D10509 r319125: mkimg: Correct an off by one error in the PMBR size The PMBR last sector should be number of sector - 1 (As stated in UEFI Spec 2.6 page 118 table 17). This fixes warning printed by linux tools like parted or fdisk. Sponsored by: Gandi.net r319295 by ngie: Update the usr.bin/mkimg golden test output files after ^/head@r319125 ^/head@r319125 changed the location of the backup pmbr, requiring the output files to be regenerated, since they're binary disk dumps. The output files were regenerated with "make rebase"--fixed in ^/head@r319294. MFC with: r319125, r319294 PR: 219673 Sponsored by: Dell EMC Isilon Added: stable/11/usr.bin/mkimg/endian.h - copied unchanged from r306330, head/usr.bin/mkimg/endian.h stable/11/usr.bin/mkimg/uuid.c - copied unchanged from r307544, head/usr.bin/mkimg/uuid.c Modified: stable/11/usr.bin/mkimg/Makefile stable/11/usr.bin/mkimg/apm.c stable/11/usr.bin/mkimg/bsd.c stable/11/usr.bin/mkimg/ebr.c stable/11/usr.bin/mkimg/format.c stable/11/usr.bin/mkimg/format.h stable/11/usr.bin/mkimg/gpt.c stable/11/usr.bin/mkimg/image.c stable/11/usr.bin/mkimg/mbr.c stable/11/usr.bin/mkimg/mkimg.1 stable/11/usr.bin/mkimg/mkimg.c stable/11/usr.bin/mkimg/mkimg.h stable/11/usr.bin/mkimg/pc98.c stable/11/usr.bin/mkimg/qcow.c stable/11/usr.bin/mkimg/raw.c stable/11/usr.bin/mkimg/scheme.c stable/11/usr.bin/mkimg/scheme.h stable/11/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow.gz.uu stable/11/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow2.gz.uu stable/11/usr.bin/mkimg/tests/img-1x1-4096-gpt.raw.gz.uu stable/11/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhd.gz.uu stable/11/usr.bin/mkimg/tests/img-1x1-4096-gpt.vhdf.gz.uu stable/11/usr.bin/mkimg/tests/img-1x1-4096-gpt.vmdk.gz.uu stable/11/usr.bin/mkimg/tests/img-1x1-512-gpt.qcow.gz.uu stable/11/usr.bin/mkimg/tests/img-1x1-512-gpt.qcow2.gz.uu stable/11/usr.bin/mkimg/tests/img-1x1-512-gpt.raw.gz.uu stable/11/usr.bin/mkimg/tests/img-1x1-512-gpt.vhd.gz.uu stable/11/usr.bin/mkimg/tests/img-1x1-512-gpt.vhdf.gz.uu stable/11/usr.bin/mkimg/tests/img-1x1-512-gpt.vmdk.gz.uu stable/11/usr.bin/mkimg/tests/img-63x255-4096-gpt.qcow.gz.uu stable/11/usr.bin/mkimg/tests/img-63x255-4096-gpt.qcow2.gz.uu stable/11/usr.bin/mkimg/tests/img-63x255-4096-gpt.raw.gz.uu stable/11/usr.bin/mkimg/tests/img-63x255-4096-gpt.vhd.gz.uu stable/11/usr.bin/mkimg/tests/img-63x255-4096-gpt.vhdf.gz.uu stable/11/usr.bin/mkimg/tests/img-63x255-4096-gpt.vmdk.gz.uu stable/11/usr.bin/mkimg/tests/img-63x255-512-gpt.qcow.gz.uu stable/11/usr.bin/mkimg/tests/img-63x255-512-gpt.qcow2.gz.uu stable/11/usr.bin/mkimg/tests/img-63x255-512-gpt.raw.gz.uu stable/11/usr.bin/mkimg/tests/img-63x255-512-gpt.vhd.gz.uu stable/11/usr.bin/mkimg/tests/img-63x255-512-gpt.vhdf.gz.uu stable/11/usr.bin/mkimg/tests/img-63x255-512-gpt.vmdk.gz.uu stable/11/usr.bin/mkimg/vhd.c stable/11/usr.bin/mkimg/vmdk.c stable/11/usr.bin/mkimg/vtoc8.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/mkimg/Makefile ============================================================================== --- stable/11/usr.bin/mkimg/Makefile Fri Feb 9 04:45:39 2018 (r329058) +++ stable/11/usr.bin/mkimg/Makefile Fri Feb 9 09:15:43 2018 (r329059) @@ -3,14 +3,15 @@ .include PROG= mkimg -SRCS= format.c image.c mkimg.c scheme.c +SRCS= format.c image.c mkimg.c scheme.c uuid.c MAN= mkimg.1 -MKIMG_VERSION=20151211 +MKIMG_VERSION=20161016 mkimg.o: Makefile CFLAGS+=-DMKIMG_VERSION=${MKIMG_VERSION} CFLAGS+=-DSPARSE_WRITE +CFLAGS+=-I${.CURDIR:H:H}/sys # List of formats to support SRCS+= \ Modified: stable/11/usr.bin/mkimg/apm.c ============================================================================== --- stable/11/usr.bin/mkimg/apm.c Fri Feb 9 04:45:39 2018 (r329058) +++ stable/11/usr.bin/mkimg/apm.c Fri Feb 9 09:15:43 2018 (r329059) @@ -27,14 +27,15 @@ #include __FBSDID("$FreeBSD$"); -#include -#include -#include #include +#include #include #include #include +#include + +#include "endian.h" #include "image.h" #include "mkimg.h" #include "scheme.h" @@ -91,7 +92,7 @@ apm_write(lba_t imgsz, void *bootcode __unused) strncpy(ent->ent_type, APM_ENT_TYPE_SELF, sizeof(ent->ent_type)); strncpy(ent->ent_name, "Apple", sizeof(ent->ent_name)); - STAILQ_FOREACH(part, &partlist, link) { + TAILQ_FOREACH(part, &partlist, link) { ent = (void *)(buf + (part->index + 2) * secsz); be16enc(&ent->ent_sig, APM_ENT_SIG); be32enc(&ent->ent_pmblkcnt, nparts + 1); Modified: stable/11/usr.bin/mkimg/bsd.c ============================================================================== --- stable/11/usr.bin/mkimg/bsd.c Fri Feb 9 04:45:39 2018 (r329058) +++ stable/11/usr.bin/mkimg/bsd.c Fri Feb 9 09:15:43 2018 (r329059) @@ -27,14 +27,15 @@ #include __FBSDID("$FreeBSD$"); -#include -#include -#include #include +#include #include #include #include +#include + +#include "endian.h" #include "image.h" #include "mkimg.h" #include "scheme.h" @@ -103,7 +104,7 @@ bsd_write(lba_t imgsz, void *bootcode) dp = &d->d_partitions[RAW_PART]; le32enc(&dp->p_size, imgsz); - STAILQ_FOREACH(part, &partlist, link) { + TAILQ_FOREACH(part, &partlist, link) { n = part->index + ((part->index >= RAW_PART) ? 1 : 0); dp = &d->d_partitions[n]; le32enc(&dp->p_size, part->size); Modified: stable/11/usr.bin/mkimg/ebr.c ============================================================================== --- stable/11/usr.bin/mkimg/ebr.c Fri Feb 9 04:45:39 2018 (r329058) +++ stable/11/usr.bin/mkimg/ebr.c Fri Feb 9 09:15:43 2018 (r329059) @@ -27,14 +27,15 @@ #include __FBSDID("$FreeBSD$"); -#include -#include -#include #include +#include #include #include #include +#include + +#include "endian.h" #include "image.h" #include "mkimg.h" #include "scheme.h" @@ -88,7 +89,7 @@ ebr_write(lba_t imgsz __unused, void *bootcode __unuse le16enc(ebr + DOSMAGICOFFSET, DOSMAGIC); error = 0; - STAILQ_FOREACH_SAFE(part, &partlist, link, next) { + TAILQ_FOREACH(part, &partlist, link) { block = part->block - nsecs; size = round_track(part->size); dp = (void *)(ebr + DOSPARTOFF); @@ -100,6 +101,7 @@ ebr_write(lba_t imgsz __unused, void *bootcode __unuse le32enc(&dp->dp_size, size); /* Add link entry */ + next = TAILQ_NEXT(part, link); if (next != NULL) { size = round_track(next->size); dp++; Copied: stable/11/usr.bin/mkimg/endian.h (from r306330, head/usr.bin/mkimg/endian.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/usr.bin/mkimg/endian.h Fri Feb 9 09:15:43 2018 (r329059, copy of r306330, head/usr.bin/mkimg/endian.h) @@ -0,0 +1,106 @@ +/*- + * Copyright (c) 2002 Thomas Moestl + * 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 _MKIMG_ENDIAN_H_ +#define _MKIMG_ENDIAN_H_ + +static __inline uint16_t +be16dec(const void *pp) +{ + uint8_t const *p = (uint8_t const *)pp; + + return ((p[0] << 8) | p[1]); +} + +static __inline void +be16enc(void *pp, uint16_t u) +{ + uint8_t *p = (uint8_t *)pp; + + p[0] = (u >> 8) & 0xff; + p[1] = u & 0xff; +} + +static __inline void +be32enc(void *pp, uint32_t u) +{ + uint8_t *p = (uint8_t *)pp; + + p[0] = (u >> 24) & 0xff; + p[1] = (u >> 16) & 0xff; + p[2] = (u >> 8) & 0xff; + p[3] = u & 0xff; +} + +static __inline void +be64enc(void *pp, uint64_t u) +{ + uint8_t *p = (uint8_t *)pp; + + be32enc(p, (uint32_t)(u >> 32)); + be32enc(p + 4, (uint32_t)(u & 0xffffffffU)); +} + +static __inline uint16_t +le16dec(const void *pp) +{ + uint8_t const *p = (uint8_t const *)pp; + + return ((p[1] << 8) | p[0]); +} + +static __inline void +le16enc(void *pp, uint16_t u) +{ + uint8_t *p = (uint8_t *)pp; + + p[0] = u & 0xff; + p[1] = (u >> 8) & 0xff; +} + +static __inline void +le32enc(void *pp, uint32_t u) +{ + uint8_t *p = (uint8_t *)pp; + + p[0] = u & 0xff; + p[1] = (u >> 8) & 0xff; + p[2] = (u >> 16) & 0xff; + p[3] = (u >> 24) & 0xff; +} + +static __inline void +le64enc(void *pp, uint64_t u) +{ + uint8_t *p = (uint8_t *)pp; + + le32enc(p, (uint32_t)(u & 0xffffffffU)); + le32enc(p + 4, (uint32_t)(u >> 32)); +} + +#endif /* _MKIMG_ENDIAN_H_ */ Modified: stable/11/usr.bin/mkimg/format.c ============================================================================== --- stable/11/usr.bin/mkimg/format.c Fri Feb 9 04:45:39 2018 (r329058) +++ stable/11/usr.bin/mkimg/format.c Fri Feb 9 09:15:43 2018 (r329059) @@ -27,9 +27,6 @@ #include __FBSDID("$FreeBSD$"); -#include -#include -#include #include #include #include @@ -42,8 +39,24 @@ __FBSDID("$FreeBSD$"); #include "format.h" #include "mkimg.h" +static struct mkimg_format *first; static struct mkimg_format *format; +struct mkimg_format * +format_iterate(struct mkimg_format *f) +{ + + return ((f == NULL) ? first : f->next); +} + +void +format_register(struct mkimg_format *f) +{ + + f->next = first; + first = f; +} + int format_resize(lba_t end) { @@ -56,10 +69,10 @@ format_resize(lba_t end) int format_select(const char *spec) { - struct mkimg_format *f, **iter; + struct mkimg_format *f; - SET_FOREACH(iter, formats) { - f = *iter; + f = NULL; + while ((f = format_iterate(f)) != NULL) { if (strcasecmp(spec, f->name) == 0) { format = f; return (0); Modified: stable/11/usr.bin/mkimg/format.h ============================================================================== --- stable/11/usr.bin/mkimg/format.h Fri Feb 9 04:45:39 2018 (r329058) +++ stable/11/usr.bin/mkimg/format.h Fri Feb 9 09:15:43 2018 (r329059) @@ -29,21 +29,24 @@ #ifndef _MKIMG_FORMAT_H_ #define _MKIMG_FORMAT_H_ -#include - struct mkimg_format { + struct mkimg_format *next; const char *name; const char *description; int (*resize)(lba_t); int (*write)(int); }; -SET_DECLARE(formats, struct mkimg_format); -#define FORMAT_DEFINE(nm) DATA_SET(formats, nm) +#define FORMAT_DEFINE(nm) \ +static void format_register_##nm(void) __attribute__((constructor)); \ +static void format_register_##nm(void) { format_register(&nm); } -int format_resize(lba_t); +struct mkimg_format *format_iterate(struct mkimg_format *); +void format_register(struct mkimg_format *); int format_select(const char *); struct mkimg_format *format_selected(void); + +int format_resize(lba_t); int format_write(int); #endif /* _MKIMG_FORMAT_H_ */ Modified: stable/11/usr.bin/mkimg/gpt.c ============================================================================== --- stable/11/usr.bin/mkimg/gpt.c Fri Feb 9 04:45:39 2018 (r329058) +++ stable/11/usr.bin/mkimg/gpt.c Fri Feb 9 09:15:43 2018 (r329059) @@ -27,18 +27,17 @@ #include __FBSDID("$FreeBSD$"); -#include -#include -#include #include -#include #include #include #include #include #include -#include +#include +#include + +#include "endian.h" #include "image.h" #include "mkimg.h" #include "scheme.h" @@ -131,21 +130,6 @@ crc32(const void *buf, size_t sz) return (crc ^ ~0U); } -static void -gpt_uuid_enc(void *buf, const uuid_t *uuid) -{ - uint8_t *p = buf; - int i; - - le32enc(p, uuid->time_low); - le16enc(p + 4, uuid->time_mid); - le16enc(p + 6, uuid->time_hi_and_version); - p[8] = uuid->clock_seq_hi_and_reserved; - p[9] = uuid->clock_seq_low; - for (i = 0; i < _UUID_NODE_LEN; i++) - p[10 + i] = uuid->node[i]; -} - static u_int gpt_tblsz(void) { @@ -173,7 +157,7 @@ gpt_write_pmbr(lba_t blks, void *bootcode) uint32_t secs; int error; - secs = (blks > UINT32_MAX) ? UINT32_MAX : (uint32_t)blks; + secs = (blks > UINT32_MAX) ? UINT32_MAX : (uint32_t)blks - 1; pmbr = malloc(secsz); if (pmbr == NULL) @@ -199,7 +183,7 @@ gpt_write_pmbr(lba_t blks, void *bootcode) static struct gpt_ent * gpt_mktbl(u_int tblsz) { - uuid_t uuid; + mkimg_uuid_t uuid; struct gpt_ent *tbl, *ent; struct part *part; int c, idx; @@ -208,11 +192,11 @@ gpt_mktbl(u_int tblsz) if (tbl == NULL) return (NULL); - STAILQ_FOREACH(part, &partlist, link) { + TAILQ_FOREACH(part, &partlist, link) { ent = tbl + part->index; - gpt_uuid_enc(&ent->ent_type, ALIAS_TYPE2PTR(part->type)); + mkimg_uuid_enc(&ent->ent_type, ALIAS_TYPE2PTR(part->type)); mkimg_uuid(&uuid); - gpt_uuid_enc(&ent->ent_uuid, &uuid); + mkimg_uuid_enc(&ent->ent_uuid, &uuid); le64enc(&ent->ent_lba_start, part->block); le64enc(&ent->ent_lba_end, part->block + part->size - 1); if (part->label != NULL) { @@ -243,7 +227,7 @@ gpt_write_hdr(struct gpt_hdr *hdr, uint64_t self, uint static int gpt_write(lba_t imgsz, void *bootcode) { - uuid_t uuid; + mkimg_uuid_t uuid; struct gpt_ent *tbl; struct gpt_hdr *hdr; uint32_t crc; @@ -280,7 +264,7 @@ gpt_write(lba_t imgsz, void *bootcode) le64enc(&hdr->hdr_lba_start, 2 + tblsz); le64enc(&hdr->hdr_lba_end, imgsz - tblsz - 2); mkimg_uuid(&uuid); - gpt_uuid_enc(&hdr->hdr_uuid, &uuid); + mkimg_uuid_enc(&hdr->hdr_uuid, &uuid); le32enc(&hdr->hdr_entries, nparts); le32enc(&hdr->hdr_entsz, sizeof(struct gpt_ent)); crc = crc32(tbl, nparts * sizeof(struct gpt_ent)); Modified: stable/11/usr.bin/mkimg/image.c ============================================================================== --- stable/11/usr.bin/mkimg/image.c Fri Feb 9 04:45:39 2018 (r329058) +++ stable/11/usr.bin/mkimg/image.c Fri Feb 9 09:15:43 2018 (r329059) @@ -28,9 +28,7 @@ __FBSDID("$FreeBSD$"); #include -#include #include -#include #include #include #include @@ -45,8 +43,22 @@ __FBSDID("$FreeBSD$"); #include "image.h" #include "mkimg.h" +#ifndef MAP_NOCORE +#define MAP_NOCORE 0 +#endif +#ifndef MAP_NOSYNC +#define MAP_NOSYNC 0 +#endif + +#ifndef SEEK_DATA +#define SEEK_DATA -1 +#endif +#ifndef SEEK_HOLE +#define SEEK_HOLE -1 +#endif + struct chunk { - STAILQ_ENTRY(chunk) ch_list; + TAILQ_ENTRY(chunk) ch_list; size_t ch_size; /* Size of chunk in bytes. */ lba_t ch_block; /* Block address in image. */ union { @@ -64,7 +76,7 @@ struct chunk { #define CH_TYPE_MEMORY 2 /* Memory-backed chunk */ }; -static STAILQ_HEAD(chunk_head, chunk) image_chunks; +static TAILQ_HEAD(chunk_head, chunk) image_chunks; static u_int image_nchunks; static char image_swap_file[PATH_MAX]; @@ -125,14 +137,14 @@ image_chunk_find(lba_t blk) struct chunk *ch; ch = (last != NULL && last->ch_block <= blk) - ? last : STAILQ_FIRST(&image_chunks); + ? last : TAILQ_FIRST(&image_chunks); while (ch != NULL) { if (ch->ch_block <= blk && (lba_t)(ch->ch_block + (ch->ch_size / secsz)) > blk) { last = ch; break; } - ch = STAILQ_NEXT(ch, ch_list); + ch = TAILQ_NEXT(ch, ch_list); } return (ch); } @@ -174,7 +186,7 @@ image_chunk_memory(struct chunk *ch, lba_t blk) ch->ch_size = (blk - ch->ch_block) * secsz; new->ch_block = blk; new->ch_size -= ch->ch_size; - STAILQ_INSERT_AFTER(&image_chunks, ch, new, ch_list); + TAILQ_INSERT_AFTER(&image_chunks, ch, new, ch_list); image_nchunks++; ch = new; } @@ -189,7 +201,7 @@ image_chunk_memory(struct chunk *ch, lba_t blk) ch->ch_size = secsz; new->ch_block++; new->ch_size -= secsz; - STAILQ_INSERT_AFTER(&image_chunks, ch, new, ch_list); + TAILQ_INSERT_AFTER(&image_chunks, ch, new, ch_list); image_nchunks++; } @@ -205,7 +217,7 @@ image_chunk_skipto(lba_t to) lba_t from; size_t sz; - ch = STAILQ_LAST(&image_chunks, chunk, ch_list); + ch = TAILQ_LAST(&image_chunks, chunk_head); from = (ch != NULL) ? ch->ch_block + (ch->ch_size / secsz) : 0LL; assert(from <= to); @@ -230,7 +242,7 @@ image_chunk_skipto(lba_t to) ch->ch_block = from; ch->ch_size = sz; ch->ch_type = CH_TYPE_ZEROES; - STAILQ_INSERT_TAIL(&image_chunks, ch, ch_list); + TAILQ_INSERT_TAIL(&image_chunks, ch, ch_list); image_nchunks++; return (0); } @@ -240,7 +252,7 @@ image_chunk_append(lba_t blk, size_t sz, off_t ofs, in { struct chunk *ch; - ch = STAILQ_LAST(&image_chunks, chunk, ch_list); + ch = TAILQ_LAST(&image_chunks, chunk_head); if (ch != NULL && ch->ch_type == CH_TYPE_FILE) { if (fd == ch->ch_u.file.fd && blk == (lba_t)(ch->ch_block + (ch->ch_size / secsz)) && @@ -261,7 +273,7 @@ image_chunk_append(lba_t blk, size_t sz, off_t ofs, in ch->ch_type = CH_TYPE_FILE; ch->ch_u.file.ofs = ofs; ch->ch_u.file.fd = fd; - STAILQ_INSERT_TAIL(&image_chunks, ch, ch_list); + TAILQ_INSERT_TAIL(&image_chunks, ch, ch_list); image_nchunks++; return (0); } @@ -456,8 +468,7 @@ image_copyin_mapped(lba_t blk, int fd, uint64_t *sizep * I don't know what this means or whether it * can happen at all... */ - error = EDOOFUS; - break; + assert(0); } } if (error) @@ -583,10 +594,13 @@ image_copyout_region(int fd, lba_t blk, lba_t size) size *= secsz; - while (size > 0) { + error = 0; + while (!error && size > 0) { ch = image_chunk_find(blk); - if (ch == NULL) - return (EINVAL); + if (ch == NULL) { + error = EINVAL; + break; + } ofs = (blk - ch->ch_block) * secsz; sz = ch->ch_size - ofs; sz = ((lba_t)sz < size) ? sz : (size_t)size; @@ -602,12 +616,12 @@ image_copyout_region(int fd, lba_t blk, lba_t size) error = image_copyout_memory(fd, sz, ch->ch_u.mem.ptr); break; default: - return (EDOOFUS); + assert(0); } size -= sz; blk += sz / secsz; } - return (0); + return (error); } int @@ -682,7 +696,7 @@ image_cleanup(void) { struct chunk *ch; - while ((ch = STAILQ_FIRST(&image_chunks)) != NULL) { + while ((ch = TAILQ_FIRST(&image_chunks)) != NULL) { switch (ch->ch_type) { case CH_TYPE_FILE: /* We may be closing the same file multiple times. */ @@ -695,7 +709,7 @@ image_cleanup(void) default: break; } - STAILQ_REMOVE_HEAD(&image_chunks, ch_list); + TAILQ_REMOVE(&image_chunks, ch, ch_list); free(ch); } if (image_swap_fd != -1) @@ -708,7 +722,7 @@ image_init(void) { const char *tmpdir; - STAILQ_INIT(&image_chunks); + TAILQ_INIT(&image_chunks); image_nchunks = 0; image_swap_size = 0; Modified: stable/11/usr.bin/mkimg/mbr.c ============================================================================== --- stable/11/usr.bin/mkimg/mbr.c Fri Feb 9 04:45:39 2018 (r329058) +++ stable/11/usr.bin/mkimg/mbr.c Fri Feb 9 09:15:43 2018 (r329059) @@ -27,14 +27,15 @@ #include __FBSDID("$FreeBSD$"); -#include -#include -#include #include +#include #include #include #include +#include + +#include "endian.h" #include "image.h" #include "mkimg.h" #include "scheme.h" @@ -101,10 +102,15 @@ mbr_write(lba_t imgsz __unused, void *bootcode) memset(mbr, 0, secsz); le16enc(mbr + DOSMAGICOFFSET, DOSMAGIC); dpbase = (void *)(mbr + DOSPARTOFF); - STAILQ_FOREACH(part, &partlist, link) { + TAILQ_FOREACH(part, &partlist, link) { size = round_track(part->size); dp = dpbase + part->index; - dp->dp_flag = (part->index == 0 && bootcode != NULL) ? 0x80 : 0; + if (active_partition != 0) + dp->dp_flag = + (part->index + 1 == active_partition) ? 0x80 : 0; + else + dp->dp_flag = + (part->index == 0 && bootcode != NULL) ? 0x80 : 0; mbr_chs(&dp->dp_scyl, &dp->dp_shd, &dp->dp_ssect, part->block); dp->dp_typ = ALIAS_TYPE2INT(part->type); Modified: stable/11/usr.bin/mkimg/mkimg.1 ============================================================================== --- stable/11/usr.bin/mkimg/mkimg.1 Fri Feb 9 04:45:39 2018 (r329058) +++ stable/11/usr.bin/mkimg/mkimg.1 Fri Feb 9 09:15:43 2018 (r329059) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 7, 2015 +.Dd April 26, 2017 .Dt MKIMG 1 .Os .Sh NAME @@ -37,9 +37,12 @@ .Op Fl S Ar secsz .Op Fl T Ar tracksz .Op Fl b Ar bootcode -.Op Fl c Ar capacity +.Op Fl c Ar min_capacity +.Op Fl C Ar max_capacity +.Op Fl -capacity Ar capacity .Op Fl f Ar format .Op Fl o Ar outfile +.Op Fl a Ar active .Op Fl v .Op Fl y .Op Fl s Ar scheme Op Fl p Ar partition ... @@ -119,11 +122,23 @@ An empty partition table can be written to the disk wh partitioning scheme with the .Fl s option, but without specifying any partitions. -When the size required to for all the partitions is larger than the +When the size required for all the partitions is larger than the given capacity, then the disk image will be larger than the capacity given. .Pp The +.Fl C +option specifies a maximum capacity for the disk image. +If the combined sizes of the given partitions exceed the size given with +.Fl C , +image creation fails. +.Pp +The +.Fl -capacity +option is a shorthand to specify the minimum and maximum capacity at the +same time. +.Pp +The .Fl v option increases the level of output that the .Nm @@ -138,6 +153,26 @@ utility will generate predictable values for Universal (UUIDs) and time stamps so that consecutive runs of the .Nm utility will create images that are identical. +.Pp +The +.Ar active +option marks a partition as active, if the partitioning +scheme supports it. +Currently, only the +.Ar mbr +scheme supports this concept. +By default, +.Nm +will only mark the first partition as active when boot code is +specified. +Use the +.Ar active +option to override the active partition. +The number specified corresponds to the number after the 's' in the +partition's +.Xr geom 8 +name. +No partitions are marked active when the value is 0. .Pp A set of long options exist to query about the .Nm Modified: stable/11/usr.bin/mkimg/mkimg.c ============================================================================== --- stable/11/usr.bin/mkimg/mkimg.c Fri Feb 9 04:45:39 2018 (r329058) +++ stable/11/usr.bin/mkimg/mkimg.c Fri Feb 9 09:15:43 2018 (r329059) @@ -27,17 +27,15 @@ #include __FBSDID("$FreeBSD$"); -#include -#include +#include #include -#include -#include #include #include #include #include #include #include +#include #include #include #include @@ -49,20 +47,23 @@ __FBSDID("$FreeBSD$"); #include "mkimg.h" #include "scheme.h" -#define LONGOPT_FORMATS 0x01000001 -#define LONGOPT_SCHEMES 0x01000002 -#define LONGOPT_VERSION 0x01000003 +#define LONGOPT_FORMATS 0x01000001 +#define LONGOPT_SCHEMES 0x01000002 +#define LONGOPT_VERSION 0x01000003 +#define LONGOPT_CAPACITY 0x01000004 static struct option longopts[] = { { "formats", no_argument, NULL, LONGOPT_FORMATS }, { "schemes", no_argument, NULL, LONGOPT_SCHEMES }, { "version", no_argument, NULL, LONGOPT_VERSION }, + { "capacity", required_argument, NULL, LONGOPT_CAPACITY }, { NULL, 0, NULL, 0 } }; -static uint64_t capacity; +static uint64_t min_capacity = 0; +static uint64_t max_capacity = 0; -struct partlisthead partlist = STAILQ_HEAD_INITIALIZER(partlist); +struct partlisthead partlist = TAILQ_HEAD_INITIALIZER(partlist); u_int nparts = 0; u_int unit_testing; @@ -73,24 +74,25 @@ u_int nheads = 1; u_int nsecs = 1; u_int secsz = 512; u_int blksz = 0; +uint32_t active_partition = 0; static void print_formats(int usage) { - struct mkimg_format *f, **f_iter; + struct mkimg_format *f; const char *sep; if (usage) { fprintf(stderr, " formats:\n"); - SET_FOREACH(f_iter, formats) { - f = *f_iter; + f = NULL; + while ((f = format_iterate(f)) != NULL) { fprintf(stderr, "\t%s\t- %s\n", f->name, f->description); } } else { sep = ""; - SET_FOREACH(f_iter, formats) { - f = *f_iter; + f = NULL; + while ((f = format_iterate(f)) != NULL) { printf("%s%s", sep, f->name); sep = " "; } @@ -101,20 +103,20 @@ print_formats(int usage) static void print_schemes(int usage) { - struct mkimg_scheme *s, **s_iter; + struct mkimg_scheme *s; const char *sep; if (usage) { fprintf(stderr, " schemes:\n"); - SET_FOREACH(s_iter, schemes) { - s = *s_iter; + s = NULL; + while ((s = scheme_iterate(s)) != NULL) { fprintf(stderr, "\t%s\t- %s\n", s->name, s->description); } } else { sep = ""; - SET_FOREACH(s_iter, schemes) { - s = *s_iter; + s = NULL; + while ((s = scheme_iterate(s)) != NULL) { printf("%s%s", sep, s->name); sep = " "; } @@ -148,8 +150,10 @@ usage(const char *why) fprintf(stderr, "\t--schemes\t- list partition schemes\n"); fprintf(stderr, "\t--version\t- show version information\n"); fputc('\n', stderr); + fprintf(stderr, "\t-a \t- mark num'th partion as active\n"); fprintf(stderr, "\t-b \t- file containing boot code\n"); - fprintf(stderr, "\t-c \t- capacity (in bytes) of the disk\n"); + fprintf(stderr, "\t-c \t- minimum capacity (in bytes) of the disk\n"); + fprintf(stderr, "\t-C \t- maximum capacity (in bytes) of the disk\n"); fprintf(stderr, "\t-f \n"); fprintf(stderr, "\t-o \t- file to write image into\n"); fprintf(stderr, "\t-p \n"); @@ -302,7 +306,7 @@ parse_part(const char *spec) } part->index = nparts; - STAILQ_INSERT_TAIL(&partlist, part, link); + TAILQ_INSERT_TAIL(&partlist, part, link); nparts++; return (0); @@ -376,31 +380,20 @@ mkimg_chs(lba_t lba, u_int maxcyl, u_int *cylp, u_int *secp = sec; } -void -mkimg_uuid(struct uuid *uuid) -{ - static uint8_t gen[sizeof(struct uuid)]; - u_int i; - - if (!unit_testing) { - uuidgen(uuid, 1); - return; - } - - for (i = 0; i < sizeof(gen); i++) - gen[i]++; - memcpy(uuid, gen, sizeof(uuid_t)); -} - static int capacity_resize(lba_t end) { - lba_t capsz; + lba_t min_capsz, max_capsz; - capsz = (capacity + secsz - 1) / secsz; - if (end >= capsz) + min_capsz = (min_capacity + secsz - 1) / secsz; + max_capsz = (max_capacity + secsz - 1) / secsz; + + if (max_capsz != 0 && end > max_capsz) + return (ENOSPC); + if (end >= min_capsz) return (0); - return (image_set_size(capsz)); + + return (image_set_size(min_capsz)); } static void @@ -413,14 +406,14 @@ mkimg(void) int error, fd; /* First check partition information */ - STAILQ_FOREACH(part, &partlist, link) { + TAILQ_FOREACH(part, &partlist, link) { error = scheme_check_part(part); if (error) errc(EX_DATAERR, error, "partition %d", part->index+1); } block = scheme_metadata(SCHEME_META_IMG_START, 0); - STAILQ_FOREACH(part, &partlist, link) { + TAILQ_FOREACH(part, &partlist, link) { block = scheme_metadata(SCHEME_META_PART_BEFORE, block); if (verbose) fprintf(stderr, "partition %d: starting block %llu " @@ -487,9 +480,14 @@ main(int argc, char *argv[]) bcfd = -1; outfd = 1; /* Write to stdout by default */ - while ((c = getopt_long(argc, argv, "b:c:f:o:p:s:vyH:P:S:T:", + while ((c = getopt_long(argc, argv, "a:b:c:C:f:o:p:s:vyH:P:S:T:", longopts, NULL)) != -1) { switch (c) { + case 'a': /* ACTIVE PARTITION, if supported */ + error = parse_uint32(&active_partition, 1, 100, optarg); + if (error) + errc(EX_DATAERR, error, "Partition ordinal"); + break; case 'b': /* BOOT CODE */ if (bcfd != -1) usage("multiple bootcode given"); @@ -497,11 +495,16 @@ main(int argc, char *argv[]) if (bcfd == -1) err(EX_UNAVAILABLE, "%s", optarg); break; - case 'c': /* CAPACITY */ - error = parse_uint64(&capacity, 1, OFF_MAX, optarg); + case 'c': /* MINIMUM CAPACITY */ + error = parse_uint64(&min_capacity, 1, INT64_MAX, optarg); if (error) - errc(EX_DATAERR, error, "capacity in bytes"); + errc(EX_DATAERR, error, "minimum capacity in bytes"); break; + case 'C': /* MAXIMUM CAPACITY */ + error = parse_uint64(&max_capacity, 1, INT64_MAX, optarg); + if (error) + errc(EX_DATAERR, error, "maximum capacity in bytes"); + break; case 'f': /* OUTPUT FORMAT */ if (format_selected() != NULL) usage("multiple formats given"); @@ -571,6 +574,12 @@ main(int argc, char *argv[]) print_version(); exit(EX_OK); /*NOTREACHED*/ + case LONGOPT_CAPACITY: + error = parse_uint64(&min_capacity, 1, INT64_MAX, optarg); + if (error) + errc(EX_DATAERR, error, "capacity in bytes"); + max_capacity = min_capacity; + break; default: usage("unknown option"); } @@ -580,8 +589,10 @@ main(int argc, char *argv[]) usage("trailing arguments"); if (scheme_selected() == NULL && nparts > 0) usage("no scheme"); - if (nparts == 0 && capacity == 0) + if (nparts == 0 && min_capacity == 0) usage("no partitions"); + if (max_capacity != 0 && min_capacity > max_capacity) + usage("minimum capacity cannot be larger than the maximum one"); if (secsz > blksz) { if (blksz != 0) Modified: stable/11/usr.bin/mkimg/mkimg.h ============================================================================== --- stable/11/usr.bin/mkimg/mkimg.h Fri Feb 9 04:45:39 2018 (r329058) +++ stable/11/usr.bin/mkimg/mkimg.h Fri Feb 9 09:15:43 2018 (r329059) @@ -30,9 +30,10 @@ #define _MKIMG_MKIMG_H_ #include +#include struct part { - STAILQ_ENTRY(part) link; + TAILQ_ENTRY(part) link; char *alias; /* Partition type alias. */ char *contents; /* Contents/size specification. */ u_int kind; /* Content kind. */ @@ -47,7 +48,7 @@ struct part { char *label; /* Partition label. */ }; -extern STAILQ_HEAD(partlisthead, part) partlist; +extern TAILQ_HEAD(partlisthead, part) partlist; extern u_int nparts; extern u_int unit_testing; @@ -58,6 +59,7 @@ extern u_int nheads; extern u_int nsecs; extern u_int secsz; /* Logical block size. */ extern u_int blksz; /* Physical block size. */ +extern uint32_t active_partition; static inline lba_t round_block(lba_t n) @@ -89,7 +91,17 @@ ssize_t sparse_write(int, const void *, size_t); void mkimg_chs(lba_t, u_int, u_int *, u_int *, u_int *); -struct uuid; -void mkimg_uuid(struct uuid *); +struct mkimg_uuid { + uint32_t time_low; + uint16_t time_mid; + uint16_t time_hi_and_version; + uint8_t clock_seq_hi_and_reserved; + uint8_t clock_seq_low; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Feb 9 10:20:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F40EF16FC2; Fri, 9 Feb 2018 10:20:17 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F6497BDA0; Fri, 9 Feb 2018 10:20:17 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 461592380C; Fri, 9 Feb 2018 10:20:17 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w19AKHsh052579; Fri, 9 Feb 2018 10:20:17 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w19AKHJ8052578; Fri, 9 Feb 2018 10:20:17 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201802091020.w19AKHJ8052578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Fri, 9 Feb 2018 10:20:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329060 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: royger X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 329060 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Feb 2018 10:20:17 -0000 Author: royger Date: Fri Feb 9 10:20:16 2018 New Revision: 329060 URL: https://svnweb.freebsd.org/changeset/base/329060 Log: loader: fix endianness conversion r328536 broke symbol loading on amd64 at least (and probably other arches). r328826 contained the problem to ppc only by adding pre-processors guards. Fix this properly by moving the endianness conversion to separate helper functions, and make the conversion more robust by using sizeof instead of having to manually code the size of each field. Finally list the fields in each structure in a macro in order to avoid code repetition. Sponsored by: Citrix Systems R&D Reviewed by: kib emaste wma Differential revision: https://reviews.freebsd.org/D14267 Modified: head/stand/common/load_elf.c Modified: head/stand/common/load_elf.c ============================================================================== --- head/stand/common/load_elf.c Fri Feb 9 09:15:43 2018 (r329059) +++ head/stand/common/load_elf.c Fri Feb 9 10:20:16 2018 (r329060) @@ -87,6 +87,112 @@ const char *__elfN(moduletype) = "elf module"; u_int64_t __elfN(relocation_offset) = 0; +extern void elf_wrong_field_size(void); +#define CONVERT_FIELD(b, f, e) \ + switch (sizeof((b)->f)) { \ + case 2: \ + (b)->f = e ## 16toh((b)->f); \ + break; \ + case 4: \ + (b)->f = e ## 32toh((b)->f); \ + break; \ + case 8: \ + (b)->f = e ## 64toh((b)->f); \ + break; \ + default: \ + /* Force a link time error. */ \ + elf_wrong_field_size(); \ + break; \ + } + +#define CONVERT_SWITCH(h, d, f) \ + switch ((h)->e_ident[EI_DATA]) { \ + case ELFDATA2MSB: \ + f(d, be); \ + break; \ + case ELFDATA2LSB: \ + f(d, le); \ + break; \ + default: \ + return (EINVAL); \ + } + + +static int elf_header_convert(Elf_Ehdr *ehdr) +{ + /* + * Fixup ELF header endianness. + * + * The Xhdr structure was loaded using block read call to optimize file + * accesses. It might happen, that the endianness of the system memory + * is different that endianness of the ELF header. Swap fields here to + * guarantee that Xhdr always contain valid data regardless of + * architecture. + */ +#define HEADER_FIELDS(b, e) \ + CONVERT_FIELD(b, e_type, e); \ + CONVERT_FIELD(b, e_machine, e); \ + CONVERT_FIELD(b, e_version, e); \ + CONVERT_FIELD(b, e_entry, e); \ + CONVERT_FIELD(b, e_phoff, e); \ + CONVERT_FIELD(b, e_shoff, e); \ + CONVERT_FIELD(b, e_flags, e); \ + CONVERT_FIELD(b, e_ehsize, e); \ + CONVERT_FIELD(b, e_phentsize, e); \ + CONVERT_FIELD(b, e_phnum, e); \ + CONVERT_FIELD(b, e_shentsize, e); \ + CONVERT_FIELD(b, e_shnum, e); \ + CONVERT_FIELD(b, e_shstrndx, e) + + CONVERT_SWITCH(ehdr, ehdr, HEADER_FIELDS); + +#undef HEADER_FIELDS + + return (0); +} + +static int elf_program_header_convert(const Elf_Ehdr *ehdr, Elf_Phdr *phdr) +{ +#define PROGRAM_HEADER_FIELDS(b, e) \ + CONVERT_FIELD(b, p_type, e); \ + CONVERT_FIELD(b, p_flags, e); \ + CONVERT_FIELD(b, p_offset, e); \ + CONVERT_FIELD(b, p_vaddr, e); \ + CONVERT_FIELD(b, p_paddr, e); \ + CONVERT_FIELD(b, p_filesz, e); \ + CONVERT_FIELD(b, p_memsz, e); \ + CONVERT_FIELD(b, p_align, e) + + CONVERT_SWITCH(ehdr, phdr, PROGRAM_HEADER_FIELDS); + +#undef PROGRAM_HEADER_FIELDS + + return (0); +} + +static int elf_section_header_convert(const Elf_Ehdr *ehdr, Elf_Shdr *shdr) +{ +#define SECTION_HEADER_FIELDS(b, e) \ + CONVERT_FIELD(b, sh_name, e); \ + CONVERT_FIELD(b, sh_type, e); \ + CONVERT_FIELD(b, sh_link, e); \ + CONVERT_FIELD(b, sh_info, e); \ + CONVERT_FIELD(b, sh_flags, e); \ + CONVERT_FIELD(b, sh_addr, e); \ + CONVERT_FIELD(b, sh_offset, e); \ + CONVERT_FIELD(b, sh_size, e); \ + CONVERT_FIELD(b, sh_addralign, e); \ + CONVERT_FIELD(b, sh_entsize, e) + + CONVERT_SWITCH(ehdr, shdr, SECTION_HEADER_FIELDS); + +#undef SECTION_HEADER_FIELDS + + return (0); +} +#undef CONVERT_SWITCH +#undef CONVERT_FIELD + static int __elfN(load_elf_header)(char *filename, elf_file_t ef) { @@ -127,63 +233,10 @@ __elfN(load_elf_header)(char *filename, elf_file_t ef) goto error; } -#ifdef __powerpc__ - /* - * XXX: should be in a separate helper. - * - * Fixup ELF endianness. - * - * The Xhdr structure was loaded using block read call to - * optimize file accesses. It might happen, that the endianness - * of the system memory is different that endianness of - * the ELF header. - * Swap fields here to guarantee that Xhdr always contain - * valid data regardless of architecture. - */ - if (ehdr->e_ident[EI_DATA] == ELFDATA2MSB) { - ehdr->e_type = be16toh(ehdr->e_type); - ehdr->e_machine = be16toh(ehdr->e_machine); - ehdr->e_version = be32toh(ehdr->e_version); - if (ehdr->e_ident[EI_CLASS] == ELFCLASS64) { - ehdr->e_entry = be64toh(ehdr->e_entry); - ehdr->e_phoff = be64toh(ehdr->e_phoff); - ehdr->e_shoff = be64toh(ehdr->e_shoff); - } else { - ehdr->e_entry = be32toh(ehdr->e_entry); - ehdr->e_phoff = be32toh(ehdr->e_phoff); - ehdr->e_shoff = be32toh(ehdr->e_shoff); - } - ehdr->e_flags = be32toh(ehdr->e_flags); - ehdr->e_ehsize = be16toh(ehdr->e_ehsize); - ehdr->e_phentsize = be16toh(ehdr->e_phentsize); - ehdr->e_phnum = be16toh(ehdr->e_phnum); - ehdr->e_shentsize = be16toh(ehdr->e_shentsize); - ehdr->e_shnum = be16toh(ehdr->e_shnum); - ehdr->e_shstrndx = be16toh(ehdr->e_shstrndx); + err = elf_header_convert(ehdr); + if (err) + goto error; - } else { - ehdr->e_type = le16toh(ehdr->e_type); - ehdr->e_machine = le16toh(ehdr->e_machine); - ehdr->e_version = le32toh(ehdr->e_version); - if (ehdr->e_ident[EI_CLASS] == ELFCLASS64) { - ehdr->e_entry = le64toh(ehdr->e_entry); - ehdr->e_phoff = le64toh(ehdr->e_phoff); - ehdr->e_shoff = le64toh(ehdr->e_shoff); - } else { - ehdr->e_entry = le32toh(ehdr->e_entry); - ehdr->e_phoff = le32toh(ehdr->e_phoff); - ehdr->e_shoff = le32toh(ehdr->e_shoff); - } - ehdr->e_flags = le32toh(ehdr->e_flags); - ehdr->e_ehsize = le16toh(ehdr->e_ehsize); - ehdr->e_phentsize = le16toh(ehdr->e_phentsize); - ehdr->e_phnum = le16toh(ehdr->e_phnum); - ehdr->e_shentsize = le16toh(ehdr->e_shentsize); - ehdr->e_shnum = le16toh(ehdr->e_shnum); - ehdr->e_shstrndx = le16toh(ehdr->e_shstrndx); - } -#endif - if (ehdr->e_version != EV_CURRENT || ehdr->e_machine != ELF_TARG_MACH) { /* Machine ? */ err = EFTYPE; goto error; @@ -453,57 +506,8 @@ __elfN(loadimage)(struct preloaded_file *fp, elf_file_ phdr = (Elf_Phdr *)(ef->firstpage + ehdr->e_phoff); for (i = 0; i < ehdr->e_phnum; i++) { -#ifdef __powerpc__ - /* - * XXX: should be in a seprate helper. - * - * Fixup ELF endianness. - * - * The Xhdr structure was loaded using block read call to - * optimize file accesses. It might happen, that the endianness - * of the system memory is different that endianness of - * the ELF header. - * Swap fields here to guarantee that Xhdr always contain - * valid data regardless of architecture. - */ - if (ehdr->e_ident[EI_DATA] == ELFDATA2MSB) { - phdr[i].p_type = be32toh(phdr[i].p_type); - phdr[i].p_flags = be32toh(phdr[i].p_flags); - if (ehdr->e_ident[EI_CLASS] == ELFCLASS64) { - phdr[i].p_offset = be64toh(phdr[i].p_offset); - phdr[i].p_vaddr = be64toh(phdr[i].p_vaddr); - phdr[i].p_paddr = be64toh(phdr[i].p_paddr); - phdr[i].p_filesz = be64toh(phdr[i].p_filesz); - phdr[i].p_memsz = be64toh(phdr[i].p_memsz); - phdr[i].p_align = be64toh(phdr[i].p_align); - } else { - phdr[i].p_offset = be32toh(phdr[i].p_offset); - phdr[i].p_vaddr = be32toh(phdr[i].p_vaddr); - phdr[i].p_paddr = be32toh(phdr[i].p_paddr); - phdr[i].p_filesz = be32toh(phdr[i].p_filesz); - phdr[i].p_memsz = be32toh(phdr[i].p_memsz); - phdr[i].p_align = be32toh(phdr[i].p_align); - } - } else { - phdr[i].p_type = le32toh(phdr[i].p_type); - phdr[i].p_flags = le32toh(phdr[i].p_flags); - if (ehdr->e_ident[EI_CLASS] == ELFCLASS64) { - phdr[i].p_offset = le64toh(phdr[i].p_offset); - phdr[i].p_vaddr = le64toh(phdr[i].p_vaddr); - phdr[i].p_paddr = le64toh(phdr[i].p_paddr); - phdr[i].p_filesz = le64toh(phdr[i].p_filesz); - phdr[i].p_memsz = le64toh(phdr[i].p_memsz); - phdr[i].p_align = le64toh(phdr[i].p_align); - } else { - phdr[i].p_offset = le32toh(phdr[i].p_offset); - phdr[i].p_vaddr = le32toh(phdr[i].p_vaddr); - phdr[i].p_paddr = le32toh(phdr[i].p_paddr); - phdr[i].p_filesz = le32toh(phdr[i].p_filesz); - phdr[i].p_memsz = le32toh(phdr[i].p_memsz); - phdr[i].p_align = le32toh(phdr[i].p_align); - } - } -#endif + if (elf_program_header_convert(ehdr, phdr)) + continue; /* We want to load PT_LOAD segments only.. */ if (phdr[i].p_type != PT_LOAD) @@ -580,63 +584,8 @@ __elfN(loadimage)(struct preloaded_file *fp, elf_file_ goto nosyms; } -#ifdef __powerpc__ - /* - * XXX: should be in a seprate helper. - * - * Fixup ELF endianness. - * - * The Xhdr structure was loaded using block read call to - * optimize file accesses. It might happen, that the endianness - * of the system memory is different that endianness of - * the ELF header. - * Swap fields here to guarantee that Xhdr always contain - * valid data regardless of architecture. - */ - for (i = 0; i < ehdr->e_shnum; i++) { - if (ehdr->e_ident[EI_DATA] == ELFDATA2MSB) { - shdr[i].sh_name = be32toh(shdr[i].sh_name); - shdr[i].sh_type = be32toh(shdr[i].sh_type); - shdr[i].sh_link = be32toh(shdr[i].sh_link); - shdr[i].sh_info = be32toh(shdr[i].sh_info); - if (ehdr->e_ident[EI_CLASS] == ELFCLASS64) { - shdr[i].sh_flags = be64toh(shdr[i].sh_flags); - shdr[i].sh_addr = be64toh(shdr[i].sh_addr); - shdr[i].sh_offset = be64toh(shdr[i].sh_offset); - shdr[i].sh_size = be64toh(shdr[i].sh_size); - shdr[i].sh_addralign = be64toh(shdr[i].sh_addralign); - shdr[i].sh_entsize = be64toh(shdr[i].sh_entsize); - } else { - shdr[i].sh_flags = be32toh(shdr[i].sh_flags); - shdr[i].sh_addr = be32toh(shdr[i].sh_addr); - shdr[i].sh_offset = be32toh(shdr[i].sh_offset); - shdr[i].sh_size = be32toh(shdr[i].sh_size); - shdr[i].sh_addralign = be32toh(shdr[i].sh_addralign); - shdr[i].sh_entsize = be32toh(shdr[i].sh_entsize); - } - } else { - shdr[i].sh_name = le32toh(shdr[i].sh_name); - shdr[i].sh_type = le32toh(shdr[i].sh_type); - shdr[i].sh_link = le32toh(shdr[i].sh_link); - shdr[i].sh_info = le32toh(shdr[i].sh_info); - if (ehdr->e_ident[EI_CLASS] == ELFCLASS64) { - shdr[i].sh_flags = le64toh(shdr[i].sh_flags); - shdr[i].sh_addr = le64toh(shdr[i].sh_addr); - shdr[i].sh_offset = le64toh(shdr[i].sh_offset); - shdr[i].sh_size = le64toh(shdr[i].sh_size); - shdr[i].sh_addralign = le64toh(shdr[i].sh_addralign); - shdr[i].sh_entsize = le64toh(shdr[i].sh_entsize); - } else { - shdr[i].sh_flags = le32toh(shdr[i].sh_flags); - shdr[i].sh_addr = le32toh(shdr[i].sh_addr); - shdr[i].sh_offset = le32toh(shdr[i].sh_offset); - shdr[i].sh_size = le32toh(shdr[i].sh_size); - shdr[i].sh_addralign = le32toh(shdr[i].sh_addralign); - shdr[i].sh_entsize = le32toh(shdr[i].sh_entsize); - } - } - } -#endif + for (i = 0; i < ehdr->e_shnum; i++) + elf_section_header_convert(ehdr, &shdr[i]); file_addmetadata(fp, MODINFOMD_SHDR, chunk, shdr); From owner-svn-src-all@freebsd.org Fri Feb 9 14:31:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53130F08429; Fri, 9 Feb 2018 14:31:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 05E7A86C58; Fri, 9 Feb 2018 14:31:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 00B7E26127; Fri, 9 Feb 2018 14:31:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w19EVCvb081274; Fri, 9 Feb 2018 14:31:12 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w19EVCb9081265; Fri, 9 Feb 2018 14:31:12 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802091431.w19EVCb9081265@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 9 Feb 2018 14:31:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329061 - head/tools/tools/nanobsd/embedded X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/tools/tools/nanobsd/embedded X-SVN-Commit-Revision: 329061 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Feb 2018 14:31:13 -0000 Author: kevans Date: Fri Feb 9 14:31:11 2018 New Revision: 329061 URL: https://svnweb.freebsd.org/changeset/base/329061 Log: Teach nanobsd about armv7, add -m to qemu invocations qemu defaults to 128 MiB of RAM, which has been found to not necessarily be enough for booting the system, at least on amd64 and armv7 Add a sensible -m 512 to the examples so that they'll work out of the box in the general case. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D14234 Modified: head/tools/tools/nanobsd/embedded/beaglebone.cfg head/tools/tools/nanobsd/embedded/common head/tools/tools/nanobsd/embedded/pandaboard.cfg head/tools/tools/nanobsd/embedded/qemu-amd64-uefi-bios.cfg head/tools/tools/nanobsd/embedded/qemu-amd64-uefi.cfg head/tools/tools/nanobsd/embedded/qemu-amd64.cfg head/tools/tools/nanobsd/embedded/qemu-armv7.cfg head/tools/tools/nanobsd/embedded/rpi2.cfg Modified: head/tools/tools/nanobsd/embedded/beaglebone.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/beaglebone.cfg Fri Feb 9 10:20:16 2018 (r329060) +++ head/tools/tools/nanobsd/embedded/beaglebone.cfg Fri Feb 9 14:31:11 2018 (r329061) @@ -26,7 +26,7 @@ # SUCH DAMAGE. # -NANO_ARCH=armv6 +NANO_ARCH=armv7 NANO_KERNEL=BEAGLEBONE NANO_DRIVE=mmcsd0 NANO_NAME=beaglebone Modified: head/tools/tools/nanobsd/embedded/common ============================================================================== --- head/tools/tools/nanobsd/embedded/common Fri Feb 9 10:20:16 2018 (r329060) +++ head/tools/tools/nanobsd/embedded/common Fri Feb 9 14:31:11 2018 (r329061) @@ -535,6 +535,9 @@ std_armeb ( ) { std_armv6 ( ) { } +std_armv7 ( ) { +} + std_i386 ( ) { # Default values, if not overridden in .cfg file : ${NANO_KERNEL:=GENERIC} Modified: head/tools/tools/nanobsd/embedded/pandaboard.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/pandaboard.cfg Fri Feb 9 10:20:16 2018 (r329060) +++ head/tools/tools/nanobsd/embedded/pandaboard.cfg Fri Feb 9 14:31:11 2018 (r329061) @@ -26,7 +26,7 @@ # SUCH DAMAGE. # -NANO_ARCH=armv6 +NANO_ARCH=armv7 NANO_KERNEL=PANDABOARD NANO_DRIVE=mmcsd0 NANO_NAME=pandaboard Modified: head/tools/tools/nanobsd/embedded/qemu-amd64-uefi-bios.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/qemu-amd64-uefi-bios.cfg Fri Feb 9 10:20:16 2018 (r329060) +++ head/tools/tools/nanobsd/embedded/qemu-amd64-uefi-bios.cfg Fri Feb 9 14:31:11 2018 (r329061) @@ -36,7 +36,7 @@ qemu_env # # Run with -# qemu-system-x86_64 -serial stdio -bios OVMF.fd \ +# qemu-system-x86_64 -m 512 -serial stdio -bios OVMF.fd \ # -hda _.disk.image.qemu-amd64-uefi.qcow2 # OVMF.fd is from # http://sourceforge.net/projects/edk2/files/OVMF/OVMF-X64-r15214.zip Modified: head/tools/tools/nanobsd/embedded/qemu-amd64-uefi.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/qemu-amd64-uefi.cfg Fri Feb 9 10:20:16 2018 (r329060) +++ head/tools/tools/nanobsd/embedded/qemu-amd64-uefi.cfg Fri Feb 9 14:31:11 2018 (r329061) @@ -36,7 +36,7 @@ qemu_env # # Run with -# qemu-system-x86_64 -serial stdio -bios OVMF.fd \ +# qemu-system-x86_64 -m 512 -serial stdio -bios OVMF.fd \ # -hda _.disk.image.qemu-amd64-uefi.qcow2 # OVMF.fd is from # http://sourceforge.net/projects/edk2/files/OVMF/OVMF-X64-r15214.zip Modified: head/tools/tools/nanobsd/embedded/qemu-amd64.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/qemu-amd64.cfg Fri Feb 9 10:20:16 2018 (r329060) +++ head/tools/tools/nanobsd/embedded/qemu-amd64.cfg Fri Feb 9 14:31:11 2018 (r329061) @@ -34,6 +34,6 @@ NANO_NAME=qemu-amd64 qemu_env # Run with: -# qemu-system-x86_64 -hdd $file -serial telnet::4444,server -nographic +# qemu-system-x86_64 -m 512 -hdd $file -serial telnet::4444,server -nographic # To get some breathing room on the image: # qemu-img resize $file +2G Modified: head/tools/tools/nanobsd/embedded/qemu-armv7.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/qemu-armv7.cfg Fri Feb 9 10:20:16 2018 (r329060) +++ head/tools/tools/nanobsd/embedded/qemu-armv7.cfg Fri Feb 9 14:31:11 2018 (r329061) @@ -27,7 +27,7 @@ # SUCH DAMAGE. # -NANO_ARCH=armv6 +NANO_ARCH=armv7 NANO_DRIVE=vtbd0 NANO_KERNEL=GENERIC NANO_NAME=qemu-armv7 @@ -40,7 +40,7 @@ qemu_env # # Run with -# qemu-system-arm -M virt -serial stdio -bios QEMU_EFI.fd \ +# qemu-system-arm -m 512 -M virt -serial stdio -bios QEMU_EFI.fd \ # -drive if=none,file=_.disk.image.qemu-armv7.qcow2,id=hd0 \ # -device virtio-blk-device,drive=hd0 # QEMU_EFI.fd is from Modified: head/tools/tools/nanobsd/embedded/rpi2.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/rpi2.cfg Fri Feb 9 10:20:16 2018 (r329060) +++ head/tools/tools/nanobsd/embedded/rpi2.cfg Fri Feb 9 14:31:11 2018 (r329061) @@ -26,7 +26,7 @@ # SUCH DAMAGE. # -NANO_ARCH=armv6 +NANO_ARCH=armv7 NANO_KERNEL=RPI2 NANO_DRIVE=mmcsd0 NANO_NAME=rpi2 From owner-svn-src-all@freebsd.org Fri Feb 9 15:50:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EE03F0D85A; Fri, 9 Feb 2018 15:50:33 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F44E69A2C; Fri, 9 Feb 2018 15:50:33 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A4E426CB3; Fri, 9 Feb 2018 15:50: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 w19FoXQc018182; Fri, 9 Feb 2018 15:50:33 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w19FoXEb018181; Fri, 9 Feb 2018 15:50:33 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802091550.w19FoXEb018181@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 9 Feb 2018 15:50:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329064 - head/share/zoneinfo X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/share/zoneinfo X-SVN-Commit-Revision: 329064 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Feb 2018 15:50:33 -0000 Author: imp Date: Fri Feb 9 15:50:32 2018 New Revision: 329064 URL: https://svnweb.freebsd.org/changeset/base/329064 Log: We don't actually need env here, so drop it. All shells allow setting of shell variables for the next command like this. Modified: head/share/zoneinfo/Makefile Modified: head/share/zoneinfo/Makefile ============================================================================== --- head/share/zoneinfo/Makefile Fri Feb 9 15:49:56 2018 (r329063) +++ head/share/zoneinfo/Makefile Fri Feb 9 15:50:32 2018 (r329064) @@ -101,7 +101,7 @@ zoneinfo: yearistype ${TDATA} # differences between the two don't matter for this purpose. # .if make(*install*) -TZS!= cd ${TZBUILDDIR} && find * -type f | env LC_ALL=C sort +TZS!= cd ${TZBUILDDIR} && find * -type f | LC_ALL=C sort .endif beforeinstall: install-zoneinfo From owner-svn-src-all@freebsd.org Fri Feb 9 16:08:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39BECF0F0A8; Fri, 9 Feb 2018 16:08:58 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E18426A8F6; Fri, 9 Feb 2018 16:08:57 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D7D1A26FD3; Fri, 9 Feb 2018 16:08:57 +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 w19G8vVi027874; Fri, 9 Feb 2018 16:08:57 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w19G8vbe027873; Fri, 9 Feb 2018 16:08:57 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201802091608.w19G8vbe027873@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 9 Feb 2018 16:08:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329067 - head/cddl/contrib/opensolaris/cmd/zpool X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/zpool X-SVN-Commit-Revision: 329067 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Feb 2018 16:08:58 -0000 Author: asomers Date: Fri Feb 9 16:08:57 2018 New Revision: 329067 URL: https://svnweb.freebsd.org/changeset/base/329067 Log: Fix "zpool add" crash when a replacing vdev has a spare child Fix an assertion in zpool that causes a crash when running any "zpool add" command on a spare that contains a replacing vdev with a spare child. This likely affects Illumos, too. PR: 225546 MFC after: 3 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D14138 Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c Fri Feb 9 15:58:33 2018 (r329066) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c Fri Feb 9 16:08:57 2018 (r329067) @@ -688,6 +688,21 @@ get_replication(nvlist_t *nvroot, boolean_t fatal) verify(nvlist_lookup_string(cnv, ZPOOL_CONFIG_TYPE, &childtype) == 0); + if (strcmp(childtype, + VDEV_TYPE_SPARE) == 0) { + /* We have a replacing vdev with + * a spare child. Get the first + * real child of the spare + */ + verify( + nvlist_lookup_nvlist_array( + cnv, + ZPOOL_CONFIG_CHILDREN, + &rchild, + &rchildren) == 0); + assert(rchildren >= 2); + cnv = rchild[0]; + } } verify(nvlist_lookup_string(cnv, From owner-svn-src-all@freebsd.org Fri Feb 9 16:19:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DE34F0FC90; Fri, 9 Feb 2018 16:19:09 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf0-x22a.google.com (mail-lf0-x22a.google.com [IPv6:2a00:1450:4010:c07::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 0CC886B227; Fri, 9 Feb 2018 16:19:09 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf0-x22a.google.com with SMTP id f136so11939555lff.8; Fri, 09 Feb 2018 08:19:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=4uxOnYfw6BF2IZ467ZYGJ3a5Z8Wc+G/mEpYCdktS3r0=; b=CeV7UGlsdLpi2pMMB8iydWKilA9zp4ZLTjbm4+DfWWVhAY4kyXTNQYlEJ9ZBMVjT62 mC0/HHikmE3e9pDJM6LQsxgTfTsAD0Z5ziAaYqPt8o5KjHH2Ru8Qp789gAGFJHXkwU7O VOApVsp9DVZeJPDXcfE1lVlUY4150nq1AZ9dvdX36nwiH2PlHJ9PdT+/Zek5r1Sw4i7s lbH57O6DlFcXxpW/oIjvK9eBmroc8+dqIcjPFfKrLO0v5RLH1t3yNhrBjSsaoPpYYeW/ /byxm/+fJ0KXV51fZDujpIvQ1kJRpWOXQbaa5OXeNlhaFGO2onh1lW7ZS8UhOFcHLe8n 7+eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=4uxOnYfw6BF2IZ467ZYGJ3a5Z8Wc+G/mEpYCdktS3r0=; b=HBMupySTDuRgWQ6NMC+DUE9txbWLzc7FW9DnThreGEmMVbtdoVbsRJ3baUs1a5idpn RniMB7fWZQFBB41wO6Kq4GC0jRrIFL2sCuRC9xwRGGeeasEiUQtMq4V9zu9PAaAYvAv8 SKtDBkoIO76jBp03sLjqkghx2KxNIItQu+uqUSnhN83x71uajTRjjEJcDJnqPXMtXmyQ xjGXoF8PKCjUz9G7ZXWMfjjFUBSCzIx6bqJ9QCuNqu/O4AdFglo3wL1ujL3R7NGTVOtw 3O2wZ/RXl2dk7gXrWX0bt1XxVAFltCSAQy8nbigVUKXLYJf25AXWlZ+LbBR1EAlXAtae NMmw== X-Gm-Message-State: APf1xPCl77b4LdbLA1T33QVX5CUQ4CGZRlUKX56cZrZowIAWAHGpB4qf CFzVgnhDGQo1az976piYyX05W3vdRAlB2/VpDqg= X-Google-Smtp-Source: AH8x2260J6u1cEcclt6ZyUNUGmDqmcZxUXRgVunQnJ3hTjfYQKAYhv/JMnn0lARlQnhg8JwBdPXmD9BWk08HuQX05K8= X-Received: by 10.25.229.129 with SMTP id i1mr2463891lfk.66.1518193146239; Fri, 09 Feb 2018 08:19:06 -0800 (PST) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.179.87.131 with HTTP; Fri, 9 Feb 2018 08:19:05 -0800 (PST) In-Reply-To: <201802091550.w19FoXEb018181@repo.freebsd.org> References: <201802091550.w19FoXEb018181@repo.freebsd.org> From: Alan Somers Date: Fri, 9 Feb 2018 09:19:05 -0700 X-Google-Sender-Auth: _0DFQXrqOgayRAGfrU7J4J_0Nto Message-ID: Subject: Re: svn commit: r329064 - head/share/zoneinfo To: Warner Losh 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.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Feb 2018 16:19:09 -0000 On Fri, Feb 9, 2018 at 8:50 AM, Warner Losh wrote: > Author: imp > Date: Fri Feb 9 15:50:32 2018 > New Revision: 329064 > URL: https://svnweb.freebsd.org/changeset/base/329064 > > Log: > We don't actually need env here, so drop it. All shells allow setting > of shell variables for the next command like this. > > Modified: > head/share/zoneinfo/Makefile > As a matter of fact, shells/fish doesn't allow that. But don't go reverting your commit; fish doesn't support "&&" either. Only a weirdo would invoke fish from a Makefile. -Alan From owner-svn-src-all@freebsd.org Fri Feb 9 16:41:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0530AF1186B for ; Fri, 9 Feb 2018 16:41:40 +0000 (UTC) (envelope-from wlosh@bsdimp.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 809316C3AF for ; Fri, 9 Feb 2018 16:41:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x230.google.com with SMTP id f34so10268233ioi.13 for ; Fri, 09 Feb 2018 08:41:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=JdJUxm6uPNho7XHBTXpxnLFkNTTd17HP3I9ahwC2uDc=; b=MWgbXHX2eqWdIMNsWHl5vHQCWjr1plOk0lreFrda1HD1pEczNTWWpxHFqlhP1NX1+s xwV/66qfjGoIjHV4xKHq5wH5G3yooxpyXWc9lZnlq3f3NO1lhSMxLGar3GtPBTA1Efrz QzPQKJOyq1+PusYYkKKyNhawAt7l55X4qperMf8eMmLeapficsu4e5vWYelicXjbSy6E jW1CqRWFhXuBS82vm9x3iumfrORYvoHUHqc1GAIeU4Kyci2xyCRuU2tDpBqTuag0a8NA 9x6u64cyQnjJlRMDAKez13VL7FeY5Hzt2T87ETplIt+hlUQejgekvZIDW04EotIrnUVy LhYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=JdJUxm6uPNho7XHBTXpxnLFkNTTd17HP3I9ahwC2uDc=; b=njkx4P52ha+82hc0zUaQVlJ9yNRt58aTHW/dfSAhgNlvBRkbY4ajpNZSsNgIUbueXG a6BhgdjCyRF0c8wCE2RrCZOFpwOSvIJFo8V76nRb3Ypvena2cZb2Mb0PpyEkwuCKsPnM LEbjtHYw7lAII2T31JGZSDcnCvoB7GPDnBftOpNsN8aMU56zB+aqGMlyp261+o01BGeA vJxO4fXy7SehUNV37U4N4Oo3KZwB8bhucaW9NPAy4yetHgFfdZ7KrSPA9fXVT1P3l6JY pBozFcAlMkZK79UpTnaf8y2uPBLughZ/k/HbqYQmGb1Uql5DigUoCKn0PaDYQZRTzchS cLxA== X-Gm-Message-State: APf1xPDhUWrE2FJkdDInAc9LFlRc0KiqtGlj9tmmmts2ZwkHHfncUU3Y EINDOHf1ZbBKOZ7LvJADGvww0oPuqLRM87oR6iH4/Q== X-Google-Smtp-Source: AH8x224VLVItrj/S22frfsKbxhmIK6gSxdrXDvk8FwEFY5F9yvt5J9FsYULW9YGCweOi5PdTNn8eONO0vvZ45q7PjbI= X-Received: by 10.107.136.76 with SMTP id k73mr4032602iod.301.1518194498788; Fri, 09 Feb 2018 08:41:38 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Fri, 9 Feb 2018 08:41:37 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: References: <201802091550.w19FoXEb018181@repo.freebsd.org> From: Warner Losh Date: Fri, 9 Feb 2018 09:41:37 -0700 X-Google-Sender-Auth: p_YlxVciDWxOG6dsbliF0SHAqHw Message-ID: Subject: Re: svn commit: r329064 - head/share/zoneinfo To: Alan Somers Cc: Warner Losh , 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.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Feb 2018 16:41:40 -0000 On Fri, Feb 9, 2018 at 9:19 AM, Alan Somers wrote: > On Fri, Feb 9, 2018 at 8:50 AM, Warner Losh wrote: > >> Author: imp >> Date: Fri Feb 9 15:50:32 2018 >> New Revision: 329064 >> URL: https://svnweb.freebsd.org/changeset/base/329064 >> >> Log: >> We don't actually need env here, so drop it. All shells allow setting >> of shell variables for the next command like this. >> >> Modified: >> head/share/zoneinfo/Makefile >> > > As a matter of fact, shells/fish doesn't allow that. But don't go > reverting your commit; fish doesn't support "&&" either. Only a weirdo > would invoke fish from a Makefile. > All Bourne-like shells have to. Warner From owner-svn-src-all@freebsd.org Fri Feb 9 17:25:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8233AF152A7; Fri, 9 Feb 2018 17:25:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 357AA6E9B0; Fri, 9 Feb 2018 17:25:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2BD4427CA5; Fri, 9 Feb 2018 17:25:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w19HPZt3067706; Fri, 9 Feb 2018 17:25:35 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w19HPZFC067705; Fri, 9 Feb 2018 17:25:35 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802091725.w19HPZFC067705@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 9 Feb 2018 17:25:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329070 - stable/11/sys/boot/i386/libi386 X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/sys/boot/i386/libi386 X-SVN-Commit-Revision: 329070 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Feb 2018 17:25:35 -0000 Author: kevans Date: Fri Feb 9 17:25:34 2018 New Revision: 329070 URL: https://svnweb.freebsd.org/changeset/base/329070 Log: MFC r327606: Handle misconfigured/nonexistent pcidev for comconsole instead of BTX panic. [This is effectively a direct commit to stable/11 due to path restructuring in head. Diffs have simply been applied to previous location] PR: 203319 Modified: stable/11/sys/boot/i386/libi386/comconsole.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/i386/libi386/comconsole.c ============================================================================== --- stable/11/sys/boot/i386/libi386/comconsole.c Fri Feb 9 17:01:30 2018 (r329069) +++ stable/11/sys/boot/i386/libi386/comconsole.c Fri Feb 9 17:25:34 2018 (r329070) @@ -267,6 +267,16 @@ comc_pcidev_handle(uint32_t locator) printf("Cannot read bar at 0x%x\n", locator); return (CMD_ERROR); } + + /* + * biospci_read_config() sets port == 0xffffffff if the pcidev + * isn't found on the bus. Check for 0xffffffff and return to not + * panic in BTX. + */ + if (port == 0xffffffff) { + printf("Cannot find specified pcidev\n"); + return (CMD_ERROR); + } if (!PCI_BAR_IO(port)) { printf("Memory bar at 0x%x\n", locator); return (CMD_ERROR); From owner-svn-src-all@freebsd.org Fri Feb 9 17:46:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DCBDF169E1; Fri, 9 Feb 2018 17:46:34 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ED24E6F9D3; Fri, 9 Feb 2018 17:46:33 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E38FA27FD6; Fri, 9 Feb 2018 17:46:33 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w19HkX8f078038; Fri, 9 Feb 2018 17:46:33 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w19HkXAD078037; Fri, 9 Feb 2018 17:46:33 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201802091746.w19HkXAD078037@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Fri, 9 Feb 2018 17:46:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329071 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 329071 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Feb 2018 17:46:34 -0000 Author: jtl Date: Fri Feb 9 17:46:33 2018 New Revision: 329071 URL: https://svnweb.freebsd.org/changeset/base/329071 Log: On bootup, the amd64 pmap initialization code creates page-table mappings for the pages used for the kernel and some initial allocations used for the page table. It maps the kernel and the blocks used for these initial allocations using 2MB pages. However, if the kernel does not end on a 2MB boundary, it still maps the last portion using a 2MB page, but reports that the unused 4K blocks within this 2MB allocation are free physical blocks. This means that these same physical blocks could also be mapped elsewhere - for example, into a user process. Given the proximity to the kernel text and data area, it seems wise to avoid allowing someone to write data to physical blocks also mapped into these virtual addresses. (Note that this isn't a security vulnerability: the direct map makes most/all memory on the system mapped into kernel space. And, nothing in the kernel should be trying to access these pages, as the virtual addresses are unused. It simply seems wise to avoid reusing these physical blocks while they are mapped to virtual addresses so close to the kernel text and data area.) Consequently, let's reserve the physical blocks covered by the page-table mappings for these initial allocations. Reviewed by: kib, markj MFC after: 2 weeks Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D14268 Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Fri Feb 9 17:25:34 2018 (r329070) +++ head/sys/amd64/amd64/pmap.c Fri Feb 9 17:46:33 2018 (r329071) @@ -957,6 +957,13 @@ create_pagetables(vm_paddr_t *firstaddr) pd_p[i] = (i << PDRSHIFT) | X86_PG_RW | X86_PG_V | PG_PS | pg_g; + /* + * Because we map the physical blocks in 2M pages, adjust firstaddr + * to record the physical blocks we've actually mapped into kernel + * virtual address space. + */ + *firstaddr = round_2mpage(*firstaddr); + /* And connect up the PD to the PDP (leaving room for L4 pages) */ pdp_p = (pdp_entry_t *)(KPDPphys + ptoa(KPML4I - KPML4BASE)); for (i = 0; i < nkpdpe; i++) From owner-svn-src-all@freebsd.org Fri Feb 9 17:52:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61874F16FC5; Fri, 9 Feb 2018 17:52:03 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.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 0D40F6FE95; Fri, 9 Feb 2018 17:52:03 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 799AA10A7DB; Fri, 9 Feb 2018 12:52:01 -0500 (EST) From: John Baldwin To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329064 - head/share/zoneinfo Date: Fri, 09 Feb 2018 09:49:33 -0800 Message-ID: <14002093.zLdzgIqnsv@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201802091550.w19FoXEb018181@repo.freebsd.org> References: <201802091550.w19FoXEb018181@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.4.3 (mail.baldwin.cx); Fri, 09 Feb 2018 12:52:01 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Feb 2018 17:52:03 -0000 On Friday, February 09, 2018 03:50:33 PM Warner Losh wrote: > Author: imp > Date: Fri Feb 9 15:50:32 2018 > New Revision: 329064 > URL: https://svnweb.freebsd.org/changeset/base/329064 > > Log: > We don't actually need env here, so drop it. All shells allow setting > of shell variables for the next command like this. Eh: % LC_ALL=C env LC_ALL=C: Command not found. csh and tcsh don't let you set environment variables as a prefix. That said, if you try to use csh as the SHELL for make I bet many things would break. -- John Baldwin From owner-svn-src-all@freebsd.org Fri Feb 9 18:18:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9018FF18E70; Fri, 9 Feb 2018 18:18:01 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3BFFD71256; Fri, 9 Feb 2018 18:18:01 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3038D51E; Fri, 9 Feb 2018 18:18:01 +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 w19II1J9093053; Fri, 9 Feb 2018 18:18:01 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w19II07x093049; Fri, 9 Feb 2018 18:18:00 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201802091818.w19II07x093049@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 9 Feb 2018 18:18:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r329072 - in vendor-sys/acpica/dist: . generate/unix/iasl source/common source/compiler source/components/dispatcher source/components/executer source/components/namespace source/compon... X-SVN-Group: vendor-sys X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in vendor-sys/acpica/dist: . generate/unix/iasl source/common source/compiler source/components/dispatcher source/components/executer source/components/namespace source/components/parser source/compon... X-SVN-Commit-Revision: 329072 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Feb 2018 18:18:01 -0000 Author: jkim Date: Fri Feb 9 18:18:00 2018 New Revision: 329072 URL: https://svnweb.freebsd.org/changeset/base/329072 Log: Import ACPICA 20180209. Added: vendor-sys/acpica/dist/source/common/dmtbdump1.c (contents, props changed) vendor-sys/acpica/dist/source/common/dmtbdump2.c (contents, props changed) vendor-sys/acpica/dist/source/common/dmtbdump3.c (contents, props changed) vendor-sys/acpica/dist/source/common/dmtbinfo1.c (contents, props changed) vendor-sys/acpica/dist/source/common/dmtbinfo2.c (contents, props changed) vendor-sys/acpica/dist/source/common/dmtbinfo3.c (contents, props changed) Modified: vendor-sys/acpica/dist/changes.txt vendor-sys/acpica/dist/generate/unix/iasl/Makefile vendor-sys/acpica/dist/source/common/dmtbdump.c vendor-sys/acpica/dist/source/common/dmtbinfo.c vendor-sys/acpica/dist/source/compiler/aslbtypes.c vendor-sys/acpica/dist/source/compiler/aslerror.c vendor-sys/acpica/dist/source/compiler/aslfold.c vendor-sys/acpica/dist/source/compiler/aslload.c vendor-sys/acpica/dist/source/compiler/aslmessages.c vendor-sys/acpica/dist/source/compiler/aslmessages.h vendor-sys/acpica/dist/source/compiler/dtcompile.c vendor-sys/acpica/dist/source/compiler/dtcompiler.h vendor-sys/acpica/dist/source/compiler/dtexpress.c vendor-sys/acpica/dist/source/compiler/dtparser.l vendor-sys/acpica/dist/source/compiler/dtparser.y vendor-sys/acpica/dist/source/compiler/dttable.c vendor-sys/acpica/dist/source/compiler/dttable1.c vendor-sys/acpica/dist/source/compiler/dttable2.c vendor-sys/acpica/dist/source/components/dispatcher/dsargs.c vendor-sys/acpica/dist/source/components/dispatcher/dsopcode.c vendor-sys/acpica/dist/source/components/dispatcher/dspkginit.c vendor-sys/acpica/dist/source/components/dispatcher/dswexec.c vendor-sys/acpica/dist/source/components/dispatcher/dswload.c vendor-sys/acpica/dist/source/components/executer/exconvrt.c vendor-sys/acpica/dist/source/components/executer/exnames.c vendor-sys/acpica/dist/source/components/executer/exresop.c vendor-sys/acpica/dist/source/components/namespace/nseval.c vendor-sys/acpica/dist/source/components/namespace/nsinit.c vendor-sys/acpica/dist/source/components/namespace/nsnames.c vendor-sys/acpica/dist/source/components/namespace/nsparse.c vendor-sys/acpica/dist/source/components/parser/psargs.c vendor-sys/acpica/dist/source/components/parser/psloop.c vendor-sys/acpica/dist/source/components/parser/psparse.c vendor-sys/acpica/dist/source/components/parser/pstree.c vendor-sys/acpica/dist/source/components/utilities/utcache.c vendor-sys/acpica/dist/source/components/utilities/utdelete.c vendor-sys/acpica/dist/source/include/acopcode.h vendor-sys/acpica/dist/source/include/acpixf.h vendor-sys/acpica/dist/source/include/actbl1.h vendor-sys/acpica/dist/source/include/actbl2.h vendor-sys/acpica/dist/source/include/actbl3.h vendor-sys/acpica/dist/source/include/amlcode.h vendor-sys/acpica/dist/source/include/platform/aclinux.h vendor-sys/acpica/dist/source/tools/acpiexec/aemain.c Modified: vendor-sys/acpica/dist/changes.txt ============================================================================== --- vendor-sys/acpica/dist/changes.txt Fri Feb 9 17:46:33 2018 (r329071) +++ vendor-sys/acpica/dist/changes.txt Fri Feb 9 18:18:00 2018 (r329072) @@ -1,4 +1,72 @@ ---------------------------------------- +09 February 2018. Summary of changes for version 20180209: + + +1) ACPICA kernel-resident subsystem: + +Completed the final integration of the recent changes to Package Object +handling and the module-level AML code support. This allows forward +references from individual package elements when the package object is +declared from within module-level code blocks. Provides compatibility +with other ACPI implementations. + +The new architecture for the AML module-level code has been completed and +is now the default for the ACPICA code. This new architecture executes +the module-level code in-line as the ACPI table is loaded/parsed instead +of the previous architecture which deferred this code until after the +table was fully loaded. This solves some ASL code ordering issues and +provides compatibility with other ACPI implementations. At this time, +there is an option to fallback to the earlier architecture, but this +support is deprecated and is planned to be completely removed later this +year. + +Added a compile-time option to ignore AE_NOT_FOUND exceptions during +resolution of named reference elements within Package objects. Although +this is potentially a serious problem, it can generate a lot of +noise/errors on platforms whose firmware carries around a bunch of unused +Package objects. To disable these errors, define +ACPI_IGNORE_PACKAGE_RESOLUTION_ERRORS in the OS-specific header. All +errors are always reported for ACPICA applications such as AcpiExec. + +Fixed a regression related to the explicit type-conversion AML operators +(ToXXXX). The regression was introduced early in 2017 but was not seen +until recently because these operators are not fully supported by other +ACPI implementations and are thus rarely used by firmware developers. The +operators are defined by the ACPI specification to not implement the +"implicit result object conversion". The regression incorrectly +introduced this object conversion for the following explicit conversion +operators: + ToInteger + ToString + ToBuffer + ToDecimalString + ToHexString + ToBCD + FromBCD + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Fixed a problem with the compiler constant folding feature as +related to the ToXXXX explicit conversion operators. These operators do +not support the "implicit result object conversion" by definition. Thus, +ASL expressions that use these operators cannot be folded to a simple +Store operator because Store implements the implicit conversion. This +change uses the CopyObject operator for the ToXXXX operator folding +instead. CopyObject is defined to not implement implicit result +conversions and is thus appropriate for folding the ToXXXX operators. + +iASL: Changed the severity of an error condition to a simple warning for +the case where a symbol is declared both locally and as an external +symbol. This accommodates existing ASL code. + +AcpiExec: The -ep option to enable the new architecture for module-level +code has been removed. It is replaced by the -dp option which instead has +the opposite effect: it disables the new architecture (the default) and +enables the legacy architecture. When the legacy code is removed in the +future, the -dp option will be removed also. + +---------------------------------------- 05 January 2018. Summary of changes for version 20180105: Modified: vendor-sys/acpica/dist/generate/unix/iasl/Makefile ============================================================================== --- vendor-sys/acpica/dist/generate/unix/iasl/Makefile Fri Feb 9 17:46:33 2018 (r329071) +++ vendor-sys/acpica/dist/generate/unix/iasl/Makefile Fri Feb 9 18:18:00 2018 (r329072) @@ -128,7 +128,13 @@ OBJECTS = \ $(OBJDIR)/dmtable.o\ $(OBJDIR)/dmtables.o\ $(OBJDIR)/dmtbdump.o\ + $(OBJDIR)/dmtbdump1.o\ + $(OBJDIR)/dmtbdump2.o\ + $(OBJDIR)/dmtbdump3.o\ $(OBJDIR)/dmtbinfo.o\ + $(OBJDIR)/dmtbinfo1.o\ + $(OBJDIR)/dmtbinfo2.o\ + $(OBJDIR)/dmtbinfo3.o\ $(OBJDIR)/dmutils.o\ $(OBJDIR)/dmwalk.o\ $(OBJDIR)/dsargs.o\ Modified: vendor-sys/acpica/dist/source/common/dmtbdump.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtbdump.c Fri Feb 9 17:46:33 2018 (r329071) +++ vendor-sys/acpica/dist/source/common/dmtbdump.c Fri Feb 9 18:18:00 2018 (r329072) @@ -603,3832 +603,3 @@ AcpiDmValidateFadtLength ( "found %X expected %X\n", Revision, Length, ExpectedLength); } - - -/******************************************************************************* - * - * FUNCTION: AcpiDmDumpAsf - * - * PARAMETERS: Table - A ASF table - * - * RETURN: None - * - * DESCRIPTION: Format the contents of a ASF table - * - ******************************************************************************/ - -void -AcpiDmDumpAsf ( - ACPI_TABLE_HEADER *Table) -{ - ACPI_STATUS Status; - UINT32 Offset = sizeof (ACPI_TABLE_HEADER); - ACPI_ASF_INFO *Subtable; - ACPI_DMTABLE_INFO *InfoTable; - ACPI_DMTABLE_INFO *DataInfoTable = NULL; - UINT8 *DataTable = NULL; - UINT32 DataCount = 0; - UINT32 DataLength = 0; - UINT32 DataOffset = 0; - UINT32 i; - UINT8 Type; - - - /* No main table, only subtables */ - - Subtable = ACPI_ADD_PTR (ACPI_ASF_INFO, Table, Offset); - while (Offset < Table->Length) - { - /* Common subtable header */ - - Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, - Subtable->Header.Length, AcpiDmTableInfoAsfHdr); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* The actual type is the lower 7 bits of Type */ - - Type = (UINT8) (Subtable->Header.Type & 0x7F); - - switch (Type) - { - case ACPI_ASF_TYPE_INFO: - - InfoTable = AcpiDmTableInfoAsf0; - break; - - case ACPI_ASF_TYPE_ALERT: - - InfoTable = AcpiDmTableInfoAsf1; - DataInfoTable = AcpiDmTableInfoAsf1a; - DataTable = ACPI_ADD_PTR (UINT8, Subtable, sizeof (ACPI_ASF_ALERT)); - DataCount = ACPI_CAST_PTR (ACPI_ASF_ALERT, Subtable)->Alerts; - DataLength = ACPI_CAST_PTR (ACPI_ASF_ALERT, Subtable)->DataLength; - DataOffset = Offset + sizeof (ACPI_ASF_ALERT); - break; - - case ACPI_ASF_TYPE_CONTROL: - - InfoTable = AcpiDmTableInfoAsf2; - DataInfoTable = AcpiDmTableInfoAsf2a; - DataTable = ACPI_ADD_PTR (UINT8, Subtable, sizeof (ACPI_ASF_REMOTE)); - DataCount = ACPI_CAST_PTR (ACPI_ASF_REMOTE, Subtable)->Controls; - DataLength = ACPI_CAST_PTR (ACPI_ASF_REMOTE, Subtable)->DataLength; - DataOffset = Offset + sizeof (ACPI_ASF_REMOTE); - break; - - case ACPI_ASF_TYPE_BOOT: - - InfoTable = AcpiDmTableInfoAsf3; - break; - - case ACPI_ASF_TYPE_ADDRESS: - - InfoTable = AcpiDmTableInfoAsf4; - DataTable = ACPI_ADD_PTR (UINT8, Subtable, sizeof (ACPI_ASF_ADDRESS)); - DataLength = ACPI_CAST_PTR (ACPI_ASF_ADDRESS, Subtable)->Devices; - DataOffset = Offset + sizeof (ACPI_ASF_ADDRESS); - break; - - default: - - AcpiOsPrintf ("\n**** Unknown ASF subtable type 0x%X\n", - Subtable->Header.Type); - return; - } - - Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, - Subtable->Header.Length, InfoTable); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Dump variable-length extra data */ - - switch (Type) - { - case ACPI_ASF_TYPE_ALERT: - case ACPI_ASF_TYPE_CONTROL: - - for (i = 0; i < DataCount; i++) - { - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Table->Length, DataOffset, - DataTable, DataLength, DataInfoTable); - if (ACPI_FAILURE (Status)) - { - return; - } - - DataTable = ACPI_ADD_PTR (UINT8, DataTable, DataLength); - DataOffset += DataLength; - } - break; - - case ACPI_ASF_TYPE_ADDRESS: - - for (i = 0; i < DataLength; i++) - { - if (!(i % 16)) - { - AcpiDmLineHeader (DataOffset, 1, "Addresses"); - } - - AcpiOsPrintf ("%2.2X ", *DataTable); - DataTable++; - DataOffset++; - - if (DataOffset > Table->Length) - { - AcpiOsPrintf ( - "**** ACPI table terminates in the middle of a " - "data structure! (ASF! table)\n"); - return; - } - } - - AcpiOsPrintf ("\n"); - break; - - default: - - break; - } - - AcpiOsPrintf ("\n"); - - /* Point to next subtable */ - - if (!Subtable->Header.Length) - { - AcpiOsPrintf ("Invalid zero subtable header length\n"); - return; - } - - Offset += Subtable->Header.Length; - Subtable = ACPI_ADD_PTR (ACPI_ASF_INFO, Subtable, - Subtable->Header.Length); - } -} - - -/******************************************************************************* - * - * FUNCTION: AcpiDmDumpCpep - * - * PARAMETERS: Table - A CPEP table - * - * RETURN: None - * - * DESCRIPTION: Format the contents of a CPEP. This table type consists - * of an open-ended number of subtables. - * - ******************************************************************************/ - -void -AcpiDmDumpCpep ( - ACPI_TABLE_HEADER *Table) -{ - ACPI_STATUS Status; - ACPI_CPEP_POLLING *Subtable; - UINT32 Length = Table->Length; - UINT32 Offset = sizeof (ACPI_TABLE_CPEP); - - - /* Main table */ - - Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoCpep); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Subtables */ - - Subtable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, Table, Offset); - while (Offset < Table->Length) - { - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, Subtable, - Subtable->Header.Length, AcpiDmTableInfoCpep0); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Point to next subtable */ - - Offset += Subtable->Header.Length; - Subtable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, Subtable, - Subtable->Header.Length); - } -} - - -/******************************************************************************* - * - * FUNCTION: AcpiDmDumpCsrt - * - * PARAMETERS: Table - A CSRT table - * - * RETURN: None - * - * DESCRIPTION: Format the contents of a CSRT. This table type consists - * of an open-ended number of subtables. - * - ******************************************************************************/ - -void -AcpiDmDumpCsrt ( - ACPI_TABLE_HEADER *Table) -{ - ACPI_STATUS Status; - ACPI_CSRT_GROUP *Subtable; - ACPI_CSRT_SHARED_INFO *SharedInfoTable; - ACPI_CSRT_DESCRIPTOR *SubSubtable; - UINT32 Length = Table->Length; - UINT32 Offset = sizeof (ACPI_TABLE_CSRT); - UINT32 SubOffset; - UINT32 SubSubOffset; - UINT32 InfoLength; - - - /* The main table only contains the ACPI header, thus already handled */ - - /* Subtables (Resource Groups) */ - - Subtable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Table, Offset); - while (Offset < Table->Length) - { - /* Resource group subtable */ - - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, Subtable, - Subtable->Length, AcpiDmTableInfoCsrt0); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Shared info subtable (One per resource group) */ - - SubOffset = sizeof (ACPI_CSRT_GROUP); - SharedInfoTable = ACPI_ADD_PTR (ACPI_CSRT_SHARED_INFO, Table, - Offset + SubOffset); - - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset + SubOffset, SharedInfoTable, - sizeof (ACPI_CSRT_SHARED_INFO), AcpiDmTableInfoCsrt1); - if (ACPI_FAILURE (Status)) - { - return; - } - - SubOffset += Subtable->SharedInfoLength; - - /* Sub-Subtables (Resource Descriptors) */ - - SubSubtable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, Table, - Offset + SubOffset); - - while ((SubOffset < Subtable->Length) && - ((Offset + SubOffset) < Table->Length)) - { - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset + SubOffset, SubSubtable, - SubSubtable->Length, AcpiDmTableInfoCsrt2); - if (ACPI_FAILURE (Status)) - { - return; - } - - SubSubOffset = sizeof (ACPI_CSRT_DESCRIPTOR); - - /* Resource-specific info buffer */ - - InfoLength = SubSubtable->Length - SubSubOffset; - if (InfoLength) - { - Status = AcpiDmDumpTable (Length, - Offset + SubOffset + SubSubOffset, Table, - InfoLength, AcpiDmTableInfoCsrt2a); - if (ACPI_FAILURE (Status)) - { - return; - } - SubSubOffset += InfoLength; - } - - /* Point to next sub-subtable */ - - SubOffset += SubSubtable->Length; - SubSubtable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, SubSubtable, - SubSubtable->Length); - } - - /* Point to next subtable */ - - Offset += Subtable->Length; - Subtable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Subtable, - Subtable->Length); - } -} - - -/******************************************************************************* - * - * FUNCTION: AcpiDmDumpDbg2 - * - * PARAMETERS: Table - A DBG2 table - * - * RETURN: None - * - * DESCRIPTION: Format the contents of a DBG2. This table type consists - * of an open-ended number of subtables. - * - ******************************************************************************/ - -void -AcpiDmDumpDbg2 ( - ACPI_TABLE_HEADER *Table) -{ - ACPI_STATUS Status; - ACPI_DBG2_DEVICE *Subtable; - UINT32 Length = Table->Length; - UINT32 Offset = sizeof (ACPI_TABLE_DBG2); - UINT32 i; - UINT32 ArrayOffset; - UINT32 AbsoluteOffset; - UINT8 *Array; - - - /* Main table */ - - Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoDbg2); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Subtables */ - - Subtable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Table, Offset); - while (Offset < Table->Length) - { - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, Subtable, - Subtable->Length, AcpiDmTableInfoDbg2Device); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Dump the BaseAddress array */ - - for (i = 0; i < Subtable->RegisterCount; i++) - { - ArrayOffset = Subtable->BaseAddressOffset + - (sizeof (ACPI_GENERIC_ADDRESS) * i); - AbsoluteOffset = Offset + ArrayOffset; - Array = (UINT8 *) Subtable + ArrayOffset; - - Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array, - Subtable->Length, AcpiDmTableInfoDbg2Addr); - if (ACPI_FAILURE (Status)) - { - return; - } - } - - /* Dump the AddressSize array */ - - for (i = 0; i < Subtable->RegisterCount; i++) - { - ArrayOffset = Subtable->AddressSizeOffset + - (sizeof (UINT32) * i); - AbsoluteOffset = Offset + ArrayOffset; - Array = (UINT8 *) Subtable + ArrayOffset; - - Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array, - Subtable->Length, AcpiDmTableInfoDbg2Size); - if (ACPI_FAILURE (Status)) - { - return; - } - } - - /* Dump the Namestring (required) */ - - AcpiOsPrintf ("\n"); - ArrayOffset = Subtable->NamepathOffset; - AbsoluteOffset = Offset + ArrayOffset; - Array = (UINT8 *) Subtable + ArrayOffset; - - Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array, - Subtable->Length, AcpiDmTableInfoDbg2Name); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Dump the OemData (optional) */ - - if (Subtable->OemDataOffset) - { - Status = AcpiDmDumpTable (Length, Offset + Subtable->OemDataOffset, - Table, Subtable->OemDataLength, - AcpiDmTableInfoDbg2OemData); - if (ACPI_FAILURE (Status)) - { - return; - } - } - - /* Point to next subtable */ - - Offset += Subtable->Length; - Subtable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Subtable, - Subtable->Length); - } -} - - -/******************************************************************************* - * - * FUNCTION: AcpiDmDumpDmar - * - * PARAMETERS: Table - A DMAR table - * - * RETURN: None - * - * DESCRIPTION: Format the contents of a DMAR. This table type consists - * of an open-ended number of subtables. - * - ******************************************************************************/ - -void -AcpiDmDumpDmar ( - ACPI_TABLE_HEADER *Table) -{ - ACPI_STATUS Status; - ACPI_DMAR_HEADER *Subtable; - UINT32 Length = Table->Length; - UINT32 Offset = sizeof (ACPI_TABLE_DMAR); - ACPI_DMTABLE_INFO *InfoTable; - ACPI_DMAR_DEVICE_SCOPE *ScopeTable; - UINT32 ScopeOffset; - UINT8 *PciPath; - UINT32 PathOffset; - - - /* Main table */ - - Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoDmar); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Subtables */ - - Subtable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Table, Offset); - while (Offset < Table->Length) - { - /* Common subtable header */ - - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, Subtable, - Subtable->Length, AcpiDmTableInfoDmarHdr); - if (ACPI_FAILURE (Status)) - { - return; - } - - AcpiOsPrintf ("\n"); - - switch (Subtable->Type) - { - case ACPI_DMAR_TYPE_HARDWARE_UNIT: - - InfoTable = AcpiDmTableInfoDmar0; - ScopeOffset = sizeof (ACPI_DMAR_HARDWARE_UNIT); - break; - - case ACPI_DMAR_TYPE_RESERVED_MEMORY: - - InfoTable = AcpiDmTableInfoDmar1; - ScopeOffset = sizeof (ACPI_DMAR_RESERVED_MEMORY); - break; - - case ACPI_DMAR_TYPE_ROOT_ATS: - - InfoTable = AcpiDmTableInfoDmar2; - ScopeOffset = sizeof (ACPI_DMAR_ATSR); - break; - - case ACPI_DMAR_TYPE_HARDWARE_AFFINITY: - - InfoTable = AcpiDmTableInfoDmar3; - ScopeOffset = sizeof (ACPI_DMAR_RHSA); - break; - - case ACPI_DMAR_TYPE_NAMESPACE: - - InfoTable = AcpiDmTableInfoDmar4; - ScopeOffset = sizeof (ACPI_DMAR_ANDD); - break; - - default: - - AcpiOsPrintf ("\n**** Unknown DMAR subtable type 0x%X\n\n", - Subtable->Type); - return; - } - - Status = AcpiDmDumpTable (Length, Offset, Subtable, - Subtable->Length, InfoTable); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* - * Dump the optional device scope entries - */ - if ((Subtable->Type == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) || - (Subtable->Type == ACPI_DMAR_TYPE_NAMESPACE)) - { - /* These types do not support device scopes */ - - goto NextSubtable; - } - - ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE, Subtable, ScopeOffset); - while (ScopeOffset < Subtable->Length) - { - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset + ScopeOffset, ScopeTable, - ScopeTable->Length, AcpiDmTableInfoDmarScope); - if (ACPI_FAILURE (Status)) - { - return; - } - AcpiOsPrintf ("\n"); - - /* Dump the PCI Path entries for this device scope */ - - PathOffset = sizeof (ACPI_DMAR_DEVICE_SCOPE); /* Path entries start at this offset */ - - PciPath = ACPI_ADD_PTR (UINT8, ScopeTable, - sizeof (ACPI_DMAR_DEVICE_SCOPE)); - - while (PathOffset < ScopeTable->Length) - { - AcpiDmLineHeader ((PathOffset + ScopeOffset + Offset), 2, - "PCI Path"); - AcpiOsPrintf ("%2.2X,%2.2X\n", PciPath[0], PciPath[1]); - - /* Point to next PCI Path entry */ - - PathOffset += 2; - PciPath += 2; - AcpiOsPrintf ("\n"); - } - - /* Point to next device scope entry */ - - ScopeOffset += ScopeTable->Length; - ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE, - ScopeTable, ScopeTable->Length); - } - -NextSubtable: - /* Point to next subtable */ - - Offset += Subtable->Length; - Subtable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Subtable, - Subtable->Length); - } -} - - -/******************************************************************************* - * - * FUNCTION: AcpiDmDumpDrtm - * - * PARAMETERS: Table - A DRTM table - * - * RETURN: None - * - * DESCRIPTION: Format the contents of a DRTM. - * - ******************************************************************************/ - -void -AcpiDmDumpDrtm ( - ACPI_TABLE_HEADER *Table) -{ - ACPI_STATUS Status; - UINT32 Offset; - ACPI_DRTM_VTABLE_LIST *DrtmVtl; - ACPI_DRTM_RESOURCE_LIST *DrtmRl; - ACPI_DRTM_DPS_ID *DrtmDps; - UINT32 Count; - - - /* Main table */ - - Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, - AcpiDmTableInfoDrtm); - if (ACPI_FAILURE (Status)) - { - return; - } - - Offset = sizeof (ACPI_TABLE_DRTM); - - /* Sub-tables */ - - /* Dump ValidatedTable length */ - - DrtmVtl = ACPI_ADD_PTR (ACPI_DRTM_VTABLE_LIST, Table, Offset); - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Table->Length, Offset, - DrtmVtl, ACPI_OFFSET (ACPI_DRTM_VTABLE_LIST, ValidatedTables), - AcpiDmTableInfoDrtm0); - if (ACPI_FAILURE (Status)) - { - return; - } - - Offset += ACPI_OFFSET (ACPI_DRTM_VTABLE_LIST, ValidatedTables); - - /* Dump Validated table addresses */ - - Count = 0; - while ((Offset < Table->Length) && - (DrtmVtl->ValidatedTableCount > Count)) - { - Status = AcpiDmDumpTable (Table->Length, Offset, - ACPI_ADD_PTR (void, Table, Offset), sizeof (UINT64), - AcpiDmTableInfoDrtm0a); - if (ACPI_FAILURE (Status)) - { - return; - } - - Offset += sizeof (UINT64); - Count++; - } - - /* Dump ResourceList length */ - - DrtmRl = ACPI_ADD_PTR (ACPI_DRTM_RESOURCE_LIST, Table, Offset); - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Table->Length, Offset, - DrtmRl, ACPI_OFFSET (ACPI_DRTM_RESOURCE_LIST, Resources), - AcpiDmTableInfoDrtm1); - if (ACPI_FAILURE (Status)) - { - return; - } - - Offset += ACPI_OFFSET (ACPI_DRTM_RESOURCE_LIST, Resources); - - /* Dump the Resource List */ - - Count = 0; - while ((Offset < Table->Length) && - (DrtmRl->ResourceCount > Count)) - { - Status = AcpiDmDumpTable (Table->Length, Offset, - ACPI_ADD_PTR (void, Table, Offset), - sizeof (ACPI_DRTM_RESOURCE), AcpiDmTableInfoDrtm1a); - if (ACPI_FAILURE (Status)) - { - return; - } - - Offset += sizeof (ACPI_DRTM_RESOURCE); - Count++; - } - - /* Dump DPS */ - - DrtmDps = ACPI_ADD_PTR (ACPI_DRTM_DPS_ID, Table, Offset); - AcpiOsPrintf ("\n"); - (void) AcpiDmDumpTable (Table->Length, Offset, - DrtmDps, sizeof (ACPI_DRTM_DPS_ID), AcpiDmTableInfoDrtm2); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiDmDumpEinj - * - * PARAMETERS: Table - A EINJ table - * - * RETURN: None - * - * DESCRIPTION: Format the contents of a EINJ. This table type consists - * of an open-ended number of subtables. - * - ******************************************************************************/ - -void -AcpiDmDumpEinj ( - ACPI_TABLE_HEADER *Table) -{ - ACPI_STATUS Status; - ACPI_WHEA_HEADER *Subtable; - UINT32 Length = Table->Length; - UINT32 Offset = sizeof (ACPI_TABLE_EINJ); - - - /* Main table */ - - Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoEinj); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Subtables */ - - Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset); - while (Offset < Table->Length) - { - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, Subtable, - sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoEinj0); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Point to next subtable (each subtable is of fixed length) */ - - Offset += sizeof (ACPI_WHEA_HEADER); - Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Subtable, - sizeof (ACPI_WHEA_HEADER)); - } -} - - -/******************************************************************************* - * - * FUNCTION: AcpiDmDumpErst - * - * PARAMETERS: Table - A ERST table - * - * RETURN: None - * - * DESCRIPTION: Format the contents of a ERST. This table type consists - * of an open-ended number of subtables. - * - ******************************************************************************/ - -void -AcpiDmDumpErst ( - ACPI_TABLE_HEADER *Table) -{ - ACPI_STATUS Status; - ACPI_WHEA_HEADER *Subtable; - UINT32 Length = Table->Length; - UINT32 Offset = sizeof (ACPI_TABLE_ERST); - - - /* Main table */ - - Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoErst); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Subtables */ - - Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset); - while (Offset < Table->Length) - { - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, Subtable, - sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoErst0); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Point to next subtable (each subtable is of fixed length) */ - - Offset += sizeof (ACPI_WHEA_HEADER); - Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Subtable, - sizeof (ACPI_WHEA_HEADER)); - } -} - - -/******************************************************************************* - * - * FUNCTION: AcpiDmDumpFpdt - * - * PARAMETERS: Table - A FPDT table - * - * RETURN: None - * - * DESCRIPTION: Format the contents of a FPDT. This table type consists - * of an open-ended number of subtables. - * - ******************************************************************************/ - -void -AcpiDmDumpFpdt ( - ACPI_TABLE_HEADER *Table) -{ - ACPI_STATUS Status; - ACPI_FPDT_HEADER *Subtable; - UINT32 Length = Table->Length; - UINT32 Offset = sizeof (ACPI_TABLE_FPDT); - ACPI_DMTABLE_INFO *InfoTable; - - - /* There is no main table (other than the standard ACPI header) */ - - /* Subtables */ - - Subtable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Table, Offset); - while (Offset < Table->Length) - { - /* Common subtable header */ - - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, Subtable, - Subtable->Length, AcpiDmTableInfoFpdtHdr); - if (ACPI_FAILURE (Status)) - { - return; - } - - switch (Subtable->Type) - { - case ACPI_FPDT_TYPE_BOOT: - - InfoTable = AcpiDmTableInfoFpdt0; - break; - - case ACPI_FPDT_TYPE_S3PERF: - - InfoTable = AcpiDmTableInfoFpdt1; - break; - - default: - - AcpiOsPrintf ("\n**** Unknown FPDT subtable type 0x%X\n\n", - Subtable->Type); - - /* Attempt to continue */ - - if (!Subtable->Length) - { - AcpiOsPrintf ("Invalid zero length subtable\n"); - return; - } - goto NextSubtable; - } - - Status = AcpiDmDumpTable (Length, Offset, Subtable, - Subtable->Length, InfoTable); - if (ACPI_FAILURE (Status)) - { - return; - } - *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Feb 9 18:18:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87A9BF18F09; Fri, 9 Feb 2018 18:18:36 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3B13A7137E; Fri, 9 Feb 2018 18:18:36 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1BFCE51F; Fri, 9 Feb 2018 18:18: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 w19IIZW7093111; Fri, 9 Feb 2018 18:18:35 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w19IIZDs093110; Fri, 9 Feb 2018 18:18:35 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201802091818.w19IIZDs093110@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 9 Feb 2018 18:18:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r329073 - vendor-sys/acpica/20180209 X-SVN-Group: vendor-sys X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: vendor-sys/acpica/20180209 X-SVN-Commit-Revision: 329073 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Feb 2018 18:18:36 -0000 Author: jkim Date: Fri Feb 9 18:18:35 2018 New Revision: 329073 URL: https://svnweb.freebsd.org/changeset/base/329073 Log: Tag ACPICA 20180209. Added: vendor-sys/acpica/20180209/ - copied from r329072, vendor-sys/acpica/dist/ From owner-svn-src-all@freebsd.org Fri Feb 9 18:47:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78D8CF1ABF6; Fri, 9 Feb 2018 18:47:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F244725C2; Fri, 9 Feb 2018 18:47:01 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 25F28A45; Fri, 9 Feb 2018 18:47: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 w19Il0Vj008012; Fri, 9 Feb 2018 18:47:00 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w19Il0GX008011; Fri, 9 Feb 2018 18:47:00 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802091847.w19Il0GX008011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 9 Feb 2018 18:47:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329075 - head X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 329075 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Feb 2018 18:47:01 -0000 Author: imp Date: Fri Feb 9 18:47:00 2018 New Revision: 329075 URL: https://svnweb.freebsd.org/changeset/base/329075 Log: sort needs to be in ITOOLS since find -s was changed to find | sort. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Feb 9 18:42:34 2018 (r329074) +++ head/Makefile.inc1 Fri Feb 9 18:47:00 2018 (r329075) @@ -1109,7 +1109,7 @@ _zoneinfo= zic tzsetup ITOOLS= [ awk cap_mkdb cat chflags chmod chown cmp cp \ date echo egrep find grep id install ${_install-info} \ ln make mkdir mtree mv pwd_mkdb \ - rm sed services_mkdb sh strip sysctl test true uname wc ${_zoneinfo} \ + rm sed services_mkdb sh sort strip sysctl test true uname wc ${_zoneinfo} \ ${LOCAL_ITOOLS} # Needed for share/man From owner-svn-src-all@freebsd.org Fri Feb 9 18:50:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 082BAF1B001 for ; Fri, 9 Feb 2018 18:50:38 +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 28F2A728D1 for ; Fri, 9 Feb 2018 18:50:37 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x231.google.com with SMTP id d13so10705793iog.5 for ; Fri, 09 Feb 2018 10:50:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=gRh5+MCgUeG8RIaJAH7Zy1sazI9ahv6y0gmNKNOJ5hg=; b=Zakc6KMRczcF73gj7on5SmgpvWLUowPcZFsjtmlWiNFpcGXCOVp1USNo//tJJa23P8 jbP/yHtymQC+xKPdehffKj2T82heVeO3/1ZV6bEUOJrMAHmsahKlSSBKrDkRU9Qil3yT 82L2NsU2wfsNmINY3ah7FW6PQ0ygWpP7g0QTV4FHsLbMDYneZzatBagLoZOgW5ZqhYY6 umK9aa7IrZRfABefbsQXbhyCOTHqMnggL1Efw2v8zpzQYWFnkMwqXFdq2ClZVhkA5pVQ 21wyGfogKUM1ULMVItF5NlG1al/c/8rLBHBjAA96rg/R0ppL3jZAuUpo0+uL74mIsa/0 cmZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=gRh5+MCgUeG8RIaJAH7Zy1sazI9ahv6y0gmNKNOJ5hg=; b=lHKYg7xgNvHKhj43NMwvnZHweZbZBs/m7irJU1d1W1y2ZC+qsKZLMc500Uw5jEmk7k tL+cVp07gbJ4SmM1bbSCBVmzZ2/EoHrfc5UmxtlfToXE/QJjg0hAUcnPUOegCU4qiqSJ yRAuvtg2mTh8K/IfggmTSvEpI5OQCVuVR0VAS/a3LQTqpea3vxPJJg6nQDh8i+rmZ8JC YtPiRTX0WbNO+QjtDgAmhOsHWrCNIlsUiMsO04Uu7vofszvSOtZcsjNWAXMZ0p5x06ue TNP1PYrKDO3mmhIPVX5MKmP8+dBTmiKqIYBUzlb/PqP7Wkb/pLac5WmZIAZHPCxnkI+i qm9g== X-Gm-Message-State: APf1xPBHjcqZ2WCo9Fe9+klCqxuCVtS6hPNRret8qWAidnMqqDN1Ri+g U/V3dDZDOse8U8oydBMZ2ogZ1DTbeyJFz4ugnvEULg== X-Google-Smtp-Source: AH8x224fm/TWIuZNZJ1CKFi3nqxu13mH2YeGqClDF/AzoUnxY/dCNxP3qN65kAfAo2xo4sNsKxGX2K43g2L6YLv945I= X-Received: by 10.107.30.146 with SMTP id e140mr3593160ioe.291.1518202236430; Fri, 09 Feb 2018 10:50:36 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Fri, 9 Feb 2018 10:50:35 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: <14002093.zLdzgIqnsv@ralph.baldwin.cx> References: <201802091550.w19FoXEb018181@repo.freebsd.org> <14002093.zLdzgIqnsv@ralph.baldwin.cx> From: Warner Losh Date: Fri, 9 Feb 2018 11:50:35 -0700 X-Google-Sender-Auth: hGUKYQkCEMDUWpTM4pgwDl3Pr4s Message-ID: Subject: Re: svn commit: r329064 - head/share/zoneinfo To: John Baldwin Cc: Warner Losh , 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.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Feb 2018 18:50:38 -0000 On Fri, Feb 9, 2018 at 10:49 AM, John Baldwin wrote: > On Friday, February 09, 2018 03:50:33 PM Warner Losh wrote: > > Author: imp > > Date: Fri Feb 9 15:50:32 2018 > > New Revision: 329064 > > URL: https://svnweb.freebsd.org/changeset/base/329064 > > > > Log: > > We don't actually need env here, so drop it. All shells allow setting > > of shell variables for the next command like this. > > Eh: > > % LC_ALL=C env > LC_ALL=C: Command not found. > > csh and tcsh don't let you set environment variables as a prefix. > > That said, if you try to use csh as the SHELL for make I bet many things > would break. > Right, all shells supported as SHELL for make. csh isn't on the list of supported shells. Your bet is right: a lot of things do break. Warner From owner-svn-src-all@freebsd.org Fri Feb 9 19:04:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03D69F1BF7F; Fri, 9 Feb 2018 19:04:51 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A37987367F; Fri, 9 Feb 2018 19:04:50 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 9CB155CAC; Fri, 9 Feb 2018 19:04:50 +0000 (UTC) Date: Fri, 9 Feb 2018 19:04:50 +0000 From: Alexey Dokuchaev To: Warner Losh Cc: John Baldwin , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh Subject: Re: svn commit: r329064 - head/share/zoneinfo Message-ID: <20180209190450.GA85711@FreeBSD.org> References: <201802091550.w19FoXEb018181@repo.freebsd.org> <14002093.zLdzgIqnsv@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Feb 2018 19:04:51 -0000 On Fri, Feb 09, 2018 at 11:50:35AM -0700, Warner Losh wrote: > On Fri, Feb 9, 2018 at 10:49 AM, John Baldwin wrote: > > On Friday, February 09, 2018 03:50:33 PM Warner Losh wrote: > > > New Revision: 329064 > > > URL: https://svnweb.freebsd.org/changeset/base/329064 > > > > > > Log: > > > We don't actually need env here, so drop it. All shells allow setting > > > of shell variables for the next command like this. > > > > Eh: > > > > % LC_ALL=C env > > LC_ALL=C: Command not found. > > > > csh and tcsh don't let you set environment variables as a prefix. > > > > That said, if you try to use csh as the SHELL for make I bet many things > > would break. > > Right, all shells supported as SHELL for make. csh isn't on the list of > supported shells. Your bet is right: a lot of things do break. I don't really understand why we're discussing it: (t)csh, fish, whatever are for interactive use *only*. Scripts (and makefiles) should only be written for standard plain POSIX shell. ./danfe From owner-svn-src-all@freebsd.org Fri Feb 9 19:10:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B65DF1C47E; Fri, 9 Feb 2018 19:10:47 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BFFEB73A1E; Fri, 9 Feb 2018 19:10:46 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB044D9C; Fri, 9 Feb 2018 19:10:46 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w19JAkkE018428; Fri, 9 Feb 2018 19:10:46 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w19JAksQ018424; Fri, 9 Feb 2018 19:10:46 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201802091910.w19JAksQ018424@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Fri, 9 Feb 2018 19:10:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329076 - in head/tools/diag: . prtblknos X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in head/tools/diag: . prtblknos X-SVN-Commit-Revision: 329076 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Feb 2018 19:10:47 -0000 Author: mckusick Date: Fri Feb 9 19:10:46 2018 New Revision: 329076 URL: https://svnweb.freebsd.org/changeset/base/329076 Log: This is a little C-program that can be used to print out the list of blocks used by a requested list of inodes. For example, to list the blocks referenced by your kernel: guest_12 % df / Filesystem 1K-blocks Used Avail Capacity Mounted on /dev/gpt/rootfs 20307196 10707336 7975288 57% / guest_12 % ls -i /boot/kernel/kernel 160603 /boot/kernel/kernel guest_12 % ./prtblknos /dev/gpt/rootfs 160603 160603: lbn 0-7 blkno 3217584-3217647 lbn 8-11 blkno 3217864-3217895 distance 216 First-level indirect, blkno 3217896-3217903 distance 0 lbn 12-19 blkno 3217904-3217967 distance 8 lbn 20-75 blkno 3251816-3252263 distance 33848 lbn 76-83 blkno 3252368-3252431 distance 104 lbn 84-91 blkno 3252464-3252527 distance 32 lbn 92-852 blkno 3252896-3258983 distance 368 Each contiguous range of blocks is printed on a line. The distance metric is the size of the gap from the end of the previous set of blocks to the beginning of the next set of blocks. Short distances are desirable. Added: head/tools/diag/prtblknos/ head/tools/diag/prtblknos/Makefile (contents, props changed) head/tools/diag/prtblknos/README (contents, props changed) head/tools/diag/prtblknos/prtblknos.c (contents, props changed) Modified: head/tools/diag/README Modified: head/tools/diag/README ============================================================================== --- head/tools/diag/README Fri Feb 9 18:47:00 2018 (r329075) +++ head/tools/diag/README Fri Feb 9 19:10:46 2018 (r329076) @@ -11,4 +11,4 @@ Please make a subdir per program, and add a brief desc dumpvfscache program that can be used to examine the contents of the vfs name cache. localeck check for invalid/incomplete locales - +prtblknos Print out the blocks used by each inode in the list Added: head/tools/diag/prtblknos/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/diag/prtblknos/Makefile Fri Feb 9 19:10:46 2018 (r329076) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +PROG= prtblknos + +MAN= + +test: ${PROG} + ./${PROG} > a + +.include Added: head/tools/diag/prtblknos/README ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/diag/prtblknos/README Fri Feb 9 19:10:46 2018 (r329076) @@ -0,0 +1,31 @@ +# $FreeBSD$ + +This is a little C-program that can be used to print out the list +of blocks used by a requested list of inodes. + +For example, to list the blocks referenced by your kernel: + +guest_12 % df / +Filesystem 1K-blocks Used Avail Capacity Mounted on +/dev/gpt/rootfs 20307196 10707336 7975288 57% / + +guest_12 % ls -i /boot/kernel/kernel +160603 /boot/kernel/kernel + +guest_12 % ./prtblknos /dev/gpt/rootfs 160603 +160603: lbn 0-7 blkno 3217584-3217647 + lbn 8-11 blkno 3217864-3217895 distance 216 +First-level indirect, blkno 3217896-3217903 distance 0 + lbn 12-19 blkno 3217904-3217967 distance 8 + lbn 20-75 blkno 3251816-3252263 distance 33848 + lbn 76-83 blkno 3252368-3252431 distance 104 + lbn 84-91 blkno 3252464-3252527 distance 32 + lbn 92-852 blkno 3252896-3258983 distance 368 + +Each contiguous range of blocks is printed on a line. +The distance metric is the size of the gap from the end of the +previous set of blocks to the beginning of the next set of blocks. +Short distances are desirable. + + Marshall Kirk McKusick + January 19, 2018 Added: head/tools/diag/prtblknos/prtblknos.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/diag/prtblknos/prtblknos.c Fri Feb 9 19:10:46 2018 (r329076) @@ -0,0 +1,314 @@ +/* + * Copyright (c) 1998, 2003, 2013, 2018 Marshall Kirk McKusick. + * 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 MARSHALL KIRK MCKUSICK ``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 MARSHALL KIRK MCKUSICK 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 + +union dinode { + struct ufs1_dinode *dp1; + struct ufs2_dinode *dp2; +}; +struct fs *sbp; +char *fsname; +int fd; + +void indirprt(int level, int blksperindir, int lbn, ufs2_daddr_t blkno, + int lastlbn); +void printblk(int lbn, ufs2_daddr_t blkno, int numblks, int lastlbn); + +/* + * Possible superblock locations ordered from most to least likely. + */ +static int sblock_try[] = SBLOCKSEARCH; + +int +main(argc, argv) + int argc; + char *argv[]; +{ + int i, len, lbn, frags, inonum, numblks, blksperindir; + char sblock[SBLOCKSIZE], ibuf[MAXBSIZE]; + ufs2_daddr_t blkno; + off_t size, offset; + union dinode dp; + + if (argc < 3) { + (void)fprintf(stderr,"usage: prtblknos filesystem inode ...\n"); + exit(1); + } + + fsname = *++argv; + + /* get the superblock. */ + if ((fd = open(fsname, O_RDONLY, 0)) < 0) + err(1, "%s", fsname); + for (i = 0; sblock_try[i] != -1; i++) { + if (lseek(fd, sblock_try[i], SEEK_SET) < 0) + err(1, "lseek: %s", fsname); + if (read(fd, sblock, (long)SBLOCKSIZE) != SBLOCKSIZE) + err(1, "can't read superblock: %s", fsname); + sbp = (struct fs *)sblock; + if ((sbp->fs_magic == FS_UFS1_MAGIC || + (sbp->fs_magic == FS_UFS2_MAGIC && + sbp->fs_sblockloc == sblock_try[i])) && + sbp->fs_bsize <= MAXBSIZE && + sbp->fs_bsize >= sizeof(struct fs)) + break; + } + if (sblock_try[i] == -1) + errx(1, "Cannot find file system superblock\n"); + + /* remaining arguments are inode numbers. */ + while (*++argv) { + /* get the inode number. */ + if ((inonum = atoi(*argv)) <= 0) + errx(1, "%s is not a valid inode number", *argv); + (void)printf("%d:", inonum); + + /* read in the appropriate block. */ + offset = ino_to_fsba(sbp, inonum); /* inode to fs blk */ + offset = fsbtodb(sbp, offset); /* fs blk disk blk */ + offset *= DEV_BSIZE; /* disk blk to bytes */ + + /* seek and read the block */ + if (lseek(fd, offset, SEEK_SET) < 0) + err(1, "%s", fsname); + if (read(fd, ibuf, sbp->fs_bsize) != sbp->fs_bsize) + err(1, "%s", fsname); + + /* get the inode within the block. */ + if (sbp->fs_magic == FS_UFS1_MAGIC) { + dp.dp1 = &((struct ufs1_dinode *)(ibuf)) + [ino_to_fsbo(sbp, inonum)]; + size = dp.dp1->di_size; + } else { + dp.dp2 = &((struct ufs2_dinode *)(ibuf)) + [ino_to_fsbo(sbp, inonum)]; + size = dp.dp2->di_size; + } + + numblks = howmany(size, sbp->fs_bsize); + if (numblks == 0) { + printf(" empty file\n"); + continue; + } + len = numblks < UFS_NDADDR ? numblks : UFS_NDADDR; + for (i = 0; i < len; i++) { + if (i < numblks - 1) + frags = sbp->fs_frag; + else + frags = howmany(size % sbp->fs_bsize, + sbp->fs_fsize); + if (sbp->fs_magic == FS_UFS1_MAGIC) + blkno = dp.dp1->di_db[i]; + else + blkno = dp.dp2->di_db[i]; + printblk(i, blkno, frags, numblks); + } + + blksperindir = 1; + len = numblks - UFS_NDADDR; + lbn = UFS_NDADDR; + for (i = 0; len > 0 && i < UFS_NIADDR; i++) { + if (sbp->fs_magic == FS_UFS1_MAGIC) + blkno = dp.dp1->di_ib[i]; + else + blkno = dp.dp2->di_ib[i]; + indirprt(i, blksperindir, lbn, blkno, numblks); + blksperindir *= NINDIR(sbp); + lbn += blksperindir; + len -= blksperindir; + } + + /* dummy print to flush out last extent */ + printblk(numblks, 0, frags, 0); + } + (void)close(fd); + exit(0); +} + +void +indirprt(level, blksperindir, lbn, blkno, lastlbn) + int level; + int blksperindir; + int lbn; + ufs2_daddr_t blkno; + int lastlbn; +{ + char indir[MAXBSIZE]; + off_t offset; + int i, last; + + printblk(lbn, blkno, sbp->fs_frag, -level); + /* read in the indirect block. */ + offset = fsbtodb(sbp, blkno); /* fs blk disk blk */ + offset *= DEV_BSIZE; /* disk blk to bytes */ + if (lseek(fd, offset, SEEK_SET) < 0) + err(1, "%s", fsname); + if (read(fd, indir, sbp->fs_bsize) != sbp->fs_bsize) + err(1, "%s", fsname); + last = howmany(lastlbn - lbn, blksperindir) < NINDIR(sbp) ? + howmany(lastlbn - lbn, blksperindir) : NINDIR(sbp); + if (blksperindir == 1) { + for (i = 0; i < last; i++) { + if (sbp->fs_magic == FS_UFS1_MAGIC) + blkno = ((ufs1_daddr_t *)indir)[i]; + else + blkno = ((ufs2_daddr_t *)indir)[i]; + printblk(lbn + i, blkno, sbp->fs_frag, lastlbn); + } + return; + } + for (i = 0; i < last; i++) { + if (sbp->fs_magic == FS_UFS1_MAGIC) + blkno = ((ufs1_daddr_t *)indir)[i]; + else + blkno = ((ufs2_daddr_t *)indir)[i]; + indirprt(level - 1, blksperindir / NINDIR(sbp), + lbn + blksperindir * i, blkno, lastlbn); + } +} + +char * +distance(lastblk, firstblk) + daddr_t lastblk; + daddr_t firstblk; +{ + daddr_t delta; + int firstcg, lastcg; + static char buf[100]; + + if (lastblk == 0) + return (""); + delta = firstblk - lastblk - 1; + firstcg = dtog(sbp, firstblk); + lastcg = dtog(sbp, lastblk); + if (firstcg == lastcg) { + snprintf(buf, 100, " distance %jd", (intmax_t)delta); + return (&buf[0]); + } + snprintf(buf, 100, " cg %d blk %jd to cg %d blk %jd", + lastcg, dtogd(sbp, lastblk), firstcg, dtogd(sbp, firstblk)); + return (&buf[0]); +} + + +char *indirname[UFS_NIADDR] = { "First", "Second", "Third" }; + +void +printblk(lbn, blkno, numblks, lastlbn) + int lbn; + ufs2_daddr_t blkno; + int numblks; + int lastlbn; +{ + static int seq; + static daddr_t lastindirblk, lastblk, firstblk; + + if (lastlbn <= 0) + goto flush; + if (seq == 0) { + seq = 1; + firstblk = blkno; + return; + } + if (lbn == 0) { + seq = 1; + lastblk = 0; + firstblk = blkno; + lastindirblk = 0; + return; + } + if (lbn < lastlbn && ((firstblk == 0 && blkno == 0) || + (firstblk == BLK_NOCOPY && blkno == BLK_NOCOPY) || + (firstblk == BLK_SNAP && blkno == BLK_SNAP) || + blkno == firstblk + seq * numblks)) { + seq++; + return; + } +flush: + if (seq == 0) + goto prtindir; + if (firstblk <= BLK_SNAP) { + if (seq == 1) + printf("\tlbn %d %s\n", lbn - seq, + firstblk == 0 ? "hole" : + firstblk == BLK_NOCOPY ? "nocopy" : + "snapblk"); + else + printf("\tlbn %d-%d %s\n", + lbn - seq, lbn - 1, + firstblk == 0 ? "hole" : + firstblk == BLK_NOCOPY ? "nocopy" : + "snapblk"); + } else if (seq == 1) { + if (numblks == 1) + printf("\tlbn %d blkno %jd%s\n", lbn - seq, + (intmax_t)firstblk, distance(lastblk, firstblk)); + else + printf("\tlbn %d blkno %jd-%jd%s\n", lbn - seq, + (intmax_t)firstblk, + (intmax_t)(firstblk + numblks - 1), + distance(lastblk, firstblk)); + lastblk = firstblk + numblks - 1; + } else { + printf("\tlbn %d-%d blkno %jd-%jd%s\n", lbn - seq, lbn - 1, + (intmax_t)firstblk, (intmax_t)(firstblk + + (seq - 1) * sbp->fs_frag + numblks - 1), + distance(lastblk, firstblk)); + lastblk = firstblk + (seq - 1) * sbp->fs_frag + numblks - 1; + } + if (lastlbn > 0 || blkno == 0) { + seq = 1; + firstblk = blkno; + return; + } +prtindir: + if (seq != 0 && (sbp->fs_metaspace == 0 || lastindirblk == 0)) + lastindirblk = lastblk; + printf("%s-level indirect, blkno %jd-%jd%s\n", indirname[-lastlbn], + (intmax_t)blkno, (intmax_t)(blkno + numblks - 1), + distance(lastindirblk, blkno)); + lastindirblk = blkno + numblks - 1; + if (sbp->fs_metaspace == 0) + lastblk = lastindirblk; + seq = 0; +} From owner-svn-src-all@freebsd.org Fri Feb 9 19:25:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D76F1F1D48E; Fri, 9 Feb 2018 19:25: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 ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 777A674566; Fri, 9 Feb 2018 19:25: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 8.0.1.2.20170607 64bit (built Jun 7 2017)) id <0P3W00A00DAAYS00@mr11p00im-asmtp003.me.com>; Fri, 09 Feb 2018 19:25:07 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=04042017; t=1518204307; bh=CZHY82/TcgVJFuqKQa4LVQhHhr9QyypElUI+8unqiTc=; h=Date:Subject:From:To:Message-id:MIME-version:Content-type; b=p6885I1sY3En2AaEhMnzxoKRof71K7eGRm7dVfc6xKVOwjTJ8ZwBjb1aYW7ngQDCn SupMwUdJ9OJSvOYxPvTtFZyAGleNLe+lR+TYoSCZ9o8aasFg616bRNh1bCxaHGy7u1 wrez1iVKDBU7tMKhBMEtTxsCTOrpGme2uYkL8jYYVt7iDRyq1D7htiWvh6L1ukh43l L+RdDR5iazf/U7xq3rRav2Nc5mnHSRcbfdREDyVpHYXDHUqqfXUrO9KqDm4L0V2iMZ meq2V489zWfyqzYGRkXrYtWgDwo8NhnppnTFjcAuOgtcgBa+WRt0kuNL3ltsVK9rXk H/ybc4GciC0ow== Received: from icloud.com ([127.0.0.1]) by mr11p00im-asmtp003.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) with ESMTPSA id <0P3W003F7DXS6610@mr11p00im-asmtp003.me.com>; Fri, 09 Feb 2018 19:25:06 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-02-09_10:,, 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-1707230000 definitions=main-1802090245 User-Agent: Microsoft-MacOutlook/10.9.0.180116 Date: Fri, 09 Feb 2018 11:25:03 -0800 Subject: Re: svn commit: r329076 - in head/tools/diag: . prtblknos From: Ravi Pokala To: Kirk McKusick , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: <338960AC-4E8D-455D-A622-937D6D4FAB9B@mac.com> Thread-topic: svn commit: r329076 - in head/tools/diag: . prtblknos References: <201802091910.w19JAksQ018424@repo.freebsd.org> In-reply-to: <201802091910.w19JAksQ018424@repo.freebsd.org> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Feb 2018 19:25:26 -0000 Neat! But, please define "block". Are you talking about a filesystem block = (i.e. default 32KB on UFS2), are you talking about a disk block (which may v= ary based on the Logical Sector Size of the underlying media)? Thanks, Ravi (rpokala@) =EF=BB=BF-----Original Message----- From: on behalf of Kirk McKusick Date: 2018-02-09, Friday at 11:10 To: , , Subject: svn commit: r329076 - in head/tools/diag: . prtblknos Author: mckusick Date: Fri Feb 9 19:10:46 2018 New Revision: 329076 URL: https://svnweb.freebsd.org/changeset/base/329076 Log: This is a little C-program that can be used to print out the list of blocks used by a requested list of inodes. =20 For example, to list the blocks referenced by your kernel: =20 guest_12 % df / Filesystem 1K-blocks Used Avail Capacity Mounted on /dev/gpt/rootfs 20307196 10707336 7975288 57% / =20 guest_12 % ls -i /boot/kernel/kernel 160603 /boot/kernel/kernel =20 guest_12 % ./prtblknos /dev/gpt/rootfs 160603 160603: lbn 0-7 blkno 3217584-3217647 lbn 8-11 blkno 3217864-3217895 distance 216 First-level indirect, blkno 3217896-3217903 distance 0 lbn 12-19 blkno 3217904-3217967 distance 8 lbn 20-75 blkno 3251816-3252263 distance 33848 lbn 76-83 blkno 3252368-3252431 distance 104 lbn 84-91 blkno 3252464-3252527 distance 32 lbn 92-852 blkno 3252896-3258983 distance 368 =20 Each contiguous range of blocks is printed on a line. The distance metric is the size of the gap from the end of the previous set of blocks to the beginning of the next set of blocks. Short distances are desirable. Added: head/tools/diag/prtblknos/ head/tools/diag/prtblknos/Makefile (contents, props changed) head/tools/diag/prtblknos/README (contents, props changed) head/tools/diag/prtblknos/prtblknos.c (contents, props changed) Modified: head/tools/diag/README Modified: head/tools/diag/README =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/tools/diag/README Fri Feb 9 18:47:00 2018 (r329075) +++ head/tools/diag/README Fri Feb 9 19:10:46 2018 (r329076) @@ -11,4 +11,4 @@ Please make a subdir per program, and add a brief desc dumpvfscache program that can be used to examine the contents of the vfs name cache. localeck check for invalid/incomplete locales=20 - +prtblknos Print out the blocks used by each inode in the list Added: head/tools/diag/prtblknos/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/diag/prtblknos/Makefile Fri Feb 9 19:10:46 2018 (r329076) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +PROG=3D prtblknos + +MAN=3D + +test: ${PROG} + ./${PROG} > a + +.include Added: head/tools/diag/prtblknos/README =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/diag/prtblknos/README Fri Feb 9 19:10:46 2018 (r329076) @@ -0,0 +1,31 @@ +# $FreeBSD$ + +This is a little C-program that can be used to print out the list +of blocks used by a requested list of inodes. + +For example, to list the blocks referenced by your kernel: + +guest_12 % df / +Filesystem 1K-blocks Used Avail Capacity Mounted on +/dev/gpt/rootfs 20307196 10707336 7975288 57% / + +guest_12 % ls -i /boot/kernel/kernel +160603 /boot/kernel/kernel + +guest_12 % ./prtblknos /dev/gpt/rootfs 160603 +160603: lbn 0-7 blkno 3217584-3217647 + lbn 8-11 blkno 3217864-3217895 distance 216 +First-level indirect, blkno 3217896-3217903 distance 0 + lbn 12-19 blkno 3217904-3217967 distance 8 + lbn 20-75 blkno 3251816-3252263 distance 33848 + lbn 76-83 blkno 3252368-3252431 distance 104 + lbn 84-91 blkno 3252464-3252527 distance 32 + lbn 92-852 blkno 3252896-3258983 distance 368 + +Each contiguous range of blocks is printed on a line. +The distance metric is the size of the gap from the end of the +previous set of blocks to the beginning of the next set of blocks. +Short distances are desirable. + + Marshall Kirk McKusick + January 19, 2018 Added: head/tools/diag/prtblknos/prtblknos.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 --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/diag/prtblknos/prtblknos.c Fri Feb 9 19:10:46 2018 (r329076= ) @@ -0,0 +1,314 @@ +/* + * Copyright (c) 1998, 2003, 2013, 2018 Marshall Kirk McKusick. + * 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 MARSHALL KIRK MCKUSICK ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURP= OSE + * ARE DISCLAIMED. IN NO EVENT SHALL MARSHALL KIRK MCKUSICK BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENT= IAL + * 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, STR= ICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY W= AY + * 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 + +union dinode { + struct ufs1_dinode *dp1; + struct ufs2_dinode *dp2; +}; +struct fs *sbp; +char *fsname; +int fd; + +void indirprt(int level, int blksperindir, int lbn, ufs2_daddr_t blkno, + int lastlbn); +void printblk(int lbn, ufs2_daddr_t blkno, int numblks, int lastlbn); + +/*=20 + * Possible superblock locations ordered from most to least likely. + */ +static int sblock_try[] =3D SBLOCKSEARCH; + +int +main(argc, argv) + int argc; + char *argv[]; +{ + int i, len, lbn, frags, inonum, numblks, blksperindir; + char sblock[SBLOCKSIZE], ibuf[MAXBSIZE]; + ufs2_daddr_t blkno; + off_t size, offset; + union dinode dp; + + if (argc < 3) { + (void)fprintf(stderr,"usage: prtblknos filesystem inode ...\n"); + exit(1); + } + + fsname =3D *++argv; + + /* get the superblock. */ + if ((fd =3D open(fsname, O_RDONLY, 0)) < 0) + err(1, "%s", fsname); + for (i =3D 0; sblock_try[i] !=3D -1; i++) { + if (lseek(fd, sblock_try[i], SEEK_SET) < 0) + err(1, "lseek: %s", fsname); + if (read(fd, sblock, (long)SBLOCKSIZE) !=3D SBLOCKSIZE) + err(1, "can't read superblock: %s", fsname); + sbp =3D (struct fs *)sblock; + if ((sbp->fs_magic =3D=3D FS_UFS1_MAGIC || + (sbp->fs_magic =3D=3D FS_UFS2_MAGIC && + sbp->fs_sblockloc =3D=3D sblock_try[i])) && + sbp->fs_bsize <=3D MAXBSIZE && + sbp->fs_bsize >=3D sizeof(struct fs)) + break; + } + if (sblock_try[i] =3D=3D -1) + errx(1, "Cannot find file system superblock\n"); + + /* remaining arguments are inode numbers. */ + while (*++argv) { + /* get the inode number. */ + if ((inonum =3D atoi(*argv)) <=3D 0) + errx(1, "%s is not a valid inode number", *argv); + (void)printf("%d:", inonum); + + /* read in the appropriate block. */ + offset =3D ino_to_fsba(sbp, inonum); /* inode to fs blk */ + offset =3D fsbtodb(sbp, offset); /* fs blk disk blk */ + offset *=3D DEV_BSIZE; /* disk blk to bytes */ + + /* seek and read the block */ + if (lseek(fd, offset, SEEK_SET) < 0) + err(1, "%s", fsname); + if (read(fd, ibuf, sbp->fs_bsize) !=3D sbp->fs_bsize) + err(1, "%s", fsname); + + /* get the inode within the block. */ + if (sbp->fs_magic =3D=3D FS_UFS1_MAGIC) { + dp.dp1 =3D &((struct ufs1_dinode *)(ibuf)) + [ino_to_fsbo(sbp, inonum)]; + size =3D dp.dp1->di_size; + } else { + dp.dp2 =3D &((struct ufs2_dinode *)(ibuf)) + [ino_to_fsbo(sbp, inonum)]; + size =3D dp.dp2->di_size; + } + + numblks =3D howmany(size, sbp->fs_bsize); + if (numblks =3D=3D 0) { + printf(" empty file\n"); + continue; + } + len =3D numblks < UFS_NDADDR ? numblks : UFS_NDADDR; + for (i =3D 0; i < len; i++) { + if (i < numblks - 1) + frags =3D sbp->fs_frag; + else + frags =3D howmany(size % sbp->fs_bsize, + sbp->fs_fsize); + if (sbp->fs_magic =3D=3D FS_UFS1_MAGIC) + blkno =3D dp.dp1->di_db[i]; + else + blkno =3D dp.dp2->di_db[i]; + printblk(i, blkno, frags, numblks); + } + + blksperindir =3D 1; + len =3D numblks - UFS_NDADDR; + lbn =3D UFS_NDADDR; + for (i =3D 0; len > 0 && i < UFS_NIADDR; i++) { + if (sbp->fs_magic =3D=3D FS_UFS1_MAGIC) + blkno =3D dp.dp1->di_ib[i]; + else + blkno =3D dp.dp2->di_ib[i]; + indirprt(i, blksperindir, lbn, blkno, numblks); + blksperindir *=3D NINDIR(sbp); + lbn +=3D blksperindir; + len -=3D blksperindir; + } + + /* dummy print to flush out last extent */ + printblk(numblks, 0, frags, 0); + } + (void)close(fd); + exit(0); +} + +void +indirprt(level, blksperindir, lbn, blkno, lastlbn) + int level; + int blksperindir; + int lbn; + ufs2_daddr_t blkno; + int lastlbn; +{ + char indir[MAXBSIZE]; + off_t offset; + int i, last; + + printblk(lbn, blkno, sbp->fs_frag, -level); + /* read in the indirect block. */ + offset =3D fsbtodb(sbp, blkno); /* fs blk disk blk */ + offset *=3D DEV_BSIZE; /* disk blk to bytes */ + if (lseek(fd, offset, SEEK_SET) < 0) + err(1, "%s", fsname); + if (read(fd, indir, sbp->fs_bsize) !=3D sbp->fs_bsize) + err(1, "%s", fsname); + last =3D howmany(lastlbn - lbn, blksperindir) < NINDIR(sbp) ? + howmany(lastlbn - lbn, blksperindir) : NINDIR(sbp); + if (blksperindir =3D=3D 1) { + for (i =3D 0; i < last; i++) { + if (sbp->fs_magic =3D=3D FS_UFS1_MAGIC) + blkno =3D ((ufs1_daddr_t *)indir)[i]; + else + blkno =3D ((ufs2_daddr_t *)indir)[i]; + printblk(lbn + i, blkno, sbp->fs_frag, lastlbn); + } + return; + } + for (i =3D 0; i < last; i++) { + if (sbp->fs_magic =3D=3D FS_UFS1_MAGIC) + blkno =3D ((ufs1_daddr_t *)indir)[i]; + else + blkno =3D ((ufs2_daddr_t *)indir)[i]; + indirprt(level - 1, blksperindir / NINDIR(sbp), + lbn + blksperindir * i, blkno, lastlbn); + } +} + +char * +distance(lastblk, firstblk) + daddr_t lastblk; + daddr_t firstblk; +{ + daddr_t delta; + int firstcg, lastcg; + static char buf[100]; + + if (lastblk =3D=3D 0) + return (""); + delta =3D firstblk - lastblk - 1; + firstcg =3D dtog(sbp, firstblk); + lastcg =3D dtog(sbp, lastblk); + if (firstcg =3D=3D lastcg) { + snprintf(buf, 100, " distance %jd", (intmax_t)delta); + return (&buf[0]); + } + snprintf(buf, 100, " cg %d blk %jd to cg %d blk %jd", + lastcg, dtogd(sbp, lastblk), firstcg, dtogd(sbp, firstblk)); + return (&buf[0]); +} + + +char *indirname[UFS_NIADDR] =3D { "First", "Second", "Third" }; + +void +printblk(lbn, blkno, numblks, lastlbn) + int lbn; + ufs2_daddr_t blkno; + int numblks; + int lastlbn; +{ + static int seq; + static daddr_t lastindirblk, lastblk, firstblk; + + if (lastlbn <=3D 0) + goto flush; + if (seq =3D=3D 0) { + seq =3D 1; + firstblk =3D blkno; + return; + } + if (lbn =3D=3D 0) { + seq =3D 1; + lastblk =3D 0; + firstblk =3D blkno; + lastindirblk =3D 0; + return; + } + if (lbn < lastlbn && ((firstblk =3D=3D 0 && blkno =3D=3D 0) || + (firstblk =3D=3D BLK_NOCOPY && blkno =3D=3D BLK_NOCOPY) || + (firstblk =3D=3D BLK_SNAP && blkno =3D=3D BLK_SNAP) || + blkno =3D=3D firstblk + seq * numblks)) { + seq++; + return; + } +flush: + if (seq =3D=3D 0) + goto prtindir; + if (firstblk <=3D BLK_SNAP) { + if (seq =3D=3D 1) + printf("\tlbn %d %s\n", lbn - seq, + firstblk =3D=3D 0 ? "hole" : + firstblk =3D=3D BLK_NOCOPY ? "nocopy" : + "snapblk"); + else + printf("\tlbn %d-%d %s\n", + lbn - seq, lbn - 1, + firstblk =3D=3D 0 ? "hole" : + firstblk =3D=3D BLK_NOCOPY ? "nocopy" : + "snapblk"); + } else if (seq =3D=3D 1) { + if (numblks =3D=3D 1) + printf("\tlbn %d blkno %jd%s\n", lbn - seq, + (intmax_t)firstblk, distance(lastblk, firstblk)); + else + printf("\tlbn %d blkno %jd-%jd%s\n", lbn - seq, + (intmax_t)firstblk, + (intmax_t)(firstblk + numblks - 1), + distance(lastblk, firstblk)); + lastblk =3D firstblk + numblks - 1; + } else { + printf("\tlbn %d-%d blkno %jd-%jd%s\n", lbn - seq, lbn - 1, + (intmax_t)firstblk, (intmax_t)(firstblk + + (seq - 1) * sbp->fs_frag + numblks - 1), + distance(lastblk, firstblk)); + lastblk =3D firstblk + (seq - 1) * sbp->fs_frag + numblks - 1; + } + if (lastlbn > 0 || blkno =3D=3D 0) { + seq =3D 1; + firstblk =3D blkno; + return; + } +prtindir: + if (seq !=3D 0 && (sbp->fs_metaspace =3D=3D 0 || lastindirblk =3D=3D 0)) + lastindirblk =3D lastblk; + printf("%s-level indirect, blkno %jd-%jd%s\n", indirname[-lastlbn], + (intmax_t)blkno, (intmax_t)(blkno + numblks - 1), + distance(lastindirblk, blkno)); + lastindirblk =3D blkno + numblks - 1; + if (sbp->fs_metaspace =3D=3D 0) + lastblk =3D lastindirblk; + seq =3D 0; +} From owner-svn-src-all@freebsd.org Fri Feb 9 19:46:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B106F1EC71; Fri, 9 Feb 2018 19:46:52 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48B69754A3; Fri, 9 Feb 2018 19:46:52 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F9A71416; Fri, 9 Feb 2018 19:46:52 +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 w19JkqSC038865; Fri, 9 Feb 2018 19:46:52 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w19Jkqb3038864; Fri, 9 Feb 2018 19:46:52 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802091946.w19Jkqb3038864@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 9 Feb 2018 19:46:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329077 - head/usr.bin/tftp X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/usr.bin/tftp X-SVN-Commit-Revision: 329077 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Feb 2018 19:46:53 -0000 Author: cem Date: Fri Feb 9 19:46:51 2018 New Revision: 329077 URL: https://svnweb.freebsd.org/changeset/base/329077 Log: tftp(1): Fix libedit state corruption involving signals This bug was first reported 14 years ago. The problem was understood 8.5 years ago. A patch that is functionally identical to this one was proposed almost 8 years ago and languished in the PR system / Bugzilla. PR: 63197 Submitted by: lxv AT omut.org, fernando.apesteguia AT gmail.com Reported by: freebsd AT nbritton.org Modified: head/usr.bin/tftp/main.c Modified: head/usr.bin/tftp/main.c ============================================================================== --- head/usr.bin/tftp/main.c Fri Feb 9 19:10:46 2018 (r329076) +++ head/usr.bin/tftp/main.c Fri Feb 9 19:46:51 2018 (r329077) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -114,7 +115,7 @@ static void setoptions(int, char **); static void setrollover(int, char **); static void setpacketdrop(int, char **); -static void command(void) __dead2; +static void command(bool, EditLine *, History *, HistEvent *) __dead2; static const char *command_prompt(void); static void urihandling(char *URI); @@ -176,11 +177,28 @@ static struct modes { int main(int argc, char *argv[]) { + HistEvent he; + EditLine *el; + History *hist; + bool interactive; acting_as_client = 1; peer = -1; strcpy(mode, "netascii"); signal(SIGINT, intr); + + interactive = isatty(STDIN_FILENO); + if (interactive) { + el = el_init("tftp", stdin, stdout, stderr); + hist = history_init(); + history(hist, &he, H_SETSIZE, 100); + el_set(el, EL_HIST, history, hist); + el_set(el, EL_EDITOR, "emacs"); + el_set(el, EL_PROMPT, command_prompt); + el_set(el, EL_SIGNAL, 1); + el_source(el, NULL); + } + if (argc > 1) { if (setjmp(toplevel) != 0) exit(txrx_error); @@ -192,11 +210,15 @@ main(int argc, char *argv[]) setpeer(argc, argv); } - if (setjmp(toplevel) != 0) + + if (setjmp(toplevel) != 0) { + if (interactive) + el_reset(el); (void)putchar('\n'); + } init_options(); - command(); + command(interactive, el, hist, &he); } /* @@ -703,36 +725,22 @@ command_prompt(void) * Command parser. */ static void -command(void) +command(bool interactive, EditLine *el, History *hist, HistEvent *hep) { - HistEvent he; struct cmd *c; - static EditLine *el; - static History *hist; const char *bp; char *cp; - int len, num, vrbose; + int len, num; char line[MAXLINE]; - vrbose = isatty(0); - if (vrbose) { - el = el_init("tftp", stdin, stdout, stderr); - hist = history_init(); - history(hist, &he, H_SETSIZE, 100); - el_set(el, EL_HIST, history, hist); - el_set(el, EL_EDITOR, "emacs"); - el_set(el, EL_PROMPT, command_prompt); - el_set(el, EL_SIGNAL, 1); - el_source(el, NULL); - } for (;;) { - if (vrbose) { + if (interactive) { if ((bp = el_gets(el, &num)) == NULL || num == 0) exit(0); len = MIN(MAXLINE, num); memcpy(line, bp, len); line[len] = '\0'; - history(hist, &he, H_ENTER, bp); + history(hist, hep, H_ENTER, bp); } else { line[0] = 0; if (fgets(line, sizeof line , stdin) == NULL) { From owner-svn-src-all@freebsd.org Fri Feb 9 19:50:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59900F1F105; Fri, 9 Feb 2018 19:50:48 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F09875852; Fri, 9 Feb 2018 19:50:48 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A0911439; Fri, 9 Feb 2018 19:50:48 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w19JolE8041245; Fri, 9 Feb 2018 19:50:47 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w19Joljx041243; Fri, 9 Feb 2018 19:50:47 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201802091950.w19Joljx041243@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Fri, 9 Feb 2018 19:50:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329078 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 329078 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Feb 2018 19:50:48 -0000 Author: mckusick Date: Fri Feb 9 19:50:47 2018 New Revision: 329078 URL: https://svnweb.freebsd.org/changeset/base/329078 Log: Merge biodone_finish() back into biodone(). The primary purpose is to make the order of operations clearer to avoid the race condition that was fixed in r328914. In particular, this commit corrects a similar race that existed in the soft updates callback. Doing some sleuthing through the SVN repository, it appears that bufdone_finish() was added to support XFS: ------------------------------------------------------------------------ r153192 | rodrigc | 2005-12-06 19:39:08 -0800 (Tue, 06 Dec 2005) | 13 lines Changes imported from XFS for FreeBSD project: - add fields to struct buf (needed by XFS) - 3 private fields: b_fsprivate1, b_fsprivate2, b_fsprivate3 - b_pin_count, count of pinned buffer - add new B_MANAGED flag - add breada() function to initiate asynchronous I/O on read-ahead blocks. - add bufdone_finish(), bpin(), bunpin_wait() functions Patches provided by: kan Reviewed by: phk Silence on: arch@ ------------------------------------------------------------------------ It does not appear to ever have been used for anything else. XFS was disconnected in r241607: ------------------------------------------------------------------------ r241607 | attilio | 2012-10-16 03:04:00 -0700 (Tue, 16 Oct 2012) | 5 lines Disconnect non-MPSAFE XFS from the build in preparation for dropping GIANT from VFS. This is not targeted for MFC. ------------------------------------------------------------------------ and removed entirely in r247631: ------------------------------------------------------------------------ r247631 | attilio | 2013-03-02 07:33:54 -0800 (Sat, 02 Mar 2013) | 5 lines Garbage collect XFS bits which are now already completely disconnected from the tree since few months. This is not targeted for MFC. ------------------------------------------------------------------------ Since XFS support is gone, there is no reason to retain biodone_finish(). Suggested by: Warner Losh (imp) Discussed with: cem, kib Tested by: Peter Holm (pho) Modified: head/sys/kern/vfs_bio.c head/sys/sys/buf.h Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Fri Feb 9 19:46:51 2018 (r329077) +++ head/sys/kern/vfs_bio.c Fri Feb 9 19:50:47 2018 (r329078) @@ -4086,21 +4086,6 @@ bufdone(struct buf *bp) bufobj_wdrop(dropobj); return; } - - bufdone_finish(bp); - - if (dropobj) - bufobj_wdrop(dropobj); -} - -void -bufdone_finish(struct buf *bp) -{ - BUF_ASSERT_HELD(bp); - - if (!LIST_EMPTY(&bp->b_dep)) - buf_complete(bp); - if (bp->b_flags & B_VMIO) { /* * Set B_CACHE if the op was a normal read and no error @@ -4113,14 +4098,14 @@ bufdone_finish(struct buf *bp) bp->b_flags |= B_CACHE; vfs_vmio_iodone(bp); } + if (!LIST_EMPTY(&bp->b_dep)) + buf_complete(bp); if ((bp->b_flags & B_CKHASH) != 0) { KASSERT(bp->b_iocmd == BIO_READ, - ("bufdone_finish: b_iocmd %d not BIO_READ", bp->b_iocmd)); - KASSERT(buf_mapped(bp), - ("bufdone_finish: bp %p not mapped", bp)); + ("bufdone: b_iocmd %d not BIO_READ", bp->b_iocmd)); + KASSERT(buf_mapped(bp), ("bufdone: bp %p not mapped", bp)); (*bp->b_ckhashcalc)(bp); } - /* * For asynchronous completions, release the buffer now. The brelse * will do a wakeup there if necessary - so no need to do a wakeup @@ -4134,6 +4119,8 @@ bufdone_finish(struct buf *bp) bqrelse(bp); } else bdone(bp); + if (dropobj) + bufobj_wdrop(dropobj); } /* Modified: head/sys/sys/buf.h ============================================================================== --- head/sys/sys/buf.h Fri Feb 9 19:46:51 2018 (r329077) +++ head/sys/sys/buf.h Fri Feb 9 19:50:47 2018 (r329078) @@ -542,7 +542,6 @@ struct buf *geteblk(int, int); int bufwait(struct buf *); int bufwrite(struct buf *); void bufdone(struct buf *); -void bufdone_finish(struct buf *); void bd_speedup(void); int cluster_read(struct vnode *, u_quad_t, daddr_t, long, From owner-svn-src-all@freebsd.org Fri Feb 9 20:00:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90D1AF1FB9A; Fri, 9 Feb 2018 20:00:52 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 404307605E; Fri, 9 Feb 2018 20:00:52 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B49715EE; Fri, 9 Feb 2018 20:00:52 +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 w19K0qjf044073; Fri, 9 Feb 2018 20:00:52 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w19K0qdb044072; Fri, 9 Feb 2018 20:00:52 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802092000.w19K0qdb044072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 9 Feb 2018 20:00:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329079 - head/usr.bin/tftp X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/usr.bin/tftp X-SVN-Commit-Revision: 329079 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Feb 2018 20:00:52 -0000 Author: cem Date: Fri Feb 9 20:00:51 2018 New Revision: 329079 URL: https://svnweb.freebsd.org/changeset/base/329079 Log: tftp(1): Clean up leading and trailing whitespace Whitespace-only change. Sponsored by: Dell EMC Isilon Modified: head/usr.bin/tftp/main.c Modified: head/usr.bin/tftp/main.c ============================================================================== --- head/usr.bin/tftp/main.c Fri Feb 9 19:50:47 2018 (r329078) +++ head/usr.bin/tftp/main.c Fri Feb 9 20:00:51 2018 (r329079) @@ -475,7 +475,7 @@ put(int argc, char *argv[]) lcp[strlen(lcp) - 1] = '\0'; lcp++; } - setpeer0(lcp, NULL); + setpeer0(lcp, NULL); } if (!connected) { printf("No target machine specified.\n"); @@ -735,11 +735,11 @@ command(bool interactive, EditLine *el, History *hist, for (;;) { if (interactive) { - if ((bp = el_gets(el, &num)) == NULL || num == 0) - exit(0); - len = MIN(MAXLINE, num); - memcpy(line, bp, len); - line[len] = '\0'; + if ((bp = el_gets(el, &num)) == NULL || num == 0) + exit(0); + len = MIN(MAXLINE, num); + memcpy(line, bp, len); + line[len] = '\0'; history(hist, hep, H_ENTER, bp); } else { line[0] = 0; From owner-svn-src-all@freebsd.org Fri Feb 9 20:05:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A9B9F20229; Fri, 9 Feb 2018 20:05:41 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f43.google.com (mail-it0-f43.google.com [209.85.214.43]) (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 969E8767BA; Fri, 9 Feb 2018 20:05:40 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f43.google.com with SMTP id b66so12390780itd.5; Fri, 09 Feb 2018 12:05:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=UFEKVGasYZPxwbSElxH44Xqo9Q8Il+ub180Q2NTcDCk=; b=LAz8cbA8RwKRQ5rKmxAc7nZqqHTHobwonVAiwAfVPA5TWcsl9ge14NzCSwmL+CIrcq BUqCIjWHn8cFQZZc2WgxNKNY6c+FAEt8Y9ooV5cAHPKQDu+JXUGfVhGDTlQ79DWJNQQ3 VJe/OxgUBbrbik7dhZrSlpIutX/OkB9xTrDyVMQKWRic/4vyKUX0/u/ZMV13Ukcmo3e1 NcRPiqAmgJAKEvlC5yaGcZL/m1NPC1u3FVcBy0PSXY4vbUKyI/zja0MSrjGWVe6Axvyj 9OKu+9Xwgt3sSSTAwV7XjecpXcwtwr5nUuJVlim5kzT/VZ/D7OS5Vg186uyEflYAHdLl xFXg== X-Gm-Message-State: APf1xPB9A8txxzKD0WvrmVRzBcMHicuTnb8waGO0ibdUN3svljp+Yv1l Z9qVoq4fauGB8aAnn9j05csAjeCE X-Google-Smtp-Source: AH8x227rf7mSm/G2XbY/6Ajk62LU8JiOVMg2FaGiVe8VlTImVV/YUMdbWXPVAFnbijvLbI6dUHsjWw== X-Received: by 10.36.57.74 with SMTP id l71mr5386878ita.40.1518206733977; Fri, 09 Feb 2018 12:05:33 -0800 (PST) Received: from mail-io0-f179.google.com (mail-io0-f179.google.com. [209.85.223.179]) by smtp.gmail.com with ESMTPSA id p2sm3848353ite.1.2018.02.09.12.05.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Feb 2018 12:05:33 -0800 (PST) Received: by mail-io0-f179.google.com with SMTP id d13so10931997iog.5; Fri, 09 Feb 2018 12:05:33 -0800 (PST) X-Received: by 10.107.131.210 with SMTP id n79mr4347091ioi.215.1518206733569; Fri, 09 Feb 2018 12:05:33 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.152.123 with HTTP; Fri, 9 Feb 2018 12:05:33 -0800 (PST) In-Reply-To: <201802091950.w19Joljx041243@repo.freebsd.org> References: <201802091950.w19Joljx041243@repo.freebsd.org> From: Conrad Meyer Date: Fri, 9 Feb 2018 12:05:33 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r329078 - in head/sys: kern sys To: Kirk McKusick 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.25 Precedence: list List-Id: "SVN commit messages 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, 09 Feb 2018 20:05:41 -0000 On Fri, Feb 9, 2018 at 11:50 AM, Kirk McKusick wrote: > Author: mckusick > Date: Fri Feb 9 19:50:47 2018 > New Revision: 329078 > URL: https://svnweb.freebsd.org/changeset/base/329078 > > Log: > Merge biodone_finish() back into biodone(). The primary purpose is > to make the order of operations clearer to avoid the race condition > that was fixed in r328914. In particular, this commit corrects a > similar race that existed in the soft updates callback. Thanks! From owner-svn-src-all@freebsd.org Fri Feb 9 20:09:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B5B0F205A4; Fri, 9 Feb 2018 20:09:33 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F4C076A62; Fri, 9 Feb 2018 20:09:33 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A4AD1777; Fri, 9 Feb 2018 20:09:33 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w19K9Xsk049277; Fri, 9 Feb 2018 20:09:33 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w19K9Xxa049276; Fri, 9 Feb 2018 20:09:33 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201802092009.w19K9Xxa049276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Fri, 9 Feb 2018 20:09:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329080 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 329080 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Feb 2018 20:09:33 -0000 Author: nwhitehorn Date: Fri Feb 9 20:09:32 2018 New Revision: 329080 URL: https://svnweb.freebsd.org/changeset/base/329080 Log: Fix PowerMac G5 thermal management, plus likely other bugs, introduced in r328113 and affecting SMP systems. The way the time is set on PowerMacs is racy and relies on all the CPUs in the system setting a register simultaneously in a rendezvous. A few-cycle delay can result in out-of-sync times, which can break the scheduler and result in calls like mtx_sleep() and pause() never timing out if the thread is migrated while sleeping. r328113 added a call to a no-op function between the beginning of the rendezvous and setting the time that was only called on APs and added enough cycles to cause a problematic offset. For some reason, the fan-management code was the first place this appeared. Clue from: andreast Reported by: many Modified: head/sys/powerpc/powerpc/mp_machdep.c Modified: head/sys/powerpc/powerpc/mp_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/mp_machdep.c Fri Feb 9 20:00:51 2018 (r329079) +++ head/sys/powerpc/powerpc/mp_machdep.c Fri Feb 9 20:09:32 2018 (r329080) @@ -81,11 +81,20 @@ machdep_ap_bootstrap(void) __asm __volatile("or 27,27,27"); __asm __volatile("or 6,6,6"); - /* Give platform code a chance to do anything necessary */ + /* + * Set timebase as soon as possible to meet an implicit rendezvous + * from cpu_mp_unleash(), which sets ap_letgo and then immediately + * sets timebase. + * + * Note that this is instrinsically racy and is only relevant on + * platforms that do not support better mechanisms. + */ + platform_smp_timebase_sync(ap_timebase, 1); + + /* Give platform code a chance to do anything else necessary */ platform_smp_ap_init(); - /* Initialize DEC and TB, sync with the BSP values */ - platform_smp_timebase_sync(ap_timebase, 1); + /* Initialize decrementer */ decr_ap_init(); /* Serialize console output and AP count increment */ From owner-svn-src-all@freebsd.org Fri Feb 9 20:22:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 845C1F21237 for ; Fri, 9 Feb 2018 20:22:10 +0000 (UTC) (envelope-from wlosh@bsdimp.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 E9F1677458 for ; Fri, 9 Feb 2018 20:22:09 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22b.google.com with SMTP id 72so10981265iom.10 for ; Fri, 09 Feb 2018 12:22:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=y0hJxBEVXWk/CiZbvLQ4DIzlaEm6F6NeX7acrDG9C1c=; b=hZvUzvg698f1DrU5Z6QwTZCe9vv8voiR97/oU8rRnWVQMY84soy3GKTqmrjkO97xUE Ef1jGI8ROzh96LxEBG+qHZ4Qnckm6dul5p8PXvoBadMtm++qhphGPGjMEF5qJeJWU9Bx b7G6/RjWE5RndL7rECRKuO5rje9I0+7+r65U3E/ODeziYhOodG/808n4YvXYhP+v1DB+ Vhk14uSfl/jFN6b0zAUdnhJ4XR8/FnSjOpvySiQBe0kbFgGUGVjj6fSDhzJSa+bI2i78 nRggdNLyfBKl7k98JJI14ehmF54JoebXEr63EJRl9NnuPTK/ZyIqXPNRZeaI2YuhtZRo Qb0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=y0hJxBEVXWk/CiZbvLQ4DIzlaEm6F6NeX7acrDG9C1c=; b=bJDDAXq+5AvFHN9VixtsSKVu+6FaR65J27PDL1eSndZ+G7TEIht9wJMo7a/ykAcG7W 319BhOwY0knJqlT/JiBam6Zyrgp4yz7QrVfWCuT5t0YFpVXPeRoKsQk5TI+9aABSmYMb xKkCq753G4hOtALmi9w/r4XIl5k/ueNAy06Efoj5YbPCL4vT+4mC/TOTRcPZEpU67HRY SQE3YRF3WPn+kBDno4ltbyu0PCjbUFSsuwHLVc9JyGba3yF040DlvCMjbeDp/EQPlPy8 wdMTqIrQ9wkGC8ThAniNP757/JGjiPO/wTTmhvfs1ZONlV95G26E9ww/SyPPtanBxIMO hjEQ== X-Gm-Message-State: APf1xPDCI5kG4XTn8k3rvESvlqr3hLJcW04/PCItKqCQXugiGRaZcQp8 VjB4Ef3phi/UYoUS9QOCSikmWN+gpopimiXcIuQLeg== X-Google-Smtp-Source: AH8x227sCgxSU01heFZ/th7sIxF4vadysrNX3iMWRqTcMK35IMS5jT9JSGXL3t+cwRaEDJXDtZeXn4vO53TEcGnDFWk= X-Received: by 10.107.167.69 with SMTP id q66mr4346675ioe.130.1518207729305; Fri, 09 Feb 2018 12:22:09 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Fri, 9 Feb 2018 12:22:08 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: <20180209190450.GA85711@FreeBSD.org> References: <201802091550.w19FoXEb018181@repo.freebsd.org> <14002093.zLdzgIqnsv@ralph.baldwin.cx> <20180209190450.GA85711@FreeBSD.org> From: Warner Losh Date: Fri, 9 Feb 2018 13:22:08 -0700 X-Google-Sender-Auth: mKPOLH1qF1GBY9ZikDCnWCYcTHw Message-ID: Subject: Re: svn commit: r329064 - head/share/zoneinfo To: Alexey Dokuchaev Cc: John Baldwin , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Feb 2018 20:22:10 -0000 On Fri, Feb 9, 2018 at 12:04 PM, Alexey Dokuchaev wrote: > On Fri, Feb 09, 2018 at 11:50:35AM -0700, Warner Losh wrote: > > On Fri, Feb 9, 2018 at 10:49 AM, John Baldwin wrote: > > > On Friday, February 09, 2018 03:50:33 PM Warner Losh wrote: > > > > New Revision: 329064 > > > > URL: https://svnweb.freebsd.org/changeset/base/329064 > > > > > > > > Log: > > > > We don't actually need env here, so drop it. All shells allow > setting > > > > of shell variables for the next command like this. > > > > > > Eh: > > > > > > % LC_ALL=C env > > > LC_ALL=C: Command not found. > > > > > > csh and tcsh don't let you set environment variables as a prefix. > > > > > > That said, if you try to use csh as the SHELL for make I bet many > things > > > would break. > > > > Right, all shells supported as SHELL for make. csh isn't on the list of > > supported shells. Your bet is right: a lot of things do break. > > I don't really understand why we're discussing it: (t)csh, fish, whatever > are for interactive use *only*. Scripts (and makefiles) should only be > written for standard plain POSIX shell. > Right. 'all shells' in my original simply meant that this has been a feature of /bin/sh for long enough that we won't have anything to worry about if we build on a foreign OS using something weird like bash. Warner From owner-svn-src-all@freebsd.org Fri Feb 9 20:49:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DBB2F00F56; Fri, 9 Feb 2018 20:49:10 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78CB6787D9; Fri, 9 Feb 2018 20:49:09 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w19Kn1FO032219; Fri, 9 Feb 2018 12:49:01 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w19Kn152032218; Fri, 9 Feb 2018 12:49:01 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201802092049.w19Kn152032218@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r329076 - in head/tools/diag: . prtblknos In-Reply-To: <201802091910.w19JAksQ018424@repo.freebsd.org> To: Kirk McKusick Date: Fri, 9 Feb 2018 12:49:01 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Feb 2018 20:49:10 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: mckusick > Date: Fri Feb 9 19:10:46 2018 > New Revision: 329076 > URL: https://svnweb.freebsd.org/changeset/base/329076 > > Log: > This is a little C-program that can be used to print out the list > of blocks used by a requested list of inodes. > > For example, to list the blocks referenced by your kernel: > > guest_12 % df / > Filesystem 1K-blocks Used Avail Capacity Mounted on > /dev/gpt/rootfs 20307196 10707336 7975288 57% / > > guest_12 % ls -i /boot/kernel/kernel > 160603 /boot/kernel/kernel > > guest_12 % ./prtblknos /dev/gpt/rootfs 160603 > 160603: lbn 0-7 blkno 3217584-3217647 > lbn 8-11 blkno 3217864-3217895 distance 216 > First-level indirect, blkno 3217896-3217903 distance 0 > lbn 12-19 blkno 3217904-3217967 distance 8 > lbn 20-75 blkno 3251816-3252263 distance 33848 > lbn 76-83 blkno 3252368-3252431 distance 104 > lbn 84-91 blkno 3252464-3252527 distance 32 > lbn 92-852 blkno 3252896-3258983 distance 368 > > Each contiguous range of blocks is printed on a line. > The distance metric is the size of the gap from the end of the > previous set of blocks to the beginning of the next set of blocks. > Short distances are desirable. Cant this be done with fsdb blocks command? > > Added: > head/tools/diag/prtblknos/ > head/tools/diag/prtblknos/Makefile (contents, props changed) > head/tools/diag/prtblknos/README (contents, props changed) > head/tools/diag/prtblknos/prtblknos.c (contents, props changed) > Modified: > head/tools/diag/README > > Modified: head/tools/diag/README > ============================================================================== > --- head/tools/diag/README Fri Feb 9 18:47:00 2018 (r329075) > +++ head/tools/diag/README Fri Feb 9 19:10:46 2018 (r329076) > @@ -11,4 +11,4 @@ Please make a subdir per program, and add a brief desc > dumpvfscache program that can be used to examine the contents of the vfs > name cache. > localeck check for invalid/incomplete locales > - > +prtblknos Print out the blocks used by each inode in the list > > Added: head/tools/diag/prtblknos/Makefile > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/tools/diag/prtblknos/Makefile Fri Feb 9 19:10:46 2018 (r329076) > @@ -0,0 +1,10 @@ > +# $FreeBSD$ > + > +PROG= prtblknos > + > +MAN= > + > +test: ${PROG} > + ./${PROG} > a > + > +.include > > Added: head/tools/diag/prtblknos/README > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/tools/diag/prtblknos/README Fri Feb 9 19:10:46 2018 (r329076) > @@ -0,0 +1,31 @@ > +# $FreeBSD$ > + > +This is a little C-program that can be used to print out the list > +of blocks used by a requested list of inodes. > + > +For example, to list the blocks referenced by your kernel: > + > +guest_12 % df / > +Filesystem 1K-blocks Used Avail Capacity Mounted on > +/dev/gpt/rootfs 20307196 10707336 7975288 57% / > + > +guest_12 % ls -i /boot/kernel/kernel > +160603 /boot/kernel/kernel > + > +guest_12 % ./prtblknos /dev/gpt/rootfs 160603 > +160603: lbn 0-7 blkno 3217584-3217647 > + lbn 8-11 blkno 3217864-3217895 distance 216 > +First-level indirect, blkno 3217896-3217903 distance 0 > + lbn 12-19 blkno 3217904-3217967 distance 8 > + lbn 20-75 blkno 3251816-3252263 distance 33848 > + lbn 76-83 blkno 3252368-3252431 distance 104 > + lbn 84-91 blkno 3252464-3252527 distance 32 > + lbn 92-852 blkno 3252896-3258983 distance 368 > + > +Each contiguous range of blocks is printed on a line. > +The distance metric is the size of the gap from the end of the > +previous set of blocks to the beginning of the next set of blocks. > +Short distances are desirable. > + > + Marshall Kirk McKusick > + January 19, 2018 > > Added: head/tools/diag/prtblknos/prtblknos.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/tools/diag/prtblknos/prtblknos.c Fri Feb 9 19:10:46 2018 (r329076) > @@ -0,0 +1,314 @@ > +/* > + * Copyright (c) 1998, 2003, 2013, 2018 Marshall Kirk McKusick. > + * 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 MARSHALL KIRK MCKUSICK ``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 MARSHALL KIRK MCKUSICK 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 > + > +union dinode { > + struct ufs1_dinode *dp1; > + struct ufs2_dinode *dp2; > +}; > +struct fs *sbp; > +char *fsname; > +int fd; > + > +void indirprt(int level, int blksperindir, int lbn, ufs2_daddr_t blkno, > + int lastlbn); > +void printblk(int lbn, ufs2_daddr_t blkno, int numblks, int lastlbn); > + > +/* > + * Possible superblock locations ordered from most to least likely. > + */ > +static int sblock_try[] = SBLOCKSEARCH; > + > +int > +main(argc, argv) > + int argc; > + char *argv[]; > +{ > + int i, len, lbn, frags, inonum, numblks, blksperindir; > + char sblock[SBLOCKSIZE], ibuf[MAXBSIZE]; > + ufs2_daddr_t blkno; > + off_t size, offset; > + union dinode dp; > + > + if (argc < 3) { > + (void)fprintf(stderr,"usage: prtblknos filesystem inode ...\n"); > + exit(1); > + } > + > + fsname = *++argv; > + > + /* get the superblock. */ > + if ((fd = open(fsname, O_RDONLY, 0)) < 0) > + err(1, "%s", fsname); > + for (i = 0; sblock_try[i] != -1; i++) { > + if (lseek(fd, sblock_try[i], SEEK_SET) < 0) > + err(1, "lseek: %s", fsname); > + if (read(fd, sblock, (long)SBLOCKSIZE) != SBLOCKSIZE) > + err(1, "can't read superblock: %s", fsname); > + sbp = (struct fs *)sblock; > + if ((sbp->fs_magic == FS_UFS1_MAGIC || > + (sbp->fs_magic == FS_UFS2_MAGIC && > + sbp->fs_sblockloc == sblock_try[i])) && > + sbp->fs_bsize <= MAXBSIZE && > + sbp->fs_bsize >= sizeof(struct fs)) > + break; > + } > + if (sblock_try[i] == -1) > + errx(1, "Cannot find file system superblock\n"); > + > + /* remaining arguments are inode numbers. */ > + while (*++argv) { > + /* get the inode number. */ > + if ((inonum = atoi(*argv)) <= 0) > + errx(1, "%s is not a valid inode number", *argv); > + (void)printf("%d:", inonum); > + > + /* read in the appropriate block. */ > + offset = ino_to_fsba(sbp, inonum); /* inode to fs blk */ > + offset = fsbtodb(sbp, offset); /* fs blk disk blk */ > + offset *= DEV_BSIZE; /* disk blk to bytes */ > + > + /* seek and read the block */ > + if (lseek(fd, offset, SEEK_SET) < 0) > + err(1, "%s", fsname); > + if (read(fd, ibuf, sbp->fs_bsize) != sbp->fs_bsize) > + err(1, "%s", fsname); > + > + /* get the inode within the block. */ > + if (sbp->fs_magic == FS_UFS1_MAGIC) { > + dp.dp1 = &((struct ufs1_dinode *)(ibuf)) > + [ino_to_fsbo(sbp, inonum)]; > + size = dp.dp1->di_size; > + } else { > + dp.dp2 = &((struct ufs2_dinode *)(ibuf)) > + [ino_to_fsbo(sbp, inonum)]; > + size = dp.dp2->di_size; > + } > + > + numblks = howmany(size, sbp->fs_bsize); > + if (numblks == 0) { > + printf(" empty file\n"); > + continue; > + } > + len = numblks < UFS_NDADDR ? numblks : UFS_NDADDR; > + for (i = 0; i < len; i++) { > + if (i < numblks - 1) > + frags = sbp->fs_frag; > + else > + frags = howmany(size % sbp->fs_bsize, > + sbp->fs_fsize); > + if (sbp->fs_magic == FS_UFS1_MAGIC) > + blkno = dp.dp1->di_db[i]; > + else > + blkno = dp.dp2->di_db[i]; > + printblk(i, blkno, frags, numblks); > + } > + > + blksperindir = 1; > + len = numblks - UFS_NDADDR; > + lbn = UFS_NDADDR; > + for (i = 0; len > 0 && i < UFS_NIADDR; i++) { > + if (sbp->fs_magic == FS_UFS1_MAGIC) > + blkno = dp.dp1->di_ib[i]; > + else > + blkno = dp.dp2->di_ib[i]; > + indirprt(i, blksperindir, lbn, blkno, numblks); > + blksperindir *= NINDIR(sbp); > + lbn += blksperindir; > + len -= blksperindir; > + } > + > + /* dummy print to flush out last extent */ > + printblk(numblks, 0, frags, 0); > + } > + (void)close(fd); > + exit(0); > +} > + > +void > +indirprt(level, blksperindir, lbn, blkno, lastlbn) > + int level; > + int blksperindir; > + int lbn; > + ufs2_daddr_t blkno; > + int lastlbn; > +{ > + char indir[MAXBSIZE]; > + off_t offset; > + int i, last; > + > + printblk(lbn, blkno, sbp->fs_frag, -level); > + /* read in the indirect block. */ > + offset = fsbtodb(sbp, blkno); /* fs blk disk blk */ > + offset *= DEV_BSIZE; /* disk blk to bytes */ > + if (lseek(fd, offset, SEEK_SET) < 0) > + err(1, "%s", fsname); > + if (read(fd, indir, sbp->fs_bsize) != sbp->fs_bsize) > + err(1, "%s", fsname); > + last = howmany(lastlbn - lbn, blksperindir) < NINDIR(sbp) ? > + howmany(lastlbn - lbn, blksperindir) : NINDIR(sbp); > + if (blksperindir == 1) { > + for (i = 0; i < last; i++) { > + if (sbp->fs_magic == FS_UFS1_MAGIC) > + blkno = ((ufs1_daddr_t *)indir)[i]; > + else > + blkno = ((ufs2_daddr_t *)indir)[i]; > + printblk(lbn + i, blkno, sbp->fs_frag, lastlbn); > + } > + return; > + } > + for (i = 0; i < last; i++) { > + if (sbp->fs_magic == FS_UFS1_MAGIC) > + blkno = ((ufs1_daddr_t *)indir)[i]; > + else > + blkno = ((ufs2_daddr_t *)indir)[i]; > + indirprt(level - 1, blksperindir / NINDIR(sbp), > + lbn + blksperindir * i, blkno, lastlbn); > + } > +} > + > +char * > +distance(lastblk, firstblk) > + daddr_t lastblk; > + daddr_t firstblk; > +{ > + daddr_t delta; > + int firstcg, lastcg; > + static char buf[100]; > + > + if (lastblk == 0) > + return (""); > + delta = firstblk - lastblk - 1; > + firstcg = dtog(sbp, firstblk); > + lastcg = dtog(sbp, lastblk); > + if (firstcg == lastcg) { > + snprintf(buf, 100, " distance %jd", (intmax_t)delta); > + return (&buf[0]); > + } > + snprintf(buf, 100, " cg %d blk %jd to cg %d blk %jd", > + lastcg, dtogd(sbp, lastblk), firstcg, dtogd(sbp, firstblk)); > + return (&buf[0]); > +} > + > + > +char *indirname[UFS_NIADDR] = { "First", "Second", "Third" }; > + > +void > +printblk(lbn, blkno, numblks, lastlbn) > + int lbn; > + ufs2_daddr_t blkno; > + int numblks; > + int lastlbn; > +{ > + static int seq; > + static daddr_t lastindirblk, lastblk, firstblk; > + > + if (lastlbn <= 0) > + goto flush; > + if (seq == 0) { > + seq = 1; > + firstblk = blkno; > + return; > + } > + if (lbn == 0) { > + seq = 1; > + lastblk = 0; > + firstblk = blkno; > + lastindirblk = 0; > + return; > + } > + if (lbn < lastlbn && ((firstblk == 0 && blkno == 0) || > + (firstblk == BLK_NOCOPY && blkno == BLK_NOCOPY) || > + (firstblk == BLK_SNAP && blkno == BLK_SNAP) || > + blkno == firstblk + seq * numblks)) { > + seq++; > + return; > + } > +flush: > + if (seq == 0) > + goto prtindir; > + if (firstblk <= BLK_SNAP) { > + if (seq == 1) > + printf("\tlbn %d %s\n", lbn - seq, > + firstblk == 0 ? "hole" : > + firstblk == BLK_NOCOPY ? "nocopy" : > + "snapblk"); > + else > + printf("\tlbn %d-%d %s\n", > + lbn - seq, lbn - 1, > + firstblk == 0 ? "hole" : > + firstblk == BLK_NOCOPY ? "nocopy" : > + "snapblk"); > + } else if (seq == 1) { > + if (numblks == 1) > + printf("\tlbn %d blkno %jd%s\n", lbn - seq, > + (intmax_t)firstblk, distance(lastblk, firstblk)); > + else > + printf("\tlbn %d blkno %jd-%jd%s\n", lbn - seq, > + (intmax_t)firstblk, > + (intmax_t)(firstblk + numblks - 1), > + distance(lastblk, firstblk)); > + lastblk = firstblk + numblks - 1; > + } else { > + printf("\tlbn %d-%d blkno %jd-%jd%s\n", lbn - seq, lbn - 1, > + (intmax_t)firstblk, (intmax_t)(firstblk + > + (seq - 1) * sbp->fs_frag + numblks - 1), > + distance(lastblk, firstblk)); > + lastblk = firstblk + (seq - 1) * sbp->fs_frag + numblks - 1; > + } > + if (lastlbn > 0 || blkno == 0) { > + seq = 1; > + firstblk = blkno; > + return; > + } > +prtindir: > + if (seq != 0 && (sbp->fs_metaspace == 0 || lastindirblk == 0)) > + lastindirblk = lastblk; > + printf("%s-level indirect, blkno %jd-%jd%s\n", indirname[-lastlbn], > + (intmax_t)blkno, (intmax_t)(blkno + numblks - 1), > + distance(lastindirblk, blkno)); > + lastindirblk = blkno + numblks - 1; > + if (sbp->fs_metaspace == 0) > + lastblk = lastindirblk; > + seq = 0; > +} > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Fri Feb 9 21:49:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DDF3F050AC; Fri, 9 Feb 2018 21:49:39 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ADC867B23F; Fri, 9 Feb 2018 21:49:38 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A3D7227DE; Fri, 9 Feb 2018 21:49:38 +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 w19LncPU001323; Fri, 9 Feb 2018 21:49:38 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w19Lnc3g001320; Fri, 9 Feb 2018 21:49:38 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201802092149.w19Lnc3g001320@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 9 Feb 2018 21:49:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329085 - in head: sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/dispatcher sys/contrib/dev/acpica/components/ex... X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in head: sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/dispatcher sys/contrib/dev/acpica/components/executer sys/contrib/dev/ac... X-SVN-Commit-Revision: 329085 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Feb 2018 21:49:39 -0000 Author: jkim Date: Fri Feb 9 21:49:38 2018 New Revision: 329085 URL: https://svnweb.freebsd.org/changeset/base/329085 Log: MFV: r329072 Merge ACPICA 20180209. Added: head/sys/contrib/dev/acpica/common/dmtbdump1.c - copied, changed from r329072, vendor-sys/acpica/dist/source/common/dmtbdump1.c head/sys/contrib/dev/acpica/common/dmtbdump2.c - copied, changed from r329072, vendor-sys/acpica/dist/source/common/dmtbdump2.c head/sys/contrib/dev/acpica/common/dmtbdump3.c - copied, changed from r329072, vendor-sys/acpica/dist/source/common/dmtbdump3.c head/sys/contrib/dev/acpica/common/dmtbinfo1.c - copied, changed from r329072, vendor-sys/acpica/dist/source/common/dmtbinfo1.c head/sys/contrib/dev/acpica/common/dmtbinfo2.c - copied, changed from r329072, vendor-sys/acpica/dist/source/common/dmtbinfo2.c head/sys/contrib/dev/acpica/common/dmtbinfo3.c - copied, changed from r329072, vendor-sys/acpica/dist/source/common/dmtbinfo3.c Modified: head/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/common/dmtbdump.c head/sys/contrib/dev/acpica/common/dmtbinfo.c head/sys/contrib/dev/acpica/compiler/aslbtypes.c head/sys/contrib/dev/acpica/compiler/aslerror.c head/sys/contrib/dev/acpica/compiler/aslfold.c head/sys/contrib/dev/acpica/compiler/aslload.c head/sys/contrib/dev/acpica/compiler/aslmessages.c head/sys/contrib/dev/acpica/compiler/aslmessages.h head/sys/contrib/dev/acpica/compiler/dtcompile.c head/sys/contrib/dev/acpica/compiler/dtcompiler.h head/sys/contrib/dev/acpica/compiler/dtexpress.c head/sys/contrib/dev/acpica/compiler/dtparser.l head/sys/contrib/dev/acpica/compiler/dtparser.y head/sys/contrib/dev/acpica/compiler/dttable.c head/sys/contrib/dev/acpica/compiler/dttable1.c head/sys/contrib/dev/acpica/compiler/dttable2.c head/sys/contrib/dev/acpica/components/dispatcher/dsargs.c head/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c head/sys/contrib/dev/acpica/components/dispatcher/dspkginit.c head/sys/contrib/dev/acpica/components/dispatcher/dswexec.c head/sys/contrib/dev/acpica/components/dispatcher/dswload.c head/sys/contrib/dev/acpica/components/executer/exconvrt.c head/sys/contrib/dev/acpica/components/executer/exnames.c head/sys/contrib/dev/acpica/components/executer/exresop.c head/sys/contrib/dev/acpica/components/namespace/nseval.c head/sys/contrib/dev/acpica/components/namespace/nsinit.c head/sys/contrib/dev/acpica/components/namespace/nsnames.c head/sys/contrib/dev/acpica/components/namespace/nsparse.c head/sys/contrib/dev/acpica/components/parser/psargs.c head/sys/contrib/dev/acpica/components/parser/psloop.c head/sys/contrib/dev/acpica/components/parser/psparse.c head/sys/contrib/dev/acpica/components/parser/pstree.c head/sys/contrib/dev/acpica/components/utilities/utcache.c head/sys/contrib/dev/acpica/components/utilities/utdelete.c head/sys/contrib/dev/acpica/include/acopcode.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/actbl1.h head/sys/contrib/dev/acpica/include/actbl2.h head/sys/contrib/dev/acpica/include/actbl3.h head/sys/contrib/dev/acpica/include/amlcode.h head/usr.sbin/acpi/iasl/Makefile Directory Properties: head/sys/contrib/dev/acpica/ (props changed) Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Fri Feb 9 21:33:47 2018 (r329084) +++ head/sys/contrib/dev/acpica/changes.txt Fri Feb 9 21:49:38 2018 (r329085) @@ -1,4 +1,72 @@ ---------------------------------------- +09 February 2018. Summary of changes for version 20180209: + + +1) ACPICA kernel-resident subsystem: + +Completed the final integration of the recent changes to Package Object +handling and the module-level AML code support. This allows forward +references from individual package elements when the package object is +declared from within module-level code blocks. Provides compatibility +with other ACPI implementations. + +The new architecture for the AML module-level code has been completed and +is now the default for the ACPICA code. This new architecture executes +the module-level code in-line as the ACPI table is loaded/parsed instead +of the previous architecture which deferred this code until after the +table was fully loaded. This solves some ASL code ordering issues and +provides compatibility with other ACPI implementations. At this time, +there is an option to fallback to the earlier architecture, but this +support is deprecated and is planned to be completely removed later this +year. + +Added a compile-time option to ignore AE_NOT_FOUND exceptions during +resolution of named reference elements within Package objects. Although +this is potentially a serious problem, it can generate a lot of +noise/errors on platforms whose firmware carries around a bunch of unused +Package objects. To disable these errors, define +ACPI_IGNORE_PACKAGE_RESOLUTION_ERRORS in the OS-specific header. All +errors are always reported for ACPICA applications such as AcpiExec. + +Fixed a regression related to the explicit type-conversion AML operators +(ToXXXX). The regression was introduced early in 2017 but was not seen +until recently because these operators are not fully supported by other +ACPI implementations and are thus rarely used by firmware developers. The +operators are defined by the ACPI specification to not implement the +"implicit result object conversion". The regression incorrectly +introduced this object conversion for the following explicit conversion +operators: + ToInteger + ToString + ToBuffer + ToDecimalString + ToHexString + ToBCD + FromBCD + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Fixed a problem with the compiler constant folding feature as +related to the ToXXXX explicit conversion operators. These operators do +not support the "implicit result object conversion" by definition. Thus, +ASL expressions that use these operators cannot be folded to a simple +Store operator because Store implements the implicit conversion. This +change uses the CopyObject operator for the ToXXXX operator folding +instead. CopyObject is defined to not implement implicit result +conversions and is thus appropriate for folding the ToXXXX operators. + +iASL: Changed the severity of an error condition to a simple warning for +the case where a symbol is declared both locally and as an external +symbol. This accommodates existing ASL code. + +AcpiExec: The -ep option to enable the new architecture for module-level +code has been removed. It is replaced by the -dp option which instead has +the opposite effect: it disables the new architecture (the default) and +enables the legacy architecture. When the legacy code is removed in the +future, the -dp option will be removed also. + +---------------------------------------- 05 January 2018. Summary of changes for version 20180105: Modified: head/sys/contrib/dev/acpica/common/dmtbdump.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbdump.c Fri Feb 9 21:33:47 2018 (r329084) +++ head/sys/contrib/dev/acpica/common/dmtbdump.c Fri Feb 9 21:49:38 2018 (r329085) @@ -603,3832 +603,3 @@ AcpiDmValidateFadtLength ( "found %X expected %X\n", Revision, Length, ExpectedLength); } - - -/******************************************************************************* - * - * FUNCTION: AcpiDmDumpAsf - * - * PARAMETERS: Table - A ASF table - * - * RETURN: None - * - * DESCRIPTION: Format the contents of a ASF table - * - ******************************************************************************/ - -void -AcpiDmDumpAsf ( - ACPI_TABLE_HEADER *Table) -{ - ACPI_STATUS Status; - UINT32 Offset = sizeof (ACPI_TABLE_HEADER); - ACPI_ASF_INFO *Subtable; - ACPI_DMTABLE_INFO *InfoTable; - ACPI_DMTABLE_INFO *DataInfoTable = NULL; - UINT8 *DataTable = NULL; - UINT32 DataCount = 0; - UINT32 DataLength = 0; - UINT32 DataOffset = 0; - UINT32 i; - UINT8 Type; - - - /* No main table, only subtables */ - - Subtable = ACPI_ADD_PTR (ACPI_ASF_INFO, Table, Offset); - while (Offset < Table->Length) - { - /* Common subtable header */ - - Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, - Subtable->Header.Length, AcpiDmTableInfoAsfHdr); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* The actual type is the lower 7 bits of Type */ - - Type = (UINT8) (Subtable->Header.Type & 0x7F); - - switch (Type) - { - case ACPI_ASF_TYPE_INFO: - - InfoTable = AcpiDmTableInfoAsf0; - break; - - case ACPI_ASF_TYPE_ALERT: - - InfoTable = AcpiDmTableInfoAsf1; - DataInfoTable = AcpiDmTableInfoAsf1a; - DataTable = ACPI_ADD_PTR (UINT8, Subtable, sizeof (ACPI_ASF_ALERT)); - DataCount = ACPI_CAST_PTR (ACPI_ASF_ALERT, Subtable)->Alerts; - DataLength = ACPI_CAST_PTR (ACPI_ASF_ALERT, Subtable)->DataLength; - DataOffset = Offset + sizeof (ACPI_ASF_ALERT); - break; - - case ACPI_ASF_TYPE_CONTROL: - - InfoTable = AcpiDmTableInfoAsf2; - DataInfoTable = AcpiDmTableInfoAsf2a; - DataTable = ACPI_ADD_PTR (UINT8, Subtable, sizeof (ACPI_ASF_REMOTE)); - DataCount = ACPI_CAST_PTR (ACPI_ASF_REMOTE, Subtable)->Controls; - DataLength = ACPI_CAST_PTR (ACPI_ASF_REMOTE, Subtable)->DataLength; - DataOffset = Offset + sizeof (ACPI_ASF_REMOTE); - break; - - case ACPI_ASF_TYPE_BOOT: - - InfoTable = AcpiDmTableInfoAsf3; - break; - - case ACPI_ASF_TYPE_ADDRESS: - - InfoTable = AcpiDmTableInfoAsf4; - DataTable = ACPI_ADD_PTR (UINT8, Subtable, sizeof (ACPI_ASF_ADDRESS)); - DataLength = ACPI_CAST_PTR (ACPI_ASF_ADDRESS, Subtable)->Devices; - DataOffset = Offset + sizeof (ACPI_ASF_ADDRESS); - break; - - default: - - AcpiOsPrintf ("\n**** Unknown ASF subtable type 0x%X\n", - Subtable->Header.Type); - return; - } - - Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, - Subtable->Header.Length, InfoTable); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Dump variable-length extra data */ - - switch (Type) - { - case ACPI_ASF_TYPE_ALERT: - case ACPI_ASF_TYPE_CONTROL: - - for (i = 0; i < DataCount; i++) - { - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Table->Length, DataOffset, - DataTable, DataLength, DataInfoTable); - if (ACPI_FAILURE (Status)) - { - return; - } - - DataTable = ACPI_ADD_PTR (UINT8, DataTable, DataLength); - DataOffset += DataLength; - } - break; - - case ACPI_ASF_TYPE_ADDRESS: - - for (i = 0; i < DataLength; i++) - { - if (!(i % 16)) - { - AcpiDmLineHeader (DataOffset, 1, "Addresses"); - } - - AcpiOsPrintf ("%2.2X ", *DataTable); - DataTable++; - DataOffset++; - - if (DataOffset > Table->Length) - { - AcpiOsPrintf ( - "**** ACPI table terminates in the middle of a " - "data structure! (ASF! table)\n"); - return; - } - } - - AcpiOsPrintf ("\n"); - break; - - default: - - break; - } - - AcpiOsPrintf ("\n"); - - /* Point to next subtable */ - - if (!Subtable->Header.Length) - { - AcpiOsPrintf ("Invalid zero subtable header length\n"); - return; - } - - Offset += Subtable->Header.Length; - Subtable = ACPI_ADD_PTR (ACPI_ASF_INFO, Subtable, - Subtable->Header.Length); - } -} - - -/******************************************************************************* - * - * FUNCTION: AcpiDmDumpCpep - * - * PARAMETERS: Table - A CPEP table - * - * RETURN: None - * - * DESCRIPTION: Format the contents of a CPEP. This table type consists - * of an open-ended number of subtables. - * - ******************************************************************************/ - -void -AcpiDmDumpCpep ( - ACPI_TABLE_HEADER *Table) -{ - ACPI_STATUS Status; - ACPI_CPEP_POLLING *Subtable; - UINT32 Length = Table->Length; - UINT32 Offset = sizeof (ACPI_TABLE_CPEP); - - - /* Main table */ - - Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoCpep); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Subtables */ - - Subtable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, Table, Offset); - while (Offset < Table->Length) - { - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, Subtable, - Subtable->Header.Length, AcpiDmTableInfoCpep0); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Point to next subtable */ - - Offset += Subtable->Header.Length; - Subtable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, Subtable, - Subtable->Header.Length); - } -} - - -/******************************************************************************* - * - * FUNCTION: AcpiDmDumpCsrt - * - * PARAMETERS: Table - A CSRT table - * - * RETURN: None - * - * DESCRIPTION: Format the contents of a CSRT. This table type consists - * of an open-ended number of subtables. - * - ******************************************************************************/ - -void -AcpiDmDumpCsrt ( - ACPI_TABLE_HEADER *Table) -{ - ACPI_STATUS Status; - ACPI_CSRT_GROUP *Subtable; - ACPI_CSRT_SHARED_INFO *SharedInfoTable; - ACPI_CSRT_DESCRIPTOR *SubSubtable; - UINT32 Length = Table->Length; - UINT32 Offset = sizeof (ACPI_TABLE_CSRT); - UINT32 SubOffset; - UINT32 SubSubOffset; - UINT32 InfoLength; - - - /* The main table only contains the ACPI header, thus already handled */ - - /* Subtables (Resource Groups) */ - - Subtable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Table, Offset); - while (Offset < Table->Length) - { - /* Resource group subtable */ - - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, Subtable, - Subtable->Length, AcpiDmTableInfoCsrt0); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Shared info subtable (One per resource group) */ - - SubOffset = sizeof (ACPI_CSRT_GROUP); - SharedInfoTable = ACPI_ADD_PTR (ACPI_CSRT_SHARED_INFO, Table, - Offset + SubOffset); - - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset + SubOffset, SharedInfoTable, - sizeof (ACPI_CSRT_SHARED_INFO), AcpiDmTableInfoCsrt1); - if (ACPI_FAILURE (Status)) - { - return; - } - - SubOffset += Subtable->SharedInfoLength; - - /* Sub-Subtables (Resource Descriptors) */ - - SubSubtable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, Table, - Offset + SubOffset); - - while ((SubOffset < Subtable->Length) && - ((Offset + SubOffset) < Table->Length)) - { - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset + SubOffset, SubSubtable, - SubSubtable->Length, AcpiDmTableInfoCsrt2); - if (ACPI_FAILURE (Status)) - { - return; - } - - SubSubOffset = sizeof (ACPI_CSRT_DESCRIPTOR); - - /* Resource-specific info buffer */ - - InfoLength = SubSubtable->Length - SubSubOffset; - if (InfoLength) - { - Status = AcpiDmDumpTable (Length, - Offset + SubOffset + SubSubOffset, Table, - InfoLength, AcpiDmTableInfoCsrt2a); - if (ACPI_FAILURE (Status)) - { - return; - } - SubSubOffset += InfoLength; - } - - /* Point to next sub-subtable */ - - SubOffset += SubSubtable->Length; - SubSubtable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, SubSubtable, - SubSubtable->Length); - } - - /* Point to next subtable */ - - Offset += Subtable->Length; - Subtable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Subtable, - Subtable->Length); - } -} - - -/******************************************************************************* - * - * FUNCTION: AcpiDmDumpDbg2 - * - * PARAMETERS: Table - A DBG2 table - * - * RETURN: None - * - * DESCRIPTION: Format the contents of a DBG2. This table type consists - * of an open-ended number of subtables. - * - ******************************************************************************/ - -void -AcpiDmDumpDbg2 ( - ACPI_TABLE_HEADER *Table) -{ - ACPI_STATUS Status; - ACPI_DBG2_DEVICE *Subtable; - UINT32 Length = Table->Length; - UINT32 Offset = sizeof (ACPI_TABLE_DBG2); - UINT32 i; - UINT32 ArrayOffset; - UINT32 AbsoluteOffset; - UINT8 *Array; - - - /* Main table */ - - Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoDbg2); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Subtables */ - - Subtable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Table, Offset); - while (Offset < Table->Length) - { - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, Subtable, - Subtable->Length, AcpiDmTableInfoDbg2Device); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Dump the BaseAddress array */ - - for (i = 0; i < Subtable->RegisterCount; i++) - { - ArrayOffset = Subtable->BaseAddressOffset + - (sizeof (ACPI_GENERIC_ADDRESS) * i); - AbsoluteOffset = Offset + ArrayOffset; - Array = (UINT8 *) Subtable + ArrayOffset; - - Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array, - Subtable->Length, AcpiDmTableInfoDbg2Addr); - if (ACPI_FAILURE (Status)) - { - return; - } - } - - /* Dump the AddressSize array */ - - for (i = 0; i < Subtable->RegisterCount; i++) - { - ArrayOffset = Subtable->AddressSizeOffset + - (sizeof (UINT32) * i); - AbsoluteOffset = Offset + ArrayOffset; - Array = (UINT8 *) Subtable + ArrayOffset; - - Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array, - Subtable->Length, AcpiDmTableInfoDbg2Size); - if (ACPI_FAILURE (Status)) - { - return; - } - } - - /* Dump the Namestring (required) */ - - AcpiOsPrintf ("\n"); - ArrayOffset = Subtable->NamepathOffset; - AbsoluteOffset = Offset + ArrayOffset; - Array = (UINT8 *) Subtable + ArrayOffset; - - Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array, - Subtable->Length, AcpiDmTableInfoDbg2Name); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Dump the OemData (optional) */ - - if (Subtable->OemDataOffset) - { - Status = AcpiDmDumpTable (Length, Offset + Subtable->OemDataOffset, - Table, Subtable->OemDataLength, - AcpiDmTableInfoDbg2OemData); - if (ACPI_FAILURE (Status)) - { - return; - } - } - - /* Point to next subtable */ - - Offset += Subtable->Length; - Subtable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Subtable, - Subtable->Length); - } -} - - -/******************************************************************************* - * - * FUNCTION: AcpiDmDumpDmar - * - * PARAMETERS: Table - A DMAR table - * - * RETURN: None - * - * DESCRIPTION: Format the contents of a DMAR. This table type consists - * of an open-ended number of subtables. - * - ******************************************************************************/ - -void -AcpiDmDumpDmar ( - ACPI_TABLE_HEADER *Table) -{ - ACPI_STATUS Status; - ACPI_DMAR_HEADER *Subtable; - UINT32 Length = Table->Length; - UINT32 Offset = sizeof (ACPI_TABLE_DMAR); - ACPI_DMTABLE_INFO *InfoTable; - ACPI_DMAR_DEVICE_SCOPE *ScopeTable; - UINT32 ScopeOffset; - UINT8 *PciPath; - UINT32 PathOffset; - - - /* Main table */ - - Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoDmar); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Subtables */ - - Subtable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Table, Offset); - while (Offset < Table->Length) - { - /* Common subtable header */ - - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, Subtable, - Subtable->Length, AcpiDmTableInfoDmarHdr); - if (ACPI_FAILURE (Status)) - { - return; - } - - AcpiOsPrintf ("\n"); - - switch (Subtable->Type) - { - case ACPI_DMAR_TYPE_HARDWARE_UNIT: - - InfoTable = AcpiDmTableInfoDmar0; - ScopeOffset = sizeof (ACPI_DMAR_HARDWARE_UNIT); - break; - - case ACPI_DMAR_TYPE_RESERVED_MEMORY: - - InfoTable = AcpiDmTableInfoDmar1; - ScopeOffset = sizeof (ACPI_DMAR_RESERVED_MEMORY); - break; - - case ACPI_DMAR_TYPE_ROOT_ATS: - - InfoTable = AcpiDmTableInfoDmar2; - ScopeOffset = sizeof (ACPI_DMAR_ATSR); - break; - - case ACPI_DMAR_TYPE_HARDWARE_AFFINITY: - - InfoTable = AcpiDmTableInfoDmar3; - ScopeOffset = sizeof (ACPI_DMAR_RHSA); - break; - - case ACPI_DMAR_TYPE_NAMESPACE: - - InfoTable = AcpiDmTableInfoDmar4; - ScopeOffset = sizeof (ACPI_DMAR_ANDD); - break; - - default: - - AcpiOsPrintf ("\n**** Unknown DMAR subtable type 0x%X\n\n", - Subtable->Type); - return; - } - - Status = AcpiDmDumpTable (Length, Offset, Subtable, - Subtable->Length, InfoTable); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* - * Dump the optional device scope entries - */ - if ((Subtable->Type == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) || - (Subtable->Type == ACPI_DMAR_TYPE_NAMESPACE)) - { - /* These types do not support device scopes */ - - goto NextSubtable; - } - - ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE, Subtable, ScopeOffset); - while (ScopeOffset < Subtable->Length) - { - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset + ScopeOffset, ScopeTable, - ScopeTable->Length, AcpiDmTableInfoDmarScope); - if (ACPI_FAILURE (Status)) - { - return; - } - AcpiOsPrintf ("\n"); - - /* Dump the PCI Path entries for this device scope */ - - PathOffset = sizeof (ACPI_DMAR_DEVICE_SCOPE); /* Path entries start at this offset */ - - PciPath = ACPI_ADD_PTR (UINT8, ScopeTable, - sizeof (ACPI_DMAR_DEVICE_SCOPE)); - - while (PathOffset < ScopeTable->Length) - { - AcpiDmLineHeader ((PathOffset + ScopeOffset + Offset), 2, - "PCI Path"); - AcpiOsPrintf ("%2.2X,%2.2X\n", PciPath[0], PciPath[1]); - - /* Point to next PCI Path entry */ - - PathOffset += 2; - PciPath += 2; - AcpiOsPrintf ("\n"); - } - - /* Point to next device scope entry */ - - ScopeOffset += ScopeTable->Length; - ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE, - ScopeTable, ScopeTable->Length); - } - -NextSubtable: - /* Point to next subtable */ - - Offset += Subtable->Length; - Subtable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Subtable, - Subtable->Length); - } -} - - -/******************************************************************************* - * - * FUNCTION: AcpiDmDumpDrtm - * - * PARAMETERS: Table - A DRTM table - * - * RETURN: None - * - * DESCRIPTION: Format the contents of a DRTM. - * - ******************************************************************************/ - -void -AcpiDmDumpDrtm ( - ACPI_TABLE_HEADER *Table) -{ - ACPI_STATUS Status; - UINT32 Offset; - ACPI_DRTM_VTABLE_LIST *DrtmVtl; - ACPI_DRTM_RESOURCE_LIST *DrtmRl; - ACPI_DRTM_DPS_ID *DrtmDps; - UINT32 Count; - - - /* Main table */ - - Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, - AcpiDmTableInfoDrtm); - if (ACPI_FAILURE (Status)) - { - return; - } - - Offset = sizeof (ACPI_TABLE_DRTM); - - /* Sub-tables */ - - /* Dump ValidatedTable length */ - - DrtmVtl = ACPI_ADD_PTR (ACPI_DRTM_VTABLE_LIST, Table, Offset); - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Table->Length, Offset, - DrtmVtl, ACPI_OFFSET (ACPI_DRTM_VTABLE_LIST, ValidatedTables), - AcpiDmTableInfoDrtm0); - if (ACPI_FAILURE (Status)) - { - return; - } - - Offset += ACPI_OFFSET (ACPI_DRTM_VTABLE_LIST, ValidatedTables); - - /* Dump Validated table addresses */ - - Count = 0; - while ((Offset < Table->Length) && - (DrtmVtl->ValidatedTableCount > Count)) - { - Status = AcpiDmDumpTable (Table->Length, Offset, - ACPI_ADD_PTR (void, Table, Offset), sizeof (UINT64), - AcpiDmTableInfoDrtm0a); - if (ACPI_FAILURE (Status)) - { - return; - } - - Offset += sizeof (UINT64); - Count++; - } - - /* Dump ResourceList length */ - - DrtmRl = ACPI_ADD_PTR (ACPI_DRTM_RESOURCE_LIST, Table, Offset); - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Table->Length, Offset, - DrtmRl, ACPI_OFFSET (ACPI_DRTM_RESOURCE_LIST, Resources), - AcpiDmTableInfoDrtm1); - if (ACPI_FAILURE (Status)) - { - return; - } - - Offset += ACPI_OFFSET (ACPI_DRTM_RESOURCE_LIST, Resources); - - /* Dump the Resource List */ - - Count = 0; - while ((Offset < Table->Length) && - (DrtmRl->ResourceCount > Count)) - { - Status = AcpiDmDumpTable (Table->Length, Offset, - ACPI_ADD_PTR (void, Table, Offset), - sizeof (ACPI_DRTM_RESOURCE), AcpiDmTableInfoDrtm1a); - if (ACPI_FAILURE (Status)) - { - return; - } - - Offset += sizeof (ACPI_DRTM_RESOURCE); - Count++; - } - - /* Dump DPS */ - - DrtmDps = ACPI_ADD_PTR (ACPI_DRTM_DPS_ID, Table, Offset); - AcpiOsPrintf ("\n"); - (void) AcpiDmDumpTable (Table->Length, Offset, - DrtmDps, sizeof (ACPI_DRTM_DPS_ID), AcpiDmTableInfoDrtm2); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiDmDumpEinj - * - * PARAMETERS: Table - A EINJ table - * - * RETURN: None - * - * DESCRIPTION: Format the contents of a EINJ. This table type consists - * of an open-ended number of subtables. - * - ******************************************************************************/ - -void -AcpiDmDumpEinj ( - ACPI_TABLE_HEADER *Table) -{ - ACPI_STATUS Status; - ACPI_WHEA_HEADER *Subtable; - UINT32 Length = Table->Length; - UINT32 Offset = sizeof (ACPI_TABLE_EINJ); - - - /* Main table */ - - Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoEinj); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Subtables */ - - Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset); - while (Offset < Table->Length) - { - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, Subtable, - sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoEinj0); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Point to next subtable (each subtable is of fixed length) */ - - Offset += sizeof (ACPI_WHEA_HEADER); - Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Subtable, - sizeof (ACPI_WHEA_HEADER)); - } -} - - -/******************************************************************************* - * - * FUNCTION: AcpiDmDumpErst - * - * PARAMETERS: Table - A ERST table - * - * RETURN: None - * - * DESCRIPTION: Format the contents of a ERST. This table type consists - * of an open-ended number of subtables. - * - ******************************************************************************/ - -void -AcpiDmDumpErst ( - ACPI_TABLE_HEADER *Table) -{ - ACPI_STATUS Status; - ACPI_WHEA_HEADER *Subtable; - UINT32 Length = Table->Length; - UINT32 Offset = sizeof (ACPI_TABLE_ERST); - - - /* Main table */ - - Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoErst); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Subtables */ - - Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset); - while (Offset < Table->Length) - { - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, Subtable, - sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoErst0); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Point to next subtable (each subtable is of fixed length) */ - - Offset += sizeof (ACPI_WHEA_HEADER); - Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Subtable, - sizeof (ACPI_WHEA_HEADER)); - } -} - - -/******************************************************************************* - * - * FUNCTION: AcpiDmDumpFpdt - * - * PARAMETERS: Table - A FPDT table - * - * RETURN: None - * - * DESCRIPTION: Format the contents of a FPDT. This table type consists - * of an open-ended number of subtables. - * - ******************************************************************************/ - -void -AcpiDmDumpFpdt ( - ACPI_TABLE_HEADER *Table) -{ - ACPI_STATUS Status; - ACPI_FPDT_HEADER *Subtable; - UINT32 Length = Table->Length; - UINT32 Offset = sizeof (ACPI_TABLE_FPDT); - ACPI_DMTABLE_INFO *InfoTable; - - - /* There is no main table (other than the standard ACPI header) */ - - /* Subtables */ - - Subtable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Table, Offset); - while (Offset < Table->Length) - { - /* Common subtable header */ - - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, Subtable, - Subtable->Length, AcpiDmTableInfoFpdtHdr); - if (ACPI_FAILURE (Status)) - { - return; - } - - switch (Subtable->Type) - { - case ACPI_FPDT_TYPE_BOOT: - - InfoTable = AcpiDmTableInfoFpdt0; - break; - - case ACPI_FPDT_TYPE_S3PERF: - - InfoTable = AcpiDmTableInfoFpdt1; - break; - - default: - - AcpiOsPrintf ("\n**** Unknown FPDT subtable type 0x%X\n\n", - Subtable->Type); - - /* Attempt to continue */ - - if (!Subtable->Length) - { - AcpiOsPrintf ("Invalid zero length subtable\n"); - return; - } - goto NextSubtable; - } - - Status = AcpiDmDumpTable (Length, Offset, Subtable, - Subtable->Length, InfoTable); - if (ACPI_FAILURE (Status)) - { - return; - } - -NextSubtable: - /* Point to next subtable */ - - Offset += Subtable->Length; - Subtable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Subtable, - Subtable->Length); - } -} - - -/******************************************************************************* - * - * FUNCTION: AcpiDmDumpGtdt - * - * PARAMETERS: Table - A GTDT table - * *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Feb 9 22:23:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AC92F07110; Fri, 9 Feb 2018 22:23:11 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E48BB7C5A7; Fri, 9 Feb 2018 22:23:10 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB0722E32; Fri, 9 Feb 2018 22:23:10 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w19MNAl4021794; Fri, 9 Feb 2018 22:23:10 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w19MNAr1021793; Fri, 9 Feb 2018 22:23:10 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201802092223.w19MNAr1021793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Fri, 9 Feb 2018 22:23:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329087 - head/tools/diag/prtblknos X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/tools/diag/prtblknos X-SVN-Commit-Revision: 329087 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Feb 2018 22:23:11 -0000 Author: mckusick Date: Fri Feb 9 22:23:10 2018 New Revision: 329087 URL: https://svnweb.freebsd.org/changeset/base/329087 Log: Add an explanation of the block size units output by prtblknos. Suggested by: Ravi Pokala (rpokala@) Modified: head/tools/diag/prtblknos/README Modified: head/tools/diag/prtblknos/README ============================================================================== --- head/tools/diag/prtblknos/README Fri Feb 9 21:51:08 2018 (r329086) +++ head/tools/diag/prtblknos/README Fri Feb 9 22:23:10 2018 (r329087) @@ -27,5 +27,22 @@ The distance metric is the size of the gap from the en previous set of blocks to the beginning of the next set of blocks. Short distances are desirable. +The logical block numbers (lbn above) describe filesystem-block +size blocks which by today's default is 32Kb. + +The physical block numbers (blkno above) describe the smallest piece +of disk space that an inode can reference which is a filesystem +fragment. Since the default size for fragments today is 4Kb, the +physical block numbers reference 4Kb blocks. The distances listed +above are also in physical block size units. Thus a distance of 8 +means a separation of just one 32Kb block. For example lbn 11, ends +at 3217895, the 32Kb first level indirect immediately follows it at +3217896-3217903, and lbn 12 starts distance 8 after lbn 11 immediately +after the indirect block at 3217904. + +If you were to create a filesystem with the fragment size equal to +half the block size (say 32Kb blocks with 16Kb fragments) then the +physical block numbers listed would be 16Kb in size. + Marshall Kirk McKusick January 19, 2018 From owner-svn-src-all@freebsd.org Fri Feb 9 22:33:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D61DF07BE3; Fri, 9 Feb 2018 22:33:31 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 60B717CFFC; Fri, 9 Feb 2018 22:33:29 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E0652FED; Fri, 9 Feb 2018 22:33:29 +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 w19MXSM5027139; Fri, 9 Feb 2018 22:33:28 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w19MXNZL027086; Fri, 9 Feb 2018 22:33:23 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201802092233.w19MXNZL027086@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 9 Feb 2018 22:33:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r329088 - in vendor/device-tree/dist: Bindings Bindings/arm Bindings/arm/amlogic Bindings/arm/bcm Bindings/arm/mediatek Bindings/arm/omap Bindings/arm/samsung Bindings/arm/tegra Binding... X-SVN-Group: vendor X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in vendor/device-tree/dist: Bindings Bindings/arm Bindings/arm/amlogic Bindings/arm/bcm Bindings/arm/mediatek Bindings/arm/omap Bindings/arm/samsung Bindings/arm/tegra Bindings/ata Bindings/bus Bindin... X-SVN-Commit-Revision: 329088 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Feb 2018 22:33:31 -0000 Author: manu Date: Fri Feb 9 22:33:22 2018 New Revision: 329088 URL: https://svnweb.freebsd.org/changeset/base/329088 Log: Update our copies of the Device Tree Source to Linux 4.15 Added: vendor/device-tree/dist/Bindings/arm/amlogic/ vendor/device-tree/dist/Bindings/arm/amlogic/analog-top.txt (contents, props changed) vendor/device-tree/dist/Bindings/arm/amlogic/assist.txt (contents, props changed) vendor/device-tree/dist/Bindings/arm/amlogic/bootrom.txt (contents, props changed) vendor/device-tree/dist/Bindings/arm/amlogic/pmu.txt (contents, props changed) vendor/device-tree/dist/Bindings/arm/amlogic/smp-sram.txt (contents, props changed) vendor/device-tree/dist/Bindings/arm/bcm/brcm,hr2.txt (contents, props changed) vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,audsys.txt (contents, props changed) vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,jpgdecsys.txt (contents, props changed) vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,mcucfg.txt (contents, props changed) vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,mfgcfg.txt (contents, props changed) vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,pciesys.txt (contents, props changed) vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,sgmiisys.txt (contents, props changed) vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,ssusbsys.txt (contents, props changed) vendor/device-tree/dist/Bindings/arm/spe-pmu.txt (contents, props changed) vendor/device-tree/dist/Bindings/bus/ti-sysc.txt (contents, props changed) vendor/device-tree/dist/Bindings/bus/ts-nbus.txt (contents, props changed) vendor/device-tree/dist/Bindings/crypto/samsung,exynos-rng4.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/bridge/sii9234.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/faraday,tve200.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/google,goldfish-fb.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/panel/orisetech,otm8009a.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/panel/raspberrypi,7inch-touchscreen.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/panel/samsung,s6e63j0x03.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/panel/seiko,43wvf1g.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/panel/toshiba,lt089ac29000.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/rockchip/rockchip-lvds.txt (contents, props changed) vendor/device-tree/dist/Bindings/dma/sprd-dma.txt (contents, props changed) vendor/device-tree/dist/Bindings/dma/stm32-dmamux.txt (contents, props changed) vendor/device-tree/dist/Bindings/dma/stm32-mdma.txt (contents, props changed) vendor/device-tree/dist/Bindings/gpio/gpio-max3191x.txt (contents, props changed) vendor/device-tree/dist/Bindings/gpio/gpio-uniphier.txt (contents, props changed) vendor/device-tree/dist/Bindings/hwmon/gpio-fan.txt (contents, props changed) vendor/device-tree/dist/Bindings/hwmon/max1619.txt (contents, props changed) vendor/device-tree/dist/Bindings/hwmon/max31785.txt (contents, props changed) vendor/device-tree/dist/Bindings/iio/dac/ds4424.txt (contents, props changed) vendor/device-tree/dist/Bindings/iio/dac/ti-dac082s085.txt (contents, props changed) vendor/device-tree/dist/Bindings/input/gpio-mouse.txt (contents, props changed) vendor/device-tree/dist/Bindings/input/touchscreen/exc3000.txt (contents, props changed) vendor/device-tree/dist/Bindings/input/touchscreen/hideep.txt (contents, props changed) vendor/device-tree/dist/Bindings/input/touchscreen/samsung,s6sy761.txt (contents, props changed) vendor/device-tree/dist/Bindings/interrupt-controller/amlogic,meson-gpio-intc.txt (contents, props changed) vendor/device-tree/dist/Bindings/interrupt-controller/openrisc,ompic.txt (contents, props changed) vendor/device-tree/dist/Bindings/interrupt-controller/socionext,synquacer-exiu.txt (contents, props changed) vendor/device-tree/dist/Bindings/media/cec-gpio.txt (contents, props changed) vendor/device-tree/dist/Bindings/media/i2c/imx274.txt (contents, props changed) vendor/device-tree/dist/Bindings/media/rockchip-rga.txt (contents, props changed) vendor/device-tree/dist/Bindings/media/tango-ir.txt (contents, props changed) vendor/device-tree/dist/Bindings/media/tegra-cec.txt (contents, props changed) vendor/device-tree/dist/Bindings/memory-controllers/brcm,dpfe-cpu.txt (contents, props changed) vendor/device-tree/dist/Bindings/mfd/brcm,iproc-cdru.txt (contents, props changed) vendor/device-tree/dist/Bindings/mfd/brcm,iproc-mhb.txt (contents, props changed) vendor/device-tree/dist/Bindings/mfd/sprd,sc27xx-pmic.txt (contents, props changed) vendor/device-tree/dist/Bindings/misc/ge-achc.txt (contents, props changed) vendor/device-tree/dist/Bindings/mmc/amlogic,meson-mx-sdio.txt (contents, props changed) vendor/device-tree/dist/Bindings/mmc/sdhci-omap.txt (contents, props changed) vendor/device-tree/dist/Bindings/net/bluetooth.txt (contents, props changed) vendor/device-tree/dist/Bindings/net/dwmac-sun8i.txt (contents, props changed) vendor/device-tree/dist/Bindings/nvmem/amlogic-meson-mx-efuse.txt (contents, props changed) vendor/device-tree/dist/Bindings/nvmem/snvs-lpgpr.txt (contents, props changed) vendor/device-tree/dist/Bindings/nvmem/uniphier-efuse.txt (contents, props changed) vendor/device-tree/dist/Bindings/openrisc/ vendor/device-tree/dist/Bindings/openrisc/opencores/ vendor/device-tree/dist/Bindings/openrisc/opencores/or1ksim.txt (contents, props changed) vendor/device-tree/dist/Bindings/pci/designware-pcie-ecam.txt (contents, props changed) vendor/device-tree/dist/Bindings/pci/hisilicon-histb-pcie.txt (contents, props changed) vendor/device-tree/dist/Bindings/phy/brcm,brcmstb-usb-phy.txt (contents, props changed) vendor/device-tree/dist/Bindings/pinctrl/pinctrl-mcp23s08.txt (contents, props changed) vendor/device-tree/dist/Bindings/power/amlogic,meson-gx-pwrc.txt (contents, props changed) vendor/device-tree/dist/Bindings/power/supply/sbs,sbs-manager.txt (contents, props changed) vendor/device-tree/dist/Bindings/power/ti-smartreflex.txt (contents, props changed) vendor/device-tree/dist/Bindings/reserved-memory/qcom,rmtfs-mem.txt (contents, props changed) vendor/device-tree/dist/Bindings/reset/snps,axs10x-reset.txt (contents, props changed) vendor/device-tree/dist/Bindings/riscv/ vendor/device-tree/dist/Bindings/riscv/cpus.txt (contents, props changed) vendor/device-tree/dist/Bindings/rtc/pcf85363.txt (contents, props changed) vendor/device-tree/dist/Bindings/rtc/rtc-ds1307.txt (contents, props changed) vendor/device-tree/dist/Bindings/rtc/rtc-m41t80.txt (contents, props changed) vendor/device-tree/dist/Bindings/rtc/rtc-mt7622.txt (contents, props changed) vendor/device-tree/dist/Bindings/rtc/sirf,prima2-sysrtc.txt (contents, props changed) vendor/device-tree/dist/Bindings/rtc/sprd,sc27xx-rtc.txt (contents, props changed) vendor/device-tree/dist/Bindings/rtc/stericsson,coh901331.txt (contents, props changed) vendor/device-tree/dist/Bindings/sound/tfa9879.txt (contents, props changed) vendor/device-tree/dist/Bindings/sound/wlf,arizona.txt (contents, props changed) vendor/device-tree/dist/Bindings/spi/spi-sprd-adi.txt (contents, props changed) vendor/device-tree/dist/Bindings/thermal/brcm,avs-tmon.txt (contents, props changed) vendor/device-tree/dist/Bindings/thermal/nvidia,tegra186-bpmp-thermal.txt (contents, props changed) vendor/device-tree/dist/Bindings/usb/maxim,max3421.txt (contents, props changed) vendor/device-tree/dist/include/dt-bindings/clock/mt2712-clk.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/clock/mt7622-clk.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/clock/r8a77970-cpg-mssr.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/gpio/uniphier-gpio.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/pinctrl/stm32-pinfunc.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/power/r8a77970-sysc.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/reset/mt7622-reset.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/thermal/tegra186-bpmp-thermal.h (contents, props changed) vendor/device-tree/dist/src/arm/axp81x.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/bcm-hr2.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/bcm47094-luxul-abr-4500.dts (contents, props changed) vendor/device-tree/dist/src/arm/bcm47094-luxul-xbr-4500.dts (contents, props changed) vendor/device-tree/dist/src/arm/bcm47189-luxul-xap-1440.dts (contents, props changed) vendor/device-tree/dist/src/arm/bcm47189-luxul-xap-810.dts (contents, props changed) vendor/device-tree/dist/src/arm/bcm53340-ubnt-unifi-switch8.dts (contents, props changed) vendor/device-tree/dist/src/arm/exynos5422-odroid-core.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/exynos5422-odroidhc1.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx51-zii-rdu1.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx53-ppd.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx6dl-tx6s-8034-mb7.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx6dl-tx6s-8035-mb7.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx6dl-tx6u-8033-mb7.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx6dl-tx6u-80xx-mb7.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx6dl-wandboard-revd1.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx6q-display5-tianma-tm070-1280x768.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx6q-display5.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/imx6q-pistachio.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx6q-tx6q-1036-mb7.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx6q-tx6q-10x0-mb7.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx6q-wandboard-revd1.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx6qdl-tx6-lcd.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/imx6qdl-tx6-lvds.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/imx6qdl-tx6-mb7.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/imx6qdl-wandboard-revd1.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/imx6qp-tx6qp-8037-mb7.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx6qp-tx6qp-8037.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx6qp-tx6qp-8137-mb7.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx6qp-tx6qp-8137.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx6qp-wandboard-revd1.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx6sx-softing-vining-2000.dts (contents, props changed) vendor/device-tree/dist/src/arm/iwg20d-q7-common.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/iwg20d-q7-dbcm-ca.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/omap3-evm-processor-common.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/owl-s500-cubieboard6.dts (contents, props changed) vendor/device-tree/dist/src/arm/qcom-msm8974-fairphone-fp2.dts (contents, props changed) vendor/device-tree/dist/src/arm/qcom-msm8974-sony-xperia-castor.dts (contents, props changed) vendor/device-tree/dist/src/arm/qcom-msm8974pro.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/r8a7743-iwg20d-q7-dbcm-ca.dts (contents, props changed) vendor/device-tree/dist/src/arm/r8a7745-iwg22d-sodimm.dts (contents, props changed) vendor/device-tree/dist/src/arm/r8a7745-iwg22m.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/rk3288-vyasa.dts (contents, props changed) vendor/device-tree/dist/src/arm/sun7i-a20-olinuxino-micro-emmc.dts (contents, props changed) vendor/device-tree/dist/src/arm/sun8i-a83t-tbs-a711.dts (contents, props changed) vendor/device-tree/dist/src/arm/sun8i-r40-bananapi-m2-ultra.dts (contents, props changed) vendor/device-tree/dist/src/arm/sun8i-r40.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/sun8i-v40-bananapi-m2-berry.dts (contents, props changed) vendor/device-tree/dist/src/arm64/allwinner/sun50i-h5-nanopi-neo-plus2.dts (contents, props changed) vendor/device-tree/dist/src/arm64/amlogic/meson-axg-s400.dts (contents, props changed) vendor/device-tree/dist/src/arm64/amlogic/meson-axg.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/amlogic/meson-gxm-khadas-vim2.dts (contents, props changed) vendor/device-tree/dist/src/arm64/amlogic/meson-gxm-vega-s96.dts (contents, props changed) vendor/device-tree/dist/src/arm64/arm/foundation-v8-gicv2.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/arm/foundation-v8-gicv3-psci.dts (contents, props changed) vendor/device-tree/dist/src/arm64/arm/foundation-v8-gicv3.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/arm/foundation-v8-psci.dts (contents, props changed) vendor/device-tree/dist/src/arm64/arm/foundation-v8-psci.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/arm/foundation-v8-spin-table.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/hisilicon/hi6220-coresight.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/realtek/rtd1295-mele-v9.dts (contents, props changed) vendor/device-tree/dist/src/arm64/realtek/rtd1295-probox2-ava.dts (contents, props changed) vendor/device-tree/dist/src/arm64/realtek/rtd129x.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/renesas/r8a7795-es1-h3ulcb-kf.dts (contents, props changed) vendor/device-tree/dist/src/arm64/renesas/r8a7795-h3ulcb-kf.dts (contents, props changed) vendor/device-tree/dist/src/arm64/renesas/r8a7796-m3ulcb-kf.dts (contents, props changed) vendor/device-tree/dist/src/arm64/renesas/r8a77970-eagle.dts (contents, props changed) vendor/device-tree/dist/src/arm64/renesas/r8a77970.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/renesas/ulcb-kf.dtsi (contents, props changed) vendor/device-tree/dist/src/openrisc/simple_smp.dts (contents, props changed) Deleted: vendor/device-tree/dist/Bindings/gpio/gpio-fan.txt vendor/device-tree/dist/Bindings/gpio/gpio-mcp23s08.txt vendor/device-tree/dist/Bindings/rng/samsung,exynos-rng4.txt vendor/device-tree/dist/Bindings/rtc/dallas,ds1339.txt vendor/device-tree/dist/include/dt-bindings/pinctrl/stm32f429-pinfunc.h vendor/device-tree/dist/include/dt-bindings/pinctrl/stm32f746-pinfunc.h vendor/device-tree/dist/include/dt-bindings/pinctrl/stm32h7-pinfunc.h Modified: vendor/device-tree/dist/Bindings/arm/actions.txt vendor/device-tree/dist/Bindings/arm/amlogic.txt vendor/device-tree/dist/Bindings/arm/bcm/brcm,brcmstb.txt vendor/device-tree/dist/Bindings/arm/ccn.txt vendor/device-tree/dist/Bindings/arm/cpus.txt vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,apmixedsys.txt vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,bdpsys.txt vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,ethsys.txt vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,hifsys.txt vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,imgsys.txt vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,infracfg.txt vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,mmsys.txt vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,pericfg.txt vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,topckgen.txt vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,vdecsys.txt vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,vencsys.txt vendor/device-tree/dist/Bindings/arm/omap/crossbar.txt vendor/device-tree/dist/Bindings/arm/omap/ctrl.txt vendor/device-tree/dist/Bindings/arm/realtek.txt vendor/device-tree/dist/Bindings/arm/rockchip.txt vendor/device-tree/dist/Bindings/arm/samsung/pmu.txt vendor/device-tree/dist/Bindings/arm/samsung/samsung-boards.txt vendor/device-tree/dist/Bindings/arm/shmobile.txt vendor/device-tree/dist/Bindings/arm/sp810.txt vendor/device-tree/dist/Bindings/arm/sunxi.txt vendor/device-tree/dist/Bindings/arm/tegra/nvidia,tegra20-mc.txt vendor/device-tree/dist/Bindings/arm/vexpress-sysreg.txt vendor/device-tree/dist/Bindings/ata/ahci-ceva.txt vendor/device-tree/dist/Bindings/ata/ahci-platform.txt vendor/device-tree/dist/Bindings/ata/imx-sata.txt vendor/device-tree/dist/Bindings/bus/imx-weim.txt vendor/device-tree/dist/Bindings/bus/sunxi-rsb.txt vendor/device-tree/dist/Bindings/clock/arm-syscon-icst.txt vendor/device-tree/dist/Bindings/clock/axi-clkgen.txt vendor/device-tree/dist/Bindings/clock/brcm,bcm2835-aux-clock.txt vendor/device-tree/dist/Bindings/clock/brcm,iproc-clocks.txt vendor/device-tree/dist/Bindings/clock/clk-exynos-audss.txt vendor/device-tree/dist/Bindings/clock/clk-s5pv210-audss.txt vendor/device-tree/dist/Bindings/clock/dove-divider-clock.txt vendor/device-tree/dist/Bindings/clock/exynos4-clock.txt vendor/device-tree/dist/Bindings/clock/exynos5250-clock.txt vendor/device-tree/dist/Bindings/clock/exynos5410-clock.txt vendor/device-tree/dist/Bindings/clock/exynos5420-clock.txt vendor/device-tree/dist/Bindings/clock/exynos5433-clock.txt vendor/device-tree/dist/Bindings/clock/exynos5440-clock.txt vendor/device-tree/dist/Bindings/clock/imx1-clock.txt vendor/device-tree/dist/Bindings/clock/imx6q-clock.txt vendor/device-tree/dist/Bindings/clock/maxim,max77686.txt vendor/device-tree/dist/Bindings/clock/qcom,rpmcc.txt vendor/device-tree/dist/Bindings/clock/renesas,cpg-mssr.txt vendor/device-tree/dist/Bindings/clock/renesas,rz-cpg-clocks.txt vendor/device-tree/dist/Bindings/clock/st/st,clkgen.txt vendor/device-tree/dist/Bindings/clock/sunxi-ccu.txt vendor/device-tree/dist/Bindings/clock/sunxi.txt vendor/device-tree/dist/Bindings/clock/ti,cdce706.txt vendor/device-tree/dist/Bindings/clock/ti-keystone-pllctrl.txt vendor/device-tree/dist/Bindings/clock/zx296702-clk.txt vendor/device-tree/dist/Bindings/common-properties.txt vendor/device-tree/dist/Bindings/crypto/fsl-sec4.txt vendor/device-tree/dist/Bindings/crypto/sun4i-ss.txt vendor/device-tree/dist/Bindings/devfreq/event/rockchip-dfi.txt vendor/device-tree/dist/Bindings/display/atmel,lcdc.txt vendor/device-tree/dist/Bindings/display/bridge/adi,adv7511.txt vendor/device-tree/dist/Bindings/display/bridge/renesas,dw-hdmi.txt vendor/device-tree/dist/Bindings/display/etnaviv/etnaviv-drm.txt vendor/device-tree/dist/Bindings/display/imx/fsl-imx-drm.txt vendor/device-tree/dist/Bindings/display/imx/hdmi.txt vendor/device-tree/dist/Bindings/display/msm/dsi.txt vendor/device-tree/dist/Bindings/display/msm/edp.txt vendor/device-tree/dist/Bindings/display/msm/hdmi.txt vendor/device-tree/dist/Bindings/display/msm/mdp5.txt vendor/device-tree/dist/Bindings/display/simple-framebuffer.txt vendor/device-tree/dist/Bindings/display/sunxi/sun4i-drm.txt vendor/device-tree/dist/Bindings/display/tegra/nvidia,tegra20-host1x.txt vendor/device-tree/dist/Bindings/dma/qcom_hidma_mgmt.txt vendor/device-tree/dist/Bindings/dma/renesas,usb-dmac.txt vendor/device-tree/dist/Bindings/dma/stm32-dma.txt vendor/device-tree/dist/Bindings/dma/sun4i-dma.txt vendor/device-tree/dist/Bindings/dma/sun6i-dma.txt vendor/device-tree/dist/Bindings/dma/ti-edma.txt vendor/device-tree/dist/Bindings/dma/zxdma.txt vendor/device-tree/dist/Bindings/eeprom/at25.txt vendor/device-tree/dist/Bindings/eeprom/eeprom.txt vendor/device-tree/dist/Bindings/firmware/nvidia,tegra186-bpmp.txt vendor/device-tree/dist/Bindings/firmware/qcom,scm.txt vendor/device-tree/dist/Bindings/gpio/gpio-altera.txt vendor/device-tree/dist/Bindings/gpio/gpio-dsp-keystone.txt vendor/device-tree/dist/Bindings/gpio/gpio-pca953x.txt vendor/device-tree/dist/Bindings/gpio/gpio-tz1090-pdc.txt vendor/device-tree/dist/Bindings/gpio/gpio-tz1090.txt vendor/device-tree/dist/Bindings/gpio/renesas,gpio-rcar.txt vendor/device-tree/dist/Bindings/gpio/snps-dwapb-gpio.txt vendor/device-tree/dist/Bindings/gpu/arm,mali-utgard.txt vendor/device-tree/dist/Bindings/hsi/omap-ssi.txt vendor/device-tree/dist/Bindings/hwmon/jc42.txt vendor/device-tree/dist/Bindings/i2c/i2c-aspeed.txt vendor/device-tree/dist/Bindings/i2c/i2c-axxia.txt vendor/device-tree/dist/Bindings/i2c/i2c-davinci.txt vendor/device-tree/dist/Bindings/i2c/i2c-gpio.txt vendor/device-tree/dist/Bindings/i2c/i2c-jz4780.txt vendor/device-tree/dist/Bindings/i2c/i2c-mux.txt vendor/device-tree/dist/Bindings/i2c/i2c-rcar.txt vendor/device-tree/dist/Bindings/i2c/i2c-sunxi-p2wi.txt vendor/device-tree/dist/Bindings/i2c/i2c.txt vendor/device-tree/dist/Bindings/iio/adc/mcp320x.txt vendor/device-tree/dist/Bindings/iio/adc/mt6577_auxadc.txt vendor/device-tree/dist/Bindings/iio/health/max30100.txt vendor/device-tree/dist/Bindings/iio/health/max30102.txt vendor/device-tree/dist/Bindings/iio/magnetometer/ak8974.txt vendor/device-tree/dist/Bindings/iio/magnetometer/ak8975.txt vendor/device-tree/dist/Bindings/iio/pressure/hp03.txt vendor/device-tree/dist/Bindings/iio/st-sensors.txt vendor/device-tree/dist/Bindings/input/sun4i-lradc-keys.txt vendor/device-tree/dist/Bindings/input/touchscreen/bu21013.txt vendor/device-tree/dist/Bindings/input/touchscreen/egalax-ts.txt vendor/device-tree/dist/Bindings/input/touchscreen/goodix.txt vendor/device-tree/dist/Bindings/input/touchscreen/imx6ul_tsc.txt vendor/device-tree/dist/Bindings/interrupt-controller/allwinner,sunxi-nmi.txt vendor/device-tree/dist/Bindings/interrupt-controller/arm,gic-v3.txt vendor/device-tree/dist/Bindings/interrupt-controller/arm,gic.txt vendor/device-tree/dist/Bindings/interrupt-controller/brcm,l2-intc.txt vendor/device-tree/dist/Bindings/interrupt-controller/fsl,ls-scfg-msi.txt vendor/device-tree/dist/Bindings/interrupt-controller/img,meta-intc.txt vendor/device-tree/dist/Bindings/interrupt-controller/img,pdc-intc.txt vendor/device-tree/dist/Bindings/interrupt-controller/renesas,irqc.txt vendor/device-tree/dist/Bindings/interrupt-controller/st,spear3xx-shirq.txt vendor/device-tree/dist/Bindings/interrupt-controller/st,stm32-exti.txt vendor/device-tree/dist/Bindings/interrupt-controller/ti,keystone-irq.txt vendor/device-tree/dist/Bindings/iommu/qcom,iommu.txt vendor/device-tree/dist/Bindings/iommu/renesas,ipmmu-vmsa.txt vendor/device-tree/dist/Bindings/leds/register-bit-led.txt vendor/device-tree/dist/Bindings/mailbox/altera-mailbox.txt vendor/device-tree/dist/Bindings/mailbox/brcm,iproc-pdc-mbox.txt vendor/device-tree/dist/Bindings/mailbox/ti,message-manager.txt vendor/device-tree/dist/Bindings/marvell.txt vendor/device-tree/dist/Bindings/media/exynos5-gsc.txt vendor/device-tree/dist/Bindings/media/i2c/nokia,smia.txt vendor/device-tree/dist/Bindings/media/i2c/tc358743.txt vendor/device-tree/dist/Bindings/media/img-ir-rev1.txt vendor/device-tree/dist/Bindings/media/mediatek-vcodec.txt vendor/device-tree/dist/Bindings/media/rcar_vin.txt vendor/device-tree/dist/Bindings/media/renesas,vsp1.txt vendor/device-tree/dist/Bindings/media/samsung-fimc.txt vendor/device-tree/dist/Bindings/media/sh_mobile_ceu.txt vendor/device-tree/dist/Bindings/media/stih-cec.txt vendor/device-tree/dist/Bindings/media/stih407-c8sectpfe.txt vendor/device-tree/dist/Bindings/media/sunxi-ir.txt vendor/device-tree/dist/Bindings/media/video-interfaces.txt vendor/device-tree/dist/Bindings/memory-controllers/ti/emif.txt vendor/device-tree/dist/Bindings/mfd/arizona.txt vendor/device-tree/dist/Bindings/mfd/aspeed-scu.txt vendor/device-tree/dist/Bindings/mfd/max77686.txt vendor/device-tree/dist/Bindings/mfd/max77693.txt vendor/device-tree/dist/Bindings/mfd/max77802.txt vendor/device-tree/dist/Bindings/mfd/mc13xxx.txt vendor/device-tree/dist/Bindings/mfd/mfd.txt vendor/device-tree/dist/Bindings/mfd/sun4i-gpadc.txt vendor/device-tree/dist/Bindings/mfd/sun6i-prcm.txt vendor/device-tree/dist/Bindings/mfd/syscon.txt vendor/device-tree/dist/Bindings/mfd/ti-keystone-devctrl.txt vendor/device-tree/dist/Bindings/mips/brcm/soc.txt vendor/device-tree/dist/Bindings/misc/brcm,kona-smc.txt vendor/device-tree/dist/Bindings/mmc/brcm,kona-sdhci.txt vendor/device-tree/dist/Bindings/mmc/brcm,sdhci-iproc.txt vendor/device-tree/dist/Bindings/mmc/mmc.txt vendor/device-tree/dist/Bindings/mmc/mtk-sd.txt vendor/device-tree/dist/Bindings/mmc/sdhci-fujitsu.txt vendor/device-tree/dist/Bindings/mmc/sdhci-msm.txt vendor/device-tree/dist/Bindings/mmc/sdhci-st.txt vendor/device-tree/dist/Bindings/mmc/sunxi-mmc.txt vendor/device-tree/dist/Bindings/mmc/ti-omap-hsmmc.txt vendor/device-tree/dist/Bindings/mmc/tmio_mmc.txt vendor/device-tree/dist/Bindings/mtd/cadence-quadspi.txt vendor/device-tree/dist/Bindings/mtd/denali-nand.txt vendor/device-tree/dist/Bindings/mtd/gpmc-nor.txt vendor/device-tree/dist/Bindings/mtd/jedec,spi-nor.txt vendor/device-tree/dist/Bindings/mtd/mtk-nand.txt vendor/device-tree/dist/Bindings/mtd/mtk-quadspi.txt vendor/device-tree/dist/Bindings/mtd/pxa3xx-nand.txt vendor/device-tree/dist/Bindings/mtd/sunxi-nand.txt vendor/device-tree/dist/Bindings/net/allwinner,sun4i-emac.txt vendor/device-tree/dist/Bindings/net/allwinner,sun4i-mdio.txt vendor/device-tree/dist/Bindings/net/allwinner,sun7i-a20-gmac.txt vendor/device-tree/dist/Bindings/net/altera_tse.txt vendor/device-tree/dist/Bindings/net/brcm,bcmgenet.txt vendor/device-tree/dist/Bindings/net/can/m_can.txt vendor/device-tree/dist/Bindings/net/can/sun4i_can.txt vendor/device-tree/dist/Bindings/net/dsa/lan9303.txt vendor/device-tree/dist/Bindings/net/fsl-fec.txt vendor/device-tree/dist/Bindings/net/mdio.txt vendor/device-tree/dist/Bindings/net/renesas,ravb.txt vendor/device-tree/dist/Bindings/net/sh_eth.txt vendor/device-tree/dist/Bindings/net/socfpga-dwmac.txt vendor/device-tree/dist/Bindings/net/stmmac.txt vendor/device-tree/dist/Bindings/net/wireless/brcm,bcm43xx-fmac.txt vendor/device-tree/dist/Bindings/nios2/nios2.txt vendor/device-tree/dist/Bindings/nvmem/allwinner,sunxi-sid.txt vendor/device-tree/dist/Bindings/nvmem/amlogic-efuse.txt vendor/device-tree/dist/Bindings/nvmem/brcm,ocotp.txt vendor/device-tree/dist/Bindings/nvmem/imx-ocotp.txt vendor/device-tree/dist/Bindings/nvmem/nvmem.txt vendor/device-tree/dist/Bindings/nvmem/qfprom.txt vendor/device-tree/dist/Bindings/nvmem/rockchip-efuse.txt vendor/device-tree/dist/Bindings/pci/altera-pcie.txt vendor/device-tree/dist/Bindings/pci/fsl,imx6q-pcie.txt vendor/device-tree/dist/Bindings/pci/hisilicon-pcie.txt vendor/device-tree/dist/Bindings/pci/layerscape-pci.txt vendor/device-tree/dist/Bindings/pci/nvidia,tegra20-pcie.txt vendor/device-tree/dist/Bindings/pci/pci-rcar-gen2.txt vendor/device-tree/dist/Bindings/pci/v3-v360epc-pci.txt vendor/device-tree/dist/Bindings/phy/brcm,cygnus-pcie-phy.txt vendor/device-tree/dist/Bindings/phy/brcm-sata-phy.txt vendor/device-tree/dist/Bindings/phy/mxs-usb-phy.txt vendor/device-tree/dist/Bindings/phy/rcar-gen2-phy.txt vendor/device-tree/dist/Bindings/phy/rcar-gen3-phy-usb2.txt vendor/device-tree/dist/Bindings/phy/sun4i-usb-phy.txt vendor/device-tree/dist/Bindings/phy/sun9i-usb-phy.txt vendor/device-tree/dist/Bindings/pinctrl/allwinner,sunxi-pinctrl.txt vendor/device-tree/dist/Bindings/pinctrl/brcm,cygnus-pinmux.txt vendor/device-tree/dist/Bindings/pinctrl/cortina,gemini-pinctrl.txt vendor/device-tree/dist/Bindings/pinctrl/fsl,imx-pinctrl.txt vendor/device-tree/dist/Bindings/pinctrl/img,tz1090-pdc-pinctrl.txt vendor/device-tree/dist/Bindings/pinctrl/img,tz1090-pinctrl.txt vendor/device-tree/dist/Bindings/pinctrl/marvell,armada-37xx-pinctrl.txt vendor/device-tree/dist/Bindings/pinctrl/nvidia,tegra124-xusb-padctl.txt vendor/device-tree/dist/Bindings/pinctrl/pinctrl-atlas7.txt vendor/device-tree/dist/Bindings/pinctrl/pinctrl-bindings.txt vendor/device-tree/dist/Bindings/pinctrl/pinctrl-mt65xx.txt vendor/device-tree/dist/Bindings/pinctrl/pinctrl-sirf.txt vendor/device-tree/dist/Bindings/pinctrl/pinctrl-st.txt vendor/device-tree/dist/Bindings/pinctrl/qcom,msm8996-pinctrl.txt vendor/device-tree/dist/Bindings/pinctrl/qcom,pmic-gpio.txt vendor/device-tree/dist/Bindings/pinctrl/renesas,rza1-pinctrl.txt vendor/device-tree/dist/Bindings/pinctrl/rockchip,pinctrl.txt vendor/device-tree/dist/Bindings/pinctrl/st,stm32-pinctrl.txt vendor/device-tree/dist/Bindings/power/fsl,imx-gpc.txt vendor/device-tree/dist/Bindings/power/renesas,apmu.txt vendor/device-tree/dist/Bindings/power/renesas,rcar-sysc.txt vendor/device-tree/dist/Bindings/power/reset/imx-snvs-poweroff.txt vendor/device-tree/dist/Bindings/power/reset/keystone-reset.txt vendor/device-tree/dist/Bindings/powerpc/fsl/mcu-mpc8349emitx.txt vendor/device-tree/dist/Bindings/pwm/pwm-sun4i.txt vendor/device-tree/dist/Bindings/pwm/renesas,pwm-rcar.txt vendor/device-tree/dist/Bindings/regulator/da9211.txt vendor/device-tree/dist/Bindings/regulator/max77686.txt vendor/device-tree/dist/Bindings/regulator/max77802.txt vendor/device-tree/dist/Bindings/regulator/pfuze100.txt vendor/device-tree/dist/Bindings/regulator/qcom,spmi-regulator.txt vendor/device-tree/dist/Bindings/regulator/regulator.txt vendor/device-tree/dist/Bindings/remoteproc/qcom,q6v5.txt vendor/device-tree/dist/Bindings/reset/allwinner,sunxi-clock-reset.txt vendor/device-tree/dist/Bindings/reset/fsl,imx-src.txt vendor/device-tree/dist/Bindings/reset/renesas,rst.txt vendor/device-tree/dist/Bindings/reset/ti-syscon-reset.txt vendor/device-tree/dist/Bindings/reset/uniphier-reset.txt vendor/device-tree/dist/Bindings/rng/brcm,iproc-rng200.txt vendor/device-tree/dist/Bindings/rtc/imxdi-rtc.txt vendor/device-tree/dist/Bindings/rtc/sun6i-rtc.txt vendor/device-tree/dist/Bindings/rtc/sunxi-rtc.txt vendor/device-tree/dist/Bindings/serial/atmel-usart.txt vendor/device-tree/dist/Bindings/serial/brcm,bcm6345-uart.txt vendor/device-tree/dist/Bindings/serial/efm32-uart.txt vendor/device-tree/dist/Bindings/serial/fsl-imx-uart.txt vendor/device-tree/dist/Bindings/serial/fsl-lpuart.txt vendor/device-tree/dist/Bindings/serial/mvebu-uart.txt vendor/device-tree/dist/Bindings/serial/omap_serial.txt vendor/device-tree/dist/Bindings/serial/st,stm32-usart.txt vendor/device-tree/dist/Bindings/serio/allwinner,sun4i-ps2.txt vendor/device-tree/dist/Bindings/soc/fsl/bman.txt vendor/device-tree/dist/Bindings/soc/fsl/cpm_qe/qe/par_io.txt vendor/device-tree/dist/Bindings/soc/fsl/cpm_qe/qe/pincfg.txt vendor/device-tree/dist/Bindings/soc/fsl/qman.txt vendor/device-tree/dist/Bindings/soc/mediatek/pwrap.txt vendor/device-tree/dist/Bindings/soc/qcom/qcom,glink.txt vendor/device-tree/dist/Bindings/soc/qcom/qcom,wcnss.txt vendor/device-tree/dist/Bindings/soc/ti/keystone-navigator-qmss.txt vendor/device-tree/dist/Bindings/soc/ti/sci-pm-domain.txt vendor/device-tree/dist/Bindings/sound/adi,axi-i2s.txt vendor/device-tree/dist/Bindings/sound/adi,axi-spdif-tx.txt vendor/device-tree/dist/Bindings/sound/ak4613.txt vendor/device-tree/dist/Bindings/sound/ak4642.txt vendor/device-tree/dist/Bindings/sound/audio-graph-card.txt vendor/device-tree/dist/Bindings/sound/audio-graph-scu-card.txt vendor/device-tree/dist/Bindings/sound/cdns,xtfpga-i2s.txt vendor/device-tree/dist/Bindings/sound/cs42l56.txt vendor/device-tree/dist/Bindings/sound/da7218.txt vendor/device-tree/dist/Bindings/sound/da7219.txt vendor/device-tree/dist/Bindings/sound/fsl,asrc.txt vendor/device-tree/dist/Bindings/sound/fsl,esai.txt vendor/device-tree/dist/Bindings/sound/fsl,spdif.txt vendor/device-tree/dist/Bindings/sound/imx-audmux.txt vendor/device-tree/dist/Bindings/sound/max98371.txt vendor/device-tree/dist/Bindings/sound/max9867.txt vendor/device-tree/dist/Bindings/sound/renesas,fsi.txt vendor/device-tree/dist/Bindings/sound/rockchip-spdif.txt vendor/device-tree/dist/Bindings/sound/rt5514.txt vendor/device-tree/dist/Bindings/sound/rt5663.txt vendor/device-tree/dist/Bindings/sound/samsung-i2s.txt vendor/device-tree/dist/Bindings/sound/sgtl5000.txt vendor/device-tree/dist/Bindings/sound/st,sti-asoc-card.txt vendor/device-tree/dist/Bindings/sound/st,stm32-sai.txt vendor/device-tree/dist/Bindings/sound/sun4i-codec.txt vendor/device-tree/dist/Bindings/sound/sun4i-i2s.txt vendor/device-tree/dist/Bindings/sound/sun8i-a33-codec.txt vendor/device-tree/dist/Bindings/sound/sun8i-codec-analog.txt vendor/device-tree/dist/Bindings/sound/sunxi,sun4i-spdif.txt vendor/device-tree/dist/Bindings/sound/zte,zx-spdif.txt vendor/device-tree/dist/Bindings/spi/efm32-spi.txt vendor/device-tree/dist/Bindings/spi/fsl-imx-cspi.txt vendor/device-tree/dist/Bindings/spi/sh-msiof.txt vendor/device-tree/dist/Bindings/spi/spi-davinci.txt vendor/device-tree/dist/Bindings/spi/spi-fsl-dspi.txt vendor/device-tree/dist/Bindings/spi/spi-rspi.txt vendor/device-tree/dist/Bindings/spi/spi-sun4i.txt vendor/device-tree/dist/Bindings/spi/spi-sun6i.txt vendor/device-tree/dist/Bindings/sram/samsung-sram.txt vendor/device-tree/dist/Bindings/sram/sunxi-sram.txt vendor/device-tree/dist/Bindings/thermal/hisilicon-thermal.txt vendor/device-tree/dist/Bindings/thermal/imx-thermal.txt vendor/device-tree/dist/Bindings/thermal/rockchip-thermal.txt vendor/device-tree/dist/Bindings/thermal/thermal.txt vendor/device-tree/dist/Bindings/timer/allwinner,sun5i-a13-hstimer.txt vendor/device-tree/dist/Bindings/timer/renesas,cmt.txt vendor/device-tree/dist/Bindings/trivial-devices.txt vendor/device-tree/dist/Bindings/ufs/ufs-qcom.txt vendor/device-tree/dist/Bindings/ufs/ufshcd-pltfrm.txt vendor/device-tree/dist/Bindings/usb/allwinner,sun4i-a10-musb.txt vendor/device-tree/dist/Bindings/usb/am33xx-usb.txt vendor/device-tree/dist/Bindings/usb/atmel-usb.txt vendor/device-tree/dist/Bindings/usb/dwc2.txt vendor/device-tree/dist/Bindings/usb/ehci-st.txt vendor/device-tree/dist/Bindings/usb/mediatek,mtk-xhci.txt vendor/device-tree/dist/Bindings/usb/mediatek,mtu3.txt vendor/device-tree/dist/Bindings/usb/ohci-da8xx.txt vendor/device-tree/dist/Bindings/usb/ohci-st.txt vendor/device-tree/dist/Bindings/usb/renesas_usb3.txt vendor/device-tree/dist/Bindings/usb/renesas_usbhs.txt vendor/device-tree/dist/Bindings/usb/usb-device.txt vendor/device-tree/dist/Bindings/usb/usb-ehci.txt vendor/device-tree/dist/Bindings/usb/usb-nop-xceiv.txt vendor/device-tree/dist/Bindings/usb/usb-ohci.txt vendor/device-tree/dist/Bindings/usb/usb-xhci.txt vendor/device-tree/dist/Bindings/usb/usb251xb.txt vendor/device-tree/dist/Bindings/usb/usb3503.txt vendor/device-tree/dist/Bindings/usb/usbmisc-imx.txt vendor/device-tree/dist/Bindings/vendor-prefixes.txt vendor/device-tree/dist/Bindings/watchdog/ingenic,jz4740-wdt.txt vendor/device-tree/dist/Bindings/watchdog/mtk-wdt.txt vendor/device-tree/dist/Bindings/watchdog/sunxi-wdt.txt vendor/device-tree/dist/include/dt-bindings/clock/exynos4.h vendor/device-tree/dist/include/dt-bindings/clock/gxbb-clkc.h vendor/device-tree/dist/include/dt-bindings/clock/imx7d-clock.h vendor/device-tree/dist/include/dt-bindings/clock/qcom,rpmcc.h vendor/device-tree/dist/include/dt-bindings/clock/r7s72100-clock.h vendor/device-tree/dist/include/dt-bindings/clock/rk3188-cru-common.h vendor/device-tree/dist/include/dt-bindings/clock/rk3368-cru.h vendor/device-tree/dist/include/dt-bindings/clock/s3c2443.h vendor/device-tree/dist/include/dt-bindings/clock/sun4i-a10-ccu.h vendor/device-tree/dist/include/dt-bindings/clock/sun6i-a31-ccu.h vendor/device-tree/dist/include/dt-bindings/clock/tegra210-car.h vendor/device-tree/dist/include/dt-bindings/gpio/gpio.h vendor/device-tree/dist/include/dt-bindings/gpio/meson-gxbb-gpio.h vendor/device-tree/dist/include/dt-bindings/gpio/meson-gxl-gpio.h vendor/device-tree/dist/include/dt-bindings/input/linux-event-codes.h vendor/device-tree/dist/include/dt-bindings/phy/phy.h vendor/device-tree/dist/include/dt-bindings/pinctrl/am43xx.h vendor/device-tree/dist/src/arc/axc003.dtsi vendor/device-tree/dist/src/arc/axc003_idu.dtsi vendor/device-tree/dist/src/arc/axs10x_mb.dtsi vendor/device-tree/dist/src/arc/hsdk.dts vendor/device-tree/dist/src/arm/am33xx.dtsi vendor/device-tree/dist/src/arm/am4372.dtsi vendor/device-tree/dist/src/arm/am437x-cm-t43.dts vendor/device-tree/dist/src/arm/am43x-epos-evm.dts vendor/device-tree/dist/src/arm/armada-370-synology-ds213j.dts vendor/device-tree/dist/src/arm/armada-385-db-ap.dts vendor/device-tree/dist/src/arm/armada-385-linksys.dtsi vendor/device-tree/dist/src/arm/armada-385-synology-ds116.dts vendor/device-tree/dist/src/arm/armada-388-gp.dts vendor/device-tree/dist/src/arm/armada-xp-synology-ds414.dts vendor/device-tree/dist/src/arm/artpec6.dtsi vendor/device-tree/dist/src/arm/aspeed-ast2500-evb.dts vendor/device-tree/dist/src/arm/aspeed-bmc-opp-palmetto.dts vendor/device-tree/dist/src/arm/aspeed-bmc-opp-romulus.dts vendor/device-tree/dist/src/arm/aspeed-g4.dtsi vendor/device-tree/dist/src/arm/aspeed-g5.dtsi vendor/device-tree/dist/src/arm/at91-ariag25.dts vendor/device-tree/dist/src/arm/at91-ariettag25.dts vendor/device-tree/dist/src/arm/at91-cosino_mega2560.dts vendor/device-tree/dist/src/arm/at91-kizbox2.dts vendor/device-tree/dist/src/arm/at91-kizboxmini.dts vendor/device-tree/dist/src/arm/at91-sama5d27_som1_ek.dts vendor/device-tree/dist/src/arm/at91-sama5d2_xplained.dts vendor/device-tree/dist/src/arm/at91-sama5d3_xplained.dts vendor/device-tree/dist/src/arm/at91-sama5d4_ma5d4evk.dts vendor/device-tree/dist/src/arm/at91-sama5d4_xplained.dts vendor/device-tree/dist/src/arm/at91-sama5d4ek.dts vendor/device-tree/dist/src/arm/at91-tse850-3.dts vendor/device-tree/dist/src/arm/at91-vinco.dts vendor/device-tree/dist/src/arm/at91rm9200.dtsi vendor/device-tree/dist/src/arm/at91rm9200ek.dts vendor/device-tree/dist/src/arm/at91sam9260.dtsi vendor/device-tree/dist/src/arm/at91sam9261.dtsi vendor/device-tree/dist/src/arm/at91sam9261ek.dts vendor/device-tree/dist/src/arm/at91sam9263.dtsi vendor/device-tree/dist/src/arm/at91sam9263ek.dts vendor/device-tree/dist/src/arm/at91sam9g20.dtsi vendor/device-tree/dist/src/arm/at91sam9g45.dtsi vendor/device-tree/dist/src/arm/at91sam9m10g45ek.dts vendor/device-tree/dist/src/arm/at91sam9n12.dtsi vendor/device-tree/dist/src/arm/at91sam9n12ek.dts vendor/device-tree/dist/src/arm/at91sam9rl.dtsi vendor/device-tree/dist/src/arm/at91sam9rlek.dts vendor/device-tree/dist/src/arm/at91sam9x25ek.dts vendor/device-tree/dist/src/arm/at91sam9x5.dtsi vendor/device-tree/dist/src/arm/at91sam9x5ek.dtsi vendor/device-tree/dist/src/arm/at91sam9xe.dtsi vendor/device-tree/dist/src/arm/axp209.dtsi vendor/device-tree/dist/src/arm/bcm-cygnus.dtsi vendor/device-tree/dist/src/arm/bcm-nsp.dtsi vendor/device-tree/dist/src/arm/bcm2837-rpi-3-b.dts vendor/device-tree/dist/src/arm/bcm283x.dtsi vendor/device-tree/dist/src/arm/bcm47081-luxul-xwr-1200.dts vendor/device-tree/dist/src/arm/bcm5301x.dtsi vendor/device-tree/dist/src/arm/bcm53573.dtsi vendor/device-tree/dist/src/arm/bcm958623hr.dts vendor/device-tree/dist/src/arm/bcm958625hr.dts vendor/device-tree/dist/src/arm/berlin2.dtsi vendor/device-tree/dist/src/arm/berlin2cd.dtsi vendor/device-tree/dist/src/arm/berlin2q.dtsi vendor/device-tree/dist/src/arm/da850-lcdk.dts vendor/device-tree/dist/src/arm/da850-lego-ev3.dts vendor/device-tree/dist/src/arm/da850.dtsi vendor/device-tree/dist/src/arm/dm814x.dtsi vendor/device-tree/dist/src/arm/dove.dtsi vendor/device-tree/dist/src/arm/dra7-evm-common.dtsi vendor/device-tree/dist/src/arm/dra7-evm.dts vendor/device-tree/dist/src/arm/dra7.dtsi vendor/device-tree/dist/src/arm/ep7211-edb7211.dts vendor/device-tree/dist/src/arm/exynos3250-artik5.dtsi vendor/device-tree/dist/src/arm/exynos3250-monk.dts vendor/device-tree/dist/src/arm/exynos3250-rinato.dts vendor/device-tree/dist/src/arm/exynos3250.dtsi vendor/device-tree/dist/src/arm/exynos4.dtsi vendor/device-tree/dist/src/arm/exynos4210-pinctrl.dtsi vendor/device-tree/dist/src/arm/exynos4210-universal_c210.dts vendor/device-tree/dist/src/arm/exynos4210.dtsi vendor/device-tree/dist/src/arm/exynos4412-itop-scp-core.dtsi vendor/device-tree/dist/src/arm/exynos4412-odroid-common.dtsi vendor/device-tree/dist/src/arm/exynos4412-odroidx.dts vendor/device-tree/dist/src/arm/exynos4412-origen.dts vendor/device-tree/dist/src/arm/exynos4412-pinctrl.dtsi vendor/device-tree/dist/src/arm/exynos4412-trats2.dts vendor/device-tree/dist/src/arm/exynos4412.dtsi vendor/device-tree/dist/src/arm/exynos5250-arndale.dts vendor/device-tree/dist/src/arm/exynos5250-smdk5250.dts vendor/device-tree/dist/src/arm/exynos5250-snow-common.dtsi vendor/device-tree/dist/src/arm/exynos5250-spring.dts vendor/device-tree/dist/src/arm/exynos5250.dtsi vendor/device-tree/dist/src/arm/exynos5410-odroidxu.dts vendor/device-tree/dist/src/arm/exynos5410-smdk5410.dts vendor/device-tree/dist/src/arm/exynos5410.dtsi vendor/device-tree/dist/src/arm/exynos5420-arndale-octa.dts vendor/device-tree/dist/src/arm/exynos5420-cpus.dtsi vendor/device-tree/dist/src/arm/exynos5420-peach-pit.dts vendor/device-tree/dist/src/arm/exynos5420-smdk5420.dts vendor/device-tree/dist/src/arm/exynos5420.dtsi vendor/device-tree/dist/src/arm/exynos5422-cpus.dtsi vendor/device-tree/dist/src/arm/exynos5422-odroidxu3-audio.dtsi vendor/device-tree/dist/src/arm/exynos5422-odroidxu3-common.dtsi vendor/device-tree/dist/src/arm/exynos5440-ssdk5440.dts vendor/device-tree/dist/src/arm/exynos5440.dtsi vendor/device-tree/dist/src/arm/exynos54xx.dtsi vendor/device-tree/dist/src/arm/exynos5800-peach-pi.dts vendor/device-tree/dist/src/arm/ge863-pro3.dtsi vendor/device-tree/dist/src/arm/gemini.dtsi vendor/device-tree/dist/src/arm/hip01.dtsi vendor/device-tree/dist/src/arm/hip04-d01.dts vendor/device-tree/dist/src/arm/hisi-x5hd2.dtsi vendor/device-tree/dist/src/arm/imx1.dtsi vendor/device-tree/dist/src/arm/imx25-eukrea-mbimxsd25-baseboard.dts vendor/device-tree/dist/src/arm/imx25-pdk.dts vendor/device-tree/dist/src/arm/imx28-apx4devkit.dts vendor/device-tree/dist/src/arm/imx28-eukrea-mbmx28lc.dtsi vendor/device-tree/dist/src/arm/imx28-evk.dts vendor/device-tree/dist/src/arm/imx28-m28evk.dts vendor/device-tree/dist/src/arm/imx28-tx28.dts vendor/device-tree/dist/src/arm/imx35-eukrea-mbimxsd35-baseboard.dts vendor/device-tree/dist/src/arm/imx50.dtsi vendor/device-tree/dist/src/arm/imx51-apf51dev.dts vendor/device-tree/dist/src/arm/imx51-babbage.dts vendor/device-tree/dist/src/arm/imx51-ts4800.dts vendor/device-tree/dist/src/arm/imx51.dtsi vendor/device-tree/dist/src/arm/imx53-m53evk.dts vendor/device-tree/dist/src/arm/imx53-mba53.dts vendor/device-tree/dist/src/arm/imx53-qsb-common.dtsi vendor/device-tree/dist/src/arm/imx53-smd.dts vendor/device-tree/dist/src/arm/imx53-tx53-x03x.dts vendor/device-tree/dist/src/arm/imx53-tx53-x13x.dts vendor/device-tree/dist/src/arm/imx53-tx53.dtsi vendor/device-tree/dist/src/arm/imx53-voipac-bsb.dts vendor/device-tree/dist/src/arm/imx53.dtsi vendor/device-tree/dist/src/arm/imx6dl-aristainetos2_4.dts vendor/device-tree/dist/src/arm/imx6dl-aristainetos_4.dts vendor/device-tree/dist/src/arm/imx6dl-aristainetos_7.dts vendor/device-tree/dist/src/arm/imx6dl-colibri-eval-v3.dts vendor/device-tree/dist/src/arm/imx6dl-icore.dts vendor/device-tree/dist/src/arm/imx6dl-riotboard.dts vendor/device-tree/dist/src/arm/imx6dl-tx6dl-comtft.dts vendor/device-tree/dist/src/arm/imx6dl-tx6s-8034.dts vendor/device-tree/dist/src/arm/imx6dl-tx6s-8035.dts vendor/device-tree/dist/src/arm/imx6dl-tx6u-801x.dts vendor/device-tree/dist/src/arm/imx6dl-tx6u-8033.dts vendor/device-tree/dist/src/arm/imx6dl-tx6u-811x.dts vendor/device-tree/dist/src/arm/imx6dl-tx6u-81xx-mb7.dts vendor/device-tree/dist/src/arm/imx6dl.dtsi vendor/device-tree/dist/src/arm/imx6q-apalis-eval.dts vendor/device-tree/dist/src/arm/imx6q-apalis-ixora-v1.1.dts vendor/device-tree/dist/src/arm/imx6q-apalis-ixora.dts vendor/device-tree/dist/src/arm/imx6q-bx50v3.dtsi vendor/device-tree/dist/src/arm/imx6q-cm-fx6.dts vendor/device-tree/dist/src/arm/imx6q-dmo-edmqmx6.dts vendor/device-tree/dist/src/arm/imx6q-gw5400-a.dts vendor/device-tree/dist/src/arm/imx6q-h100.dts vendor/device-tree/dist/src/arm/imx6q-icore-rqs.dts vendor/device-tree/dist/src/arm/imx6q-mccmon6.dts vendor/device-tree/dist/src/arm/imx6q-novena.dts vendor/device-tree/dist/src/arm/imx6q-tbs2910.dts vendor/device-tree/dist/src/arm/imx6q-tx6q-1010-comtft.dts vendor/device-tree/dist/src/arm/imx6q-tx6q-1010.dts vendor/device-tree/dist/src/arm/imx6q-tx6q-1020-comtft.dts vendor/device-tree/dist/src/arm/imx6q-tx6q-1020.dts vendor/device-tree/dist/src/arm/imx6q-tx6q-1036.dts vendor/device-tree/dist/src/arm/imx6q-tx6q-1110.dts vendor/device-tree/dist/src/arm/imx6q-tx6q-11x0-mb7.dts vendor/device-tree/dist/src/arm/imx6q-utilite-pro.dts vendor/device-tree/dist/src/arm/imx6q.dtsi vendor/device-tree/dist/src/arm/imx6qdl-apalis.dtsi vendor/device-tree/dist/src/arm/imx6qdl-apf6dev.dtsi vendor/device-tree/dist/src/arm/imx6qdl-colibri.dtsi vendor/device-tree/dist/src/arm/imx6qdl-gw51xx.dtsi vendor/device-tree/dist/src/arm/imx6qdl-gw52xx.dtsi vendor/device-tree/dist/src/arm/imx6qdl-gw53xx.dtsi vendor/device-tree/dist/src/arm/imx6qdl-gw54xx.dtsi vendor/device-tree/dist/src/arm/imx6qdl-gw551x.dtsi vendor/device-tree/dist/src/arm/imx6qdl-gw552x.dtsi vendor/device-tree/dist/src/arm/imx6qdl-hummingboard.dtsi vendor/device-tree/dist/src/arm/imx6qdl-icore-rqs.dtsi vendor/device-tree/dist/src/arm/imx6qdl-icore.dtsi vendor/device-tree/dist/src/arm/imx6qdl-nit6xlite.dtsi vendor/device-tree/dist/src/arm/imx6qdl-nitrogen6_max.dtsi vendor/device-tree/dist/src/arm/imx6qdl-nitrogen6_som2.dtsi vendor/device-tree/dist/src/arm/imx6qdl-nitrogen6x.dtsi vendor/device-tree/dist/src/arm/imx6qdl-rex.dtsi vendor/device-tree/dist/src/arm/imx6qdl-sabreauto.dtsi vendor/device-tree/dist/src/arm/imx6qdl-sabrelite.dtsi vendor/device-tree/dist/src/arm/imx6qdl-sabresd.dtsi vendor/device-tree/dist/src/arm/imx6qdl-tx6.dtsi vendor/device-tree/dist/src/arm/imx6qdl-wandboard.dtsi vendor/device-tree/dist/src/arm/imx6qdl-zii-rdu2.dtsi vendor/device-tree/dist/src/arm/imx6qdl.dtsi vendor/device-tree/dist/src/arm/imx6qp.dtsi vendor/device-tree/dist/src/arm/imx6sl-evk.dts vendor/device-tree/dist/src/arm/imx6sl.dtsi vendor/device-tree/dist/src/arm/imx6sx-nitrogen6sx.dts vendor/device-tree/dist/src/arm/imx6sx-sdb-reva.dts vendor/device-tree/dist/src/arm/imx6sx-sdb.dts vendor/device-tree/dist/src/arm/imx6sx-udoo-neo.dtsi vendor/device-tree/dist/src/arm/imx6sx.dtsi vendor/device-tree/dist/src/arm/imx6ul-14x14-evk.dts vendor/device-tree/dist/src/arm/imx6ul-pico-hobbit.dts vendor/device-tree/dist/src/arm/imx6ul-tx6ul-mainboard.dts vendor/device-tree/dist/src/arm/imx6ul-tx6ul.dtsi vendor/device-tree/dist/src/arm/imx6ul.dtsi vendor/device-tree/dist/src/arm/imx7-colibri.dtsi vendor/device-tree/dist/src/arm/imx7d-nitrogen7.dts vendor/device-tree/dist/src/arm/imx7d-pico.dts vendor/device-tree/dist/src/arm/imx7d-sdb.dts vendor/device-tree/dist/src/arm/imx7s-warp.dts vendor/device-tree/dist/src/arm/integrator.dtsi vendor/device-tree/dist/src/arm/integratorap.dts vendor/device-tree/dist/src/arm/keystone-k2e.dtsi vendor/device-tree/dist/src/arm/keystone-k2g-evm.dts vendor/device-tree/dist/src/arm/keystone-k2g.dtsi vendor/device-tree/dist/src/arm/keystone-k2hk.dtsi vendor/device-tree/dist/src/arm/keystone-k2l.dtsi vendor/device-tree/dist/src/arm/keystone.dtsi vendor/device-tree/dist/src/arm/kirkwood-openblocks_a7.dts vendor/device-tree/dist/src/arm/kirkwood-synology.dtsi vendor/device-tree/dist/src/arm/kirkwood-ts219.dtsi vendor/device-tree/dist/src/arm/kirkwood.dtsi vendor/device-tree/dist/src/arm/logicpd-som-lv-37xx-devkit.dts vendor/device-tree/dist/src/arm/logicpd-som-lv.dtsi vendor/device-tree/dist/src/arm/lpc3250-ea3250.dts vendor/device-tree/dist/src/arm/lpc3250-phy3250.dts vendor/device-tree/dist/src/arm/lpc32xx.dtsi vendor/device-tree/dist/src/arm/ls1021a-qds.dts vendor/device-tree/dist/src/arm/ls1021a-twr.dts vendor/device-tree/dist/src/arm/meson.dtsi vendor/device-tree/dist/src/arm/meson6.dtsi vendor/device-tree/dist/src/arm/meson8.dtsi vendor/device-tree/dist/src/arm/meson8b-odroidc1.dts vendor/device-tree/dist/src/arm/meson8b.dtsi vendor/device-tree/dist/src/arm/mpa1600.dts vendor/device-tree/dist/src/arm/mt2701-evb.dts vendor/device-tree/dist/src/arm/mt2701.dtsi vendor/device-tree/dist/src/arm/mt6589.dtsi vendor/device-tree/dist/src/arm/mt7623.dtsi vendor/device-tree/dist/src/arm/nspire.dtsi vendor/device-tree/dist/src/arm/omap2420-n8x0-common.dtsi vendor/device-tree/dist/src/arm/omap3-beagle-xm.dts vendor/device-tree/dist/src/arm/omap3-beagle.dts vendor/device-tree/dist/src/arm/omap3-cm-t3x.dtsi vendor/device-tree/dist/src/arm/omap3-evm-37xx.dts vendor/device-tree/dist/src/arm/omap3-evm-common.dtsi vendor/device-tree/dist/src/arm/omap3-evm.dts vendor/device-tree/dist/src/arm/omap3-gta04.dtsi vendor/device-tree/dist/src/arm/omap3-igep0020-common.dtsi vendor/device-tree/dist/src/arm/omap3-igep0030-common.dtsi vendor/device-tree/dist/src/arm/omap3-lilly-a83x.dtsi vendor/device-tree/dist/src/arm/omap3-n9.dts vendor/device-tree/dist/src/arm/omap3-n900.dts vendor/device-tree/dist/src/arm/omap3-n950-n9.dtsi vendor/device-tree/dist/src/arm/omap3-n950.dts vendor/device-tree/dist/src/arm/omap3-overo-base.dtsi vendor/device-tree/dist/src/arm/omap3-pandora-common.dtsi vendor/device-tree/dist/src/arm/omap3-panel-sharp-ls037v7dw01.dtsi vendor/device-tree/dist/src/arm/omap3-tao3530.dtsi vendor/device-tree/dist/src/arm/omap3.dtsi vendor/device-tree/dist/src/arm/omap4-droid4-xt894.dts vendor/device-tree/dist/src/arm/omap4-duovero.dtsi vendor/device-tree/dist/src/arm/omap4-panda-common.dtsi vendor/device-tree/dist/src/arm/omap4-var-som-om44.dtsi vendor/device-tree/dist/src/arm/omap4.dtsi vendor/device-tree/dist/src/arm/omap5-board-common.dtsi vendor/device-tree/dist/src/arm/omap5-cm-t54.dts vendor/device-tree/dist/src/arm/omap5.dtsi vendor/device-tree/dist/src/arm/owl-s500-guitar-bb-rev-b.dts vendor/device-tree/dist/src/arm/owl-s500.dtsi vendor/device-tree/dist/src/arm/ox810se.dtsi vendor/device-tree/dist/src/arm/ox820.dtsi vendor/device-tree/dist/src/arm/picoxcell-pc3x2.dtsi vendor/device-tree/dist/src/arm/picoxcell-pc3x3.dtsi vendor/device-tree/dist/src/arm/pm9g45.dts vendor/device-tree/dist/src/arm/qcom-apq8060-dragonboard.dts vendor/device-tree/dist/src/arm/qcom-apq8064.dtsi vendor/device-tree/dist/src/arm/qcom-msm8660.dtsi vendor/device-tree/dist/src/arm/qcom-msm8974.dtsi vendor/device-tree/dist/src/arm/r7s72100-gr-peach.dts vendor/device-tree/dist/src/arm/r7s72100.dtsi vendor/device-tree/dist/src/arm/r8a73a4.dtsi vendor/device-tree/dist/src/arm/r8a7743-iwg20d-q7.dts vendor/device-tree/dist/src/arm/r8a7743-iwg20m.dtsi vendor/device-tree/dist/src/arm/r8a7743.dtsi vendor/device-tree/dist/src/arm/r8a7745.dtsi vendor/device-tree/dist/src/arm/r8a7778.dtsi vendor/device-tree/dist/src/arm/r8a7779.dtsi vendor/device-tree/dist/src/arm/r8a7790-lager.dts vendor/device-tree/dist/src/arm/r8a7790.dtsi vendor/device-tree/dist/src/arm/r8a7791-koelsch.dts vendor/device-tree/dist/src/arm/r8a7791-porter.dts vendor/device-tree/dist/src/arm/r8a7791.dtsi vendor/device-tree/dist/src/arm/r8a7792-blanche.dts vendor/device-tree/dist/src/arm/r8a7792-wheat.dts vendor/device-tree/dist/src/arm/r8a7792.dtsi vendor/device-tree/dist/src/arm/r8a7793-gose.dts vendor/device-tree/dist/src/arm/r8a7793.dtsi vendor/device-tree/dist/src/arm/r8a7794-alt.dts vendor/device-tree/dist/src/arm/r8a7794-silk.dts vendor/device-tree/dist/src/arm/r8a7794.dtsi vendor/device-tree/dist/src/arm/rk3036-kylin.dts vendor/device-tree/dist/src/arm/rk3036.dtsi vendor/device-tree/dist/src/arm/rk3066a-marsboard.dts vendor/device-tree/dist/src/arm/rk3066a-rayeager.dts vendor/device-tree/dist/src/arm/rk3066a.dtsi vendor/device-tree/dist/src/arm/rk3188-radxarock.dts vendor/device-tree/dist/src/arm/rk3188.dtsi vendor/device-tree/dist/src/arm/rk322x.dtsi vendor/device-tree/dist/src/arm/rk3288-firefly-reload-core.dtsi vendor/device-tree/dist/src/arm/rk3288-firefly-reload.dts vendor/device-tree/dist/src/arm/rk3288-popmetal.dts vendor/device-tree/dist/src/arm/rk3288.dtsi vendor/device-tree/dist/src/arm/rk3xxx.dtsi vendor/device-tree/dist/src/arm/rv1108-evb.dts vendor/device-tree/dist/src/arm/rv1108.dtsi vendor/device-tree/dist/src/arm/sama5d2.dtsi vendor/device-tree/dist/src/arm/sama5d3.dtsi vendor/device-tree/dist/src/arm/sama5d3xmb.dtsi vendor/device-tree/dist/src/arm/sama5d3xmb_cmp.dtsi vendor/device-tree/dist/src/arm/sama5d4.dtsi vendor/device-tree/dist/src/arm/sh73a0.dtsi vendor/device-tree/dist/src/arm/ste-href-stuib.dtsi vendor/device-tree/dist/src/arm/ste-href-tvk1281618.dtsi vendor/device-tree/dist/src/arm/stih407-clock.dtsi vendor/device-tree/dist/src/arm/stih407-family.dtsi vendor/device-tree/dist/src/arm/stih407-pinctrl.dtsi vendor/device-tree/dist/src/arm/stih410-b2120.dts vendor/device-tree/dist/src/arm/stih410-b2260.dts vendor/device-tree/dist/src/arm/stih410-clock.dtsi vendor/device-tree/dist/src/arm/stih410.dtsi vendor/device-tree/dist/src/arm/stih418-b2199.dts vendor/device-tree/dist/src/arm/stih418-clock.dtsi vendor/device-tree/dist/src/arm/stih418.dtsi vendor/device-tree/dist/src/arm/stihxxx-b2120.dtsi vendor/device-tree/dist/src/arm/stm32746g-eval.dts vendor/device-tree/dist/src/arm/stm32f4-pinctrl.dtsi vendor/device-tree/dist/src/arm/stm32f429.dtsi vendor/device-tree/dist/src/arm/stm32f746-disco.dts vendor/device-tree/dist/src/arm/stm32f746.dtsi vendor/device-tree/dist/src/arm/stm32h743-pinctrl.dtsi vendor/device-tree/dist/src/arm/stm32h743.dtsi vendor/device-tree/dist/src/arm/stm32h743i-eval.dts vendor/device-tree/dist/src/arm/sun4i-a10-a1000.dts vendor/device-tree/dist/src/arm/sun4i-a10-ba10-tvbox.dts vendor/device-tree/dist/src/arm/sun4i-a10-chuwi-v7-cw0825.dts vendor/device-tree/dist/src/arm/sun4i-a10-cubieboard.dts vendor/device-tree/dist/src/arm/sun4i-a10-dserve-dsrv9703c.dts vendor/device-tree/dist/src/arm/sun4i-a10-gemei-g9.dts vendor/device-tree/dist/src/arm/sun4i-a10-hackberry.dts vendor/device-tree/dist/src/arm/sun4i-a10-hyundai-a7hd.dts vendor/device-tree/dist/src/arm/sun4i-a10-inet1.dts vendor/device-tree/dist/src/arm/sun4i-a10-inet97fv2.dts vendor/device-tree/dist/src/arm/sun4i-a10-inet9f-rev03.dts vendor/device-tree/dist/src/arm/sun4i-a10-itead-iteaduino-plus.dts vendor/device-tree/dist/src/arm/sun4i-a10-jesurun-q5.dts vendor/device-tree/dist/src/arm/sun4i-a10-marsboard.dts vendor/device-tree/dist/src/arm/sun4i-a10-mini-xplus.dts vendor/device-tree/dist/src/arm/sun4i-a10-mk802.dts vendor/device-tree/dist/src/arm/sun4i-a10-mk802ii.dts vendor/device-tree/dist/src/arm/sun4i-a10-olinuxino-lime.dts vendor/device-tree/dist/src/arm/sun4i-a10-pcduino.dts vendor/device-tree/dist/src/arm/sun4i-a10-pcduino2.dts vendor/device-tree/dist/src/arm/sun4i-a10-pov-protab2-ips9.dts vendor/device-tree/dist/src/arm/sun4i-a10.dtsi vendor/device-tree/dist/src/arm/sun5i-a10s.dtsi vendor/device-tree/dist/src/arm/sun5i-a13.dtsi vendor/device-tree/dist/src/arm/sun5i-gr8.dtsi vendor/device-tree/dist/src/arm/sun5i-reference-design-tablet.dtsi vendor/device-tree/dist/src/arm/sun5i.dtsi vendor/device-tree/dist/src/arm/sun6i-a31-hummingbird.dts vendor/device-tree/dist/src/arm/sun6i-a31.dtsi vendor/device-tree/dist/src/arm/sun6i-a31s-primo81.dts vendor/device-tree/dist/src/arm/sun6i-a31s-sina31s.dts vendor/device-tree/dist/src/arm/sun7i-a20-bananapi-m1-plus.dts vendor/device-tree/dist/src/arm/sun7i-a20-cubieboard2.dts vendor/device-tree/dist/src/arm/sun7i-a20-cubietruck.dts vendor/device-tree/dist/src/arm/sun7i-a20-lamobo-r1.dts vendor/device-tree/dist/src/arm/sun7i-a20-olinuxino-lime.dts vendor/device-tree/dist/src/arm/sun7i-a20-olinuxino-lime2.dts vendor/device-tree/dist/src/arm/sun7i-a20-olinuxino-micro.dts vendor/device-tree/dist/src/arm/sun7i-a20.dtsi vendor/device-tree/dist/src/arm/sun8i-a23-a33.dtsi vendor/device-tree/dist/src/arm/sun8i-a23.dtsi vendor/device-tree/dist/src/arm/sun8i-a33.dtsi vendor/device-tree/dist/src/arm/sun8i-a83t-allwinner-h8homlet-v2.dts vendor/device-tree/dist/src/arm/sun8i-a83t-bananapi-m3.dts vendor/device-tree/dist/src/arm/sun8i-a83t-cubietruck-plus.dts vendor/device-tree/dist/src/arm/sun8i-a83t.dtsi vendor/device-tree/dist/src/arm/sun8i-h2-plus-orangepi-zero.dts vendor/device-tree/dist/src/arm/sun8i-h3-bananapi-m2-plus.dts vendor/device-tree/dist/src/arm/sun8i-h3-nanopi-m1-plus.dts vendor/device-tree/dist/src/arm/sun8i-h3-nanopi-m1.dts vendor/device-tree/dist/src/arm/sun8i-h3-nanopi-neo.dts vendor/device-tree/dist/src/arm/sun8i-h3-nanopi.dtsi vendor/device-tree/dist/src/arm/sun8i-h3-orangepi-2.dts vendor/device-tree/dist/src/arm/sun8i-h3-orangepi-lite.dts vendor/device-tree/dist/src/arm/sun8i-h3-orangepi-one.dts vendor/device-tree/dist/src/arm/sun8i-h3-orangepi-pc-plus.dts vendor/device-tree/dist/src/arm/sun8i-h3-orangepi-pc.dts vendor/device-tree/dist/src/arm/sun8i-h3-orangepi-plus.dts vendor/device-tree/dist/src/arm/sun8i-h3-orangepi-plus2e.dts vendor/device-tree/dist/src/arm/sun8i-v3s.dtsi vendor/device-tree/dist/src/arm/sun9i-a80-cubieboard4.dts vendor/device-tree/dist/src/arm/sun9i-a80-optimus.dts vendor/device-tree/dist/src/arm/sun9i-a80.dtsi vendor/device-tree/dist/src/arm/sunxi-h3-h5.dtsi vendor/device-tree/dist/src/arm/sunxi-itead-core-common.dtsi vendor/device-tree/dist/src/arm/tango4-common.dtsi vendor/device-tree/dist/src/arm/tegra124-jetson-tk1.dts vendor/device-tree/dist/src/arm/tegra124.dtsi vendor/device-tree/dist/src/arm/uniphier-ld4-ref.dts vendor/device-tree/dist/src/arm/uniphier-ld4.dtsi vendor/device-tree/dist/src/arm/uniphier-ld6b-ref.dts vendor/device-tree/dist/src/arm/uniphier-pinctrl.dtsi vendor/device-tree/dist/src/arm/uniphier-pro4-ref.dts vendor/device-tree/dist/src/arm/uniphier-pro4.dtsi vendor/device-tree/dist/src/arm/uniphier-pro5.dtsi vendor/device-tree/dist/src/arm/uniphier-pxs2.dtsi vendor/device-tree/dist/src/arm/uniphier-sld8-ref.dts vendor/device-tree/dist/src/arm/uniphier-sld8.dtsi vendor/device-tree/dist/src/arm/uniphier-support-card.dtsi vendor/device-tree/dist/src/arm/usb_a9263.dts vendor/device-tree/dist/src/arm/usb_a9g20_common.dtsi vendor/device-tree/dist/src/arm/vf610-twr.dts vendor/device-tree/dist/src/arm/vf610-zii-dev-rev-c.dts vendor/device-tree/dist/src/arm/zx296702.dtsi vendor/device-tree/dist/src/arm/zynq-zc702.dts vendor/device-tree/dist/src/arm/zynq-zc706.dts vendor/device-tree/dist/src/arm64/actions/s900-bubblegum-96.dts vendor/device-tree/dist/src/arm64/allwinner/sun50i-a64-bananapi-m64.dts vendor/device-tree/dist/src/arm64/allwinner/sun50i-a64-pine64-plus.dts vendor/device-tree/dist/src/arm64/allwinner/sun50i-a64-pine64.dts vendor/device-tree/dist/src/arm64/allwinner/sun50i-a64-sopine-baseboard.dts vendor/device-tree/dist/src/arm64/allwinner/sun50i-a64-sopine.dtsi vendor/device-tree/dist/src/arm64/allwinner/sun50i-a64.dtsi vendor/device-tree/dist/src/arm64/allwinner/sun50i-h5-nanopi-neo2.dts vendor/device-tree/dist/src/arm64/allwinner/sun50i-h5-orangepi-pc2.dts vendor/device-tree/dist/src/arm64/allwinner/sun50i-h5-orangepi-prime.dts vendor/device-tree/dist/src/arm64/allwinner/sun50i-h5-orangepi-zero-plus2.dts vendor/device-tree/dist/src/arm64/altera/socfpga_stratix10.dtsi vendor/device-tree/dist/src/arm64/altera/socfpga_stratix10_socdk.dts vendor/device-tree/dist/src/arm64/amlogic/meson-gx-p23x-q20x.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-gx.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-gxbb-nanopi-k2.dts vendor/device-tree/dist/src/arm64/amlogic/meson-gxbb-nexbox-a95x.dts vendor/device-tree/dist/src/arm64/amlogic/meson-gxbb-odroidc2.dts vendor/device-tree/dist/src/arm64/amlogic/meson-gxbb-p200.dts vendor/device-tree/dist/src/arm64/amlogic/meson-gxbb-p20x.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-gxbb-vega-s95.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-gxbb.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-gxl-s905d-p230.dts vendor/device-tree/dist/src/arm64/amlogic/meson-gxl-s905x-hwacom-amazetv.dts vendor/device-tree/dist/src/arm64/amlogic/meson-gxl-s905x-khadas-vim.dts vendor/device-tree/dist/src/arm64/amlogic/meson-gxl-s905x-libretech-cc.dts vendor/device-tree/dist/src/arm64/amlogic/meson-gxl-s905x-nexbox-a95x.dts vendor/device-tree/dist/src/arm64/amlogic/meson-gxl-s905x-p212.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-gxl.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-gxm-nexbox-a1.dts vendor/device-tree/dist/src/arm64/amlogic/meson-gxm-q200.dts vendor/device-tree/dist/src/arm64/amlogic/meson-gxm-rbox-pro.dts vendor/device-tree/dist/src/arm64/apm/apm-shadowcat.dtsi vendor/device-tree/dist/src/arm64/apm/apm-storm.dtsi vendor/device-tree/dist/src/arm64/arm/foundation-v8-gicv3.dts vendor/device-tree/dist/src/arm64/arm/foundation-v8.dts vendor/device-tree/dist/src/arm64/arm/foundation-v8.dtsi vendor/device-tree/dist/src/arm64/arm/rtsm_ve-aemv8a.dts vendor/device-tree/dist/src/arm64/arm/rtsm_ve-motherboard.dtsi vendor/device-tree/dist/src/arm64/arm/vexpress-v2f-1xv7-ca53x2.dts vendor/device-tree/dist/src/arm64/broadcom/northstar2/ns2-xmc.dts vendor/device-tree/dist/src/arm64/broadcom/northstar2/ns2.dtsi vendor/device-tree/dist/src/arm64/broadcom/stingray/stingray-clock.dtsi vendor/device-tree/dist/src/arm64/broadcom/stingray/stingray-fs4.dtsi vendor/device-tree/dist/src/arm64/broadcom/stingray/stingray-pinctrl.dtsi vendor/device-tree/dist/src/arm64/broadcom/stingray/stingray-sata.dtsi vendor/device-tree/dist/src/arm64/broadcom/stingray/stingray.dtsi vendor/device-tree/dist/src/arm64/cavium/thunder-88xx.dts vendor/device-tree/dist/src/arm64/cavium/thunder-88xx.dtsi vendor/device-tree/dist/src/arm64/freescale/fsl-ls1012a-qds.dts vendor/device-tree/dist/src/arm64/freescale/fsl-ls1012a.dtsi vendor/device-tree/dist/src/arm64/freescale/fsl-ls1043a.dtsi vendor/device-tree/dist/src/arm64/freescale/fsl-ls1046a.dtsi vendor/device-tree/dist/src/arm64/freescale/fsl-ls1088a.dtsi vendor/device-tree/dist/src/arm64/freescale/fsl-ls2088a.dtsi vendor/device-tree/dist/src/arm64/freescale/fsl-ls208xa.dtsi vendor/device-tree/dist/src/arm64/hisilicon/hi3660-hikey960.dts vendor/device-tree/dist/src/arm64/hisilicon/hi3660.dtsi vendor/device-tree/dist/src/arm64/hisilicon/hi3798cv200-poplar.dts vendor/device-tree/dist/src/arm64/hisilicon/hi6220.dtsi vendor/device-tree/dist/src/arm64/hisilicon/hip05-d02.dts vendor/device-tree/dist/src/arm64/hisilicon/hip06-d03.dts vendor/device-tree/dist/src/arm64/marvell/armada-3720-db.dts vendor/device-tree/dist/src/arm64/marvell/armada-3720-espressobin.dts vendor/device-tree/dist/src/arm64/marvell/armada-37xx.dtsi vendor/device-tree/dist/src/arm64/marvell/armada-7040-db.dts vendor/device-tree/dist/src/arm64/marvell/armada-70x0.dtsi vendor/device-tree/dist/src/arm64/marvell/armada-8040-db.dts vendor/device-tree/dist/src/arm64/marvell/armada-8040-mcbin.dts vendor/device-tree/dist/src/arm64/marvell/armada-8080-db.dts vendor/device-tree/dist/src/arm64/marvell/armada-ap806-dual.dtsi vendor/device-tree/dist/src/arm64/marvell/armada-ap806-quad.dtsi vendor/device-tree/dist/src/arm64/marvell/armada-ap806.dtsi vendor/device-tree/dist/src/arm64/marvell/armada-ap810-ap0-octa-core.dtsi vendor/device-tree/dist/src/arm64/marvell/armada-cp110-master.dtsi vendor/device-tree/dist/src/arm64/marvell/armada-cp110-slave.dtsi vendor/device-tree/dist/src/arm64/marvell/berlin4ct.dtsi vendor/device-tree/dist/src/arm64/mediatek/mt2712e.dtsi vendor/device-tree/dist/src/arm64/mediatek/mt8173.dtsi vendor/device-tree/dist/src/arm64/nvidia/tegra186-p2771-0000.dts vendor/device-tree/dist/src/arm64/nvidia/tegra186.dtsi vendor/device-tree/dist/src/arm64/qcom/apq8016-sbc.dtsi vendor/device-tree/dist/src/arm64/qcom/apq8096-db820c.dtsi vendor/device-tree/dist/src/arm64/qcom/msm8916.dtsi vendor/device-tree/dist/src/arm64/qcom/msm8996-pins.dtsi vendor/device-tree/dist/src/arm64/qcom/msm8996.dtsi vendor/device-tree/dist/src/arm64/realtek/rtd1295-zidoo-x9s.dts vendor/device-tree/dist/src/arm64/realtek/rtd1295.dtsi vendor/device-tree/dist/src/arm64/renesas/r8a7795-es1.dtsi vendor/device-tree/dist/src/arm64/renesas/r8a7795.dtsi vendor/device-tree/dist/src/arm64/renesas/r8a7796.dtsi vendor/device-tree/dist/src/arm64/renesas/r8a77995-draak.dts vendor/device-tree/dist/src/arm64/renesas/r8a77995.dtsi vendor/device-tree/dist/src/arm64/renesas/salvator-common.dtsi vendor/device-tree/dist/src/arm64/renesas/ulcb.dtsi vendor/device-tree/dist/src/arm64/rockchip/rk3328-evb.dts vendor/device-tree/dist/src/arm64/rockchip/rk3328-rock64.dts vendor/device-tree/dist/src/arm64/rockchip/rk3328.dtsi vendor/device-tree/dist/src/arm64/rockchip/rk3368.dtsi vendor/device-tree/dist/src/arm64/rockchip/rk3399-firefly.dts vendor/device-tree/dist/src/arm64/rockchip/rk3399-gru-kevin.dts vendor/device-tree/dist/src/arm64/rockchip/rk3399-gru.dtsi vendor/device-tree/dist/src/arm64/rockchip/rk3399-puma.dtsi vendor/device-tree/dist/src/arm64/rockchip/rk3399.dtsi vendor/device-tree/dist/src/arm64/socionext/uniphier-ld11-ref.dts vendor/device-tree/dist/src/arm64/socionext/uniphier-ld11.dtsi vendor/device-tree/dist/src/arm64/socionext/uniphier-ld20-ref.dts vendor/device-tree/dist/src/arm64/socionext/uniphier-ld20.dtsi vendor/device-tree/dist/src/arm64/socionext/uniphier-pxs3-ref.dts vendor/device-tree/dist/src/arm64/socionext/uniphier-pxs3.dtsi vendor/device-tree/dist/src/mips/brcm/bcm3368.dtsi vendor/device-tree/dist/src/mips/brcm/bcm63268-comtrend-vr-3032u.dts vendor/device-tree/dist/src/mips/brcm/bcm63268.dtsi vendor/device-tree/dist/src/mips/brcm/bcm6328.dtsi vendor/device-tree/dist/src/mips/brcm/bcm6358-neufbox4-sercomm.dts vendor/device-tree/dist/src/mips/brcm/bcm6358.dtsi vendor/device-tree/dist/src/mips/brcm/bcm6362.dtsi vendor/device-tree/dist/src/mips/brcm/bcm6368.dtsi vendor/device-tree/dist/src/mips/img/pistachio.dtsi vendor/device-tree/dist/src/mips/ingenic/jz4780.dtsi vendor/device-tree/dist/src/mips/ralink/rt3052_eval.dts vendor/device-tree/dist/src/mips/xilfpga/nexys4ddr.dts vendor/device-tree/dist/src/openrisc/or1ksim.dts vendor/device-tree/dist/src/powerpc/acadia.dts Modified: vendor/device-tree/dist/Bindings/arm/actions.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/actions.txt Fri Feb 9 22:23:10 2018 (r329087) +++ vendor/device-tree/dist/Bindings/arm/actions.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -21,6 +21,7 @@ Boards: Root node property compatible must contain, depending on board: + - Cubietech CubieBoard6: "cubietech,cubieboard6" - LeMaker Guitar Base Board rev. B: "lemaker,guitar-bb-rev-b", "lemaker,guitar" Modified: vendor/device-tree/dist/Bindings/arm/amlogic.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/amlogic.txt Fri Feb 9 22:23:10 2018 (r329087) +++ vendor/device-tree/dist/Bindings/arm/amlogic.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -41,6 +41,10 @@ Boards with the Amlogic Meson GXM S912 SoC shall have Required root node property: compatible: "amlogic,s912", "amlogic,meson-gxm"; +Boards with the Amlogic Meson AXG A113D SoC shall have the following properties: + Required root node property: + compatible: "amlogic,a113d", "amlogic,meson-axg"; + Board compatible values (alphabetically, grouped by SoC): - "geniatech,atv1200" (Meson6) @@ -71,8 +75,12 @@ Board compatible values (alphabetically, grouped by So - "amlogic,q200" (Meson gxm s912) - "amlogic,q201" (Meson gxm s912) + - "khadas,vim2" (Meson gxm s912) - "kingnovel,r-box-pro" (Meson gxm S912) - "nexbox,a1" (Meson gxm s912) + - "tronsmart,vega-s96" (Meson gxm s912) + + - "amlogic,s400" (Meson axg a113d) Amlogic Meson Firmware registers Interface ------------------------------------------ Added: vendor/device-tree/dist/Bindings/arm/amlogic/analog-top.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/arm/amlogic/analog-top.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -0,0 +1,20 @@ +Amlogic Meson8 and Meson8b "analog top" registers: +-------------------------------------------------- + +The analog top registers contain information about the so-called +"metal revision" (which encodes the "minor version") of the SoC. + +Required properties: +- reg: the register range of the analog top registers +- compatible: depending on the SoC this should be one of: + - "amlogic,meson8-analog-top" + - "amlogic,meson8b-analog-top" + along with "syscon" + + +Example: + + analog_top: analog-top@81a8 { + compatible = "amlogic,meson8-analog-top", "syscon"; + reg = <0x81a8 0x14>; + }; Added: vendor/device-tree/dist/Bindings/arm/amlogic/assist.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/arm/amlogic/assist.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -0,0 +1,17 @@ +Amlogic Meson6/Meson8/Meson8b assist registers: +----------------------------------------------- + +The assist registers contain basic information about the SoC, +for example the encoded SoC part number. + +Required properties: +- reg: the register range of the assist registers +- compatible: should be "amlogic,meson-mx-assist" along with "syscon" + + +Example: + + assist: assist@7c00 { + compatible = "amlogic,meson-mx-assist", "syscon"; + reg = <0x7c00 0x200>; + }; Added: vendor/device-tree/dist/Bindings/arm/amlogic/bootrom.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/arm/amlogic/bootrom.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -0,0 +1,17 @@ +Amlogic Meson6/Meson8/Meson8b bootrom: +-------------------------------------- + +The bootrom register area can be used to access SoC specific +information, such as the "misc version". + +Required properties: +- reg: the register range of the bootrom registers +- compatible: should be "amlogic,meson-mx-bootrom" along with "syscon" + + +Example: + + bootrom: bootrom@d9040000 { + compatible = "amlogic,meson-mx-bootrom", "syscon"; + reg = <0xd9040000 0x10000>; + }; Added: vendor/device-tree/dist/Bindings/arm/amlogic/pmu.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/arm/amlogic/pmu.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -0,0 +1,18 @@ +Amlogic Meson8 and Meson8b power-management-unit: +------------------------------------------------- + +The pmu is used to turn off and on different power domains of the SoCs +This includes the power to the CPU cores. + +Required node properties: +- compatible value : depending on the SoC this should be one of: + "amlogic,meson8-pmu" + "amlogic,meson8b-pmu" +- reg : physical base address and the size of the registers window + +Example: + + pmu@c81000e4 { + compatible = "amlogic,meson8b-pmu", "syscon"; + reg = <0xc81000e0 0x18>; + }; Added: vendor/device-tree/dist/Bindings/arm/amlogic/smp-sram.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/arm/amlogic/smp-sram.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -0,0 +1,32 @@ +Amlogic Meson8 and Meson8b SRAM for smp bringup: +------------------------------------------------ + +Amlogic's SMP-capable SoCs use part of the sram for the bringup of the cores. +Once the core gets powered up it executes the code that is residing at a +specific location. + +Therefore a reserved section sub-node has to be added to the mmio-sram +declaration. + +Required sub-node properties: +- compatible : depending on the SoC this should be one of: + "amlogic,meson8-smp-sram" + "amlogic,meson8b-smp-sram" + +The rest of the properties should follow the generic mmio-sram discription +found in ../../misc/sram.txt + +Example: + + sram: sram@d9000000 { + compatible = "mmio-sram"; + reg = <0xd9000000 0x20000>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0xd9000000 0x20000>; + + smp-sram@1ff80 { + compatible = "amlogic,meson8b-smp-sram"; + reg = <0x1ff80 0x8>; + }; + }; Modified: vendor/device-tree/dist/Bindings/arm/bcm/brcm,brcmstb.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/bcm/brcm,brcmstb.txt Fri Feb 9 22:23:10 2018 (r329087) +++ vendor/device-tree/dist/Bindings/arm/bcm/brcm,brcmstb.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -164,6 +164,8 @@ Control registers for this memory controller's DDR PHY Required properties: - compatible : should contain one of these + "brcm,brcmstb-ddr-phy-v71.1" + "brcm,brcmstb-ddr-phy-v72.0" "brcm,brcmstb-ddr-phy-v225.1" "brcm,brcmstb-ddr-phy-v240.1" "brcm,brcmstb-ddr-phy-v240.2" @@ -184,7 +186,9 @@ Sequencer DRAM parameters and control registers. Used Power-Down (SRPD), among other things. Required properties: -- compatible : should contain "brcm,brcmstb-memc-ddr" +- compatible : should contain one of these + "brcm,brcmstb-memc-ddr-rev-b.2.2" + "brcm,brcmstb-memc-ddr" - reg : the MEMC DDR register range Example: Added: vendor/device-tree/dist/Bindings/arm/bcm/brcm,hr2.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/arm/bcm/brcm,hr2.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -0,0 +1,14 @@ +Broadcom Hurricane 2 device tree bindings +--------------------------------------- + +Broadcom Hurricane 2 family of SoCs are used for switching control. These SoCs +are based on Broadcom's iProc SoC architecture and feature a single core Cortex +A9 ARM CPUs, DDR2/DDR3 memory, PCIe GEN-2, USB 2.0 and USB 3.0, serial and NAND +flash and a PCIe attached integrated switching engine. + +Boards with Hurricane SoCs shall have the following properties: + +Required root node property: + +BCM53342 +compatible = "brcm,bcm53342", "brcm,hr2"; Modified: vendor/device-tree/dist/Bindings/arm/ccn.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/ccn.txt Fri Feb 9 22:23:10 2018 (r329087) +++ vendor/device-tree/dist/Bindings/arm/ccn.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -15,7 +15,7 @@ Required properties: Example: - ccn@0x2000000000 { + ccn@2000000000 { compatible = "arm,ccn-504"; reg = <0x20 0x00000000 0 0x1000000>; interrupts = <0 181 4>; Modified: vendor/device-tree/dist/Bindings/arm/cpus.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/cpus.txt Fri Feb 9 22:23:10 2018 (r329087) +++ vendor/device-tree/dist/Bindings/arm/cpus.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -197,6 +197,8 @@ described below. "actions,s500-smp" "allwinner,sun6i-a31" "allwinner,sun8i-a23" + "amlogic,meson8-smp" + "amlogic,meson8b-smp" "arm,realview-smp" "brcm,bcm11351-cpu-method" "brcm,bcm23550" Modified: vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,apmixedsys.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,apmixedsys.txt Fri Feb 9 22:23:10 2018 (r329087) +++ vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,apmixedsys.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -7,7 +7,9 @@ Required Properties: - compatible: Should be one of: - "mediatek,mt2701-apmixedsys" + - "mediatek,mt2712-apmixedsys", "syscon" - "mediatek,mt6797-apmixedsys" + - "mediatek,mt7622-apmixedsys" - "mediatek,mt8135-apmixedsys" - "mediatek,mt8173-apmixedsys" - #clock-cells: Must be 1 Added: vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,audsys.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,audsys.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -0,0 +1,22 @@ +MediaTek AUDSYS controller +============================ + +The MediaTek AUDSYS controller provides various clocks to the system. + +Required Properties: + +- compatible: Should be one of: + - "mediatek,mt7622-audsys", "syscon" +- #clock-cells: Must be 1 + +The AUDSYS controller uses the common clk binding from +Documentation/devicetree/bindings/clock/clock-bindings.txt +The available clocks are defined in dt-bindings/clock/mt*-clk.h. + +Example: + +audsys: audsys@11220000 { + compatible = "mediatek,mt7622-audsys", "syscon"; + reg = <0 0x11220000 0 0x1000>; + #clock-cells = <1>; +}; Modified: vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,bdpsys.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,bdpsys.txt Fri Feb 9 22:23:10 2018 (r329087) +++ vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,bdpsys.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -7,6 +7,7 @@ Required Properties: - compatible: Should be: - "mediatek,mt2701-bdpsys", "syscon" + - "mediatek,mt2712-bdpsys", "syscon" - #clock-cells: Must be 1 The bdpsys controller uses the common clk binding from Modified: vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,ethsys.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,ethsys.txt Fri Feb 9 22:23:10 2018 (r329087) +++ vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,ethsys.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -7,6 +7,7 @@ Required Properties: - compatible: Should be: - "mediatek,mt2701-ethsys", "syscon" + - "mediatek,mt7622-ethsys", "syscon" - #clock-cells: Must be 1 The ethsys controller uses the common clk binding from Modified: vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,hifsys.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,hifsys.txt Fri Feb 9 22:23:10 2018 (r329087) +++ vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,hifsys.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -8,6 +8,7 @@ Required Properties: - compatible: Should be: - "mediatek,mt2701-hifsys", "syscon" + - "mediatek,mt7622-hifsys", "syscon" - #clock-cells: Must be 1 The hifsys controller uses the common clk binding from Modified: vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,imgsys.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,imgsys.txt Fri Feb 9 22:23:10 2018 (r329087) +++ vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,imgsys.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -7,6 +7,7 @@ Required Properties: - compatible: Should be one of: - "mediatek,mt2701-imgsys", "syscon" + - "mediatek,mt2712-imgsys", "syscon" - "mediatek,mt6797-imgsys", "syscon" - "mediatek,mt8173-imgsys", "syscon" - #clock-cells: Must be 1 Modified: vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,infracfg.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,infracfg.txt Fri Feb 9 22:23:10 2018 (r329087) +++ vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,infracfg.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -8,7 +8,9 @@ Required Properties: - compatible: Should be one of: - "mediatek,mt2701-infracfg", "syscon" + - "mediatek,mt2712-infracfg", "syscon" - "mediatek,mt6797-infracfg", "syscon" + - "mediatek,mt7622-infracfg", "syscon" - "mediatek,mt8135-infracfg", "syscon" - "mediatek,mt8173-infracfg", "syscon" - #clock-cells: Must be 1 Added: vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,jpgdecsys.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,jpgdecsys.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -0,0 +1,22 @@ +Mediatek jpgdecsys controller +============================ + +The Mediatek jpgdecsys controller provides various clocks to the system. + +Required Properties: + +- compatible: Should be: + - "mediatek,mt2712-jpgdecsys", "syscon" +- #clock-cells: Must be 1 + +The jpgdecsys controller uses the common clk binding from +Documentation/devicetree/bindings/clock/clock-bindings.txt +The available clocks are defined in dt-bindings/clock/mt*-clk.h. + +Example: + +jpgdecsys: syscon@19000000 { + compatible = "mediatek,mt2712-jpgdecsys", "syscon"; + reg = <0 0x19000000 0 0x1000>; + #clock-cells = <1>; +}; Added: vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,mcucfg.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,mcucfg.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -0,0 +1,22 @@ +Mediatek mcucfg controller +============================ + +The Mediatek mcucfg controller provides various clocks to the system. + +Required Properties: + +- compatible: Should be one of: + - "mediatek,mt2712-mcucfg", "syscon" +- #clock-cells: Must be 1 + +The mcucfg controller uses the common clk binding from +Documentation/devicetree/bindings/clock/clock-bindings.txt +The available clocks are defined in dt-bindings/clock/mt*-clk.h. + +Example: + +mcucfg: syscon@10220000 { + compatible = "mediatek,mt2712-mcucfg", "syscon"; + reg = <0 0x10220000 0 0x1000>; + #clock-cells = <1>; +}; Added: vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,mfgcfg.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,mfgcfg.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -0,0 +1,22 @@ +Mediatek mfgcfg controller +============================ + +The Mediatek mfgcfg controller provides various clocks to the system. + +Required Properties: + +- compatible: Should be one of: + - "mediatek,mt2712-mfgcfg", "syscon" +- #clock-cells: Must be 1 + +The mfgcfg controller uses the common clk binding from +Documentation/devicetree/bindings/clock/clock-bindings.txt +The available clocks are defined in dt-bindings/clock/mt*-clk.h. + +Example: + +mfgcfg: syscon@13000000 { + compatible = "mediatek,mt2712-mfgcfg", "syscon"; + reg = <0 0x13000000 0 0x1000>; + #clock-cells = <1>; +}; Modified: vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,mmsys.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,mmsys.txt Fri Feb 9 22:23:10 2018 (r329087) +++ vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,mmsys.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -7,6 +7,7 @@ Required Properties: - compatible: Should be one of: - "mediatek,mt2701-mmsys", "syscon" + - "mediatek,mt2712-mmsys", "syscon" - "mediatek,mt6797-mmsys", "syscon" - "mediatek,mt8173-mmsys", "syscon" - #clock-cells: Must be 1 Added: vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,pciesys.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,pciesys.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -0,0 +1,22 @@ +MediaTek PCIESYS controller +============================ + +The MediaTek PCIESYS controller provides various clocks to the system. + +Required Properties: + +- compatible: Should be: + - "mediatek,mt7622-pciesys", "syscon" +- #clock-cells: Must be 1 + +The PCIESYS controller uses the common clk binding from +Documentation/devicetree/bindings/clock/clock-bindings.txt +The available clocks are defined in dt-bindings/clock/mt*-clk.h. + +Example: + +pciesys: pciesys@1a100800 { + compatible = "mediatek,mt7622-pciesys", "syscon"; + reg = <0 0x1a100800 0 0x1000>; + #clock-cells = <1>; +}; Modified: vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,pericfg.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,pericfg.txt Fri Feb 9 22:23:10 2018 (r329087) +++ vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,pericfg.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -8,6 +8,8 @@ Required Properties: - compatible: Should be one of: - "mediatek,mt2701-pericfg", "syscon" + - "mediatek,mt2712-pericfg", "syscon" + - "mediatek,mt7622-pericfg", "syscon" - "mediatek,mt8135-pericfg", "syscon" - "mediatek,mt8173-pericfg", "syscon" - #clock-cells: Must be 1 Added: vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,sgmiisys.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,sgmiisys.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -0,0 +1,22 @@ +MediaTek SGMIISYS controller +============================ + +The MediaTek SGMIISYS controller provides various clocks to the system. + +Required Properties: + +- compatible: Should be: + - "mediatek,mt7622-sgmiisys", "syscon" +- #clock-cells: Must be 1 + +The SGMIISYS controller uses the common clk binding from +Documentation/devicetree/bindings/clock/clock-bindings.txt +The available clocks are defined in dt-bindings/clock/mt*-clk.h. + +Example: + +sgmiisys: sgmiisys@1b128000 { + compatible = "mediatek,mt7622-sgmiisys", "syscon"; + reg = <0 0x1b128000 0 0x1000>; + #clock-cells = <1>; +}; Added: vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,ssusbsys.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,ssusbsys.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -0,0 +1,22 @@ +MediaTek SSUSBSYS controller +============================ + +The MediaTek SSUSBSYS controller provides various clocks to the system. + +Required Properties: + +- compatible: Should be: + - "mediatek,mt7622-ssusbsys", "syscon" +- #clock-cells: Must be 1 + +The SSUSBSYS controller uses the common clk binding from +Documentation/devicetree/bindings/clock/clock-bindings.txt +The available clocks are defined in dt-bindings/clock/mt*-clk.h. + +Example: + +ssusbsys: ssusbsys@1a000000 { + compatible = "mediatek,mt7622-ssusbsys", "syscon"; + reg = <0 0x1a000000 0 0x1000>; + #clock-cells = <1>; +}; Modified: vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,topckgen.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,topckgen.txt Fri Feb 9 22:23:10 2018 (r329087) +++ vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,topckgen.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -7,7 +7,9 @@ Required Properties: - compatible: Should be one of: - "mediatek,mt2701-topckgen" + - "mediatek,mt2712-topckgen", "syscon" - "mediatek,mt6797-topckgen" + - "mediatek,mt7622-topckgen" - "mediatek,mt8135-topckgen" - "mediatek,mt8173-topckgen" - #clock-cells: Must be 1 Modified: vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,vdecsys.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,vdecsys.txt Fri Feb 9 22:23:10 2018 (r329087) +++ vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,vdecsys.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -7,6 +7,7 @@ Required Properties: - compatible: Should be one of: - "mediatek,mt2701-vdecsys", "syscon" + - "mediatek,mt2712-vdecsys", "syscon" - "mediatek,mt6797-vdecsys", "syscon" - "mediatek,mt8173-vdecsys", "syscon" - #clock-cells: Must be 1 Modified: vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,vencsys.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,vencsys.txt Fri Feb 9 22:23:10 2018 (r329087) +++ vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,vencsys.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -6,6 +6,7 @@ The Mediatek vencsys controller provides various clock Required Properties: - compatible: Should be one of: + - "mediatek,mt2712-vencsys", "syscon" - "mediatek,mt6797-vencsys", "syscon" - "mediatek,mt8173-vencsys", "syscon" - #clock-cells: Must be 1 Modified: vendor/device-tree/dist/Bindings/arm/omap/crossbar.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/omap/crossbar.txt Fri Feb 9 22:23:10 2018 (r329087) +++ vendor/device-tree/dist/Bindings/arm/omap/crossbar.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -49,7 +49,7 @@ An interrupt consumer on an SoC using crossbar will us interrupts = Example: - device_x@0x4a023000 { + device_x@4a023000 { /* Crossbar 8 used */ interrupts = ; ... Modified: vendor/device-tree/dist/Bindings/arm/omap/ctrl.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/omap/ctrl.txt Fri Feb 9 22:23:10 2018 (r329087) +++ vendor/device-tree/dist/Bindings/arm/omap/ctrl.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -21,6 +21,8 @@ Required properties: "ti,omap3-scm" "ti,omap4-scm-core" "ti,omap4-scm-padconf-core" + "ti,omap4-scm-wkup" + "ti,omap4-scm-padconf-wkup" "ti,omap5-scm-core" "ti,omap5-scm-padconf-core" "ti,dra7-scm-core" Modified: vendor/device-tree/dist/Bindings/arm/realtek.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/realtek.txt Fri Feb 9 22:23:10 2018 (r329087) +++ vendor/device-tree/dist/Bindings/arm/realtek.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -12,6 +12,8 @@ Required root node properties: Root node property compatible must contain, depending on board: + - MeLE V9: "mele,v9" + - ProBox2 AVA: "probox2,ava" - Zidoo X9S: "zidoo,x9s" Modified: vendor/device-tree/dist/Bindings/arm/rockchip.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/rockchip.txt Fri Feb 9 22:23:10 2018 (r329087) +++ vendor/device-tree/dist/Bindings/arm/rockchip.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -1,5 +1,9 @@ Rockchip platforms device tree bindings --------------------------------------- +- Amarula Vyasa RK3288 board + Required root node properties: + - compatible = "amarula,vyasa-rk3288", "rockchip,rk3288"; + - Asus Tinker board Required root node properties: - compatible = "asus,rk3288-tinker", "rockchip,rk3288"; Modified: vendor/device-tree/dist/Bindings/arm/samsung/pmu.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/samsung/pmu.txt Fri Feb 9 22:23:10 2018 (r329087) +++ vendor/device-tree/dist/Bindings/arm/samsung/pmu.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -4,7 +4,6 @@ Properties: - compatible : should contain two values. First value must be one from following list: - "samsung,exynos3250-pmu" - for Exynos3250 SoC, - "samsung,exynos4210-pmu" - for Exynos4210 SoC, - - "samsung,exynos4212-pmu" - for Exynos4212 SoC, - "samsung,exynos4412-pmu" - for Exynos4412 SoC, - "samsung,exynos5250-pmu" - for Exynos5250 SoC, - "samsung,exynos5260-pmu" - for Exynos5260 SoC. @@ -62,7 +61,7 @@ pmu_system_controller: system-controller@10040000 { Example of clock consumer : -usb3503: usb3503@08 { +usb3503: usb3503@8 { /* ... */ clock-names = "refclk"; clocks = <&pmu_system_controller 0>; Modified: vendor/device-tree/dist/Bindings/arm/samsung/samsung-boards.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/samsung/samsung-boards.txt Fri Feb 9 22:23:10 2018 (r329087) +++ vendor/device-tree/dist/Bindings/arm/samsung/samsung-boards.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -57,6 +57,7 @@ Required root node properties: - "hardkernel,odroid-xu3-lite" - for Exynos5422-based Hardkernel Odroid XU3 Lite board. - "hardkernel,odroid-xu4" - for Exynos5422-based Hardkernel Odroid XU4. + - "hardkernel,odroid-hc1" - for Exynos5422-based Hardkernel Odroid HC1. * Insignal - "insignal,arndale" - for Exynos5250-based Insignal Arndale board. @@ -71,7 +72,7 @@ Optional nodes: - compatible: only "samsung,secure-firmware" is currently supported - reg: address of non-secure SYSRAM used for communication with firmware - firmware@0203F000 { + firmware@203F000 { compatible = "samsung,secure-firmware"; reg = <0x0203F000 0x1000>; }; Modified: vendor/device-tree/dist/Bindings/arm/shmobile.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/shmobile.txt Fri Feb 9 22:23:10 2018 (r329087) +++ vendor/device-tree/dist/Bindings/arm/shmobile.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -39,6 +39,8 @@ SoCs: compatible = "renesas,r8a7795" - R-Car M3-W (R8A77960) compatible = "renesas,r8a7796" + - R-Car V3M (R8A77970) + compatible = "renesas,r8a77970" - R-Car D3 (R8A77995) compatible = "renesas,r8a77995" @@ -57,6 +59,8 @@ Boards: compatible = "renesas,bockw", "renesas,r8a7778" - Draak (RTP0RC77995SEB0010S) compatible = "renesas,draak", "renesas,r8a77995" + - Eagle (RTP0RC77970SEB0010S) + compatible = "renesas,eagle", "renesas,r8a77970" - Genmai (RTK772100BC00000BR) compatible = "renesas,genmai", "renesas,r7s72100" - GR-Peach (X28A-M01-E/F) @@ -65,7 +69,7 @@ Boards: compatible = "renesas,gose", "renesas,r8a7793" - H3ULCB (R-Car Starter Kit Premier, RTP0RC7795SKBX0010SA00 (H3 ES1.1)) H3ULCB (R-Car Starter Kit Premier, RTP0RC77951SKBX010SA00 (H3 ES2.0)) - compatible = "renesas,h3ulcb", "renesas,r8a7795"; + compatible = "renesas,h3ulcb", "renesas,r8a7795" - Henninger compatible = "renesas,henninger", "renesas,r8a7791" - iWave Systems RZ/G1E SODIMM SOM Development Platform (iW-RainboW-G22D) @@ -76,6 +80,8 @@ Boards: compatible = "iwave,g20d", "iwave,g20m", "renesas,r8a7743" - iWave Systems RZ/G1M Qseven System On Module (iW-RainboW-G20M-Qseven) compatible = "iwave,g20m", "renesas,r8a7743" + - Kingfisher (SBEV-RCAR-KF-M03) + compatible = "shimafuji,kingfisher" - Koelsch (RTP0RC7791SEB00010S) compatible = "renesas,koelsch", "renesas,r8a7791" - Kyoto Microcomputer Co. KZM-A9-Dual @@ -85,7 +91,7 @@ Boards: - Lager (RTP0RC7790SEB00010S) compatible = "renesas,lager", "renesas,r8a7790" - M3ULCB (R-Car Starter Kit Pro, RTP0RC7796SKBX0010SA09 (M3 ES1.0)) - compatible = "renesas,m3ulcb", "renesas,r8a7796"; + compatible = "renesas,m3ulcb", "renesas,r8a7796" - Marzen (R0P7779A00010S) compatible = "renesas,marzen", "renesas,r8a7779" - Porter (M2-LCDP) @@ -93,11 +99,11 @@ Boards: - RSKRZA1 (YR0K77210C000BE) compatible = "renesas,rskrza1", "renesas,r7s72100" - Salvator-X (RTP0RC7795SIPB0010S) - compatible = "renesas,salvator-x", "renesas,r8a7795"; + compatible = "renesas,salvator-x", "renesas,r8a7795" - Salvator-X (RTP0RC7796SIPB0011S) - compatible = "renesas,salvator-x", "renesas,r8a7796"; + compatible = "renesas,salvator-x", "renesas,r8a7796" - Salvator-XS (Salvator-X 2nd version, RTP0RC7795SIPB0012S) - compatible = "renesas,salvator-xs", "renesas,r8a7795"; + compatible = "renesas,salvator-xs", "renesas,r8a7795" - SILK (RTP0RC7794LCB00011S) compatible = "renesas,silk", "renesas,r8a7794" - SK-RZG1E (YR8A77450S000BE) Modified: vendor/device-tree/dist/Bindings/arm/sp810.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/sp810.txt Fri Feb 9 22:23:10 2018 (r329087) +++ vendor/device-tree/dist/Bindings/arm/sp810.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -33,7 +33,7 @@ Required properties: property with the highest frequency Example: - v2m_sysctl: sysctl@020000 { + v2m_sysctl: sysctl@20000 { compatible = "arm,sp810", "arm,primecell"; reg = <0x020000 0x1000>; clocks = <&v2m_refclk32khz>, <&v2m_refclk1mhz>, <&smbclk>; Added: vendor/device-tree/dist/Bindings/arm/spe-pmu.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/arm/spe-pmu.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -0,0 +1,20 @@ +* ARMv8.2 Statistical Profiling Extension (SPE) Performance Monitor Units (PMU) + +ARMv8.2 introduces the optional Statistical Profiling Extension for collecting +performance sample data using an in-memory trace buffer. + +** SPE Required properties: + +- compatible : should be one of: + "arm,statistical-profiling-extension-v1" + +- interrupts : Exactly 1 PPI must be listed. For heterogeneous systems where + SPE is only supported on a subset of the CPUs, please consult + the arm,gic-v3 binding for details on describing a PPI partition. + +** Example: + +spe-pmu { + compatible = "arm,statistical-profiling-extension-v1"; + interrupts = ; +}; Modified: vendor/device-tree/dist/Bindings/arm/sunxi.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/sunxi.txt Fri Feb 9 22:23:10 2018 (r329087) +++ vendor/device-tree/dist/Bindings/arm/sunxi.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -14,6 +14,8 @@ using one of the following compatible strings: allwinner,sun8i-a83t allwinner,sun8i-h2-plus allwinner,sun8i-h3 + allwinner-sun8i-r40 + allwinner,sun8i-v3s allwinner,sun9i-a80 allwinner,sun50i-a64 nextthing,gr8 Modified: vendor/device-tree/dist/Bindings/arm/tegra/nvidia,tegra20-mc.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/tegra/nvidia,tegra20-mc.txt Fri Feb 9 22:23:10 2018 (r329087) +++ vendor/device-tree/dist/Bindings/arm/tegra/nvidia,tegra20-mc.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -8,7 +8,7 @@ Required properties: - interrupts : Should contain MC General interrupt. Example: - memory-controller@0x7000f000 { + memory-controller@7000f000 { compatible = "nvidia,tegra20-mc"; reg = <0x7000f000 0x024 0x7000f03c 0x3c4>; Modified: vendor/device-tree/dist/Bindings/arm/vexpress-sysreg.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/vexpress-sysreg.txt Fri Feb 9 22:23:10 2018 (r329087) +++ vendor/device-tree/dist/Bindings/arm/vexpress-sysreg.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -37,7 +37,7 @@ Example: compatible = "arm,vexpress-sysreg"; reg = <0x10000000 0x1000>; - v2m_led_gpios: sys_led@08 { + v2m_led_gpios: sys_led@8 { compatible = "arm,vexpress-sysreg,sys_led"; gpio-controller; #gpio-cells = <2>; Modified: vendor/device-tree/dist/Bindings/ata/ahci-ceva.txt ============================================================================== --- vendor/device-tree/dist/Bindings/ata/ahci-ceva.txt Fri Feb 9 22:23:10 2018 (r329087) +++ vendor/device-tree/dist/Bindings/ata/ahci-ceva.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -5,6 +5,36 @@ Required properties: - compatible: Compatibility string. Must be 'ceva,ahci-1v84'. - clocks: Input clock specifier. Refer to common clock bindings. - interrupts: Interrupt specifier. Refer to interrupt binding. + - ceva,p0-cominit-params: OOB timing value for COMINIT parameter for port 0. + - ceva,p1-cominit-params: OOB timing value for COMINIT parameter for port 1. + The fields for the above parameter must be as shown below: + ceva,pN-cominit-params = /bits/ 8 ; + CINMP : COMINIT Negate Minimum Period. + CIBGN : COMINIT Burst Gap Nominal. + CIBGMX: COMINIT Burst Gap Maximum. + CIBGMN: COMINIT Burst Gap Minimum. + - ceva,p0-comwake-params: OOB timing value for COMWAKE parameter for port 0. + - ceva,p1-comwake-params: OOB timing value for COMWAKE parameter for port 1. + The fields for the above parameter must be as shown below: + ceva,pN-comwake-params = /bits/ 8 ; + CWBGMN: COMWAKE Burst Gap Minimum. + CWBGMX: COMWAKE Burst Gap Maximum. + CWBGN: COMWAKE Burst Gap Nominal. + CWNMP: COMWAKE Negate Minimum Period. + - ceva,p0-burst-params: Burst timing value for COM parameter for port 0. + - ceva,p1-burst-params: Burst timing value for COM parameter for port 1. + The fields for the above parameter must be as shown below: + ceva,pN-burst-params = /bits/ 8 ; + BMX: COM Burst Maximum. + BNM: COM Burst Nominal. + SFD: Signal Failure Detection value. + PTST: Partial to Slumber timer value. + - ceva,p0-retry-params: Retry interval timing value for port 0. + - ceva,p1-retry-params: Retry interval timing value for port 1. + The fields for the above parameter must be as shown below: + ceva,pN-retry-params = /bits/ 16 ; + RIT: Retry Interval Timer. + RCT: Rate Change Timer. Optional properties: - ceva,broken-gen2: limit to gen1 speed instead of gen2. @@ -16,5 +46,14 @@ Examples: interrupt-parent = <&gic>; interrupts = <0 133 4>; clocks = <&clkc SATA_CLK_ID>; + ceva,p0-cominit-params = /bits/ 8 <0x0F 0x25 0x18 0x29>; + ceva,p0-comwake-params = /bits/ 8 <0x04 0x0B 0x08 0x0F>; + ceva,p0-burst-params = /bits/ 8 <0x0A 0x08 0x4A 0x06>; + ceva,p0-retry-params = /bits/ 16 <0x0216 0x7F06>; + + ceva,p1-cominit-params = /bits/ 8 <0x0F 0x25 0x18 0x29>; + ceva,p1-comwake-params = /bits/ 8 <0x04 0x0B 0x08 0x0F>; + ceva,p1-burst-params = /bits/ 8 <0x0A 0x08 0x4A 0x06>; + ceva,p1-retry-params = /bits/ 16 <0x0216 0x7F06>; ceva,broken-gen2; }; Modified: vendor/device-tree/dist/Bindings/ata/ahci-platform.txt ============================================================================== --- vendor/device-tree/dist/Bindings/ata/ahci-platform.txt Fri Feb 9 22:23:10 2018 (r329087) +++ vendor/device-tree/dist/Bindings/ata/ahci-platform.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -56,7 +56,7 @@ Examples: interrupts = <115>; }; - ahci: sata@01c18000 { + ahci: sata@1c18000 { compatible = "allwinner,sun4i-a10-ahci"; reg = <0x01c18000 0x1000>; interrupts = <56>; Modified: vendor/device-tree/dist/Bindings/ata/imx-sata.txt ============================================================================== --- vendor/device-tree/dist/Bindings/ata/imx-sata.txt Fri Feb 9 22:23:10 2018 (r329087) +++ vendor/device-tree/dist/Bindings/ata/imx-sata.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -25,7 +25,7 @@ Optional properties: Examples: -sata@02200000 { +sata@2200000 { compatible = "fsl,imx6q-ahci"; reg = <0x02200000 0x4000>; interrupts = <0 39 IRQ_TYPE_LEVEL_HIGH>; Modified: vendor/device-tree/dist/Bindings/bus/imx-weim.txt ============================================================================== --- vendor/device-tree/dist/Bindings/bus/imx-weim.txt Fri Feb 9 22:23:10 2018 (r329087) +++ vendor/device-tree/dist/Bindings/bus/imx-weim.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -61,7 +61,7 @@ Timing property for child nodes. It is mandatory, not Example for an imx6q-sabreauto board, the NOR flash connected to the WEIM: - weim: weim@021b8000 { + weim: weim@21b8000 { compatible = "fsl,imx6q-weim"; reg = <0x021b8000 0x4000>; clocks = <&clks 196>; Modified: vendor/device-tree/dist/Bindings/bus/sunxi-rsb.txt ============================================================================== --- vendor/device-tree/dist/Bindings/bus/sunxi-rsb.txt Fri Feb 9 22:23:10 2018 (r329087) +++ vendor/device-tree/dist/Bindings/bus/sunxi-rsb.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -28,7 +28,7 @@ which can normally be found in the datasheet. Example: - rsb@01f03400 { + rsb@1f03400 { compatible = "allwinner,sun8i-a23-rsb"; reg = <0x01f03400 0x400>; interrupts = <0 39 4>; Added: vendor/device-tree/dist/Bindings/bus/ti-sysc.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/bus/ti-sysc.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -0,0 +1,93 @@ +Texas Instruments sysc interconnect target module wrapper binding + +Texas Instruments SoCs can have a generic interconnect target module +hardware for devices connected to various interconnects such as L3 +interconnect (Arteris NoC) and L4 interconnect (Sonics s3220). The sysc +is mostly used for interaction between module and PRCM. It participates +in the OCP Disconnect Protocol but other than that is mostly independent +of the interconnect. + +Each interconnect target module can have one or more devices connected to +it. There is a set of control registers for managing interconnect target +module clocks, idle modes and interconnect level resets for the module. + +These control registers are sprinkled into the unused register address +space of the first child device IP block managed by the interconnect +target module and typically are named REVISION, SYSCONFIG and SYSSTATUS. + +Required standard properties: + +- compatible shall be one of the following generic types: + + "ti,sysc-omap2" + "ti,sysc-omap4" + "ti,sysc-omap4-simple" + + or one of the following derivative types for hardware + needing special workarounds: + + "ti,sysc-omap3430-sr" + "ti,sysc-omap3630-sr" + "ti,sysc-omap4-sr" + "ti,sysc-omap3-sham" + "ti,sysc-omap-aes" + "ti,sysc-mcasp" + "ti,sysc-usb-host-fs" + +- reg shall have register areas implemented for the interconnect + target module in question such as revision, sysc and syss + +- reg-names shall contain the register names implemented for the + interconnect target module in question such as + "rev, "sysc", and "syss" + +- ranges shall contain the interconnect target module IO range + available for one or more child device IP blocks managed + by the interconnect target module, the ranges may include + multiple ranges such as device L4 range for control and + parent L3 range for DMA access + +Optional properties: + +- clocks clock specifier for each name in the clock-names as + specified in the binding documentation for ti-clkctrl, + typically available for all interconnect targets on TI SoCs + based on omap4 except if it's read-only register in hwauto + mode as for example omap4 L4_CFG_CLKCTRL + +- clock-names should contain at least "fck", and optionally also "ick" + depending on the SoC and the interconnect target module + +- ti,hwmods optional TI interconnect module name to use legacy + hwmod platform data + + +Example: Single instance of MUSB controller on omap4 using interconnect ranges +using offsets from l4_cfg second segment (0x4a000000 + 0x80000 = 0x4a0ab000): + + target-module@2b000 { /* 0x4a0ab000, ap 84 12.0 */ + compatible = "ti,sysc-omap2"; + ti,hwmods = "usb_otg_hs"; + reg = <0x2b400 0x4>, + <0x2b404 0x4>, + <0x2b408 0x4>; + reg-names = "rev", "sysc", "syss"; + clocks = <&l3_init_clkctrl OMAP4_USB_OTG_HS_CLKCTRL 0>; + clock-names = "fck"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0x2b000 0x1000>; + + usb_otg_hs: otg@0 { + compatible = "ti,omap4-musb"; + reg = <0x0 0x7ff>; + interrupts = , + ; + usb-phy = <&usb2_phy>; + ... + }; + }; + +Note that other SoCs, such as am335x can have multipe child devices. On am335x +there are two MUSB instances, two USB PHY instances, and a single CPPI41 DMA +instance as children of a single interconnet target module. Added: vendor/device-tree/dist/Bindings/bus/ts-nbus.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/bus/ts-nbus.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -0,0 +1,50 @@ +Technologic Systems NBUS + +The NBUS is a bus used to interface with peripherals in the Technologic +Systems FPGA on the TS-4600 SoM. + +Required properties : + - compatible : "technologic,ts-nbus" + - #address-cells : must be 1 + - #size-cells : must be 0 + - pwms : The PWM bound to the FPGA + - ts,data-gpios : The 8 GPIO pins connected to the data lines on the FPGA + - ts,csn-gpios : The GPIO pin connected to the csn line on the FPGA + - ts,txrx-gpios : The GPIO pin connected to the txrx line on the FPGA + - ts,strobe-gpios : The GPIO pin connected to the stobe line on the FPGA + - ts,ale-gpios : The GPIO pin connected to the ale line on the FPGA + - ts,rdy-gpios : The GPIO pin connected to the rdy line on the FPGA + +Child nodes: + +The NBUS node can contain zero or more child nodes representing peripherals +on the bus. + +Example: + + nbus { + compatible = "technologic,ts-nbus"; + pinctrl-0 = <&nbus_pins>; + #address-cells = <1>; + #size-cells = <0>; + pwms = <&pwm 2 83>; + ts,data-gpios = <&gpio0 0 GPIO_ACTIVE_HIGH + &gpio0 1 GPIO_ACTIVE_HIGH + &gpio0 2 GPIO_ACTIVE_HIGH + &gpio0 3 GPIO_ACTIVE_HIGH + &gpio0 4 GPIO_ACTIVE_HIGH + &gpio0 5 GPIO_ACTIVE_HIGH + &gpio0 6 GPIO_ACTIVE_HIGH + &gpio0 7 GPIO_ACTIVE_HIGH>; + ts,csn-gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>; + ts,txrx-gpios = <&gpio0 24 GPIO_ACTIVE_HIGH>; + ts,strobe-gpios = <&gpio0 25 GPIO_ACTIVE_HIGH>; + ts,ale-gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>; + ts,rdy-gpios = <&gpio0 21 GPIO_ACTIVE_HIGH>; + + watchdog@2a { + compatible = "..."; + + /* ... */ + }; + }; Modified: vendor/device-tree/dist/Bindings/clock/arm-syscon-icst.txt ============================================================================== --- vendor/device-tree/dist/Bindings/clock/arm-syscon-icst.txt Fri Feb 9 22:23:10 2018 (r329087) +++ vendor/device-tree/dist/Bindings/clock/arm-syscon-icst.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -59,7 +59,7 @@ syscon: syscon@10000000 { compatible = "syscon"; reg = <0x10000000 0x1000>; - oscclk0: osc0@0c { + oscclk0: osc0@c { compatible = "arm,syscon-icst307"; #clock-cells = <0>; lock-offset = <0x20>; Modified: vendor/device-tree/dist/Bindings/clock/axi-clkgen.txt ============================================================================== --- vendor/device-tree/dist/Bindings/clock/axi-clkgen.txt Fri Feb 9 22:23:10 2018 (r329087) +++ vendor/device-tree/dist/Bindings/clock/axi-clkgen.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -17,7 +17,7 @@ Optional properties: - clock-output-names : From common clock binding. Example: - clock@0xff000000 { + clock@ff000000 { compatible = "adi,axi-clkgen"; #clock-cells = <0>; reg = <0xff000000 0x1000>; Modified: vendor/device-tree/dist/Bindings/clock/brcm,bcm2835-aux-clock.txt ============================================================================== --- vendor/device-tree/dist/Bindings/clock/brcm,bcm2835-aux-clock.txt Fri Feb 9 22:23:10 2018 (r329087) +++ vendor/device-tree/dist/Bindings/clock/brcm,bcm2835-aux-clock.txt Fri Feb 9 22:33:22 2018 (r329088) @@ -23,7 +23,7 @@ Example: clocks = <&clk_osc>; }; - aux: aux@0x7e215004 { + aux: aux@7e215004 { compatible = "brcm,bcm2835-aux"; #clock-cells = <1>; reg = <0x7e215000 0x8>; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Feb 9 22:34:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B21E5F07D59; Fri, 9 Feb 2018 22:34:58 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 66AD27D1C7; Fri, 9 Feb 2018 22:34:58 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 489EB2FEE; Fri, 9 Feb 2018 22:34:58 +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 w19MYwFw027244; Fri, 9 Feb 2018 22:34:58 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w19MYwBj027243; Fri, 9 Feb 2018 22:34:58 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201802092234.w19MYwBj027243@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 9 Feb 2018 22:34:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r329090 - vendor/device-tree/4.15 X-SVN-Group: vendor X-SVN-Commit-Author: manu X-SVN-Commit-Paths: vendor/device-tree/4.15 X-SVN-Commit-Revision: 329090 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Feb 2018 22:34:58 -0000 Author: manu Date: Fri Feb 9 22:34:57 2018 New Revision: 329090 URL: https://svnweb.freebsd.org/changeset/base/329090 Log: Tag import of DTS 4.15 Added: vendor/device-tree/4.15/ - copied from r329089, vendor/device-tree/dist/ From owner-svn-src-all@freebsd.org Fri Feb 9 23:29:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7135F0B5A7; Fri, 9 Feb 2018 23:29:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6DEDD7F0B5; Fri, 9 Feb 2018 23:29:50 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6450A3C3F; Fri, 9 Feb 2018 23:29:50 +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 w19NToST052781; Fri, 9 Feb 2018 23:29:50 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w19NToNh052780; Fri, 9 Feb 2018 23:29:50 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201802092329.w19NToNh052780@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 9 Feb 2018 23:29:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329091 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 329091 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 09 Feb 2018 23:29:50 -0000 Author: mav Date: Fri Feb 9 23:29:50 2018 New Revision: 329091 URL: https://svnweb.freebsd.org/changeset/base/329091 Log: Add sysctls for dnode block and indirect block shifts. MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Fri Feb 9 22:34:57 2018 (r329090) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Fri Feb 9 23:29:50 2018 (r329091) @@ -59,6 +59,12 @@ static dnode_phys_t dnode_phys_zero; int zfs_default_bs = SPA_MINBLOCKSHIFT; int zfs_default_ibs = DN_MAX_INDBLKSHIFT; +SYSCTL_DECL(_vfs_zfs); +SYSCTL_INT(_vfs_zfs, OID_AUTO, default_bs, CTLFLAG_RWTUN, + &zfs_default_bs, 0, "Default dnode block shift"); +SYSCTL_INT(_vfs_zfs, OID_AUTO, default_ibs, CTLFLAG_RWTUN, + &zfs_default_ibs, 0, "Default dnode indirect block shift"); + #ifdef illumos static kmem_cbrc_t dnode_move(void *, void *, size_t, void *); #endif From owner-svn-src-all@freebsd.org Sat Feb 10 00:22:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A66BF0F209; Sat, 10 Feb 2018 00:22:26 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 20457812D0; Sat, 10 Feb 2018 00:22:26 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B4474635; Sat, 10 Feb 2018 00:22:26 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1A0MPsG082454; Sat, 10 Feb 2018 00:22:25 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1A0MP7h082453; Sat, 10 Feb 2018 00:22:25 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201802100022.w1A0MP7h082453@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sat, 10 Feb 2018 00:22:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329092 - head/bin/df X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/bin/df X-SVN-Commit-Revision: 329092 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Feb 2018 00:22:26 -0000 Author: brooks Date: Sat Feb 10 00:22:25 2018 New Revision: 329092 URL: https://svnweb.freebsd.org/changeset/base/329092 Log: Add a deprecation warning when using the feature which mounts devices to see how much space it on them. Adjust MOUNT_CHAR_DEVS to allow the free space of already mounted devices to be displayed and report an appropriate error if the device isn't mounted. Reviewed by: cem MFC after: 1 week Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D8801 Modified: head/bin/df/df.c Modified: head/bin/df/df.c ============================================================================== --- head/bin/df/df.c Fri Feb 9 23:29:50 2018 (r329091) +++ head/bin/df/df.c Sat Feb 10 00:22:25 2018 (r329092) @@ -254,9 +254,11 @@ main(int argc, char *argv[]) rv = 1; continue; } -#ifdef MOUNT_CHAR_DEVS } else if (S_ISCHR(stbuf.st_mode)) { if ((mntpt = getmntpt(*argv)) == NULL) { +#ifdef MOUNT_CHAR_DEVS + xo_warnx( + "df on unmounted devices is deprecated"); mdev.fspec = *argv; mntpath = strdup("/tmp/df.XXXXXX"); if (mntpath == NULL) { @@ -305,8 +307,12 @@ main(int argc, char *argv[]) (void)rmdir(mntpt); free(mntpath); continue; - } +#else + xo_warnx("%s: not mounted", *argv); + rv = 1; + continue; #endif + } } else mntpt = *argv; From owner-svn-src-all@freebsd.org Sat Feb 10 00:22:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 038E8F0F25E; Sat, 10 Feb 2018 00:22:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7957B813D7; Sat, 10 Feb 2018 00:22:36 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 73D47463E; Sat, 10 Feb 2018 00:22:36 +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 w1A0MaGQ082508; Sat, 10 Feb 2018 00:22:36 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1A0MZCB082503; Sat, 10 Feb 2018 00:22:35 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201802100022.w1A0MZCB082503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 10 Feb 2018 00:22:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329093 - in head: lib/clang/libllvm share/mk tools/build/options usr.bin/clang X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: lib/clang/libllvm share/mk tools/build/options usr.bin/clang X-SVN-Commit-Revision: 329093 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Feb 2018 00:22:37 -0000 Author: emaste Date: Sat Feb 10 00:22:35 2018 New Revision: 329093 URL: https://svnweb.freebsd.org/changeset/base/329093 Log: Promote llvm-cov to a standalone option Introduce WITH_/WITHOUT_LLVM_COV to match GCC's WITH_/WITHOUT_GCOV. It is intended to provide a superset of the interface and functionality of gcov. It is enabled by default when building Clang, similarly to gcov and GCC. This change moves one file in libllvm to be compiled unconditionally. Previously it was included only when WITH_CLANG_EXTRAS was set, but the complexity of a new special case for (CLANG_EXTRAS | LLVM_COV) is not worth avoiding a tiny increase in build time. Reviewed by: dim, imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D142645 Added: head/tools/build/options/WITHOUT_LLVM_COV (contents, props changed) head/tools/build/options/WITH_LLVM_COV (contents, props changed) Modified: head/lib/clang/libllvm/Makefile head/share/mk/src.opts.mk head/usr.bin/clang/Makefile Modified: head/lib/clang/libllvm/Makefile ============================================================================== --- head/lib/clang/libllvm/Makefile Sat Feb 10 00:22:25 2018 (r329092) +++ head/lib/clang/libllvm/Makefile Sat Feb 10 00:22:35 2018 (r329093) @@ -664,7 +664,7 @@ SRCS_MIN+= Passes/PassBuilder.cpp SRCS_MIN+= ProfileData/Coverage/CoverageMapping.cpp SRCS_MIN+= ProfileData/Coverage/CoverageMappingReader.cpp SRCS_MIN+= ProfileData/Coverage/CoverageMappingWriter.cpp -SRCS_EXT+= ProfileData/GCOV.cpp +SRCS_MIN+= ProfileData/GCOV.cpp SRCS_MIN+= ProfileData/InstrProf.cpp SRCS_MIN+= ProfileData/InstrProfReader.cpp SRCS_MIN+= ProfileData/InstrProfWriter.cpp Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Sat Feb 10 00:22:25 2018 (r329092) +++ head/share/mk/src.opts.mk Sat Feb 10 00:22:35 2018 (r329093) @@ -119,6 +119,7 @@ __DEFAULT_YES_OPTIONS = \ LIB32 \ LIBPTHREAD \ LIBTHR \ + LLVM_COV \ LOCALES \ LOCATE \ LPR \ @@ -425,6 +426,7 @@ MK_LLDB:= no .if ${MK_CLANG} == "no" MK_CLANG_EXTRAS:= no MK_CLANG_FULL:= no +MK_LLVM_COV:= no .endif # Added: head/tools/build/options/WITHOUT_LLVM_COV ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_LLVM_COV Sat Feb 10 00:22:35 2018 (r329093) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build the +.Xr llvm-cov 1 +tool. Added: head/tools/build/options/WITH_LLVM_COV ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_LLVM_COV Sat Feb 10 00:22:35 2018 (r329093) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to build the +.Xr llvm-cov 1 +tool. Modified: head/usr.bin/clang/Makefile ============================================================================== --- head/usr.bin/clang/Makefile Sat Feb 10 00:22:25 2018 (r329092) +++ head/usr.bin/clang/Makefile Sat Feb 10 00:22:35 2018 (r329093) @@ -17,7 +17,6 @@ SUBDIR+= lli SUBDIR+= llvm-ar SUBDIR+= llvm-as SUBDIR+= llvm-bcanalyzer -SUBDIR+= llvm-cov SUBDIR+= llvm-cxxdump SUBDIR+= llvm-cxxfilt SUBDIR+= llvm-diff @@ -44,7 +43,10 @@ SUBDIR+= lld .endif .if ${MK_LLDB} != "no" SUBDIR+= lldb -.endif # MK_LLDB +.endif +.if ${MK_LLVM_COV} != "no" +SUBDIR+= llvm-cov +.endif .endif # TOOLS_PREFIX SUBDIR_PARALLEL= From owner-svn-src-all@freebsd.org Sat Feb 10 00:27:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22487F0F794; Sat, 10 Feb 2018 00:27:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA5B5816AD; Sat, 10 Feb 2018 00:27:29 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C53444646; Sat, 10 Feb 2018 00:27:29 +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 w1A0RTVi082706; Sat, 10 Feb 2018 00:27:29 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1A0RTcC082705; Sat, 10 Feb 2018 00:27:29 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201802100027.w1A0RTcC082705@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 10 Feb 2018 00:27:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329094 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 329094 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Feb 2018 00:27:30 -0000 Author: emaste Date: Sat Feb 10 00:27:29 2018 New Revision: 329094 URL: https://svnweb.freebsd.org/changeset/base/329094 Log: Regen src.conf.5 after r329093, WITH_/WITHOUT_LLVM_COV Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Sat Feb 10 00:22:35 2018 (r329093) +++ head/share/man/man5/src.conf.5 Sat Feb 10 00:27:29 2018 (r329094) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd January 12, 2018 +.Dd February 9, 2018 .Dt SRC.CONF 5 .Os .Sh NAME @@ -314,6 +314,8 @@ When set, it enforces these options: .Va WITHOUT_CLANG_EXTRAS .It .Va WITHOUT_CLANG_FULL +.It +.Va WITHOUT_LLVM_COV .El .It Va WITH_CLANG Set to build the Clang C/C++ compiler during the normal phase of the build. @@ -463,6 +465,8 @@ When set, it enforces these options: .It .Va WITHOUT_GNUCXX .It +.Va WITHOUT_LLVM_COV +.It .Va WITHOUT_TESTS .It .Va WITHOUT_TESTS_SUPPORT @@ -986,6 +990,20 @@ Set to use LLVM's LLD as the system linker, instead of .Pp This is a default setting on arm64/aarch64. +.It Va WITHOUT_LLVM_COV +Set to not build the +.Xr llvm-cov 1 +tool. +.Pp +This is a default setting on +riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +.It Va WITH_LLVM_COV +Set to build the +.Xr llvm-cov 1 +tool. +.Pp +This is a default setting on +amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. .It Va WITHOUT_LLVM_LIBUNWIND Set to use GCC's stack unwinder (instead of LLVM's libunwind). .Pp @@ -1494,6 +1512,8 @@ When set, it enforces these options: .Va WITHOUT_LLD .It .Va WITHOUT_LLDB +.It +.Va WITHOUT_LLVM_COV .El .It Va WITHOUT_UNBOUND Set to not build From owner-svn-src-all@freebsd.org Sat Feb 10 00:39:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAEA3F10172; Sat, 10 Feb 2018 00:39:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D56C81C9F; Sat, 10 Feb 2018 00:39: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 63A9E47F3; Sat, 10 Feb 2018 00:39: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 w1A0dZvi087758; Sat, 10 Feb 2018 00:39:35 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1A0dZO7087757; Sat, 10 Feb 2018 00:39:35 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201802100039.w1A0dZO7087757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 10 Feb 2018 00:39:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329095 - stable/11/sys/modules/nvme X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/modules/nvme X-SVN-Commit-Revision: 329095 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Feb 2018 00:39:35 -0000 Author: mav Date: Sat Feb 10 00:39:34 2018 New Revision: 329095 URL: https://svnweb.freebsd.org/changeset/base/329095 Log: MFC r325795 (by imp): Belatedly add opt_nvme.h to fix building nvme.ko outside of a kernel build. Modified: stable/11/sys/modules/nvme/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/modules/nvme/Makefile ============================================================================== --- stable/11/sys/modules/nvme/Makefile Sat Feb 10 00:27:29 2018 (r329094) +++ stable/11/sys/modules/nvme/Makefile Sat Feb 10 00:39:34 2018 (r329095) @@ -17,6 +17,7 @@ SRCS = nvme.c \ bus_if.h \ device_if.h \ opt_cam.h \ + opt_nvme.h \ pci_if.h .include From owner-svn-src-all@freebsd.org Sat Feb 10 00:55:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77701F112F3; Sat, 10 Feb 2018 00:55:47 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2CE5682BE8; Sat, 10 Feb 2018 00:55:47 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0AAA24B2F; Sat, 10 Feb 2018 00:55:47 +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 w1A0tkE0098643; Sat, 10 Feb 2018 00:55:46 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1A0tkHg098637; Sat, 10 Feb 2018 00:55:46 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201802100055.w1A0tkHg098637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 10 Feb 2018 00:55:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329096 - in head/sys/dev: mpr mps X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head/sys/dev: mpr mps X-SVN-Commit-Revision: 329096 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Feb 2018 00:55:47 -0000 Author: mav Date: Sat Feb 10 00:55:46 2018 New Revision: 329096 URL: https://svnweb.freebsd.org/changeset/base/329096 Log: Teach mps(4) and mpr(4) drivers to autotune chain frames. This is a first part of the change. It makes the drivers to calculate the required number of chain frames to satisfy worst case scenarios, but it does not change existing overly strict limits on them. The next step will be to rewrite the allocator to not require megabytes of physically contiguous address space, that may be problematic if done after boot, after doing which the limits can be removed. Until that this code can just correct user set limits, if they are set too high. Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D14261 Modified: head/sys/dev/mpr/mpr.c head/sys/dev/mpr/mpr_sas.c head/sys/dev/mpr/mprvar.h head/sys/dev/mps/mps.c head/sys/dev/mps/mps_sas.c head/sys/dev/mps/mpsvar.h Modified: head/sys/dev/mpr/mpr.c ============================================================================== --- head/sys/dev/mpr/mpr.c Sat Feb 10 00:39:34 2018 (r329095) +++ head/sys/dev/mpr/mpr.c Sat Feb 10 00:55:46 2018 (r329096) @@ -382,7 +382,7 @@ mpr_transition_operational(struct mpr_softc *sc) static void mpr_resize_queues(struct mpr_softc *sc) { - int reqcr, prireqcr; + u_int reqcr, prireqcr, maxio, sges_per_frame; /* * Size the queues. Since the reply queues always need one free @@ -401,7 +401,61 @@ mpr_resize_queues(struct mpr_softc *sc) sc->num_replies = MIN(sc->max_replyframes + sc->max_evtframes, sc->facts->MaxReplyDescriptorPostQueueDepth) - 1; + /* Store the request frame size in bytes rather than as 32bit words */ + sc->reqframesz = sc->facts->IOCRequestFrameSize * 4; + /* + * Gen3 and beyond uses the IOCMaxChainSegmentSize from IOC Facts to + * get the size of a Chain Frame. Previous versions use the size as a + * Request Frame for the Chain Frame size. If IOCMaxChainSegmentSize + * is 0, use the default value. The IOCMaxChainSegmentSize is the + * number of 16-byte elelements that can fit in a Chain Frame, which is + * the size of an IEEE Simple SGE. + */ + if (sc->facts->MsgVersion >= MPI2_VERSION_02_05) { + sc->chain_seg_size = + htole16(sc->facts->IOCMaxChainSegmentSize); + if (sc->chain_seg_size == 0) { + sc->chain_frame_size = MPR_DEFAULT_CHAIN_SEG_SIZE * + MPR_MAX_CHAIN_ELEMENT_SIZE; + } else { + sc->chain_frame_size = sc->chain_seg_size * + MPR_MAX_CHAIN_ELEMENT_SIZE; + } + } else { + sc->chain_frame_size = sc->reqframesz; + } + + /* + * Max IO Size is Page Size * the following: + * ((SGEs per frame - 1 for chain element) * Max Chain Depth) + * + 1 for no chain needed in last frame + * + * If user suggests a Max IO size to use, use the smaller of the + * user's value and the calculated value as long as the user's + * value is larger than 0. The user's value is in pages. + */ + sges_per_frame = sc->chain_frame_size/sizeof(MPI2_IEEE_SGE_SIMPLE64)-1; + maxio = (sges_per_frame * sc->facts->MaxChainDepth + 1) * PAGE_SIZE; + + /* + * If I/O size limitation requested then use it and pass up to CAM. + * If not, use MAXPHYS as an optimization hint, but report HW limit. + */ + if (sc->max_io_pages > 0) { + maxio = min(maxio, sc->max_io_pages * PAGE_SIZE); + sc->maxio = maxio; + } else { + sc->maxio = maxio; + maxio = min(maxio, MAXPHYS); + } + + sc->num_chains = (maxio / PAGE_SIZE + sges_per_frame - 2) / + sges_per_frame * reqcr; + if (sc->max_chains > 0 && sc->max_chains < sc->num_chains) + sc->num_chains = sc->max_chains; + + /* * Figure out the number of MSIx-based queues. If the firmware or * user has done something crazy and not allowed enough credit for * the queues to be useful then don't enable multi-queue. @@ -1355,9 +1409,6 @@ mpr_alloc_requests(struct mpr_softc *sc) struct mpr_chain *chain; int i, rsize, nsegs; - /* Store the request frame size in bytes rather than as 32bit words */ - sc->reqframesz = sc->facts->IOCRequestFrameSize * 4; - rsize = sc->reqframesz * sc->num_reqs; if (bus_dma_tag_create( sc->mpr_parent_dmat, /* parent */ 16, 0, /* algnmnt, boundary */ @@ -1382,28 +1433,7 @@ mpr_alloc_requests(struct mpr_softc *sc) bus_dmamap_load(sc->req_dmat, sc->req_map, sc->req_frames, rsize, mpr_memaddr_cb, &sc->req_busaddr, 0); - /* - * Gen3 and beyond uses the IOCMaxChainSegmentSize from IOC Facts to - * get the size of a Chain Frame. Previous versions use the size as a - * Request Frame for the Chain Frame size. If IOCMaxChainSegmentSize - * is 0, use the default value. The IOCMaxChainSegmentSize is the - * number of 16-byte elelements that can fit in a Chain Frame, which is - * the size of an IEEE Simple SGE. - */ - if (sc->facts->MsgVersion >= MPI2_VERSION_02_05) { - sc->chain_seg_size = - htole16(sc->facts->IOCMaxChainSegmentSize); - if (sc->chain_seg_size == 0) { - sc->chain_frame_size = MPR_DEFAULT_CHAIN_SEG_SIZE * - MPR_MAX_CHAIN_ELEMENT_SIZE; - } else { - sc->chain_frame_size = sc->chain_seg_size * - MPR_MAX_CHAIN_ELEMENT_SIZE; - } - } else { - sc->chain_frame_size = sc->reqframesz; - } - rsize = sc->chain_frame_size * sc->max_chains; + rsize = sc->chain_frame_size * sc->num_chains; if (bus_dma_tag_create( sc->mpr_parent_dmat, /* parent */ 16, 0, /* algnmnt, boundary */ BUS_SPACE_MAXADDR, /* lowaddr */ @@ -1451,13 +1481,13 @@ mpr_alloc_requests(struct mpr_softc *sc) bus_dmamap_load(sc->sense_dmat, sc->sense_map, sc->sense_frames, rsize, mpr_memaddr_cb, &sc->sense_busaddr, 0); - sc->chains = malloc(sizeof(struct mpr_chain) * sc->max_chains, M_MPR, + sc->chains = malloc(sizeof(struct mpr_chain) * sc->num_chains, M_MPR, M_WAITOK | M_ZERO); if (!sc->chains) { mpr_dprint(sc, MPR_ERROR, "Cannot allocate chain memory\n"); return (ENOMEM); } - for (i = 0; i < sc->max_chains; i++) { + for (i = 0; i < sc->num_chains; i++) { chain = &sc->chains[i]; chain->chain = (MPI2_SGE_IO_UNION *)(sc->chain_frames + i * sc->chain_frame_size); @@ -1477,8 +1507,7 @@ mpr_alloc_requests(struct mpr_softc *sc) return (ENOMEM); } - /* XXX Need to pick a more precise value */ - nsegs = (MAXPHYS / PAGE_SIZE) + 1; + nsegs = (sc->maxio / PAGE_SIZE) + 1; if (bus_dma_tag_create( sc->mpr_parent_dmat, /* parent */ 1, 0, /* algnmnt, boundary */ BUS_SPACE_MAXADDR, /* lowaddr */ Modified: head/sys/dev/mpr/mpr_sas.c ============================================================================== --- head/sys/dev/mpr/mpr_sas.c Sat Feb 10 00:39:34 2018 (r329095) +++ head/sys/dev/mpr/mpr_sas.c Sat Feb 10 00:55:46 2018 (r329096) @@ -1009,7 +1009,6 @@ mprsas_action(struct cam_sim *sim, union ccb *ccb) { struct ccb_pathinq *cpi = &ccb->cpi; struct mpr_softc *sc = sassc->sc; - uint8_t sges_per_frame; cpi->version_num = 1; cpi->hba_inquiry = PI_SDTR_ABLE|PI_TAG_ABLE|PI_WIDE_16; @@ -1043,24 +1042,7 @@ mprsas_action(struct cam_sim *sim, union ccb *ccb) cpi->transport_version = 0; cpi->protocol = PROTO_SCSI; cpi->protocol_version = SCSI_REV_SPC; - - /* - * Max IO Size is Page Size * the following: - * ((SGEs per frame - 1 for chain element) * - * Max Chain Depth) + 1 for no chain needed in last frame - * - * If user suggests a Max IO size to use, use the smaller of the - * user's value and the calculated value as long as the user's - * value is larger than 0. The user's value is in pages. - */ - sges_per_frame = (sc->chain_frame_size / - sizeof(MPI2_IEEE_SGE_SIMPLE64)) - 1; - cpi->maxio = (sges_per_frame * sc->facts->MaxChainDepth) + 1; - cpi->maxio *= PAGE_SIZE; - if ((sc->max_io_pages > 0) && (sc->max_io_pages * PAGE_SIZE < - cpi->maxio)) - cpi->maxio = sc->max_io_pages * PAGE_SIZE; - sc->maxio = cpi->maxio; + cpi->maxio = sc->maxio; mprsas_set_ccbstatus(ccb, CAM_REQ_CMP); break; } Modified: head/sys/dev/mpr/mprvar.h ============================================================================== --- head/sys/dev/mpr/mprvar.h Sat Feb 10 00:39:34 2018 (r329095) +++ head/sys/dev/mpr/mprvar.h Sat Feb 10 00:55:46 2018 (r329096) @@ -361,6 +361,7 @@ struct mpr_softc { int num_reqs; int num_prireqs; int num_replies; + int num_chains; int fqdepth; /* Free queue */ int pqdepth; /* Post queue */ Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Sat Feb 10 00:39:34 2018 (r329095) +++ head/sys/dev/mps/mps.c Sat Feb 10 00:55:46 2018 (r329096) @@ -379,8 +379,8 @@ mps_transition_operational(struct mps_softc *sc) static void mps_resize_queues(struct mps_softc *sc) { - int reqcr, prireqcr; - + u_int reqcr, prireqcr, maxio, sges_per_frame; + /* * Size the queues. Since the reply queues always need one free * entry, we'll deduct one reply message here. The LSI documents @@ -398,7 +398,39 @@ mps_resize_queues(struct mps_softc *sc) sc->num_replies = MIN(sc->max_replyframes + sc->max_evtframes, sc->facts->MaxReplyDescriptorPostQueueDepth) - 1; + /* Store the request frame size in bytes rather than as 32bit words */ + sc->reqframesz = sc->facts->IOCRequestFrameSize * 4; + /* + * Max IO Size is Page Size * the following: + * ((SGEs per frame - 1 for chain element) * Max Chain Depth) + * + 1 for no chain needed in last frame + * + * If user suggests a Max IO size to use, use the smaller of the + * user's value and the calculated value as long as the user's + * value is larger than 0. The user's value is in pages. + */ + sges_per_frame = sc->reqframesz / sizeof(MPI2_SGE_SIMPLE64) - 1; + maxio = (sges_per_frame * sc->facts->MaxChainDepth + 1) * PAGE_SIZE; + + /* + * If I/O size limitation requested, then use it and pass up to CAM. + * If not, use MAXPHYS as an optimization hint, but report HW limit. + */ + if (sc->max_io_pages > 0) { + maxio = min(maxio, sc->max_io_pages * PAGE_SIZE); + sc->maxio = maxio; + } else { + sc->maxio = maxio; + maxio = min(maxio, MAXPHYS); + } + + sc->num_chains = (maxio / PAGE_SIZE + sges_per_frame - 2) / + sges_per_frame * reqcr; + if (sc->max_chains > 0 && sc->max_chains < sc->num_chains) + sc->num_chains = sc->max_chains; + + /* * Figure out the number of MSIx-based queues. If the firmware or * user has done something crazy and not allowed enough credit for * the queues to be useful then don't enable multi-queue. @@ -1334,9 +1366,6 @@ mps_alloc_requests(struct mps_softc *sc) struct mps_chain *chain; int i, rsize, nsegs; - /* Store the request frame size in bytes rather than as 32bit words */ - sc->reqframesz = sc->facts->IOCRequestFrameSize * 4; - rsize = sc->reqframesz * sc->num_reqs; if (bus_dma_tag_create( sc->mps_parent_dmat, /* parent */ 16, 0, /* algnmnt, boundary */ @@ -1361,7 +1390,7 @@ mps_alloc_requests(struct mps_softc *sc) bus_dmamap_load(sc->req_dmat, sc->req_map, sc->req_frames, rsize, mps_memaddr_cb, &sc->req_busaddr, 0); - rsize = sc->reqframesz * sc->max_chains; + rsize = sc->reqframesz * sc->num_chains; if (bus_dma_tag_create( sc->mps_parent_dmat, /* parent */ 16, 0, /* algnmnt, boundary */ BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ @@ -1409,13 +1438,13 @@ mps_alloc_requests(struct mps_softc *sc) bus_dmamap_load(sc->sense_dmat, sc->sense_map, sc->sense_frames, rsize, mps_memaddr_cb, &sc->sense_busaddr, 0); - sc->chains = malloc(sizeof(struct mps_chain) * sc->max_chains, M_MPT2, + sc->chains = malloc(sizeof(struct mps_chain) * sc->num_chains, M_MPT2, M_WAITOK | M_ZERO); if(!sc->chains) { mps_dprint(sc, MPS_ERROR, "Cannot allocate chains memory\n"); return (ENOMEM); } - for (i = 0; i < sc->max_chains; i++) { + for (i = 0; i < sc->num_chains; i++) { chain = &sc->chains[i]; chain->chain = (MPI2_SGE_IO_UNION *)(sc->chain_frames + i * sc->reqframesz); @@ -1425,8 +1454,7 @@ mps_alloc_requests(struct mps_softc *sc) sc->chain_free_lowwater++; } - /* XXX Need to pick a more precise value */ - nsegs = (MAXPHYS / PAGE_SIZE) + 1; + nsegs = (sc->maxio / PAGE_SIZE) + 1; if (bus_dma_tag_create( sc->mps_parent_dmat, /* parent */ 1, 0, /* algnmnt, boundary */ BUS_SPACE_MAXADDR, /* lowaddr */ Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Sat Feb 10 00:39:34 2018 (r329095) +++ head/sys/dev/mps/mps_sas.c Sat Feb 10 00:55:46 2018 (r329096) @@ -958,7 +958,6 @@ mpssas_action(struct cam_sim *sim, union ccb *ccb) { struct ccb_pathinq *cpi = &ccb->cpi; struct mps_softc *sc = sassc->sc; - uint8_t sges_per_frame; cpi->version_num = 1; cpi->hba_inquiry = PI_SDTR_ABLE|PI_TAG_ABLE|PI_WIDE_16; @@ -987,23 +986,7 @@ mpssas_action(struct cam_sim *sim, union ccb *ccb) cpi->transport_version = 0; cpi->protocol = PROTO_SCSI; cpi->protocol_version = SCSI_REV_SPC; - - /* - * Max IO Size is Page Size * the following: - * ((SGEs per frame - 1 for chain element) * - * Max Chain Depth) + 1 for no chain needed in last frame - * - * If user suggests a Max IO size to use, use the smaller of the - * user's value and the calculated value as long as the user's - * value is larger than 0. The user's value is in pages. - */ - sges_per_frame = ((sc->reqframesz) / - sizeof(MPI2_SGE_SIMPLE64)) - 1; - cpi->maxio = (sges_per_frame * sc->facts->MaxChainDepth) + 1; - cpi->maxio *= PAGE_SIZE; - if ((sc->max_io_pages > 0) && (sc->max_io_pages * PAGE_SIZE < - cpi->maxio)) - cpi->maxio = sc->max_io_pages * PAGE_SIZE; + cpi->maxio = sc->maxio; mpssas_set_ccbstatus(ccb, CAM_REQ_CMP); break; } Modified: head/sys/dev/mps/mpsvar.h ============================================================================== --- head/sys/dev/mps/mpsvar.h Sat Feb 10 00:39:34 2018 (r329095) +++ head/sys/dev/mps/mpsvar.h Sat Feb 10 00:55:46 2018 (r329096) @@ -315,6 +315,7 @@ struct mps_softc { int chain_free; int max_chains; int max_io_pages; + u_int maxio; int chain_free_lowwater; u_int enable_ssu; int spinup_wait_time; @@ -349,6 +350,7 @@ struct mps_softc { int num_reqs; int num_prireqs; int num_replies; + int num_chains; int fqdepth; /* Free queue */ int pqdepth; /* Post queue */ From owner-svn-src-all@freebsd.org Sat Feb 10 01:09:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AE52F12277; Sat, 10 Feb 2018 01:09:23 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E4A783595; Sat, 10 Feb 2018 01:09:23 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 485644CF0; Sat, 10 Feb 2018 01:09:23 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1A19NqF004167; Sat, 10 Feb 2018 01:09:23 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1A19N3R004166; Sat, 10 Feb 2018 01:09:23 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201802100109.w1A19N3R004166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sat, 10 Feb 2018 01:09:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329097 - head/sys/nlm X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/nlm X-SVN-Commit-Revision: 329097 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Feb 2018 01:09:23 -0000 Author: brooks Date: Sat Feb 10 01:09:22 2018 New Revision: 329097 URL: https://svnweb.freebsd.org/changeset/base/329097 Log: Use syscall_helper_register() to register syscalls and initialize though the module interface. This is the more common approach and the syscall_helper interface is easier to understand. Reviewed by: jhb Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14251 Modified: head/sys/nlm/nlm_prot_impl.c Modified: head/sys/nlm/nlm_prot_impl.c ============================================================================== --- head/sys/nlm/nlm_prot_impl.c Sat Feb 10 00:55:46 2018 (r329096) +++ head/sys/nlm/nlm_prot_impl.c Sat Feb 10 01:09:22 2018 (r329097) @@ -93,17 +93,10 @@ static SYSCTL_NODE(_vfs_nlm, OID_AUTO, sysid, CTLFLAG_ /* * Syscall hooks */ -static int nlm_syscall_offset = SYS_nlm_syscall; -static struct sysent nlm_syscall_prev_sysent; -#if __FreeBSD_version < 700000 -static struct sysent nlm_syscall_sysent = { - (sizeof(struct nlm_syscall_args) / sizeof(register_t)) | SYF_MPSAFE, - (sy_call_t *) nlm_syscall +static struct syscall_helper_data nlm_syscalls[] = { + SYSCALL_INIT_HELPER(nlm_syscall), + SYSCALL_INIT_LAST }; -#else -MAKE_SYSENT(nlm_syscall); -#endif -static bool_t nlm_syscall_registered = FALSE; /* * Debug level passed in from userland. We also support a sysctl hook @@ -287,8 +280,8 @@ ng_cookie(struct netobj *src) /* * Initialise NLM globals. */ -static void -nlm_init(void *dummy) +static int +nlm_init(void) { int error; @@ -296,24 +289,18 @@ nlm_init(void *dummy) TAILQ_INIT(&nlm_waiting_locks); TAILQ_INIT(&nlm_hosts); - error = syscall_register(&nlm_syscall_offset, &nlm_syscall_sysent, - &nlm_syscall_prev_sysent, SY_THR_STATIC_KLD); - if (error) + error = syscall_helper_register(nlm_syscalls, SY_THR_STATIC_KLD); + if (error != 0) NLM_ERR("Can't register NLM syscall\n"); - else - nlm_syscall_registered = TRUE; + return (error); } -SYSINIT(nlm_init, SI_SUB_LOCK, SI_ORDER_FIRST, nlm_init, NULL); static void -nlm_uninit(void *dummy) +nlm_uninit(void) { - if (nlm_syscall_registered) - syscall_deregister(&nlm_syscall_offset, - &nlm_syscall_prev_sysent); + syscall_helper_unregister(nlm_syscalls); } -SYSUNINIT(nlm_uninit, SI_SUB_LOCK, SI_ORDER_FIRST, nlm_uninit, NULL); /* * Create a netobj from an arbitrary source. @@ -2412,8 +2399,10 @@ nfslockd_modevent(module_t mod, int type, void *data) switch (type) { case MOD_LOAD: - return (0); + return (nlm_init()); + case MOD_UNLOAD: + nlm_uninit(); /* The NLM module cannot be safely unloaded. */ /* FALLTHROUGH */ default: From owner-svn-src-all@freebsd.org Sat Feb 10 01:22:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 923D9F138C6; Sat, 10 Feb 2018 01:22:39 +0000 (UTC) (envelope-from carpeddiem@gmail.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 2F7AC8470E; Sat, 10 Feb 2018 01:22:39 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x233.google.com with SMTP id d13so11654968iog.5; Fri, 09 Feb 2018 17:22:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=B/kCtiRvSnzne1MN0Y0Bw66KgZDNU6pGlV0uyVDD/2Y=; b=nOuJYqrVjJFS0PCTExTMekDC3QoB/w22z4xifYU3x6nl0Pvw2bQSW0NhqWIF7F+Y3y O+XowKzLtwnhpeXsIBh/TCjQSgLlCmeM2DJ1T3xv+zDvgiZ70sxaR8zZt3M1MPnvn2Ey 2b2gl2dUP5M2PcZqkxforDX/wM8UoP3LPfKZdkH1g1lsFnhCdW3wviMBtZdJ+00yZN7U gBjU6vTW23/0hluFQJWKExxTFX6EGa5/LFW8Ypsw27cZ1wHfDZ/D6imfd7zFTIMCIAkU iiLZuiNqW3YxfPn/qvlk4ODxHuSbH0GQaTRPu51KZv/DWWGoQe7SeC80+VfRIb86YKfM Cqvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=B/kCtiRvSnzne1MN0Y0Bw66KgZDNU6pGlV0uyVDD/2Y=; b=QlG4zC+XrZljRo/qyHsoYnxli9Cck9nnui4p/3mSPwipwTHkk/26uwWfFDoZjVD1JV zxHZDCNThWKIzm7yANNEe/g+JlbfIGqIbK5HcUn1LkllwMekjD2aZtrN5QQDOySbJh4C /7pSbg2IOd4pqg8CdyZ/mrTAtPC0csvrpHeQ7LoQjqwbhl80ST0d6K6dXuu+nP43eGLu nR/TiZHCazc9PsFmlW8Qv6nqC9gGYIEeYVjq9QDEcndufyNTfqha1FwjzCBkQNr2uAdL g8pXIIIIO3virqJ/hMslyZ4e0o8+ru5OO0R+zUsfkpluKgWjtM/vl1FPOp8sRn9oSHBQ 50yQ== X-Gm-Message-State: APf1xPDpNaJPFNaYtI1CUs1Y4CmNYCiLLvUhkl/BNig77OfxyYcDN6mF Cl6oyfyLb/rO4D5jkVxNoaeefsEUPbrTY2hbExFb4QwJ X-Google-Smtp-Source: AH8x225O2z3rRNmidK4RlnmG/FPjQlQLwUcdokjM5cFcoIO6bqsnzM1dTTZCFvBpDSG9FwGMYSNNXwtUv7q1ILQ3Vbk= X-Received: by 10.107.173.225 with SMTP id m94mr5307131ioo.36.1518225758228; Fri, 09 Feb 2018 17:22:38 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.147.9 with HTTP; Fri, 9 Feb 2018 17:22:17 -0800 (PST) In-Reply-To: <201802091946.w19Jkqb3038864@repo.freebsd.org> References: <201802091946.w19Jkqb3038864@repo.freebsd.org> From: Ed Maste Date: Fri, 9 Feb 2018 20:22:17 -0500 X-Google-Sender-Auth: UESpACwiCTIzlexilHcPzksWL0M Message-ID: Subject: Re: svn commit: r329077 - head/usr.bin/tftp To: Conrad Meyer 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.25 Precedence: list List-Id: "SVN commit messages 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, 10 Feb 2018 01:22:39 -0000 On 9 February 2018 at 14:46, Conrad Meyer wrote: > Author: cem > Date: Fri Feb 9 19:46:51 2018 > New Revision: 329077 > URL: https://svnweb.freebsd.org/changeset/base/329077 > > Log: > tftp(1): Fix libedit state corruption involving signals >From https://ci.freebsd.org/job/FreeBSD-head-mips-build/391/console: 01:15:24 --- all_subdir_usr.bin/tftp --- 01:15:24 --- main.o --- 01:15:24 cc1: warnings being treated as errors 01:15:24 /usr/src/usr.bin/tftp/main.c: In function 'main': 01:15:24 /usr/src/usr.bin/tftp/main.c:182: warning: 'hist' may be used uninitialized in this function 01:15:24 /usr/src/usr.bin/tftp/main.c:181: warning: 'el' may be used uninitialized in this function From owner-svn-src-all@freebsd.org Sat Feb 10 01:52:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC113F15842; Sat, 10 Feb 2018 01:52:58 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7EC8285BFE; Sat, 10 Feb 2018 01:52:58 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 79689566F; Sat, 10 Feb 2018 01:52:58 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1A1qwJx028838; Sat, 10 Feb 2018 01:52:58 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1A1qwE9028836; Sat, 10 Feb 2018 01:52:58 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802100152.w1A1qwE9028836@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 10 Feb 2018 01:52:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329098 - stable/11/lib/libstand X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/lib/libstand X-SVN-Commit-Revision: 329098 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Feb 2018 01:52:59 -0000 Author: kevans Date: Sat Feb 10 01:52:58 2018 New Revision: 329098 URL: https://svnweb.freebsd.org/changeset/base/329098 Log: MFC libstand catch-up: r305116,306534,306538,306552,306638 r305116: recvtftp() is broken for large files, report file size r306534: cd9660_open should check for padding r306538: cstyle fix of cd9660_open in libstand r306552: Fix remaining cstyle issues in libstand/cd9660.c r306638: Fix remaining bugs in libstand/cd9660.c reported by Bruce Evans. PR: 200500 Modified: stable/11/lib/libstand/cd9660.c stable/11/lib/libstand/tftp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libstand/cd9660.c ============================================================================== --- stable/11/lib/libstand/cd9660.c Sat Feb 10 01:09:22 2018 (r329097) +++ stable/11/lib/libstand/cd9660.c Sat Feb 10 01:52:58 2018 (r329098) @@ -353,6 +353,12 @@ cd9660_open(const char *path, struct open_file *f) dp = (struct iso_directory_record *) ((char *) dp + isonum_711(dp->length)); + /* If the new block has zero length, it is padding. */ + if (isonum_711(dp->length) == 0) { + /* Skip to next block, if any. */ + off = boff * ISO_DEFAULT_BLOCK_SIZE; + continue; + } off += isonum_711(dp->length); } if (off >= dsize) { Modified: stable/11/lib/libstand/tftp.c ============================================================================== --- stable/11/lib/libstand/tftp.c Sat Feb 10 01:09:22 2018 (r329097) +++ stable/11/lib/libstand/tftp.c Sat Feb 10 01:52:58 2018 (r329098) @@ -200,7 +200,7 @@ recvtftp(struct tftp_handle *h, void *pkt, ssize_t len case DATA: { int got; - if (htons(t->th_block) != d->xid) { + if (htons(t->th_block) != (u_short) d->xid) { /* * Expected block? */ @@ -563,7 +563,7 @@ tftp_stat(struct open_file *f, struct stat *sb) sb->st_nlink = 1; sb->st_uid = 0; sb->st_gid = 0; - sb->st_size = -1; + sb->st_size = (off_t) tftpfile->tftp_tsize; return (0); } @@ -734,6 +734,8 @@ tftp_parse_oack(struct tftp_handle *h, char *buf, size } else if (strcasecmp(tftp_options[i], "tsize") == 0) { if (i + 1 < option_idx) tsize = strtol(tftp_options[i + 1], (char **)NULL, 10); + if (tsize != 0) + h->tftp_tsize = tsize; } else { /* Do not allow any options we did not expect to be ACKed. */ printf("unexpected tftp option '%s'\n", tftp_options[i]); From owner-svn-src-all@freebsd.org Sat Feb 10 04:03:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79F9EF1B7F7; Sat, 10 Feb 2018 04:03:04 +0000 (UTC) (envelope-from jon@brawn.org) Received: from ahs1.r4l.com (ahs1.r4l.com [198.27.81.125]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1DF006A736; Sat, 10 Feb 2018 04:03:03 +0000 (UTC) (envelope-from jon@brawn.org) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=brawn.org; s=default; h=References:To:Cc:In-Reply-To:Date:Subject:Mime-Version: Content-Type:Message-Id:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=H+nDFPukB3u6KvqJmhLaOWWfrLf1vsmxhSlNE0/+uuA=; b=SFLkAyUpdVqAzBxT4R1pWdOCTe mwLb0X35mcN1M61lAOW1tfzV6Fqjd+eOkE18oJPTIVHKy6FX5osGirJx/rr8lDMxvjHBzjhBk2+6g E50pvZcQrmIWwi+/b+cTmNIz1SmAZslertTMfbMRY2W1x6Th87X2zBbXzog4oejZD/whuwudkksHa 4VMCLjJIM2qCf4lj/EUxaslkmF1PTfc1++ACtuvmkph504dSCU84a785VVMt3ZTRCegyKWIvC/EdH lOVrl39pjdtpt2O3Z8CcvHGnFcgigN7OUoAmorzcVfXzzWVcN46sb7MzCL9+jvES5ywyNwWKAkkCg aGdtM7uQ==; Received: from [136.62.171.86] (port=58988 helo=[192.168.1.120]) by ahs1.r4l.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1ekMNL-002dwS-Pr; Fri, 09 Feb 2018 23:02:56 -0500 From: Jon Brawn Message-Id: <64E137CE-79AE-4EC2-85AC-D8069D7447A6@brawn.org> Content-Type: multipart/signed; boundary="Apple-Mail=_904B8EF2-81C4-4FF6-B484-3D2D66B35485"; protocol="application/pkcs7-signature"; micalg=sha1 Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) Subject: Re: svn commit: r329064 - head/share/zoneinfo Date: Fri, 9 Feb 2018 22:02:53 -0600 In-Reply-To: <20180209190450.GA85711@FreeBSD.org> Cc: Warner Losh , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh , John Baldwin To: Alexey Dokuchaev References: <201802091550.w19FoXEb018181@repo.freebsd.org> <14002093.zLdzgIqnsv@ralph.baldwin.cx> <20180209190450.GA85711@FreeBSD.org> X-Mailer: Apple Mail (2.3445.5.20) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - ahs1.r4l.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - brawn.org X-Get-Message-Sender-Via: ahs1.r4l.com: authenticated_id: jon@brawn.org X-Authenticated-Sender: ahs1.r4l.com: jon@brawn.org X-Source: X-Source-Args: X-Source-Dir: X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Feb 2018 04:03:04 -0000 --Apple-Mail=_904B8EF2-81C4-4FF6-B484-3D2D66B35485 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On Feb 9, 2018, at 1:04 PM, Alexey Dokuchaev wrote: >=20 > On Fri, Feb 09, 2018 at 11:50:35AM -0700, Warner Losh wrote: >> On Fri, Feb 9, 2018 at 10:49 AM, John Baldwin = wrote: >>> On Friday, February 09, 2018 03:50:33 PM Warner Losh wrote: >>>> New Revision: 329064 >>>> URL: https://svnweb.freebsd.org/changeset/base/329064 >>>>=20 >>>> Log: >>>> We don't actually need env here, so drop it. All shells allow = setting >>>> of shell variables for the next command like this. >>>=20 >>> Eh: >>>=20 >>> % LC_ALL=3DC env >>> LC_ALL=3DC: Command not found. >>>=20 >>> csh and tcsh don't let you set environment variables as a prefix. >>>=20 >>> That said, if you try to use csh as the SHELL for make I bet many = things >>> would break. >>=20 >> Right, all shells supported as SHELL for make. csh isn't on the list = of >> supported shells. Your bet is right: a lot of things do break. >=20 > I don't really understand why we're discussing it: (t)csh, fish, = whatever > are for interactive use *only*. Scripts (and makefiles) should only = be > written for standard plain POSIX shell. >=20 > ./danfe Meanwhile, back in the real world, occasionally you are mandated to = write scripts in tcsh because of external requirements over which you = have no control. This seems to happen to me at work with regular = monotony. I do shower afterwards, of course. Jon.= --Apple-Mail=_904B8EF2-81C4-4FF6-B484-3D2D66B35485 Content-Disposition: attachment; filename=smime.p7s Content-Type: application/pkcs7-signature; name=smime.p7s Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIILEzCCBSUw ggQNoAMCAQICECQcc6QQWc3Um5HgAnmjhBYwDQYJKoZIhvcNAQELBQAwgZcxCzAJBgNVBAYTAkdC MRswGQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAOBgNVBAcTB1NhbGZvcmQxGjAYBgNVBAoT EUNPTU9ETyBDQSBMaW1pdGVkMT0wOwYDVQQDEzRDT01PRE8gUlNBIENsaWVudCBBdXRoZW50aWNh dGlvbiBhbmQgU2VjdXJlIEVtYWlsIENBMB4XDTE3MTAyODAwMDAwMFoXDTE4MTAyODIzNTk1OVow HjEcMBoGCSqGSIb3DQEJARYNam9uQGJyYXduLm9yZzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC AQoCggEBALEscuT73gkjXEfkaQU3QXOOIDFilHr9RV/FKPk+ZO3wyXpoChqRW+anE+kKBLSCsmoX 6HnhAmcq3j9umj5jIYwpD84m26XbWQK+uo42GZ3cAF12VvO0g/toUvI+nJcxiD39APWowPKQ4Nae 4FN4hLOcwd2zyF3LiJgq4aXXcBQxl2s1JRCb7STFl5qpp73JVbFp1MkABmESyzI6KE0LLH3hHICU d2m+Omg6L8T+RgsTEKmgTvw1hYD04ms9ttji/viI8LtR3V9p9DDGH0iSCF56kPo4WfsbfGVBs1km tw8uvB6OVNGiD0q05kR/GI4jGiMLa4UhlCC0VsYfx7ZyGEUCAwEAAaOCAeMwggHfMB8GA1UdIwQY MBaAFIKvbIz4xf6WYXzoHz0rcUhexIvAMB0GA1UdDgQWBBRYtBFf7BnRYLxKWDc5DiI35q5WVzAO BgNVHQ8BAf8EBAMCBaAwDAYDVR0TAQH/BAIwADAgBgNVHSUEGTAXBggrBgEFBQcDBAYLKwYBBAGy MQEDBQIwEQYJYIZIAYb4QgEBBAQDAgUgMEYGA1UdIAQ/MD0wOwYMKwYBBAGyMQECAQEBMCswKQYI KwYBBQUHAgEWHWh0dHBzOi8vc2VjdXJlLmNvbW9kby5uZXQvQ1BTMFoGA1UdHwRTMFEwT6BNoEuG SWh0dHA6Ly9jcmwuY29tb2RvY2EuY29tL0NPTU9ET1JTQUNsaWVudEF1dGhlbnRpY2F0aW9uYW5k U2VjdXJlRW1haWxDQS5jcmwwgYsGCCsGAQUFBwEBBH8wfTBVBggrBgEFBQcwAoZJaHR0cDovL2Ny dC5jb21vZG9jYS5jb20vQ09NT0RPUlNBQ2xpZW50QXV0aGVudGljYXRpb25hbmRTZWN1cmVFbWFp bENBLmNydDAkBggrBgEFBQcwAYYYaHR0cDovL29jc3AuY29tb2RvY2EuY29tMBgGA1UdEQQRMA+B DWpvbkBicmF3bi5vcmcwDQYJKoZIhvcNAQELBQADggEBAKZgWVdxinnS81TZvPWc8kXjtzxKSBFU 6ZXBkofX+CSRuD+Wmg4vlt6fNIaVWqWDF95qjR3TOwyb+LQJnsMyYhAl9NI6AJTxgfghzKK49MVP aC0K7V4TnWCiucJsfK+xDqZIevPFPF3mpYz7/Uf8VPbX2uK80/uUoBRroXDLyHv7fTzG8K+bHBh6 l2x2xFB04nxAhRS4yaJvOeV6ckPOHvCgHhncXQ1HoPUvV/M94K3jaURLPvSUm2tgzODJ97QDHDWM SF7xfItpAM7AVAmN0M0U8sWI/qDykqpoeOc/TrMNeRTEcuphuJASMuN+oP57T+XZFq/lOEEIw1H+ 4QZ1mnIwggXmMIIDzqADAgECAhBqm+E4O/8ra58B1dm4p1JWMA0GCSqGSIb3DQEBDAUAMIGFMQsw CQYDVQQGEwJHQjEbMBkGA1UECBMSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3Jk MRowGAYDVQQKExFDT01PRE8gQ0EgTGltaXRlZDErMCkGA1UEAxMiQ09NT0RPIFJTQSBDZXJ0aWZp Y2F0aW9uIEF1dGhvcml0eTAeFw0xMzAxMTAwMDAwMDBaFw0yODAxMDkyMzU5NTlaMIGXMQswCQYD VQQGEwJHQjEbMBkGA1UECBMSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRow GAYDVQQKExFDT01PRE8gQ0EgTGltaXRlZDE9MDsGA1UEAxM0Q09NT0RPIFJTQSBDbGllbnQgQXV0 aGVudGljYXRpb24gYW5kIFNlY3VyZSBFbWFpbCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC AQoCggEBAL6znlesKHZ1QBbHOAOY08YYdiFQ8yV5C0y1oNF9Olg+nKcxLqf2NHbZhGra0D00SOTq 9bus3/mxgUsg/Wh/eXQ0pnp8tZ8XZWAnlyKMpjL+qUByRjXCA6RQyDMqVaVUkbIr5SU0RDX/kSsK wer3H1pT/HUrBN0X8sKtPTdGX8XAWt/VdMLBrZBlgvnkCos+KQWWCo63OTTqRvaq8aWccm+KOMjT cE6s2mj6RkalweyDI7X+7U5lNo6jzC8RTXtVV4/Vwdax720YpMPJQaDaElmOupyTf1Qib+cpukNJ nQmwygjD8m046DQkLnpXNCAGjuJy1F5NATksUsbfJAr7FLUCAwEAAaOCATwwggE4MB8GA1UdIwQY MBaAFLuvfgI9+qbxPISOre44mOzZMjLUMB0GA1UdDgQWBBSCr2yM+MX+lmF86B89K3FIXsSLwDAO BgNVHQ8BAf8EBAMCAYYwEgYDVR0TAQH/BAgwBgEB/wIBADARBgNVHSAECjAIMAYGBFUdIAAwTAYD VR0fBEUwQzBBoD+gPYY7aHR0cDovL2NybC5jb21vZG9jYS5jb20vQ09NT0RPUlNBQ2VydGlmaWNh dGlvbkF1dGhvcml0eS5jcmwwcQYIKwYBBQUHAQEEZTBjMDsGCCsGAQUFBzAChi9odHRwOi8vY3J0 LmNvbW9kb2NhLmNvbS9DT01PRE9SU0FBZGRUcnVzdENBLmNydDAkBggrBgEFBQcwAYYYaHR0cDov L29jc3AuY29tb2RvY2EuY29tMA0GCSqGSIb3DQEBDAUAA4ICAQB4XLKBKDRPPO5fVs6fl1bsj6Jr F/bz9kkIBtTYLzXN30D+03Hj6OxCDBEaIeNmsBhrJmuubvyE7HtoSmR809AgcYboW+rcTNZ/8u/H v+GTrNI/AhqX2/kiQNxmgUPt/eJPs92Qclj0HnVyy9TnSvGkSDU7I5Px+TbO+88G4zipA2psZaWe EykgzClZlPz1FjTCkk77ZXp5cQYYexE6zeeN4/0OqqoAloFrjAF4o50YJafX8mnahjp3I2Y2mkjh k0xQfhNqbzlLWPoT3m7j7U26u7zg6swjOq8hITYc3/np5tM5aVyu6t99p17bTbY7+1RTWBviN9YJ zK8HxzObXYWBf/L+VGOYNsQDTxAk0Hbvb1j6KjUhg7fO294F29QIhhmiNOr84JHoy+fNLpfvYc/Q 9EtFOI5ISYgOxLk3nD/whbUe9rmEQXLp8MB933Ij474gwwCPUpwv9mj2PMnXoc7mbrS22XUSeTwx CTP9bcmUdp4jmIoWfhQm7X9w/Zgddg+JZ/YnIHOwsGsaTUgj7fIvxqith7DoJC91WJ8Lce3CVJqb 1XWeKIJ84F7YLXZN0oa7TktYgDdmQVxYkZo1c5noaDKH9Oq9cbm/vOYRUM1cWcef20Wkyk5S/GFy yPJwG0fR1nRas3DqAf4cXxMiEKcff7PNa4M3RGTqH0pWR8p6EjGCA7cwggOzAgEBMIGsMIGXMQsw CQYDVQQGEwJHQjEbMBkGA1UECBMSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3Jk MRowGAYDVQQKExFDT01PRE8gQ0EgTGltaXRlZDE9MDsGA1UEAxM0Q09NT0RPIFJTQSBDbGllbnQg QXV0aGVudGljYXRpb24gYW5kIFNlY3VyZSBFbWFpbCBDQQIQJBxzpBBZzdSbkeACeaOEFjAJBgUr DgMCGgUAoIIB3zAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0xODAy MTAwNDAyNTNaMCMGCSqGSIb3DQEJBDEWBBS5zO/lGrpF4eE+yWSkHWo1oPnn/DCBvQYJKwYBBAGC NxAEMYGvMIGsMIGXMQswCQYDVQQGEwJHQjEbMBkGA1UECBMSR3JlYXRlciBNYW5jaGVzdGVyMRAw DgYDVQQHEwdTYWxmb3JkMRowGAYDVQQKExFDT01PRE8gQ0EgTGltaXRlZDE9MDsGA1UEAxM0Q09N T0RPIFJTQSBDbGllbnQgQXV0aGVudGljYXRpb24gYW5kIFNlY3VyZSBFbWFpbCBDQQIQJBxzpBBZ zdSbkeACeaOEFjCBvwYLKoZIhvcNAQkQAgsxga+ggawwgZcxCzAJBgNVBAYTAkdCMRswGQYDVQQI ExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAOBgNVBAcTB1NhbGZvcmQxGjAYBgNVBAoTEUNPTU9ETyBD QSBMaW1pdGVkMT0wOwYDVQQDEzRDT01PRE8gUlNBIENsaWVudCBBdXRoZW50aWNhdGlvbiBhbmQg U2VjdXJlIEVtYWlsIENBAhAkHHOkEFnN1JuR4AJ5o4QWMA0GCSqGSIb3DQEBAQUABIIBAEp+a0T4 osXuo4oLMWApxCDWCSIfn+SVZ9DzZSVPsclkZwKfXpsl/fDPEti5IJ5zxyoQ8wQLuIrVAKEvOUli nu8tkBdhdZRGNXEK/17gG4Sv/3ubxMbZaRC1nUKYdip2kGzTfxyxLXEpNWs681Ca67pLjwHyaxsL 2/63WW8dtLiEHEKNlw7y9U6YHCf3NhpNPtIZk9LjjbYBT31D9WnZDbpcRKL/YiakSbvTbX4tbeLC FStJsZ+pIzsw+45SFhBKRvA1ElyzQO2rgRcA+FlTIKff6Kc+JWNaoGs6HMtQXJXcs51DAd8Ih3nH kibrCwz7/NpcYn1wp5RiZ5ZRaXuEdM0AAAAAAAA= --Apple-Mail=_904B8EF2-81C4-4FF6-B484-3D2D66B35485-- From owner-svn-src-all@freebsd.org Sat Feb 10 04:37:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64625F1CB70; Sat, 10 Feb 2018 04:37:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 166046BC0E; Sat, 10 Feb 2018 04:37:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 110C872E5; Sat, 10 Feb 2018 04:37:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1A4bj2j009178; Sat, 10 Feb 2018 04:37:45 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1A4biOi009170; Sat, 10 Feb 2018 04:37:44 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802100437.w1A4biOi009170@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 10 Feb 2018 04:37:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329099 - in stable/11: lib/libstand sys/boot/common sys/boot/efi/include sys/boot/efi/libefi sys/boot/efi/loader sys/boot/forth sys/boot/geli sys/boot/i386/boot2 sys/boot/i386/btx/lib ... X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11: lib/libstand sys/boot/common sys/boot/efi/include sys/boot/efi/libefi sys/boot/efi/loader sys/boot/forth sys/boot/geli sys/boot/i386/boot2 sys/boot/i386/btx/lib sys/boot/i386/common sys/... X-SVN-Commit-Revision: 329099 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Feb 2018 04:37:45 -0000 Author: kevans Date: Sat Feb 10 04:37:44 2018 New Revision: 329099 URL: https://svnweb.freebsd.org/changeset/base/329099 Log: MFC Loader Fixes 2017q1: r311458,r312237,r312314,r312374,r312947,r313042, r313047,r313166,r313328,r313332,r313333,r313337,r313348,r313349,r313389, r313442,r313451,r313575,r313645,r313710,r314114,r314213,r314275,r314945, r314948,r315008,r315408,r315427,r315645,r315646,r315648,r315653,r315850, r316064,r316078,r316079,r316100,r316104,r316111,r316112,r316171,r316279, r316280,r316287,r316311,r316343,r316424,r316436 r311458: Use compiler driver to link BERI boot loaders r312237: loader.efi: find_currdev() can leak memory r312314: loader: move device path definitions to include/efidevp.h r312374: loader: efi devpath api usage should be more aware of NULL pointers r312947: Remove "-Xassembler -G0" from CFLAGS. r313042: loader.efi environment related cleanups r313047: loader: disk/part api needs to use uint64_t offsets r313166: loader: libefi/env.c warnings in arm build r313328: loader: Implement disk_ioctl() to support DIOCGSECTORSIZE and DIOCGMEDIASIZE. r313332: loader: bcache read ahead block count should take account the large sectors r313333: loader: Replace EFI part devices. r313337: loader: 313329 missed ZFS guard in loader/main.c r313348: loader: biosdisk fix for 2+TB disks r313349: loader: disk io should not use alloca() r313389: efipart is also using the '%S' printf format, add -Wno-format for it. r313442: loader: possible NULL pointer dereference in efipart.c r313451: loader: possible NULL pointer dereference in bcache.c r313575: makefs: make the buffer functions look exactly like the kernel ones r313645: loader: implement MEDIA_FILEPATH_DP support in efipart r313710: loader: cstyle fixes and DIOCGMEDIASIZE should use uint64_t r314114: Use LDFLAGS with CC instead of _LDFLAGS. r314213: Remove control+r handling from geliboot's pwgets() r314275: Remove unused macro from common/drv.c. r314945: Some style(9) fixes. No functional changes. r314948: Try to extract the RFC1048 data from PXE. r315008: r314948 seems to be missing a variable or two that will break r315408: loader: remove open_disk cache r315427: loader: biosdisk should report IO error from INT13 r315645: loader: disk_cleanup was left in userboot_disk.c r315646: loader: pxe.h constants have wrong values r315648: libstand: verify value provided by nfs.read_size r315653: loader: verify the value from dhcp.interface-mtu and use snprintf o set mtu r315850: The original author abused Nd (one-line description, used by makewhatis) r316064: Fix build with path names with 'align' or 'nop' in them. r316078: gpt*boot: Save a bit more memory when LOADER_NO_GELI_SUPPORT is specified r316079: Simply retire the sedification of the boot2.s file. r316100: Remove -fno-guess-branch-probability and -fno-unit-at-a-time. r316104: Use `NO_WCAST_ALIGN` instead of spelling it out as -Wno-cast-align in CFLAGS r316111: loader: move bios getsecs into time.c r316112: loader: ls command should display file types properly r316171: xfsread inlined uses more space, so remove the inline tag. r316279: loader: efipart should check disk size from partition table r316280: loader: simplify efi_zfs_probe and avoid double probing for zfs. r316287: Remove OLD_NFSV2 from loader and libstand r316311: Add explicit_bzero() to libstand, and switch GELIBoot to using it r316343: Implement boot-time encryption key passing (keybuf) r316424: Fix sparc64 build broken by r316343 and r316076 r316436: Restore EFI boot environment functionality broken in r313333 PR: 216940 217298 217935 Added: stable/11/sys/boot/efi/libefi/wchar.c - copied unchanged from r313042, head/sys/boot/efi/libefi/wchar.c stable/11/sys/boot/geli/geliboot_internal.h - copied unchanged from r316343, head/sys/boot/geli/geliboot_internal.h stable/11/sys/crypto/intake.h - copied unchanged from r316343, head/sys/crypto/intake.h Modified: stable/11/lib/libstand/Makefile stable/11/lib/libstand/bootp.c stable/11/lib/libstand/bootp.h stable/11/lib/libstand/nfs.c stable/11/lib/libstand/nfsv2.h stable/11/lib/libstand/stand.h stable/11/sys/boot/common/bcache.c stable/11/sys/boot/common/bootstrap.h stable/11/sys/boot/common/dev_net.c stable/11/sys/boot/common/disk.c stable/11/sys/boot/common/disk.h stable/11/sys/boot/common/ls.c stable/11/sys/boot/common/part.c stable/11/sys/boot/common/part.h stable/11/sys/boot/efi/include/efidevp.h stable/11/sys/boot/efi/include/efilib.h stable/11/sys/boot/efi/libefi/Makefile stable/11/sys/boot/efi/libefi/devpath.c stable/11/sys/boot/efi/libefi/efinet.c stable/11/sys/boot/efi/libefi/efipart.c stable/11/sys/boot/efi/libefi/env.c stable/11/sys/boot/efi/loader/conf.c stable/11/sys/boot/efi/loader/devicename.c stable/11/sys/boot/efi/loader/main.c stable/11/sys/boot/forth/beastie.4th.8 stable/11/sys/boot/forth/loader.4th stable/11/sys/boot/geli/Makefile stable/11/sys/boot/geli/geliboot.c stable/11/sys/boot/geli/geliboot.h stable/11/sys/boot/geli/geliboot_crypto.c stable/11/sys/boot/geli/pwgets.c stable/11/sys/boot/i386/boot2/Makefile stable/11/sys/boot/i386/boot2/boot2.c stable/11/sys/boot/i386/btx/lib/btxv86.h stable/11/sys/boot/i386/common/bootargs.h stable/11/sys/boot/i386/common/drv.c stable/11/sys/boot/i386/gptboot/Makefile stable/11/sys/boot/i386/gptboot/gptboot.c stable/11/sys/boot/i386/gptzfsboot/Makefile stable/11/sys/boot/i386/libi386/bioscd.c stable/11/sys/boot/i386/libi386/biosdisk.c stable/11/sys/boot/i386/libi386/bootinfo32.c stable/11/sys/boot/i386/libi386/bootinfo64.c stable/11/sys/boot/i386/libi386/pxe.c stable/11/sys/boot/i386/libi386/pxe.h stable/11/sys/boot/i386/libi386/time.c stable/11/sys/boot/i386/loader/Makefile stable/11/sys/boot/i386/loader/main.c stable/11/sys/boot/i386/zfsboot/zfsboot.c stable/11/sys/boot/mips/beri/boot2/Makefile stable/11/sys/boot/mips/beri/common/common.ldscript stable/11/sys/boot/mips/beri/loader/beri_disk_cfi.c stable/11/sys/boot/mips/beri/loader/beri_disk_sdcard.c stable/11/sys/boot/mips/beri/loader/loader.ldscript stable/11/sys/boot/sparc64/loader/Makefile stable/11/sys/boot/uboot/lib/disk.c stable/11/sys/boot/usb/storage/umass_loader.c stable/11/sys/boot/userboot/userboot/userboot_disk.c stable/11/sys/boot/zfs/libzfs.h stable/11/sys/boot/zfs/zfs.c stable/11/sys/geom/eli/g_eli.c stable/11/sys/geom/eli/g_eli.h stable/11/sys/opencrypto/crypto.c stable/11/sys/sys/linker.h stable/11/usr.sbin/makefs/ffs.c stable/11/usr.sbin/makefs/ffs/buf.c stable/11/usr.sbin/makefs/ffs/buf.h stable/11/usr.sbin/makefs/ffs/ffs_alloc.c stable/11/usr.sbin/makefs/ffs/ffs_balloc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libstand/Makefile ============================================================================== --- stable/11/lib/libstand/Makefile Sat Feb 10 01:52:58 2018 (r329098) +++ stable/11/lib/libstand/Makefile Sat Feb 10 04:37:44 2018 (r329099) @@ -155,5 +155,9 @@ SRCS+= pkgfs.c SRCS+= nandfs.c .endif +# explicit_bzero +.PATH: ${SRCTOP}/sys/libkern +SRCS+= explicit_bzero.c + .include .include Modified: stable/11/lib/libstand/bootp.c ============================================================================== --- stable/11/lib/libstand/bootp.c Sat Feb 10 01:52:58 2018 (r329098) +++ stable/11/lib/libstand/bootp.c Sat Feb 10 04:37:44 2018 (r329099) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -344,6 +345,17 @@ bad: return (-1); } +int +dhcp_try_rfc1048(u_char *cp, u_int len) +{ + + expected_dhcpmsgtype = DHCPACK; + if (bcmp(vm_rfc1048, cp, sizeof(vm_rfc1048)) == 0) { + return (vend_rfc1048(cp, len)); + } + return (-1); +} + static int vend_rfc1048(cp, len) u_char *cp; @@ -392,11 +404,29 @@ vend_rfc1048(cp, len) strlcpy(hostname, val, sizeof(hostname)); } if (tag == TAG_INTF_MTU) { + intf_mtu = 0; if ((val = getenv("dhcp.interface-mtu")) != NULL) { - intf_mtu = (u_int)strtoul(val, NULL, 0); - } else { - intf_mtu = be16dec(cp); + unsigned long tmp; + char *end; + + errno = 0; + /* + * Do not allow MTU to exceed max IPv4 packet + * size, max value of 16-bit word. + */ + tmp = strtoul(val, &end, 0); + if (errno != 0 || + *val == '\0' || *end != '\0' || + tmp > USHRT_MAX) { + printf("%s: bad value: \"%s\", " + "ignoring\n", + "dhcp.interface-mtu", val); + } else { + intf_mtu = (u_int)tmp; + } } + if (intf_mtu <= 0) + intf_mtu = be16dec(cp); } #ifdef SUPPORT_DHCP if (tag == TAG_DHCP_MSGTYPE) { Modified: stable/11/lib/libstand/bootp.h ============================================================================== --- stable/11/lib/libstand/bootp.h Sat Feb 10 01:52:58 2018 (r329098) +++ stable/11/lib/libstand/bootp.h Sat Feb 10 04:37:44 2018 (r329099) @@ -22,6 +22,8 @@ * $FreeBSD$ */ +#ifndef _BOOTP_H_ +#define _BOOTP_H_ struct bootp { unsigned char bp_op; /* packet opcode type */ @@ -145,3 +147,7 @@ struct cmu_vend { /* v_flags values */ #define VF_SMASK 1 /* Subnet mask field contains valid data */ + +int dhcp_try_rfc1048(u_char *cp, u_int len); + +#endif /* _BOOTP_H_ */ Modified: stable/11/lib/libstand/nfs.c ============================================================================== --- stable/11/lib/libstand/nfs.c Sat Feb 10 01:52:58 2018 (r329098) +++ stable/11/lib/libstand/nfs.c Sat Feb 10 04:37:44 2018 (r329099) @@ -54,73 +54,6 @@ __FBSDID("$FreeBSD$"); #define NFSREAD_MIN_SIZE 1024 #define NFSREAD_MAX_SIZE 4096 -/* Define our own NFS attributes without NQNFS stuff. */ -#ifdef OLD_NFSV2 -struct nfsv2_fattrs { - n_long fa_type; - n_long fa_mode; - n_long fa_nlink; - n_long fa_uid; - n_long fa_gid; - n_long fa_size; - n_long fa_blocksize; - n_long fa_rdev; - n_long fa_blocks; - n_long fa_fsid; - n_long fa_fileid; - struct nfsv2_time fa_atime; - struct nfsv2_time fa_mtime; - struct nfsv2_time fa_ctime; -}; - -struct nfs_read_args { - u_char fh[NFS_FHSIZE]; - n_long off; - n_long len; - n_long xxx; /* XXX what's this for? */ -}; - -/* Data part of nfs rpc reply (also the largest thing we receive) */ -struct nfs_read_repl { - n_long errno; - struct nfsv2_fattrs fa; - n_long count; - u_char data[NFSREAD_MAX_SIZE]; -}; - -#ifndef NFS_NOSYMLINK -struct nfs_readlnk_repl { - n_long errno; - n_long len; - char path[NFS_MAXPATHLEN]; -}; -#endif - -struct nfs_readdir_args { - u_char fh[NFS_FHSIZE]; - n_long cookie; - n_long count; -}; - -struct nfs_readdir_data { - n_long fileid; - n_long len; - char name[0]; -}; - -struct nfs_readdir_off { - n_long cookie; - n_long follows; -}; - -struct nfs_iodesc { - struct iodesc *iodesc; - off_t off; - u_char fh[NFS_FHSIZE]; - struct nfsv2_fattrs fa; /* all in network order */ -}; -#else /* !OLD_NFSV2 */ - /* NFSv3 definitions */ #define NFS_V3MAXFHSIZE 64 #define NFS_VER3 3 @@ -185,7 +118,6 @@ struct nfs_iodesc { struct nfsv3_fattrs fa; /* all in network order */ uint64_t cookie; }; -#endif /* OLD_NFSV2 */ /* * XXX interactions with tftp? See nfswrapper.c for a confusing @@ -214,622 +146,39 @@ struct fs_ops nfs_fsops = { static int nfs_read_size = NFSREAD_MIN_SIZE; -#ifdef OLD_NFSV2 /* - * Fetch the root file handle (call mount daemon) - * Return zero or error number. + * Improve boot performance over NFS */ -int -nfs_getrootfh(struct iodesc *d, char *path, u_char *fhp) +static void +set_nfs_read_size(void) { - int len; - struct args { - n_long len; - char path[FNAME_SIZE]; - } *args; - struct repl { - n_long errno; - u_char fh[NFS_FHSIZE]; - } *repl; - struct { - n_long h[RPC_HEADER_WORDS]; - struct args d; - } sdata; - struct { - n_long h[RPC_HEADER_WORDS]; - struct repl d; - } rdata; - size_t cc; + char *env, *end; + char buf[10]; -#ifdef NFS_DEBUG - if (debug) - printf("nfs_getrootfh: %s\n", path); -#endif - - args = &sdata.d; - repl = &rdata.d; - - bzero(args, sizeof(*args)); - len = strlen(path); - if (len > sizeof(args->path)) - len = sizeof(args->path); - args->len = htonl(len); - bcopy(path, args->path, len); - len = 4 + roundup(len, 4); - - cc = rpc_call(d, RPCPROG_MNT, RPCMNT_VER1, RPCMNT_MOUNT, - args, len, repl, sizeof(*repl)); - if (cc == -1) { - /* errno was set by rpc_call */ - return (errno); + if ((env = getenv("nfs.read_size")) != NULL) { + errno = 0; + nfs_read_size = (int)strtol(env, &end, 0); + if (errno != 0 || *env == '\0' || *end != '\0') { + printf("%s: bad value: \"%s\", defaulting to %d\n", + "nfs.read_size", env, NFSREAD_MIN_SIZE); + nfs_read_size = NFSREAD_MIN_SIZE; + } } - if (cc < 4) - return (EBADRPC); - if (repl->errno) - return (ntohl(repl->errno)); - bcopy(repl->fh, fhp, sizeof(repl->fh)); - - /* - * Improve boot performance over NFS - */ - if (getenv("nfs.read_size") != NULL) - nfs_read_size = strtol(getenv("nfs.read_size"), NULL, 0); - if (nfs_read_size < NFSREAD_MIN_SIZE) + if (nfs_read_size < NFSREAD_MIN_SIZE) { + printf("%s: bad value: \"%d\", defaulting to %d\n", + "nfs.read_size", nfs_read_size, NFSREAD_MIN_SIZE); nfs_read_size = NFSREAD_MIN_SIZE; - if (nfs_read_size > NFSREAD_MAX_SIZE) + } + if (nfs_read_size > NFSREAD_MAX_SIZE) { + printf("%s: bad value: \"%d\", defaulting to %d\n", + "nfs.read_size", nfs_read_size, NFSREAD_MIN_SIZE); nfs_read_size = NFSREAD_MAX_SIZE; - - return (0); -} - -/* - * Lookup a file. Store handle and attributes. - * Return zero or error number. - */ -int -nfs_lookupfh(struct nfs_iodesc *d, const char *name, struct nfs_iodesc *newfd) -{ - int len, rlen; - struct args { - u_char fh[NFS_FHSIZE]; - n_long len; - char name[FNAME_SIZE]; - } *args; - struct repl { - n_long errno; - u_char fh[NFS_FHSIZE]; - struct nfsv2_fattrs fa; - } *repl; - struct { - n_long h[RPC_HEADER_WORDS]; - struct args d; - } sdata; - struct { - n_long h[RPC_HEADER_WORDS]; - struct repl d; - } rdata; - ssize_t cc; - -#ifdef NFS_DEBUG - if (debug) - printf("lookupfh: called\n"); -#endif - - args = &sdata.d; - repl = &rdata.d; - - bzero(args, sizeof(*args)); - bcopy(d->fh, args->fh, sizeof(args->fh)); - len = strlen(name); - if (len > sizeof(args->name)) - len = sizeof(args->name); - bcopy(name, args->name, len); - args->len = htonl(len); - len = 4 + roundup(len, 4); - len += NFS_FHSIZE; - - rlen = sizeof(*repl); - - cc = rpc_call(d->iodesc, NFS_PROG, NFS_VER2, NFSPROC_LOOKUP, - args, len, repl, rlen); - if (cc == -1) - return (errno); /* XXX - from rpc_call */ - if (cc < 4) - return (EIO); - if (repl->errno) { - /* saerrno.h now matches NFS error numbers. */ - return (ntohl(repl->errno)); } - bcopy( repl->fh, &newfd->fh, sizeof(newfd->fh)); - bcopy(&repl->fa, &newfd->fa, sizeof(newfd->fa)); - return (0); + snprintf(buf, sizeof (buf), "%d", nfs_read_size); + setenv("nfs.read_size", buf, 1); } -#ifndef NFS_NOSYMLINK /* - * Get the destination of a symbolic link. - */ -int -nfs_readlink(struct nfs_iodesc *d, char *buf) -{ - struct { - n_long h[RPC_HEADER_WORDS]; - u_char fh[NFS_FHSIZE]; - } sdata; - struct { - n_long h[RPC_HEADER_WORDS]; - struct nfs_readlnk_repl d; - } rdata; - ssize_t cc; - -#ifdef NFS_DEBUG - if (debug) - printf("readlink: called\n"); -#endif - - bcopy(d->fh, sdata.fh, NFS_FHSIZE); - cc = rpc_call(d->iodesc, NFS_PROG, NFS_VER2, NFSPROC_READLINK, - sdata.fh, NFS_FHSIZE, - &rdata.d, sizeof(rdata.d)); - if (cc == -1) - return (errno); - - if (cc < 4) - return (EIO); - - if (rdata.d.errno) - return (ntohl(rdata.d.errno)); - - rdata.d.len = ntohl(rdata.d.len); - if (rdata.d.len > NFS_MAXPATHLEN) - return (ENAMETOOLONG); - - bcopy(rdata.d.path, buf, rdata.d.len); - buf[rdata.d.len] = 0; - return (0); -} -#endif - -/* - * Read data from a file. - * Return transfer count or -1 (and set errno) - */ -ssize_t -nfs_readdata(struct nfs_iodesc *d, off_t off, void *addr, size_t len) -{ - struct nfs_read_args *args; - struct nfs_read_repl *repl; - struct { - n_long h[RPC_HEADER_WORDS]; - struct nfs_read_args d; - } sdata; - struct { - n_long h[RPC_HEADER_WORDS]; - struct nfs_read_repl d; - } rdata; - size_t cc; - long x; - int hlen, rlen; - - args = &sdata.d; - repl = &rdata.d; - - bcopy(d->fh, args->fh, NFS_FHSIZE); - args->off = htonl((n_long)off); - if (len > nfs_read_size) - len = nfs_read_size; - args->len = htonl((n_long)len); - args->xxx = htonl((n_long)0); - hlen = offsetof(struct nfs_read_rpl, data[0]); - - cc = rpc_call(d->iodesc, NFS_PROG, NFS_VER2, NFSPROC_READ, - args, sizeof(*args), - repl, sizeof(*repl)); - if (cc == -1) { - /* errno was already set by rpc_call */ - return (-1); - } - if (cc < hlen) { - errno = EBADRPC; - return (-1); - } - if (repl->errno) { - errno = ntohl(repl->errno); - return (-1); - } - rlen = cc - hlen; - x = ntohl(repl->count); - if (rlen < x) { - printf("nfsread: short packet, %d < %ld\n", rlen, x); - errno = EBADRPC; - return(-1); - } - bcopy(repl->data, addr, x); - return (x); -} - -/* - * Open a file. - * return zero or error number - */ -int -nfs_open(const char *upath, struct open_file *f) -{ - struct iodesc *desc; - struct nfs_iodesc *currfd; - char buf[2 * NFS_FHSIZE + 3]; - u_char *fh; - char *cp; - int i; -#ifndef NFS_NOSYMLINK - struct nfs_iodesc *newfd; - struct nfsv2_fattrs *fa; - char *ncp; - int c; - char namebuf[NFS_MAXPATHLEN + 1]; - char linkbuf[NFS_MAXPATHLEN + 1]; - int nlinks = 0; -#endif - int error; - char *path; - - if (netproto != NET_NFS) - return (EINVAL); - -#ifdef NFS_DEBUG - if (debug) - printf("nfs_open: %s (rootpath=%s)\n", upath, rootpath); -#endif - if (!rootpath[0]) { - printf("no rootpath, no nfs\n"); - return (ENXIO); - } - - /* - * This is silly - we should look at dv_type but that value is - * arch dependant and we can't use it here. - */ -#ifndef __i386__ - if (strcmp(f->f_dev->dv_name, "net") != 0) - return(EINVAL); -#else - if (strcmp(f->f_dev->dv_name, "pxe") != 0) - return(EINVAL); -#endif - - if (!(desc = socktodesc(*(int *)(f->f_devdata)))) - return(EINVAL); - - /* Bind to a reserved port. */ - desc->myport = htons(--rpc_port); - desc->destip = rootip; - if ((error = nfs_getrootfh(desc, rootpath, nfs_root_node.fh))) - return (error); - nfs_root_node.fa.fa_type = htonl(NFDIR); - nfs_root_node.fa.fa_mode = htonl(0755); - nfs_root_node.fa.fa_nlink = htonl(2); - nfs_root_node.iodesc = desc; - - fh = &nfs_root_node.fh[0]; - buf[0] = 'X'; - cp = &buf[1]; - for (i = 0; i < NFS_FHSIZE; i++, cp += 2) - sprintf(cp, "%02x", fh[i]); - sprintf(cp, "X"); - setenv("boot.nfsroot.server", inet_ntoa(rootip), 1); - setenv("boot.nfsroot.path", rootpath, 1); - setenv("boot.nfsroot.nfshandle", buf, 1); - - /* Allocate file system specific data structure */ - currfd = malloc(sizeof(*newfd)); - if (currfd == NULL) { - error = ENOMEM; - goto out; - } - -#ifndef NFS_NOSYMLINK - bcopy(&nfs_root_node, currfd, sizeof(*currfd)); - newfd = NULL; - - cp = path = strdup(upath); - if (path == NULL) { - error = ENOMEM; - goto out; - } - while (*cp) { - /* - * Remove extra separators - */ - while (*cp == '/') - cp++; - - if (*cp == '\0') - break; - /* - * Check that current node is a directory. - */ - if (currfd->fa.fa_type != htonl(NFDIR)) { - error = ENOTDIR; - goto out; - } - - /* allocate file system specific data structure */ - newfd = malloc(sizeof(*newfd)); - newfd->iodesc = currfd->iodesc; - - /* - * Get next component of path name. - */ - { - int len = 0; - - ncp = cp; - while ((c = *cp) != '\0' && c != '/') { - if (++len > NFS_MAXNAMLEN) { - error = ENOENT; - goto out; - } - cp++; - } - *cp = '\0'; - } - - /* lookup a file handle */ - error = nfs_lookupfh(currfd, ncp, newfd); - *cp = c; - if (error) - goto out; - - /* - * Check for symbolic link - */ - if (newfd->fa.fa_type == htonl(NFLNK)) { - int link_len, len; - - error = nfs_readlink(newfd, linkbuf); - if (error) - goto out; - - link_len = strlen(linkbuf); - len = strlen(cp); - - if (link_len + len > MAXPATHLEN - || ++nlinks > MAXSYMLINKS) { - error = ENOENT; - goto out; - } - - bcopy(cp, &namebuf[link_len], len + 1); - bcopy(linkbuf, namebuf, link_len); - - /* - * If absolute pathname, restart at root. - * If relative pathname, restart at parent directory. - */ - cp = namebuf; - if (*cp == '/') - bcopy(&nfs_root_node, currfd, sizeof(*currfd)); - - free(newfd); - newfd = NULL; - - continue; - } - - free(currfd); - currfd = newfd; - newfd = NULL; - } - - error = 0; - -out: - free(newfd); - free(path); -#else - currfd->iodesc = desc; - - error = nfs_lookupfh(&nfs_root_node, upath, currfd); -#endif - if (!error) { - currfd->off = 0; - f->f_fsdata = (void *)currfd; - return (0); - } - -#ifdef NFS_DEBUG - if (debug) - printf("nfs_open: %s lookupfh failed: %s\n", - path, strerror(error)); -#endif - free(currfd); - - return (error); -} - -int -nfs_close(struct open_file *f) -{ - struct nfs_iodesc *fp = (struct nfs_iodesc *)f->f_fsdata; - -#ifdef NFS_DEBUG - if (debug) - printf("nfs_close: fp=0x%lx\n", (u_long)fp); -#endif - - if (fp) - free(fp); - f->f_fsdata = (void *)0; - - return (0); -} - -/* - * read a portion of a file - */ -int -nfs_read(struct open_file *f, void *buf, size_t size, size_t *resid) -{ - struct nfs_iodesc *fp = (struct nfs_iodesc *)f->f_fsdata; - ssize_t cc; - char *addr = buf; - -#ifdef NFS_DEBUG - if (debug) - printf("nfs_read: size=%lu off=%d\n", (u_long)size, - (int)fp->off); -#endif - while ((int)size > 0) { - twiddle(16); - cc = nfs_readdata(fp, fp->off, (void *)addr, size); - /* XXX maybe should retry on certain errors */ - if (cc == -1) { -#ifdef NFS_DEBUG - if (debug) - printf("nfs_read: read: %s", strerror(errno)); -#endif - return (errno); /* XXX - from nfs_readdata */ - } - if (cc == 0) { -#ifdef NFS_DEBUG - if (debug) - printf("nfs_read: hit EOF unexpectantly"); -#endif - goto ret; - } - fp->off += cc; - addr += cc; - size -= cc; - } -ret: - if (resid) - *resid = size; - - return (0); -} - -/* - * Not implemented. - */ -int -nfs_write(struct open_file *f, void *buf, size_t size, size_t *resid) -{ - return (EROFS); -} - -off_t -nfs_seek(struct open_file *f, off_t offset, int where) -{ - struct nfs_iodesc *d = (struct nfs_iodesc *)f->f_fsdata; - n_long size = ntohl(d->fa.fa_size); - - switch (where) { - case SEEK_SET: - d->off = offset; - break; - case SEEK_CUR: - d->off += offset; - break; - case SEEK_END: - d->off = size - offset; - break; - default: - errno = EINVAL; - return (-1); - } - - return (d->off); -} - -/* NFNON=0, NFREG=1, NFDIR=2, NFBLK=3, NFCHR=4, NFLNK=5 */ -int nfs_stat_types[8] = { - 0, S_IFREG, S_IFDIR, S_IFBLK, S_IFCHR, S_IFLNK, 0 }; - -int -nfs_stat(struct open_file *f, struct stat *sb) -{ - struct nfs_iodesc *fp = (struct nfs_iodesc *)f->f_fsdata; - n_long ftype, mode; - - ftype = ntohl(fp->fa.fa_type); - mode = ntohl(fp->fa.fa_mode); - mode |= nfs_stat_types[ftype & 7]; - - sb->st_mode = mode; - sb->st_nlink = ntohl(fp->fa.fa_nlink); - sb->st_uid = ntohl(fp->fa.fa_uid); - sb->st_gid = ntohl(fp->fa.fa_gid); - sb->st_size = ntohl(fp->fa.fa_size); - - return (0); -} - -static int -nfs_readdir(struct open_file *f, struct dirent *d) -{ - struct nfs_iodesc *fp = (struct nfs_iodesc *)f->f_fsdata; - struct nfs_readdir_args *args; - struct nfs_readdir_data *rd; - struct nfs_readdir_off *roff = NULL; - static char *buf; - static struct nfs_iodesc *pfp = NULL; - static n_long cookie = 0; - size_t cc; - n_long eof; - - struct { - n_long h[RPC_HEADER_WORDS]; - struct nfs_readdir_args d; - } sdata; - static struct { - n_long h[RPC_HEADER_WORDS]; - u_char d[NFS_READDIRSIZE]; - } rdata; - - if (fp != pfp || fp->off != cookie) { - pfp = NULL; - refill: - args = &sdata.d; - bzero(args, sizeof(*args)); - - bcopy(fp->fh, args->fh, NFS_FHSIZE); - args->cookie = htonl(fp->off); - args->count = htonl(NFS_READDIRSIZE); - - cc = rpc_call(fp->iodesc, NFS_PROG, NFS_VER2, NFSPROC_READDIR, - args, sizeof(*args), - rdata.d, sizeof(rdata.d)); - buf = rdata.d; - roff = (struct nfs_readdir_off *)buf; - if (ntohl(roff->cookie) != 0) - return EIO; - pfp = fp; - cookie = fp->off; - } - roff = (struct nfs_readdir_off *)buf; - - if (ntohl(roff->follows) == 0) { - eof = ntohl((roff+1)->cookie); - if (eof) { - cookie = 0; - return ENOENT; - } - goto refill; - } - - buf += sizeof(struct nfs_readdir_off); - rd = (struct nfs_readdir_data *)buf; - d->d_namlen = ntohl(rd->len); - bcopy(rd->name, d->d_name, d->d_namlen); - d->d_name[d->d_namlen] = '\0'; - - buf += (sizeof(struct nfs_readdir_data) + roundup(htonl(rd->len),4)); - roff = (struct nfs_readdir_off *)buf; - fp->off = cookie = ntohl(roff->cookie); - return 0; -} -#else /* !OLD_NFSV2 */ -/* * Fetch the root file handle (call mount daemon) * Return zero or error number. */ @@ -885,6 +234,8 @@ nfs_getrootfh(struct iodesc *d, char *path, uint32_t * return (ntohl(repl->errno)); *fhlenp = ntohl(repl->fhsize); bcopy(repl->fh, fhp, *fhlenp); + + set_nfs_read_size(); return (0); } @@ -1492,4 +843,3 @@ nfs_readdir(struct open_file *f, struct dirent *d) buf = (u_char *)&rent->nameplus[pos]; return (0); } -#endif /* OLD_NFSV2 */ Modified: stable/11/lib/libstand/nfsv2.h ============================================================================== --- stable/11/lib/libstand/nfsv2.h Sat Feb 10 01:52:58 2018 (r329098) +++ stable/11/lib/libstand/nfsv2.h Sat Feb 10 04:37:44 2018 (r329099) @@ -119,46 +119,3 @@ typedef enum { NFCHR=4, NFLNK=5 } nfstype; - -/* Structs for common parts of the rpc's */ -struct nfsv2_time { - n_long nfs_sec; - n_long nfs_usec; -}; - -/* - * File attributes and setable attributes. - */ -struct nfsv2_fattr { - n_long fa_type; - n_long fa_mode; - n_long fa_nlink; - n_long fa_uid; - n_long fa_gid; - n_long fa_size; - n_long fa_blocksize; - n_long fa_rdev; - n_long fa_blocks; - n_long fa_fsid; - n_long fa_fileid; - struct nfsv2_time fa_atime; - struct nfsv2_time fa_mtime; - struct nfsv2_time fa_ctime; -}; - -struct nfsv2_sattr { - n_long sa_mode; - n_long sa_uid; - n_long sa_gid; - n_long sa_size; - struct nfsv2_time sa_atime; - struct nfsv2_time sa_mtime; -}; - -struct nfsv2_statfs { - n_long sf_tsize; - n_long sf_bsize; - n_long sf_blocks; - n_long sf_bfree; - n_long sf_bavail; -}; Modified: stable/11/lib/libstand/stand.h ============================================================================== --- stable/11/lib/libstand/stand.h Sat Feb 10 01:52:58 2018 (r329098) +++ stable/11/lib/libstand/stand.h Sat Feb 10 04:37:44 2018 (r329099) @@ -168,6 +168,7 @@ struct devdesc #define DEVT_NET 2 #define DEVT_CD 3 #define DEVT_ZFS 4 +#define DEVT_FD 5 int d_unit; void *d_opendata; }; Modified: stable/11/sys/boot/common/bcache.c ============================================================================== --- stable/11/sys/boot/common/bcache.c Sat Feb 10 01:52:58 2018 (r329098) +++ stable/11/sys/boot/common/bcache.c Sat Feb 10 04:37:44 2018 (r329099) @@ -64,7 +64,7 @@ struct bcachectl struct bcache { struct bcachectl *bcache_ctl; caddr_t bcache_data; - u_int bcache_nblks; + size_t bcache_nblks; size_t ra; }; @@ -86,6 +86,7 @@ static u_int bcache_rablks; ((bc)->bcache_ctl[BHASH((bc), (blkno))].bc_blkno != (blkno)) #define BCACHE_READAHEAD 256 #define BCACHE_MINREADAHEAD 32 +#define BCACHE_MARKER 0xdeadbeef static void bcache_invalidate(struct bcache *bc, daddr_t blkno); static void bcache_insert(struct bcache *bc, daddr_t blkno); @@ -95,7 +96,7 @@ static void bcache_free_instance(struct bcache *bc); * Initialise the cache for (nblks) of (bsize). */ void -bcache_init(u_int nblks, size_t bsize) +bcache_init(size_t nblks, size_t bsize) { /* set up control data */ bcache_total_nblks = nblks; @@ -122,6 +123,7 @@ bcache_allocate(void) u_int i; struct bcache *bc = malloc(sizeof (struct bcache)); int disks = bcache_numdev; + uint32_t *marker; if (disks == 0) disks = 1; /* safe guard */ @@ -140,11 +142,13 @@ bcache_allocate(void) bc->bcache_nblks = bcache_total_nblks >> i; bcache_unit_nblks = bc->bcache_nblks; - bc->bcache_data = malloc(bc->bcache_nblks * bcache_blksize); + bc->bcache_data = malloc(bc->bcache_nblks * bcache_blksize + + sizeof(uint32_t)); if (bc->bcache_data == NULL) { /* dont error out yet. fall back to 32 blocks and try again */ bc->bcache_nblks = 32; - bc->bcache_data = malloc(bc->bcache_nblks * bcache_blksize); + bc->bcache_data = malloc(bc->bcache_nblks * bcache_blksize + + sizeof(uint32_t)); } bc->bcache_ctl = malloc(bc->bcache_nblks * sizeof(struct bcachectl)); @@ -152,8 +156,11 @@ bcache_allocate(void) if ((bc->bcache_data == NULL) || (bc->bcache_ctl == NULL)) { bcache_free_instance(bc); errno = ENOMEM; - return(NULL); + return (NULL); } + /* Insert cache end marker. */ + marker = (uint32_t *)(bc->bcache_data + bc->bcache_nblks * bcache_blksize); + *marker = BCACHE_MARKER; /* Flush the cache */ for (i = 0; i < bc->bcache_nblks; i++) { @@ -215,12 +222,15 @@ read_strategy(void *devdata, int rw, daddr_t blk, size int result; daddr_t p_blk; caddr_t p_buf; + uint32_t *marker; if (bc == NULL) { errno = ENODEV; return (-1); } + marker = (uint32_t *)(bc->bcache_data + bc->bcache_nblks * bcache_blksize); + if (rsize != NULL) *rsize = 0; @@ -261,9 +271,34 @@ read_strategy(void *devdata, int rw, daddr_t blk, size p_size = MIN(r_size, nblk - i); /* read at least those blocks */ + /* + * The read ahead size setup. + * While the read ahead can save us IO, it also can complicate things: + * 1. We do not want to read ahead by wrapping around the + * bcache end - this would complicate the cache management. + * 2. We are using bc->ra as dynamic hint for read ahead size, + * detected cache hits will increase the read-ahead block count, and + * misses will decrease, see the code above. + * 3. The bcache is sized by 512B blocks, however, the underlying device + * may have a larger sector size, and we should perform the IO by + * taking into account these larger sector sizes. We could solve this by + * passing the sector size to bcache_allocate(), or by using ioctl(), but + * in this version we are using the constant, 16 blocks, and are rounding + * read ahead block count down to multiple of 16. + * Using the constant has two reasons, we are not entirely sure if the + * BIOS disk interface is providing the correct value for sector size. + * And secondly, this way we get the most conservative setup for the ra. + * + * The selection of multiple of 16 blocks (8KB) is quite arbitrary, however, + * we want to cover CDs (2K) and 4K disks. + * bcache_allocate() will always fall back to a minimum of 32 blocks. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Feb 10 04:56:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3700F1D39E; Sat, 10 Feb 2018 04:56:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A2EF6C48A; Sat, 10 Feb 2018 04:56:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7FB9B7636; Sat, 10 Feb 2018 04:56:08 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1A4u8ek018962; Sat, 10 Feb 2018 04:56:08 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1A4u7QV018955; Sat, 10 Feb 2018 04:56:07 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802100456.w1A4u7QV018955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 10 Feb 2018 04:56:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329100 - in stable/11: lib/libstand share/mk sys/boot/common sys/boot/efi sys/boot/efi/boot1 sys/boot/efi/fdt sys/boot/efi/include sys/boot/efi/libefi sys/boot/efi/loader sys/boot/efi/... X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11: lib/libstand share/mk sys/boot/common sys/boot/efi sys/boot/efi/boot1 sys/boot/efi/fdt sys/boot/efi/include sys/boot/efi/libefi sys/boot/efi/loader sys/boot/efi/loader/arch/arm sys/boot/... X-SVN-Commit-Revision: 329100 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Feb 2018 04:56:09 -0000 Author: kevans Date: Sat Feb 10 04:56:07 2018 New Revision: 329100 URL: https://svnweb.freebsd.org/changeset/base/329100 Log: MFC Loader Fixes 2017q2: r316437,r316577,r316578,r316585,r316590,r316612, r316625,r316628,r316654,r316682,r316704,r316771,r317092,r317097,r317099, r317652,r317785,r317886,r317887,r318142,r318320,r318356,r318678,r318754, r318982,r318986,r318987,r318988,r318989,r318990,r318991,r318992,r318993, r318994,r318999,r319083,r319084,r319085,r320011,r320234,r320288,r320304, r320467,r320482 r316437: Small cleanup to make i386/loader match efi/loader boot environment code r316577: loader: part.c cstyle cleanup r316578: loader: want mechanism to avoid RA with bcache r316585: loader: zfs reader should check all labels r316590: libstand/dosfs: cache FAT32 in 128 Kb blocks to save loader memory r316612: In r298230 the value of HEAP_MIN was changed from 3MB to 64MB. Correct a comment. r316625: Do not use -msoft-float with intention of disabling FP on aarch64 r316628: Silence GCC warning by initializing the local variable. r316654: loader: r316585 did miss userboot update r316682: loader: r316585 did miss sparc/ofw r316704: loader.efi: only fetch zfs pool guid for the actual boot device r316771: loader: Avoid possible overflow via environment variable r317092: loader: zfs reader vdev_probe should check for minimum device size r317097: loader: F_READ/F_WRITE should be checked against masked flag r317099: loader: uboot disk ioctl should call disk_ioctl r317652: loader.efi: ResetSystem does not use data with EFI_SUCCESS r317785: zfsboot: drvsize() may be unusable on some systems r317886: distinguish NFS versus TFTP boot by rootpath r317887: loader: network read rework r318142: libstand: NULL pointer dereference in rarp r318320: loader: add ip layer code into libstand r318356: libstand: increase nfs max read size to 16k r318678: Replacing iterating over rootpath by strsep(3). r318754: Pass -N directly to ld via -Wl rather than passing it to the compiler driver. r318982: Pass a "FREEBSD" user-class in PXE dhcp request r318986: add a comment on vendor index 19 and 20 to avoid confusion r318987: Support URI scheme for root-path in netbooting r318988: Always build tftpfs support along with nfs for pxeboot r318989: Always issue the pxe request r318990: Partially revert r314948 r318991: Document recent changes on pxeboot r318992: Capitalize DHCP r318993: Use the usual FreeBSD spelling for the DHCP user class r318994: Catch with the change in the user class r318999: Update the comments concerning net_parse_rootpath to reflect what it is now r319083: Followup on the user-class changes r319084: Small cleanup in dev_net.c r319085: use the same option list for dhcp discovery and request r320011: Add chain loader support for loader r320234: Make structure padding explicit in EFI_MEMORY_DESCRIPTOR r320288: Allow Clang's integrated assembler to assemble boot0 r320304: loader.efi: Disable smbios for arm r320467: loader: chain load relocate data declaration is bad r320482: As with arm64 mark the EFI PE header as allocated on arm. PR: 218473 Added: stable/11/lib/libstand/ip.c - copied unchanged from r318320, head/lib/libstand/ip.c stable/11/sys/boot/i386/libi386/relocater_tramp.S - copied unchanged from r320011, head/sys/boot/i386/libi386/relocater_tramp.S stable/11/sys/boot/i386/loader/chain.c - copied, changed from r320011, head/sys/boot/i386/loader/chain.c Modified: stable/11/lib/libstand/Makefile stable/11/lib/libstand/arp.c stable/11/lib/libstand/bootp.c stable/11/lib/libstand/bootp.h stable/11/lib/libstand/bootparam.c stable/11/lib/libstand/dosfs.c stable/11/lib/libstand/dosfs.h stable/11/lib/libstand/ether.c stable/11/lib/libstand/globals.c stable/11/lib/libstand/net.c stable/11/lib/libstand/net.h stable/11/lib/libstand/netif.c stable/11/lib/libstand/netif.h stable/11/lib/libstand/nfs.c stable/11/lib/libstand/rarp.c stable/11/lib/libstand/rpc.c stable/11/lib/libstand/rpc.h stable/11/lib/libstand/stand.h stable/11/lib/libstand/tftp.c stable/11/lib/libstand/udp.c stable/11/share/mk/bsd.stand.mk stable/11/sys/boot/common/bcache.c stable/11/sys/boot/common/commands.c stable/11/sys/boot/common/dev_net.c stable/11/sys/boot/common/disk.c stable/11/sys/boot/common/md.c stable/11/sys/boot/common/part.c stable/11/sys/boot/efi/Makefile.inc stable/11/sys/boot/efi/boot1/Makefile stable/11/sys/boot/efi/boot1/boot1.c stable/11/sys/boot/efi/boot1/zfs_module.c stable/11/sys/boot/efi/fdt/Makefile stable/11/sys/boot/efi/include/efidef.h stable/11/sys/boot/efi/libefi/Makefile stable/11/sys/boot/efi/libefi/efinet.c stable/11/sys/boot/efi/libefi/efipart.c stable/11/sys/boot/efi/libefi/time.c stable/11/sys/boot/efi/loader/Makefile stable/11/sys/boot/efi/loader/arch/arm/start.S stable/11/sys/boot/efi/loader/arch/arm64/Makefile.inc stable/11/sys/boot/efi/loader/main.c stable/11/sys/boot/forth/menu.rc stable/11/sys/boot/i386/boot0/Makefile stable/11/sys/boot/i386/common/drv.h stable/11/sys/boot/i386/libi386/Makefile stable/11/sys/boot/i386/libi386/bioscd.c stable/11/sys/boot/i386/libi386/biosdisk.c stable/11/sys/boot/i386/libi386/biosmem.c stable/11/sys/boot/i386/libi386/libi386.h stable/11/sys/boot/i386/libi386/pxe.c stable/11/sys/boot/i386/libi386/pxe.h stable/11/sys/boot/i386/loader/Makefile stable/11/sys/boot/i386/loader/help.i386 stable/11/sys/boot/i386/loader/main.c stable/11/sys/boot/i386/pxeldr/pxeboot.8 stable/11/sys/boot/i386/zfsboot/zfsboot.c stable/11/sys/boot/mips/beri/boot2/Makefile stable/11/sys/boot/mips/beri/loader/beri_disk_cfi.c stable/11/sys/boot/mips/beri/loader/beri_disk_sdcard.c stable/11/sys/boot/ofw/libofw/ofw_disk.c stable/11/sys/boot/ofw/libofw/ofw_net.c stable/11/sys/boot/ofw/libofw/openfirm.c stable/11/sys/boot/ofw/libofw/openfirm.h stable/11/sys/boot/powerpc/ps3/ps3cdrom.c stable/11/sys/boot/powerpc/ps3/ps3disk.c stable/11/sys/boot/sparc64/loader/main.c stable/11/sys/boot/uboot/lib/disk.c stable/11/sys/boot/uboot/lib/net.c stable/11/sys/boot/usb/storage/umass_loader.c stable/11/sys/boot/userboot/userboot/main.c stable/11/sys/boot/userboot/userboot/userboot_disk.c stable/11/sys/boot/zfs/libzfs.h stable/11/sys/boot/zfs/zfsimpl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libstand/Makefile ============================================================================== --- stable/11/lib/libstand/Makefile Sat Feb 10 04:37:44 2018 (r329099) +++ stable/11/lib/libstand/Makefile Sat Feb 10 04:56:07 2018 (r329100) @@ -141,7 +141,7 @@ SRCS+= closeall.c dev.c ioctl.c nullfs.c stat.c \ fstat.c close.c lseek.c open.c read.c write.c readdir.c # network routines -SRCS+= arp.c ether.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c +SRCS+= arp.c ether.c ip.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c # network info services: SRCS+= bootp.c rarp.c bootparam.c Modified: stable/11/lib/libstand/arp.c ============================================================================== --- stable/11/lib/libstand/arp.c Sat Feb 10 04:37:44 2018 (r329099) +++ stable/11/lib/libstand/arp.c Sat Feb 10 04:56:07 2018 (r329100) @@ -65,17 +65,16 @@ int arp_num = 1; /* Local forwards */ static ssize_t arpsend(struct iodesc *, void *, size_t); -static ssize_t arprecv(struct iodesc *, void *, size_t, time_t); +static ssize_t arprecv(struct iodesc *, void **, void **, time_t); /* Broadcast an ARP packet, asking who has addr on interface d */ u_char * -arpwhohas(d, addr) - struct iodesc *d; - struct in_addr addr; +arpwhohas(struct iodesc *d, struct in_addr addr) { int i; struct ether_arp *ah; struct arp_list *al; + void *pkt; struct { struct ether_header eh; struct { @@ -83,13 +82,6 @@ arpwhohas(d, addr) u_char pad[18]; /* 60 - sizeof(...) */ } data; } wbuf; - struct { - struct ether_header eh; - struct { - struct ether_arp arp; - u_char pad[24]; /* extra space */ - } data; - } rbuf; /* Try for cached answer first */ for (i = 0, al = arp_list; i < arp_num; ++i, ++al) @@ -122,20 +114,24 @@ arpwhohas(d, addr) /* Store ip address in cache (incomplete entry). */ al->addr = addr; + pkt = NULL; + ah = NULL; i = sendrecv(d, arpsend, &wbuf.data, sizeof(wbuf.data), - arprecv, &rbuf.data, sizeof(rbuf.data)); + arprecv, &pkt, (void **)&ah); if (i == -1) { panic("arp: no response for %s\n", inet_ntoa(addr)); } /* Store ethernet address in cache */ - ah = &rbuf.data.arp; #ifdef ARP_DEBUG if (debug) { + struct ether_header *eh; + + eh = (struct ether_header *)((uintptr_t)pkt + ETHER_ALIGN); printf("arp: response from %s\n", - ether_sprintf(rbuf.eh.ether_shost)); + ether_sprintf(eh->ether_shost)); printf("arp: cacheing %s --> %s\n", inet_ntoa(addr), ether_sprintf(ah->arp_sha)); } @@ -143,14 +139,12 @@ arpwhohas(d, addr) MACPY(ah->arp_sha, al->ea); ++arp_num; + free(pkt); return (al->ea); } static ssize_t -arpsend(d, pkt, len) - struct iodesc *d; - void *pkt; - size_t len; +arpsend(struct iodesc *d, void *pkt, size_t len) { #ifdef ARP_DEBUG @@ -166,28 +160,27 @@ arpsend(d, pkt, len) * else -1 (and errno == 0) */ static ssize_t -arprecv(d, pkt, len, tleft) - struct iodesc *d; - void *pkt; - size_t len; - time_t tleft; +arprecv(struct iodesc *d, void **pkt, void **payload, time_t tleft) { ssize_t n; struct ether_arp *ah; u_int16_t etype; /* host order */ + void *ptr; #ifdef ARP_DEBUG if (debug) printf("arprecv: "); #endif - n = readether(d, pkt, len, tleft, &etype); + ptr = NULL; + n = readether(d, &ptr, (void **)&ah, tleft, &etype); errno = 0; /* XXX */ if (n == -1 || n < sizeof(struct ether_arp)) { #ifdef ARP_DEBUG if (debug) printf("bad len=%d\n", n); #endif + free(ptr); return (-1); } @@ -196,12 +189,11 @@ arprecv(d, pkt, len, tleft) if (debug) printf("not arp type=%d\n", etype); #endif + free(ptr); return (-1); } /* Ethernet address now checked in readether() */ - - ah = (struct ether_arp *)pkt; if (ah->arp_hrd != htons(ARPHRD_ETHER) || ah->arp_pro != htons(ETHERTYPE_IP) || ah->arp_hln != sizeof(ah->arp_sha) || @@ -211,6 +203,7 @@ arprecv(d, pkt, len, tleft) if (debug) printf("bad hrd/pro/hln/pln\n"); #endif + free(ptr); return (-1); } @@ -220,6 +213,7 @@ arprecv(d, pkt, len, tleft) printf("is request\n"); #endif arp_reply(d, ah); + free(ptr); return (-1); } @@ -228,6 +222,7 @@ arprecv(d, pkt, len, tleft) if (debug) printf("not ARP reply\n"); #endif + free(ptr); return (-1); } @@ -239,6 +234,7 @@ arprecv(d, pkt, len, tleft) if (debug) printf("unwanted address\n"); #endif + free(ptr); return (-1); } /* We don't care who the reply was sent to. */ @@ -248,6 +244,8 @@ arprecv(d, pkt, len, tleft) if (debug) printf("got it\n"); #endif + *pkt = ptr; + *payload = ah; return (n); } @@ -256,9 +254,7 @@ arprecv(d, pkt, len, tleft) * Notes: Re-uses buffer. Pad to length = 46. */ void -arp_reply(d, pkt) - struct iodesc *d; - void *pkt; /* the request */ +arp_reply(struct iodesc *d, void *pkt) { struct ether_arp *arp = pkt; Modified: stable/11/lib/libstand/bootp.c ============================================================================== --- stable/11/lib/libstand/bootp.c Sat Feb 10 04:37:44 2018 (r329099) +++ stable/11/lib/libstand/bootp.c Sat Feb 10 04:56:07 2018 (r329100) @@ -38,6 +38,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -72,7 +73,7 @@ static char vm_cmu[4] = VM_CMU; /* Local forwards */ static ssize_t bootpsend(struct iodesc *, void *, size_t); -static ssize_t bootprecv(struct iodesc *, void *, size_t, time_t); +static ssize_t bootprecv(struct iodesc *, void **, void **, time_t); static int vend_rfc1048(u_char *, u_int); #ifdef BOOTP_VEND_CMU static void vend_cmu(u_char *); @@ -89,23 +90,50 @@ static void setenv_(u_char *cp, u_char *ep, struct dh static char expected_dhcpmsgtype = -1, dhcp_ok; struct in_addr dhcp_serverip; #endif +struct bootp *bootp_response; +size_t bootp_response_size; +static void +bootp_fill_request(unsigned char *bp_vend) +{ + /* + * We are booting from PXE, we want to send the string + * 'PXEClient' to the DHCP server so you have the option of + * only responding to PXE aware dhcp requests. + */ + bp_vend[0] = TAG_CLASSID; + bp_vend[1] = 9; + bcopy("PXEClient", &bp_vend[2], 9); + bp_vend[11] = TAG_USER_CLASS; + /* len of each user class + number of user class */ + bp_vend[12] = 8; + /* len of the first user class */ + bp_vend[13] = 7; + bcopy("FreeBSD", &bp_vend[14], 7); + bp_vend[21] = TAG_PARAM_REQ; + bp_vend[22] = 7; + bp_vend[23] = TAG_ROOTPATH; + bp_vend[24] = TAG_HOSTNAME; + bp_vend[25] = TAG_SWAPSERVER; + bp_vend[26] = TAG_GATEWAY; + bp_vend[27] = TAG_SUBNET_MASK; + bp_vend[28] = TAG_INTF_MTU; + bp_vend[29] = TAG_SERVERID; + bp_vend[30] = TAG_END; +} + /* Fetch required bootp infomation */ void -bootp(sock, flag) - int sock; - int flag; +bootp(int sock) { + void *pkt; struct iodesc *d; struct bootp *bp; struct { u_char header[HEADER_SIZE]; struct bootp wbootp; } wbuf; - struct { - u_char header[HEADER_SIZE]; - struct bootp rbootp; - } rbuf; + struct bootp *rbootp; #ifdef BOOTP_DEBUG if (debug) @@ -137,29 +165,8 @@ bootp(sock, flag) bp->bp_vend[4] = TAG_DHCP_MSGTYPE; bp->bp_vend[5] = 1; bp->bp_vend[6] = DHCPDISCOVER; + bootp_fill_request(&bp->bp_vend[7]); - /* - * If we are booting from PXE, we want to send the string - * 'PXEClient' to the DHCP server so you have the option of - * only responding to PXE aware dhcp requests. - */ - if (flag & BOOTP_PXE) { - bp->bp_vend[7] = TAG_CLASSID; - bp->bp_vend[8] = 9; - bcopy("PXEClient", &bp->bp_vend[9], 9); - bp->bp_vend[18] = TAG_PARAM_REQ; - bp->bp_vend[19] = 8; - bp->bp_vend[20] = TAG_ROOTPATH; - bp->bp_vend[21] = TAG_TFTP_SERVER; - bp->bp_vend[22] = TAG_HOSTNAME; - bp->bp_vend[23] = TAG_SWAPSERVER; - bp->bp_vend[24] = TAG_GATEWAY; - bp->bp_vend[25] = TAG_SUBNET_MASK; - bp->bp_vend[26] = TAG_INTF_MTU; - bp->bp_vend[27] = TAG_SERVERID; - bp->bp_vend[28] = TAG_END; - } else - bp->bp_vend[7] = TAG_END; #else bp->bp_vend[4] = TAG_END; #endif @@ -176,8 +183,7 @@ bootp(sock, flag) if(sendrecv(d, bootpsend, bp, sizeof(*bp), - bootprecv, &rbuf.rbootp, sizeof(rbuf.rbootp)) - == -1) { + bootprecv, &pkt, (void **)&rbootp) == -1) { printf("bootp: no reply\n"); return; } @@ -188,7 +194,7 @@ bootp(sock, flag) bp->bp_vend[6] = DHCPREQUEST; bp->bp_vend[7] = TAG_REQ_ADDR; bp->bp_vend[8] = 4; - bcopy(&rbuf.rbootp.bp_yiaddr, &bp->bp_vend[9], 4); + bcopy(&rbootp->bp_yiaddr, &bp->bp_vend[9], 4); bp->bp_vend[13] = TAG_SERVERID; bp->bp_vend[14] = 4; bcopy(&dhcp_serverip.s_addr, &bp->bp_vend[15], 4); @@ -196,30 +202,25 @@ bootp(sock, flag) bp->bp_vend[20] = 4; leasetime = htonl(300); bcopy(&leasetime, &bp->bp_vend[21], 4); - if (flag & BOOTP_PXE) { - bp->bp_vend[25] = TAG_CLASSID; - bp->bp_vend[26] = 9; - bcopy("PXEClient", &bp->bp_vend[27], 9); - bp->bp_vend[36] = TAG_END; - } else - bp->bp_vend[25] = TAG_END; + bootp_fill_request(&bp->bp_vend[25]); expected_dhcpmsgtype = DHCPACK; + free(pkt); if(sendrecv(d, bootpsend, bp, sizeof(*bp), - bootprecv, &rbuf.rbootp, sizeof(rbuf.rbootp)) - == -1) { + bootprecv, &pkt, (void **)&rbootp) == -1) { printf("DHCPREQUEST failed\n"); return; } } #endif - myip = d->myip = rbuf.rbootp.bp_yiaddr; - servip = rbuf.rbootp.bp_siaddr; - if(rootip.s_addr == INADDR_ANY) rootip = servip; - bcopy(rbuf.rbootp.bp_file, bootfile, sizeof(bootfile)); + myip = d->myip = rbootp->bp_yiaddr; + servip = rbootp->bp_siaddr; + if (rootip.s_addr == INADDR_ANY) + rootip = servip; + bcopy(rbootp->bp_file, bootfile, sizeof(bootfile)); bootfile[sizeof(bootfile) - 1] = '\0'; if (!netmask) { @@ -259,14 +260,12 @@ bootp(sock, flag) /* Bump xid so next request will be unique. */ ++d->xid; + free(pkt); } /* Transmit a bootp request */ static ssize_t -bootpsend(d, pkt, len) - struct iodesc *d; - void *pkt; - size_t len; +bootpsend(struct iodesc *d, void *pkt, size_t len) { struct bootp *bp; @@ -287,30 +286,25 @@ bootpsend(d, pkt, len) } static ssize_t -bootprecv(d, pkt, len, tleft) -struct iodesc *d; -void *pkt; -size_t len; -time_t tleft; +bootprecv(struct iodesc *d, void **pkt, void **payload, time_t tleft) { ssize_t n; struct bootp *bp; + void *ptr; -#ifdef BOOTP_DEBUGx +#ifdef BOOTP_DEBUG if (debug) printf("bootp_recvoffer: called\n"); #endif - n = readudp(d, pkt, len, tleft); + ptr = NULL; + n = readudp(d, &ptr, (void **)&bp, tleft); if (n == -1 || n < sizeof(struct bootp) - BOOTP_VENDSIZE) goto bad; - bp = (struct bootp *)pkt; - #ifdef BOOTP_DEBUG if (debug) - printf("bootprecv: checked. bp = 0x%lx, n = %d\n", - (long)bp, (int)n); + printf("bootprecv: checked. bp = %p, n = %zd\n", bp, n); #endif if (bp->bp_xid != htonl(d->xid)) { #ifdef BOOTP_DEBUG @@ -329,8 +323,21 @@ time_t tleft; /* Suck out vendor info */ if (bcmp(vm_rfc1048, bp->bp_vend, sizeof(vm_rfc1048)) == 0) { - if(vend_rfc1048(bp->bp_vend, sizeof(bp->bp_vend)) != 0) + int vsize = n - offsetof(struct bootp, bp_vend); + if (vend_rfc1048(bp->bp_vend, vsize) != 0) goto bad; + + /* Save copy of bootp reply or DHCP ACK message */ + if (bp->bp_op == BOOTREPLY && + ((dhcp_ok == 1 && expected_dhcpmsgtype == DHCPACK) || + dhcp_ok == 0)) { + free(bootp_response); + bootp_response = malloc(n); + if (bootp_response != NULL) { + bootp_response_size = n; + bcopy(bp, bootp_response, bootp_response_size); + } + } } #ifdef BOOTP_VEND_CMU else if (bcmp(vm_cmu, bp->bp_vend, sizeof(vm_cmu)) == 0) @@ -339,8 +346,11 @@ time_t tleft; else printf("bootprecv: unknown vendor 0x%lx\n", (long)bp->bp_vend); - return(n); + *pkt = ptr; + *payload = bp; + return (n); bad: + free(ptr); errno = 0; return (-1); } @@ -357,9 +367,7 @@ dhcp_try_rfc1048(u_char *cp, u_int len) } static int -vend_rfc1048(cp, len) - u_char *cp; - u_int len; +vend_rfc1048(u_char *cp, u_int len) { u_char *ep; int size; @@ -438,10 +446,6 @@ vend_rfc1048(cp, len) bcopy(cp, &dhcp_serverip.s_addr, sizeof(dhcp_serverip.s_addr)); } - if (tag == TAG_TFTP_SERVER) { - bcopy(cp, &tftpip.s_addr, - sizeof(tftpip.s_addr)); - } #endif cp += size; } @@ -450,8 +454,7 @@ vend_rfc1048(cp, len) #ifdef BOOTP_VEND_CMU static void -vend_cmu(cp) - u_char *cp; +vend_cmu(u_char *cp) { struct cmu_vend *vp; Modified: stable/11/lib/libstand/bootp.h ============================================================================== --- stable/11/lib/libstand/bootp.h Sat Feb 10 04:37:44 2018 (r329099) +++ stable/11/lib/libstand/bootp.h Sat Feb 10 04:56:07 2018 (r329100) @@ -108,7 +108,7 @@ struct bootp { #define TAG_T2 ((unsigned char) 59) #define TAG_CLASSID ((unsigned char) 60) #define TAG_CLIENTID ((unsigned char) 61) -#define TAG_TFTP_SERVER ((unsigned char) 150) +#define TAG_USER_CLASS ((unsigned char) 77) #endif #define TAG_END ((unsigned char) 255) @@ -124,12 +124,6 @@ struct bootp { #endif /* - * bootp flags - */ -#define BOOTP_NONE 0x0000 /* No flags */ -#define BOOTP_PXE 0x0001 /* Booting from PXE. */ - -/* * "vendor" data permitted for CMU bootp clients. */ @@ -147,6 +141,10 @@ struct cmu_vend { /* v_flags values */ #define VF_SMASK 1 /* Subnet mask field contains valid data */ + +/* cached bootp response/dhcp ack */ +extern struct bootp *bootp_response; +extern size_t bootp_response_size; int dhcp_try_rfc1048(u_char *cp, u_int len); Modified: stable/11/lib/libstand/bootparam.c ============================================================================== --- stable/11/lib/libstand/bootparam.c Sat Feb 10 04:37:44 2018 (r329099) +++ stable/11/lib/libstand/bootparam.c Sat Feb 10 04:56:07 2018 (r329100) @@ -104,8 +104,7 @@ int xdr_string_decode(char **p, char *str, int *len_p) * know about us (don't want to broadcast a getport call). */ int -bp_whoami(sockfd) - int sockfd; +bp_whoami(int sockfd) { /* RPC structures for PMAPPROC_CALLIT */ struct args { @@ -126,22 +125,19 @@ bp_whoami(sockfd) n_long h[RPC_HEADER_WORDS]; struct args d; } sdata; - struct { - n_long h[RPC_HEADER_WORDS]; - struct repl d; - } rdata; char *send_tail, *recv_head; struct iodesc *d; - int len, x; + void *pkt; + int len, x, rc; RPC_PRINTF(("bp_whoami: myip=%s\n", inet_ntoa(myip))); + rc = -1; if (!(d = socktodesc(sockfd))) { RPC_PRINTF(("bp_whoami: bad socket. %d\n", sockfd)); - return (-1); + return (rc); } args = &sdata.d; - repl = &rdata.d; /* * Build request args for PMAPPROC_CALLIT. @@ -156,19 +152,19 @@ bp_whoami(sockfd) * append encapsulated data (client IP address) */ if (xdr_inaddr_encode(&send_tail, myip)) - return (-1); + return (rc); /* RPC: portmap/callit */ d->myport = htons(--rpc_port); d->destip.s_addr = INADDR_BROADCAST; /* XXX: subnet bcast? */ /* rpc_call will set d->destport */ + pkt = NULL; len = rpc_call(d, PMAPPROG, PMAPVERS, PMAPPROC_CALLIT, - args, send_tail - (char*)args, - repl, sizeof(*repl)); + args, send_tail - (char*)args, (void **)&repl, &pkt); if (len < 8) { printf("bootparamd: 'whoami' call failed\n"); - return (-1); + goto done; } /* Save bootparam server address (from IP header). */ @@ -196,7 +192,7 @@ bp_whoami(sockfd) x = ntohl(repl->encap_len); if (len < x) { printf("bp_whoami: short reply, %d < %d\n", len, x); - return (-1); + goto done; } recv_head = (char*) repl->capsule; @@ -204,24 +200,27 @@ bp_whoami(sockfd) hostnamelen = MAXHOSTNAMELEN-1; if (xdr_string_decode(&recv_head, hostname, &hostnamelen)) { RPC_PRINTF(("bp_whoami: bad hostname\n")); - return (-1); + goto done; } /* domain name */ domainnamelen = MAXHOSTNAMELEN-1; if (xdr_string_decode(&recv_head, domainname, &domainnamelen)) { RPC_PRINTF(("bp_whoami: bad domainname\n")); - return (-1); + goto done; } /* gateway address */ if (xdr_inaddr_decode(&recv_head, &gateip)) { RPC_PRINTF(("bp_whoami: bad gateway\n")); - return (-1); + goto done; } /* success */ - return(0); + rc = 0; +done: + free(pkt); + return (rc); } @@ -233,25 +232,18 @@ bp_whoami(sockfd) * server pathname */ int -bp_getfile(sockfd, key, serv_addr, pathname) - int sockfd; - char *key; - char *pathname; - struct in_addr *serv_addr; +bp_getfile(int sockfd, char *key, struct in_addr *serv_addr, char *pathname) { struct { n_long h[RPC_HEADER_WORDS]; n_long d[64]; } sdata; - struct { - n_long h[RPC_HEADER_WORDS]; - n_long d[128]; - } rdata; + void *pkt; char serv_name[FNAME_SIZE]; - char *send_tail, *recv_head; + char *rdata, *send_tail; /* misc... */ struct iodesc *d; - int sn_len, path_len, rlen; + int rc = -1, sn_len, path_len, rlen; if (!(d = socktodesc(sockfd))) { RPC_PRINTF(("bp_getfile: bad socket. %d\n", sockfd)); @@ -259,7 +251,6 @@ bp_getfile(sockfd, key, serv_addr, pathname) } send_tail = (char*) sdata.d; - recv_head = (char*) rdata.d; /* * Build request message. @@ -281,17 +272,16 @@ bp_getfile(sockfd, key, serv_addr, pathname) d->myport = htons(--rpc_port); d->destip = bp_server_addr; /* rpc_call will set d->destport */ - + pkt = NULL; rlen = rpc_call(d, BOOTPARAM_PROG, BOOTPARAM_VERS, BOOTPARAM_GETFILE, sdata.d, send_tail - (char*)sdata.d, - rdata.d, sizeof(rdata.d)); + (void **)&rdata, &pkt); if (rlen < 4) { RPC_PRINTF(("bp_getfile: short reply\n")); errno = EBADRPC; - return (-1); + goto done; } - recv_head = (char*) rdata.d; /* * Parse result message. @@ -299,26 +289,29 @@ bp_getfile(sockfd, key, serv_addr, pathname) /* server name */ sn_len = FNAME_SIZE-1; - if (xdr_string_decode(&recv_head, serv_name, &sn_len)) { + if (xdr_string_decode(&rdata, serv_name, &sn_len)) { RPC_PRINTF(("bp_getfile: bad server name\n")); - return (-1); + goto done; } /* server IP address (mountd/NFS) */ - if (xdr_inaddr_decode(&recv_head, serv_addr)) { + if (xdr_inaddr_decode(&rdata, serv_addr)) { RPC_PRINTF(("bp_getfile: bad server addr\n")); - return (-1); + goto done; } /* server pathname */ path_len = MAXPATHLEN-1; - if (xdr_string_decode(&recv_head, pathname, &path_len)) { + if (xdr_string_decode(&rdata, pathname, &path_len)) { RPC_PRINTF(("bp_getfile: bad server path\n")); - return (-1); + goto done; } /* success */ - return(0); + rc = 0; +done: + free(pkt); + return (rc); } @@ -329,17 +322,14 @@ bp_getfile(sockfd, key, serv_addr, pathname) int -xdr_string_encode(pkt, str, len) - char **pkt; - char *str; - int len; +xdr_string_encode(char **pkt, char *str, int len) { - u_int32_t *lenp; + uint32_t *lenp; char *datap; int padlen = (len + 3) & ~3; /* padded length */ /* The data will be int aligned. */ - lenp = (u_int32_t*) *pkt; + lenp = (uint32_t *) *pkt; *pkt += sizeof(*lenp); *lenp = htonl(len); @@ -351,18 +341,15 @@ xdr_string_encode(pkt, str, len) } int -xdr_string_decode(pkt, str, len_p) - char **pkt; - char *str; - int *len_p; /* bufsize - 1 */ +xdr_string_decode(char **pkt, char *str, int *len_p) { - u_int32_t *lenp; + uint32_t *lenp; char *datap; int slen; /* string length */ int plen; /* padded length */ /* The data will be int aligned. */ - lenp = (u_int32_t*) *pkt; + lenp = (uint32_t *) *pkt; *pkt += sizeof(*lenp); slen = ntohl(*lenp); plen = (slen + 3) & ~3; @@ -381,9 +368,7 @@ xdr_string_decode(pkt, str, len_p) int -xdr_inaddr_encode(pkt, ia) - char **pkt; - struct in_addr ia; /* network order */ +xdr_inaddr_encode(char **pkt, struct in_addr ia) { struct xdr_inaddr *xi; u_char *cp; @@ -414,9 +399,7 @@ xdr_inaddr_encode(pkt, ia) } int -xdr_inaddr_decode(pkt, ia) - char **pkt; - struct in_addr *ia; /* network order */ +xdr_inaddr_decode(char **pkt, struct in_addr *ia) { struct xdr_inaddr *xi; u_char *cp; Modified: stable/11/lib/libstand/dosfs.c ============================================================================== --- stable/11/lib/libstand/dosfs.c Sat Feb 10 04:37:44 2018 (r329099) +++ stable/11/lib/libstand/dosfs.c Sat Feb 10 04:56:07 2018 (r329100) @@ -65,6 +65,7 @@ struct fs_ops dosfs_fsops = { #define DEPSEC 16 /* directory entries per sector */ #define DSHIFT 4 /* DEPSEC shift */ #define LOCLUS 2 /* lowest cluster number */ +#define FATBLKSZ 0x20000 /* size of block in the FAT cache buffer */ /* DOS "BIOS Parameter Block" */ typedef struct { @@ -132,18 +133,6 @@ static DOS_DE dot[2] = { ((u_int)cv2((de)->dex.h_clus) << 16) | \ cv2((de)->clus)) -/* - * fat cache metadata - */ -struct fatcache { - int unit; /* disk unit number */ - int size; /* buffer (and fat) size in sectors */ - u_char *buf; -}; - -static struct fatcache fat; - -static int dosunmount(DOS_FS *); static int parsebs(DOS_FS *, DOS_BS *); static int namede(DOS_FS *, const char *, DOS_DE **); static int lookup(DOS_FS *, u_int, const char *, DOS_DE **); @@ -153,36 +142,37 @@ static off_t fsize(DOS_FS *, DOS_DE *); static int fatcnt(DOS_FS *, u_int); static int fatget(DOS_FS *, u_int *); static int fatend(u_int, u_int); -static int ioread(DOS_FS *, u_int, void *, u_int); -static int ioget(struct open_file *, daddr_t, void *, u_int); +static int ioread(DOS_FS *, u_int, void *, size_t); +static int ioget(struct open_file *, daddr_t, void *, size_t); -static void -dos_read_fat(DOS_FS *fs, struct open_file *fd) +static int +dos_read_fatblk(DOS_FS *fs, struct open_file *fd, u_int blknum) { - struct devdesc *dd = fd->f_devdata; + int err; + size_t io_size; + daddr_t offset_in_fat, max_offset_in_fat; - if (fat.buf != NULL) { /* can we reuse old buffer? */ - if (fat.size != fs->spf) { - free(fat.buf); /* no, free old buffer */ - fat.buf = NULL; - } - } + offset_in_fat = ((daddr_t)blknum) * FATBLKSZ; + max_offset_in_fat = secbyt(fs->spf); + io_size = FATBLKSZ; + if (offset_in_fat > max_offset_in_fat) + offset_in_fat = max_offset_in_fat; + if (offset_in_fat + io_size > max_offset_in_fat) + io_size = ((size_t)(max_offset_in_fat - offset_in_fat)); - if (fat.buf == NULL) - fat.buf = malloc(secbyt(fs->spf)); - - if (fat.buf != NULL) { - if (ioget(fd, fs->lsnfat, fat.buf, secbyt(fs->spf)) == 0) { - fat.size = fs->spf; - fat.unit = dd->d_unit; - return; - } + if (io_size != 0) { + err = ioget(fd, fs->lsnfat + bytsec(offset_in_fat), + fs->fatbuf, io_size); + if (err != 0) { + fs->fatbuf_blknum = ((u_int)(-1)); + return (err); + } } - if (fat.buf != NULL) /* got IO error */ - free(fat.buf); - fat.buf = NULL; - fat.unit = -1; /* impossible unit */ - fat.size = 0; + if (io_size < FATBLKSZ) + memset(fs->fatbuf + io_size, 0, FATBLKSZ - io_size); + + fs->fatbuf_blknum = blknum; + return (0); } /* @@ -192,24 +182,27 @@ static int dos_mount(DOS_FS *fs, struct open_file *fd) { int err; - struct devdesc *dd = fd->f_devdata; u_char *buf; bzero(fs, sizeof(DOS_FS)); fs->fd = fd; - if ((err = !(buf = malloc(secbyt(1))) ? errno : 0) || - (err = ioget(fs->fd, 0, buf, secbyt(1))) || + if ((buf = malloc(secbyt(1))) == NULL) + return (errno); + if ((err = ioget(fs->fd, 0, buf, secbyt(1))) || (err = parsebs(fs, (DOS_BS *)buf))) { - if (buf != NULL) - free(buf); - (void)dosunmount(fs); + free(buf); return (err); } free(buf); - if (fat.buf == NULL || fat.unit != dd->d_unit) - dos_read_fat(fs, fd); + if ((fs->fatbuf = malloc(FATBLKSZ)) == NULL) + return (errno); + err = dos_read_fatblk(fs, fd, 0); + if (err != 0) { + free(fs->fatbuf); + return (err); + } fs->root = dot[0]; fs->root.name[0] = ' '; @@ -228,21 +221,9 @@ dos_mount(DOS_FS *fs, struct open_file *fd) static int dos_unmount(DOS_FS *fs) { - int err; - if (fs->links) return (EBUSY); - if ((err = dosunmount(fs))) - return (err); - return (0); -} - -/* - * Common code shared by dos_mount() and dos_unmount() - */ -static int -dosunmount(DOS_FS *fs) -{ + free(fs->fatbuf); free(fs); return (0); } @@ -257,16 +238,20 @@ dos_open(const char *path, struct open_file *fd) DOS_FILE *f; DOS_FS *fs; u_int size, clus; - int err = 0; + int err; /* Allocate mount structure, associate with open */ - fs = malloc(sizeof(DOS_FS)); - - if ((err = dos_mount(fs, fd))) - goto out; + if ((fs = malloc(sizeof(DOS_FS))) == NULL) + return (errno); + if ((err = dos_mount(fs, fd))) { + free(fs); + return (err); + } - if ((err = namede(fs, path, &de))) - goto out; + if ((err = namede(fs, path, &de))) { + dos_unmount(fs); + return (err); + } clus = stclus(fs->fatsz, de); size = cv4(de->size); @@ -274,18 +259,20 @@ dos_open(const char *path, struct open_file *fd) if ((!(de->attr & FA_DIR) && (!clus != !size)) || ((de->attr & FA_DIR) && size) || (clus && !okclus(fs, clus))) { - err = EINVAL; - goto out; + dos_unmount(fs); + return (EINVAL); } - f = malloc(sizeof(DOS_FILE)); + if ((f = malloc(sizeof(DOS_FILE))) == NULL) { + err = errno; + dos_unmount(fs); + return (err); + } bzero(f, sizeof(DOS_FILE)); f->fs = fs; fs->links++; f->de = *de; fd->f_fsdata = (void *)f; - - out: - return (err); + return (0); } /* @@ -761,34 +748,57 @@ fatcnt(DOS_FS *fs, u_int c) } /* - * Get next cluster in cluster chain. Use in core fat cache unless another - * device replaced it. + * Get next cluster in cluster chain. Use in core fat cache unless + * the number of current 128K block in FAT has changed. */ static int fatget(DOS_FS *fs, u_int *c) { - u_char buf[4]; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Feb 10 10:13:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96214F0E879; Sat, 10 Feb 2018 10:13:18 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C40376EA4; Sat, 10 Feb 2018 10:13:18 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4745F12AB4; Sat, 10 Feb 2018 10:13:18 +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 w1AADIDv091212; Sat, 10 Feb 2018 10:13:18 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1AADINx091211; Sat, 10 Feb 2018 10:13:18 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201802101013.w1AADINx091211@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sat, 10 Feb 2018 10:13:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329101 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 329101 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Feb 2018 10:13:18 -0000 Author: ae Date: Sat Feb 10 10:13:17 2018 New Revision: 329101 URL: https://svnweb.freebsd.org/changeset/base/329101 Log: Reinitialize IP header length after checksum calculation. It is used later by TCP-MD5 code. This fixes the problem with broken TCP-MD5 over IPv4 when NIC has disabled TCP checksum offloading. PR: 223835 MFC after: 1 week Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Sat Feb 10 04:56:07 2018 (r329100) +++ head/sys/netinet/tcp_input.c Sat Feb 10 10:13:17 2018 (r329101) @@ -707,6 +707,7 @@ tcp_input(struct mbuf **mp, int *offp, int proto) ip->ip_tos = iptos; /* Re-initialization for later version check */ ip->ip_v = IPVERSION; + ip->ip_hl = off0 >> 2; } if (th->th_sum) { From owner-svn-src-all@freebsd.org Sat Feb 10 14:45:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3DADF013D9; Sat, 10 Feb 2018 14:45:29 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 99C0A81ABC; Sat, 10 Feb 2018 14:45:29 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F5F6156ED; Sat, 10 Feb 2018 14:45:29 +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 w1AEjTOP037607; Sat, 10 Feb 2018 14:45:29 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1AEjTlI037606; Sat, 10 Feb 2018 14:45:29 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201802101445.w1AEjTlI037606@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 10 Feb 2018 14:45:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329102 - head/lib/libcompat/4.3 X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/lib/libcompat/4.3 X-SVN-Commit-Revision: 329102 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Feb 2018 14:45:30 -0000 Author: pfg Date: Sat Feb 10 14:45:29 2018 New Revision: 329102 URL: https://svnweb.freebsd.org/changeset/base/329102 Log: libcompat: Use %hu for unsigned shorts. Obtained from: DragonFlyBSD (git 82e1476a) Modified: head/lib/libcompat/4.3/rexec.c Modified: head/lib/libcompat/4.3/rexec.c ============================================================================== --- head/lib/libcompat/4.3/rexec.c Sat Feb 10 10:13:17 2018 (r329101) +++ head/lib/libcompat/4.3/rexec.c Sat Feb 10 14:45:29 2018 (r329102) @@ -356,7 +356,7 @@ retry: goto bad; } port = ntohs((u_short)sin2.sin_port); - (void) sprintf(num, "%u", port); + (void) sprintf(num, "%hu", port); (void) write(s, num, strlen(num)+1); { int len = sizeof (from); s3 = accept(s2, (struct sockaddr *)&from, &len); From owner-svn-src-all@freebsd.org Sat Feb 10 15:23:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01D87F04293; Sat, 10 Feb 2018 15:23:31 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5AAA836C4; Sat, 10 Feb 2018 15:23:30 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A07F415D66; Sat, 10 Feb 2018 15:23:30 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1AFNUQP058059; Sat, 10 Feb 2018 15:23:30 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1AFNUFk058058; Sat, 10 Feb 2018 15:23:30 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802101523.w1AFNUFk058058@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 10 Feb 2018 15:23:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329103 - stable/11/sbin/geom/class/eli X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/sbin/geom/class/eli X-SVN-Commit-Revision: 329103 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Feb 2018 15:23:31 -0000 Author: kevans Date: Sat Feb 10 15:23:30 2018 New Revision: 329103 URL: https://svnweb.freebsd.org/changeset/base/329103 Log: MFC r303725 (oshogbo): Fix misleading description of the -b option in the geli init command. Modified: stable/11/sbin/geom/class/eli/geli.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/geom/class/eli/geli.8 ============================================================================== --- stable/11/sbin/geom/class/eli/geli.8 Sat Feb 10 14:45:29 2018 (r329102) +++ stable/11/sbin/geom/class/eli/geli.8 Sat Feb 10 15:23:30 2018 (r329103) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 10, 2015 +.Dd August 3, 2016 .Dt GELI 8 .Os .Sh NAME @@ -266,7 +266,7 @@ If the option is not given, there will be no authentic The recommended algorithm is .Nm HMAC/SHA256 . .It Fl b -Ask for the passphrase on boot, before the root partition is mounted. +Try to decrypt this partition during boot, before the root partition is mounted. This makes it possible to use an encrypted root partition. One will still need bootable unencrypted storage with a .Pa /boot/ From owner-svn-src-all@freebsd.org Sat Feb 10 15:29:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29311F0490F; Sat, 10 Feb 2018 15:29:49 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CB16B8396F; Sat, 10 Feb 2018 15:29:48 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C123515D69; Sat, 10 Feb 2018 15:29:48 +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 w1AFTm2D058370; Sat, 10 Feb 2018 15:29:48 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1AFTlQ0058352; Sat, 10 Feb 2018 15:29:47 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201802101529.w1AFTlQ0058352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 10 Feb 2018 15:29:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329104 - in head/sys/gnu/dts: arm include/dt-bindings/clock include/dt-bindings/gpio include/dt-bindings/input include/dt-bindings/phy include/dt-bindings/pinctrl include/dt-bindings/p... X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys/gnu/dts: arm include/dt-bindings/clock include/dt-bindings/gpio include/dt-bindings/input include/dt-bindings/phy include/dt-bindings/pinctrl include/dt-bindings/power include/dt-bindings/... X-SVN-Commit-Revision: 329104 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Feb 2018 15:29:49 -0000 Author: manu Date: Sat Feb 10 15:29:46 2018 New Revision: 329104 URL: https://svnweb.freebsd.org/changeset/base/329104 Log: dts: Update our device tree sources files from Linux 4.15 Added: head/sys/gnu/dts/arm/axp81x.dtsi (contents, props changed) head/sys/gnu/dts/arm/bcm-hr2.dtsi (contents, props changed) head/sys/gnu/dts/arm/bcm47094-luxul-abr-4500.dts (contents, props changed) head/sys/gnu/dts/arm/bcm47094-luxul-xbr-4500.dts (contents, props changed) head/sys/gnu/dts/arm/bcm47189-luxul-xap-1440.dts (contents, props changed) head/sys/gnu/dts/arm/bcm47189-luxul-xap-810.dts (contents, props changed) head/sys/gnu/dts/arm/bcm53340-ubnt-unifi-switch8.dts (contents, props changed) head/sys/gnu/dts/arm/exynos5422-odroid-core.dtsi (contents, props changed) head/sys/gnu/dts/arm/exynos5422-odroidhc1.dts (contents, props changed) head/sys/gnu/dts/arm/imx51-zii-rdu1.dts (contents, props changed) head/sys/gnu/dts/arm/imx53-ppd.dts (contents, props changed) head/sys/gnu/dts/arm/imx6dl-tx6s-8034-mb7.dts (contents, props changed) head/sys/gnu/dts/arm/imx6dl-tx6s-8035-mb7.dts (contents, props changed) head/sys/gnu/dts/arm/imx6dl-tx6u-8033-mb7.dts (contents, props changed) head/sys/gnu/dts/arm/imx6dl-tx6u-80xx-mb7.dts (contents, props changed) head/sys/gnu/dts/arm/imx6dl-wandboard-revd1.dts (contents, props changed) head/sys/gnu/dts/arm/imx6q-display5-tianma-tm070-1280x768.dts (contents, props changed) head/sys/gnu/dts/arm/imx6q-display5.dtsi (contents, props changed) head/sys/gnu/dts/arm/imx6q-pistachio.dts (contents, props changed) head/sys/gnu/dts/arm/imx6q-tx6q-1036-mb7.dts (contents, props changed) head/sys/gnu/dts/arm/imx6q-tx6q-10x0-mb7.dts (contents, props changed) head/sys/gnu/dts/arm/imx6q-wandboard-revd1.dts (contents, props changed) head/sys/gnu/dts/arm/imx6qdl-tx6-lcd.dtsi (contents, props changed) head/sys/gnu/dts/arm/imx6qdl-tx6-lvds.dtsi (contents, props changed) head/sys/gnu/dts/arm/imx6qdl-tx6-mb7.dtsi (contents, props changed) head/sys/gnu/dts/arm/imx6qdl-wandboard-revd1.dtsi (contents, props changed) head/sys/gnu/dts/arm/imx6qp-tx6qp-8037-mb7.dts (contents, props changed) head/sys/gnu/dts/arm/imx6qp-tx6qp-8037.dts (contents, props changed) head/sys/gnu/dts/arm/imx6qp-tx6qp-8137-mb7.dts (contents, props changed) head/sys/gnu/dts/arm/imx6qp-tx6qp-8137.dts (contents, props changed) head/sys/gnu/dts/arm/imx6qp-wandboard-revd1.dts (contents, props changed) head/sys/gnu/dts/arm/imx6sx-softing-vining-2000.dts (contents, props changed) head/sys/gnu/dts/arm/iwg20d-q7-common.dtsi (contents, props changed) head/sys/gnu/dts/arm/iwg20d-q7-dbcm-ca.dtsi (contents, props changed) head/sys/gnu/dts/arm/omap3-evm-processor-common.dtsi (contents, props changed) head/sys/gnu/dts/arm/owl-s500-cubieboard6.dts (contents, props changed) head/sys/gnu/dts/arm/qcom-msm8974-fairphone-fp2.dts (contents, props changed) head/sys/gnu/dts/arm/qcom-msm8974-sony-xperia-castor.dts (contents, props changed) head/sys/gnu/dts/arm/qcom-msm8974pro.dtsi (contents, props changed) head/sys/gnu/dts/arm/r8a7743-iwg20d-q7-dbcm-ca.dts (contents, props changed) head/sys/gnu/dts/arm/r8a7745-iwg22d-sodimm.dts (contents, props changed) head/sys/gnu/dts/arm/r8a7745-iwg22m.dtsi (contents, props changed) head/sys/gnu/dts/arm/rk3288-vyasa.dts (contents, props changed) head/sys/gnu/dts/arm/sun7i-a20-olinuxino-micro-emmc.dts (contents, props changed) head/sys/gnu/dts/arm/sun8i-a83t-tbs-a711.dts (contents, props changed) head/sys/gnu/dts/arm/sun8i-r40-bananapi-m2-ultra.dts (contents, props changed) head/sys/gnu/dts/arm/sun8i-r40.dtsi (contents, props changed) head/sys/gnu/dts/arm/sun8i-v40-bananapi-m2-berry.dts (contents, props changed) head/sys/gnu/dts/include/dt-bindings/clock/mt2712-clk.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/clock/mt7622-clk.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/clock/r8a77970-cpg-mssr.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/gpio/uniphier-gpio.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/stm32-pinfunc.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/power/r8a77970-sysc.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/reset/mt7622-reset.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/thermal/tegra186-bpmp-thermal.h (contents, props changed) Modified: head/sys/gnu/dts/arm/am33xx.dtsi head/sys/gnu/dts/arm/am4372.dtsi head/sys/gnu/dts/arm/am437x-cm-t43.dts head/sys/gnu/dts/arm/am43x-epos-evm.dts head/sys/gnu/dts/arm/armada-370-synology-ds213j.dts head/sys/gnu/dts/arm/armada-385-db-ap.dts head/sys/gnu/dts/arm/armada-385-linksys.dtsi head/sys/gnu/dts/arm/armada-385-synology-ds116.dts head/sys/gnu/dts/arm/armada-388-gp.dts head/sys/gnu/dts/arm/armada-xp-synology-ds414.dts head/sys/gnu/dts/arm/artpec6.dtsi head/sys/gnu/dts/arm/aspeed-ast2500-evb.dts head/sys/gnu/dts/arm/aspeed-bmc-opp-palmetto.dts head/sys/gnu/dts/arm/aspeed-bmc-opp-romulus.dts head/sys/gnu/dts/arm/aspeed-g4.dtsi head/sys/gnu/dts/arm/aspeed-g5.dtsi head/sys/gnu/dts/arm/at91-ariag25.dts head/sys/gnu/dts/arm/at91-ariettag25.dts head/sys/gnu/dts/arm/at91-cosino_mega2560.dts head/sys/gnu/dts/arm/at91-kizbox2.dts head/sys/gnu/dts/arm/at91-kizboxmini.dts head/sys/gnu/dts/arm/at91-sama5d27_som1_ek.dts (contents, props changed) head/sys/gnu/dts/arm/at91-sama5d2_xplained.dts head/sys/gnu/dts/arm/at91-sama5d3_xplained.dts head/sys/gnu/dts/arm/at91-sama5d4_ma5d4evk.dts head/sys/gnu/dts/arm/at91-sama5d4_xplained.dts head/sys/gnu/dts/arm/at91-sama5d4ek.dts head/sys/gnu/dts/arm/at91-tse850-3.dts head/sys/gnu/dts/arm/at91-vinco.dts head/sys/gnu/dts/arm/at91rm9200.dtsi head/sys/gnu/dts/arm/at91rm9200ek.dts head/sys/gnu/dts/arm/at91sam9260.dtsi head/sys/gnu/dts/arm/at91sam9261.dtsi head/sys/gnu/dts/arm/at91sam9261ek.dts head/sys/gnu/dts/arm/at91sam9263.dtsi head/sys/gnu/dts/arm/at91sam9263ek.dts head/sys/gnu/dts/arm/at91sam9g20.dtsi head/sys/gnu/dts/arm/at91sam9g45.dtsi head/sys/gnu/dts/arm/at91sam9m10g45ek.dts head/sys/gnu/dts/arm/at91sam9n12.dtsi head/sys/gnu/dts/arm/at91sam9n12ek.dts head/sys/gnu/dts/arm/at91sam9rl.dtsi head/sys/gnu/dts/arm/at91sam9rlek.dts head/sys/gnu/dts/arm/at91sam9x25ek.dts head/sys/gnu/dts/arm/at91sam9x5.dtsi head/sys/gnu/dts/arm/at91sam9x5ek.dtsi head/sys/gnu/dts/arm/at91sam9xe.dtsi head/sys/gnu/dts/arm/axp209.dtsi head/sys/gnu/dts/arm/bcm-cygnus.dtsi head/sys/gnu/dts/arm/bcm-nsp.dtsi head/sys/gnu/dts/arm/bcm2837-rpi-3-b.dts head/sys/gnu/dts/arm/bcm283x.dtsi head/sys/gnu/dts/arm/bcm47081-luxul-xwr-1200.dts head/sys/gnu/dts/arm/bcm5301x.dtsi head/sys/gnu/dts/arm/bcm53573.dtsi head/sys/gnu/dts/arm/bcm958623hr.dts head/sys/gnu/dts/arm/bcm958625hr.dts head/sys/gnu/dts/arm/berlin2.dtsi head/sys/gnu/dts/arm/berlin2cd.dtsi head/sys/gnu/dts/arm/berlin2q.dtsi head/sys/gnu/dts/arm/da850-lcdk.dts head/sys/gnu/dts/arm/da850-lego-ev3.dts head/sys/gnu/dts/arm/da850.dtsi head/sys/gnu/dts/arm/dm814x.dtsi head/sys/gnu/dts/arm/dove.dtsi head/sys/gnu/dts/arm/dra7-evm-common.dtsi (contents, props changed) head/sys/gnu/dts/arm/dra7-evm.dts head/sys/gnu/dts/arm/dra7.dtsi head/sys/gnu/dts/arm/ep7211-edb7211.dts head/sys/gnu/dts/arm/exynos3250-artik5.dtsi head/sys/gnu/dts/arm/exynos3250-monk.dts head/sys/gnu/dts/arm/exynos3250-rinato.dts head/sys/gnu/dts/arm/exynos3250.dtsi head/sys/gnu/dts/arm/exynos4.dtsi head/sys/gnu/dts/arm/exynos4210-pinctrl.dtsi head/sys/gnu/dts/arm/exynos4210-universal_c210.dts head/sys/gnu/dts/arm/exynos4210.dtsi head/sys/gnu/dts/arm/exynos4412-itop-scp-core.dtsi head/sys/gnu/dts/arm/exynos4412-odroid-common.dtsi head/sys/gnu/dts/arm/exynos4412-odroidx.dts head/sys/gnu/dts/arm/exynos4412-origen.dts head/sys/gnu/dts/arm/exynos4412-pinctrl.dtsi head/sys/gnu/dts/arm/exynos4412-trats2.dts head/sys/gnu/dts/arm/exynos4412.dtsi head/sys/gnu/dts/arm/exynos5250-arndale.dts head/sys/gnu/dts/arm/exynos5250-smdk5250.dts head/sys/gnu/dts/arm/exynos5250-snow-common.dtsi head/sys/gnu/dts/arm/exynos5250-spring.dts head/sys/gnu/dts/arm/exynos5250.dtsi head/sys/gnu/dts/arm/exynos5410-odroidxu.dts head/sys/gnu/dts/arm/exynos5410-smdk5410.dts head/sys/gnu/dts/arm/exynos5410.dtsi head/sys/gnu/dts/arm/exynos5420-arndale-octa.dts head/sys/gnu/dts/arm/exynos5420-cpus.dtsi head/sys/gnu/dts/arm/exynos5420-peach-pit.dts head/sys/gnu/dts/arm/exynos5420-smdk5420.dts head/sys/gnu/dts/arm/exynos5420.dtsi head/sys/gnu/dts/arm/exynos5422-cpus.dtsi head/sys/gnu/dts/arm/exynos5422-odroidxu3-audio.dtsi head/sys/gnu/dts/arm/exynos5422-odroidxu3-common.dtsi head/sys/gnu/dts/arm/exynos5440-ssdk5440.dts head/sys/gnu/dts/arm/exynos5440.dtsi head/sys/gnu/dts/arm/exynos54xx.dtsi head/sys/gnu/dts/arm/exynos5800-peach-pi.dts head/sys/gnu/dts/arm/ge863-pro3.dtsi head/sys/gnu/dts/arm/gemini.dtsi head/sys/gnu/dts/arm/hip01.dtsi head/sys/gnu/dts/arm/hip04-d01.dts head/sys/gnu/dts/arm/hisi-x5hd2.dtsi head/sys/gnu/dts/arm/imx1.dtsi head/sys/gnu/dts/arm/imx25-eukrea-mbimxsd25-baseboard.dts head/sys/gnu/dts/arm/imx25-pdk.dts head/sys/gnu/dts/arm/imx28-apx4devkit.dts head/sys/gnu/dts/arm/imx28-eukrea-mbmx28lc.dtsi head/sys/gnu/dts/arm/imx28-evk.dts head/sys/gnu/dts/arm/imx28-m28evk.dts head/sys/gnu/dts/arm/imx28-tx28.dts head/sys/gnu/dts/arm/imx35-eukrea-mbimxsd35-baseboard.dts head/sys/gnu/dts/arm/imx50.dtsi head/sys/gnu/dts/arm/imx51-apf51dev.dts head/sys/gnu/dts/arm/imx51-babbage.dts head/sys/gnu/dts/arm/imx51-ts4800.dts head/sys/gnu/dts/arm/imx51.dtsi head/sys/gnu/dts/arm/imx53-m53evk.dts head/sys/gnu/dts/arm/imx53-mba53.dts head/sys/gnu/dts/arm/imx53-qsb-common.dtsi head/sys/gnu/dts/arm/imx53-smd.dts head/sys/gnu/dts/arm/imx53-tx53-x03x.dts head/sys/gnu/dts/arm/imx53-tx53-x13x.dts head/sys/gnu/dts/arm/imx53-tx53.dtsi head/sys/gnu/dts/arm/imx53-voipac-bsb.dts head/sys/gnu/dts/arm/imx53.dtsi head/sys/gnu/dts/arm/imx6dl-aristainetos2_4.dts head/sys/gnu/dts/arm/imx6dl-aristainetos_4.dts head/sys/gnu/dts/arm/imx6dl-aristainetos_7.dts head/sys/gnu/dts/arm/imx6dl-colibri-eval-v3.dts head/sys/gnu/dts/arm/imx6dl-icore.dts head/sys/gnu/dts/arm/imx6dl-riotboard.dts head/sys/gnu/dts/arm/imx6dl-tx6dl-comtft.dts head/sys/gnu/dts/arm/imx6dl-tx6s-8034.dts head/sys/gnu/dts/arm/imx6dl-tx6s-8035.dts head/sys/gnu/dts/arm/imx6dl-tx6u-801x.dts head/sys/gnu/dts/arm/imx6dl-tx6u-8033.dts head/sys/gnu/dts/arm/imx6dl-tx6u-811x.dts head/sys/gnu/dts/arm/imx6dl-tx6u-81xx-mb7.dts head/sys/gnu/dts/arm/imx6dl.dtsi head/sys/gnu/dts/arm/imx6q-apalis-eval.dts (contents, props changed) head/sys/gnu/dts/arm/imx6q-apalis-ixora-v1.1.dts (contents, props changed) head/sys/gnu/dts/arm/imx6q-apalis-ixora.dts head/sys/gnu/dts/arm/imx6q-bx50v3.dtsi head/sys/gnu/dts/arm/imx6q-cm-fx6.dts head/sys/gnu/dts/arm/imx6q-dmo-edmqmx6.dts head/sys/gnu/dts/arm/imx6q-gw5400-a.dts head/sys/gnu/dts/arm/imx6q-h100.dts head/sys/gnu/dts/arm/imx6q-icore-rqs.dts head/sys/gnu/dts/arm/imx6q-mccmon6.dts head/sys/gnu/dts/arm/imx6q-novena.dts head/sys/gnu/dts/arm/imx6q-tbs2910.dts head/sys/gnu/dts/arm/imx6q-tx6q-1010-comtft.dts head/sys/gnu/dts/arm/imx6q-tx6q-1010.dts head/sys/gnu/dts/arm/imx6q-tx6q-1020-comtft.dts head/sys/gnu/dts/arm/imx6q-tx6q-1020.dts head/sys/gnu/dts/arm/imx6q-tx6q-1036.dts head/sys/gnu/dts/arm/imx6q-tx6q-1110.dts head/sys/gnu/dts/arm/imx6q-tx6q-11x0-mb7.dts head/sys/gnu/dts/arm/imx6q-utilite-pro.dts head/sys/gnu/dts/arm/imx6q.dtsi head/sys/gnu/dts/arm/imx6qdl-apalis.dtsi head/sys/gnu/dts/arm/imx6qdl-apf6dev.dtsi head/sys/gnu/dts/arm/imx6qdl-colibri.dtsi head/sys/gnu/dts/arm/imx6qdl-gw51xx.dtsi head/sys/gnu/dts/arm/imx6qdl-gw52xx.dtsi head/sys/gnu/dts/arm/imx6qdl-gw53xx.dtsi head/sys/gnu/dts/arm/imx6qdl-gw54xx.dtsi head/sys/gnu/dts/arm/imx6qdl-gw551x.dtsi head/sys/gnu/dts/arm/imx6qdl-gw552x.dtsi head/sys/gnu/dts/arm/imx6qdl-hummingboard.dtsi head/sys/gnu/dts/arm/imx6qdl-icore-rqs.dtsi head/sys/gnu/dts/arm/imx6qdl-icore.dtsi head/sys/gnu/dts/arm/imx6qdl-nit6xlite.dtsi head/sys/gnu/dts/arm/imx6qdl-nitrogen6_max.dtsi head/sys/gnu/dts/arm/imx6qdl-nitrogen6_som2.dtsi head/sys/gnu/dts/arm/imx6qdl-nitrogen6x.dtsi head/sys/gnu/dts/arm/imx6qdl-rex.dtsi head/sys/gnu/dts/arm/imx6qdl-sabreauto.dtsi head/sys/gnu/dts/arm/imx6qdl-sabrelite.dtsi head/sys/gnu/dts/arm/imx6qdl-sabresd.dtsi head/sys/gnu/dts/arm/imx6qdl-tx6.dtsi head/sys/gnu/dts/arm/imx6qdl-wandboard.dtsi head/sys/gnu/dts/arm/imx6qdl-zii-rdu2.dtsi head/sys/gnu/dts/arm/imx6qdl.dtsi head/sys/gnu/dts/arm/imx6qp.dtsi head/sys/gnu/dts/arm/imx6sl-evk.dts head/sys/gnu/dts/arm/imx6sl.dtsi head/sys/gnu/dts/arm/imx6sx-nitrogen6sx.dts head/sys/gnu/dts/arm/imx6sx-sdb-reva.dts head/sys/gnu/dts/arm/imx6sx-sdb.dts head/sys/gnu/dts/arm/imx6sx-udoo-neo.dtsi head/sys/gnu/dts/arm/imx6sx.dtsi head/sys/gnu/dts/arm/imx6ul-14x14-evk.dts head/sys/gnu/dts/arm/imx6ul-pico-hobbit.dts head/sys/gnu/dts/arm/imx6ul-tx6ul-mainboard.dts head/sys/gnu/dts/arm/imx6ul-tx6ul.dtsi head/sys/gnu/dts/arm/imx6ul.dtsi head/sys/gnu/dts/arm/imx7-colibri.dtsi head/sys/gnu/dts/arm/imx7d-nitrogen7.dts head/sys/gnu/dts/arm/imx7d-pico.dts head/sys/gnu/dts/arm/imx7d-sdb.dts head/sys/gnu/dts/arm/imx7s-warp.dts head/sys/gnu/dts/arm/integrator.dtsi head/sys/gnu/dts/arm/integratorap.dts head/sys/gnu/dts/arm/keystone-k2e.dtsi head/sys/gnu/dts/arm/keystone-k2g-evm.dts head/sys/gnu/dts/arm/keystone-k2g.dtsi head/sys/gnu/dts/arm/keystone-k2hk.dtsi head/sys/gnu/dts/arm/keystone-k2l.dtsi head/sys/gnu/dts/arm/keystone.dtsi head/sys/gnu/dts/arm/kirkwood-openblocks_a7.dts head/sys/gnu/dts/arm/kirkwood-synology.dtsi head/sys/gnu/dts/arm/kirkwood-ts219.dtsi head/sys/gnu/dts/arm/kirkwood.dtsi head/sys/gnu/dts/arm/logicpd-som-lv-37xx-devkit.dts head/sys/gnu/dts/arm/logicpd-som-lv.dtsi head/sys/gnu/dts/arm/lpc3250-ea3250.dts head/sys/gnu/dts/arm/lpc3250-phy3250.dts head/sys/gnu/dts/arm/lpc32xx.dtsi head/sys/gnu/dts/arm/ls1021a-qds.dts head/sys/gnu/dts/arm/ls1021a-twr.dts head/sys/gnu/dts/arm/meson.dtsi head/sys/gnu/dts/arm/meson6.dtsi head/sys/gnu/dts/arm/meson8.dtsi head/sys/gnu/dts/arm/meson8b-odroidc1.dts head/sys/gnu/dts/arm/meson8b.dtsi head/sys/gnu/dts/arm/mpa1600.dts head/sys/gnu/dts/arm/mt2701-evb.dts head/sys/gnu/dts/arm/mt2701.dtsi head/sys/gnu/dts/arm/mt6589.dtsi head/sys/gnu/dts/arm/mt7623.dtsi head/sys/gnu/dts/arm/nspire.dtsi head/sys/gnu/dts/arm/omap2420-n8x0-common.dtsi head/sys/gnu/dts/arm/omap3-beagle-xm.dts head/sys/gnu/dts/arm/omap3-beagle.dts head/sys/gnu/dts/arm/omap3-cm-t3x.dtsi head/sys/gnu/dts/arm/omap3-evm-37xx.dts head/sys/gnu/dts/arm/omap3-evm-common.dtsi head/sys/gnu/dts/arm/omap3-evm.dts head/sys/gnu/dts/arm/omap3-gta04.dtsi head/sys/gnu/dts/arm/omap3-igep0020-common.dtsi head/sys/gnu/dts/arm/omap3-igep0030-common.dtsi head/sys/gnu/dts/arm/omap3-lilly-a83x.dtsi head/sys/gnu/dts/arm/omap3-n9.dts head/sys/gnu/dts/arm/omap3-n900.dts head/sys/gnu/dts/arm/omap3-n950-n9.dtsi head/sys/gnu/dts/arm/omap3-n950.dts head/sys/gnu/dts/arm/omap3-overo-base.dtsi head/sys/gnu/dts/arm/omap3-pandora-common.dtsi head/sys/gnu/dts/arm/omap3-panel-sharp-ls037v7dw01.dtsi head/sys/gnu/dts/arm/omap3-tao3530.dtsi head/sys/gnu/dts/arm/omap3.dtsi head/sys/gnu/dts/arm/omap4-droid4-xt894.dts head/sys/gnu/dts/arm/omap4-duovero.dtsi head/sys/gnu/dts/arm/omap4-panda-common.dtsi head/sys/gnu/dts/arm/omap4-var-som-om44.dtsi head/sys/gnu/dts/arm/omap4.dtsi head/sys/gnu/dts/arm/omap5-board-common.dtsi head/sys/gnu/dts/arm/omap5-cm-t54.dts head/sys/gnu/dts/arm/omap5.dtsi head/sys/gnu/dts/arm/owl-s500-guitar-bb-rev-b.dts head/sys/gnu/dts/arm/owl-s500.dtsi head/sys/gnu/dts/arm/ox810se.dtsi head/sys/gnu/dts/arm/ox820.dtsi head/sys/gnu/dts/arm/picoxcell-pc3x2.dtsi head/sys/gnu/dts/arm/picoxcell-pc3x3.dtsi head/sys/gnu/dts/arm/pm9g45.dts head/sys/gnu/dts/arm/qcom-apq8060-dragonboard.dts head/sys/gnu/dts/arm/qcom-apq8064.dtsi head/sys/gnu/dts/arm/qcom-msm8660.dtsi head/sys/gnu/dts/arm/qcom-msm8974.dtsi head/sys/gnu/dts/arm/r7s72100-gr-peach.dts head/sys/gnu/dts/arm/r7s72100.dtsi head/sys/gnu/dts/arm/r8a73a4.dtsi head/sys/gnu/dts/arm/r8a7743-iwg20d-q7.dts head/sys/gnu/dts/arm/r8a7743-iwg20m.dtsi head/sys/gnu/dts/arm/r8a7743.dtsi head/sys/gnu/dts/arm/r8a7745.dtsi head/sys/gnu/dts/arm/r8a7778.dtsi head/sys/gnu/dts/arm/r8a7779.dtsi head/sys/gnu/dts/arm/r8a7790-lager.dts head/sys/gnu/dts/arm/r8a7790.dtsi head/sys/gnu/dts/arm/r8a7791-koelsch.dts head/sys/gnu/dts/arm/r8a7791-porter.dts head/sys/gnu/dts/arm/r8a7791.dtsi head/sys/gnu/dts/arm/r8a7792-blanche.dts head/sys/gnu/dts/arm/r8a7792-wheat.dts head/sys/gnu/dts/arm/r8a7792.dtsi head/sys/gnu/dts/arm/r8a7793-gose.dts head/sys/gnu/dts/arm/r8a7793.dtsi head/sys/gnu/dts/arm/r8a7794-alt.dts head/sys/gnu/dts/arm/r8a7794-silk.dts head/sys/gnu/dts/arm/r8a7794.dtsi head/sys/gnu/dts/arm/rk3036-kylin.dts head/sys/gnu/dts/arm/rk3036.dtsi head/sys/gnu/dts/arm/rk3066a-marsboard.dts head/sys/gnu/dts/arm/rk3066a-rayeager.dts head/sys/gnu/dts/arm/rk3066a.dtsi head/sys/gnu/dts/arm/rk3188-radxarock.dts head/sys/gnu/dts/arm/rk3188.dtsi head/sys/gnu/dts/arm/rk322x.dtsi head/sys/gnu/dts/arm/rk3288-firefly-reload-core.dtsi head/sys/gnu/dts/arm/rk3288-firefly-reload.dts head/sys/gnu/dts/arm/rk3288-popmetal.dts head/sys/gnu/dts/arm/rk3288.dtsi head/sys/gnu/dts/arm/rk3xxx.dtsi head/sys/gnu/dts/arm/rv1108-evb.dts head/sys/gnu/dts/arm/rv1108.dtsi head/sys/gnu/dts/arm/sama5d2.dtsi head/sys/gnu/dts/arm/sama5d3.dtsi head/sys/gnu/dts/arm/sama5d3xmb.dtsi head/sys/gnu/dts/arm/sama5d3xmb_cmp.dtsi head/sys/gnu/dts/arm/sama5d4.dtsi head/sys/gnu/dts/arm/sh73a0.dtsi head/sys/gnu/dts/arm/ste-href-stuib.dtsi head/sys/gnu/dts/arm/ste-href-tvk1281618.dtsi head/sys/gnu/dts/arm/stih407-clock.dtsi head/sys/gnu/dts/arm/stih407-family.dtsi head/sys/gnu/dts/arm/stih407-pinctrl.dtsi head/sys/gnu/dts/arm/stih410-b2120.dts head/sys/gnu/dts/arm/stih410-b2260.dts head/sys/gnu/dts/arm/stih410-clock.dtsi head/sys/gnu/dts/arm/stih410.dtsi head/sys/gnu/dts/arm/stih418-b2199.dts head/sys/gnu/dts/arm/stih418-clock.dtsi head/sys/gnu/dts/arm/stih418.dtsi head/sys/gnu/dts/arm/stihxxx-b2120.dtsi head/sys/gnu/dts/arm/stm32746g-eval.dts head/sys/gnu/dts/arm/stm32f4-pinctrl.dtsi (contents, props changed) head/sys/gnu/dts/arm/stm32f429.dtsi head/sys/gnu/dts/arm/stm32f746-disco.dts head/sys/gnu/dts/arm/stm32f746.dtsi head/sys/gnu/dts/arm/stm32h743-pinctrl.dtsi head/sys/gnu/dts/arm/stm32h743.dtsi head/sys/gnu/dts/arm/stm32h743i-eval.dts head/sys/gnu/dts/arm/sun4i-a10-a1000.dts head/sys/gnu/dts/arm/sun4i-a10-ba10-tvbox.dts head/sys/gnu/dts/arm/sun4i-a10-chuwi-v7-cw0825.dts head/sys/gnu/dts/arm/sun4i-a10-cubieboard.dts head/sys/gnu/dts/arm/sun4i-a10-dserve-dsrv9703c.dts head/sys/gnu/dts/arm/sun4i-a10-gemei-g9.dts head/sys/gnu/dts/arm/sun4i-a10-hackberry.dts head/sys/gnu/dts/arm/sun4i-a10-hyundai-a7hd.dts head/sys/gnu/dts/arm/sun4i-a10-inet1.dts head/sys/gnu/dts/arm/sun4i-a10-inet97fv2.dts head/sys/gnu/dts/arm/sun4i-a10-inet9f-rev03.dts head/sys/gnu/dts/arm/sun4i-a10-itead-iteaduino-plus.dts head/sys/gnu/dts/arm/sun4i-a10-jesurun-q5.dts head/sys/gnu/dts/arm/sun4i-a10-marsboard.dts head/sys/gnu/dts/arm/sun4i-a10-mini-xplus.dts head/sys/gnu/dts/arm/sun4i-a10-mk802.dts head/sys/gnu/dts/arm/sun4i-a10-mk802ii.dts head/sys/gnu/dts/arm/sun4i-a10-olinuxino-lime.dts head/sys/gnu/dts/arm/sun4i-a10-pcduino.dts head/sys/gnu/dts/arm/sun4i-a10-pcduino2.dts head/sys/gnu/dts/arm/sun4i-a10-pov-protab2-ips9.dts head/sys/gnu/dts/arm/sun4i-a10.dtsi head/sys/gnu/dts/arm/sun5i-a10s.dtsi head/sys/gnu/dts/arm/sun5i-a13.dtsi head/sys/gnu/dts/arm/sun5i-gr8.dtsi head/sys/gnu/dts/arm/sun5i-reference-design-tablet.dtsi head/sys/gnu/dts/arm/sun5i.dtsi head/sys/gnu/dts/arm/sun6i-a31-hummingbird.dts head/sys/gnu/dts/arm/sun6i-a31.dtsi head/sys/gnu/dts/arm/sun6i-a31s-primo81.dts head/sys/gnu/dts/arm/sun6i-a31s-sina31s.dts head/sys/gnu/dts/arm/sun7i-a20-bananapi-m1-plus.dts head/sys/gnu/dts/arm/sun7i-a20-cubieboard2.dts head/sys/gnu/dts/arm/sun7i-a20-cubietruck.dts head/sys/gnu/dts/arm/sun7i-a20-lamobo-r1.dts head/sys/gnu/dts/arm/sun7i-a20-olinuxino-lime.dts head/sys/gnu/dts/arm/sun7i-a20-olinuxino-lime2.dts head/sys/gnu/dts/arm/sun7i-a20-olinuxino-micro.dts head/sys/gnu/dts/arm/sun7i-a20.dtsi head/sys/gnu/dts/arm/sun8i-a23-a33.dtsi head/sys/gnu/dts/arm/sun8i-a23.dtsi head/sys/gnu/dts/arm/sun8i-a33.dtsi head/sys/gnu/dts/arm/sun8i-a83t-allwinner-h8homlet-v2.dts head/sys/gnu/dts/arm/sun8i-a83t-bananapi-m3.dts (contents, props changed) head/sys/gnu/dts/arm/sun8i-a83t-cubietruck-plus.dts head/sys/gnu/dts/arm/sun8i-a83t.dtsi head/sys/gnu/dts/arm/sun8i-h2-plus-orangepi-zero.dts head/sys/gnu/dts/arm/sun8i-h3-bananapi-m2-plus.dts head/sys/gnu/dts/arm/sun8i-h3-nanopi-m1-plus.dts head/sys/gnu/dts/arm/sun8i-h3-nanopi-m1.dts head/sys/gnu/dts/arm/sun8i-h3-nanopi-neo.dts head/sys/gnu/dts/arm/sun8i-h3-nanopi.dtsi head/sys/gnu/dts/arm/sun8i-h3-orangepi-2.dts head/sys/gnu/dts/arm/sun8i-h3-orangepi-lite.dts head/sys/gnu/dts/arm/sun8i-h3-orangepi-one.dts head/sys/gnu/dts/arm/sun8i-h3-orangepi-pc-plus.dts head/sys/gnu/dts/arm/sun8i-h3-orangepi-pc.dts head/sys/gnu/dts/arm/sun8i-h3-orangepi-plus.dts head/sys/gnu/dts/arm/sun8i-h3-orangepi-plus2e.dts head/sys/gnu/dts/arm/sun8i-v3s.dtsi head/sys/gnu/dts/arm/sun9i-a80-cubieboard4.dts head/sys/gnu/dts/arm/sun9i-a80-optimus.dts head/sys/gnu/dts/arm/sun9i-a80.dtsi head/sys/gnu/dts/arm/sunxi-h3-h5.dtsi head/sys/gnu/dts/arm/sunxi-itead-core-common.dtsi head/sys/gnu/dts/arm/tango4-common.dtsi head/sys/gnu/dts/arm/tegra124-jetson-tk1.dts head/sys/gnu/dts/arm/tegra124.dtsi head/sys/gnu/dts/arm/uniphier-ld4-ref.dts head/sys/gnu/dts/arm/uniphier-ld4.dtsi head/sys/gnu/dts/arm/uniphier-ld6b-ref.dts head/sys/gnu/dts/arm/uniphier-pinctrl.dtsi head/sys/gnu/dts/arm/uniphier-pro4-ref.dts head/sys/gnu/dts/arm/uniphier-pro4.dtsi head/sys/gnu/dts/arm/uniphier-pro5.dtsi head/sys/gnu/dts/arm/uniphier-pxs2.dtsi head/sys/gnu/dts/arm/uniphier-sld8-ref.dts head/sys/gnu/dts/arm/uniphier-sld8.dtsi head/sys/gnu/dts/arm/uniphier-support-card.dtsi head/sys/gnu/dts/arm/usb_a9263.dts head/sys/gnu/dts/arm/usb_a9g20_common.dtsi head/sys/gnu/dts/arm/vf610-twr.dts head/sys/gnu/dts/arm/vf610-zii-dev-rev-c.dts head/sys/gnu/dts/arm/zx296702.dtsi head/sys/gnu/dts/arm/zynq-zc702.dts head/sys/gnu/dts/arm/zynq-zc706.dts head/sys/gnu/dts/include/dt-bindings/clock/exynos4.h head/sys/gnu/dts/include/dt-bindings/clock/gxbb-clkc.h head/sys/gnu/dts/include/dt-bindings/clock/imx7d-clock.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,rpmcc.h head/sys/gnu/dts/include/dt-bindings/clock/r7s72100-clock.h head/sys/gnu/dts/include/dt-bindings/clock/rk3188-cru-common.h head/sys/gnu/dts/include/dt-bindings/clock/rk3368-cru.h head/sys/gnu/dts/include/dt-bindings/clock/s3c2443.h head/sys/gnu/dts/include/dt-bindings/clock/sun4i-a10-ccu.h head/sys/gnu/dts/include/dt-bindings/clock/sun6i-a31-ccu.h head/sys/gnu/dts/include/dt-bindings/clock/tegra210-car.h head/sys/gnu/dts/include/dt-bindings/gpio/gpio.h head/sys/gnu/dts/include/dt-bindings/gpio/meson-gxbb-gpio.h head/sys/gnu/dts/include/dt-bindings/gpio/meson-gxl-gpio.h head/sys/gnu/dts/include/dt-bindings/input/linux-event-codes.h head/sys/gnu/dts/include/dt-bindings/phy/phy.h head/sys/gnu/dts/include/dt-bindings/pinctrl/am43xx.h Directory Properties: head/sys/gnu/dts/arm/am335x-moxa-uc-8100-me-t.dts (props changed) head/sys/gnu/dts/arm/am57xx-beagle-x15-revc.dts (props changed) head/sys/gnu/dts/arm/at91-sama5d27_som1.dtsi (props changed) head/sys/gnu/dts/arm/bcm2835-rpi-zero-w.dts (props changed) head/sys/gnu/dts/arm/bcm2837.dtsi (props changed) head/sys/gnu/dts/arm/bcm947189acdbmr.dts (props changed) head/sys/gnu/dts/arm/dra72x-mmc-iodelay.dtsi (props changed) head/sys/gnu/dts/arm/dra74x-mmc-iodelay.dtsi (props changed) head/sys/gnu/dts/arm/dra76-evm.dts (props changed) head/sys/gnu/dts/arm/dra76x.dtsi (props changed) head/sys/gnu/dts/arm/gemini-dlink-dir-685.dts (props changed) head/sys/gnu/dts/arm/imx53-cx9020.dts (props changed) head/sys/gnu/dts/arm/imx6ul-geam.dts (props changed) head/sys/gnu/dts/arm/imx7ulp-pinfunc.h (props changed) head/sys/gnu/dts/arm/mt6323.dtsi (props changed) head/sys/gnu/dts/arm/mt7623n-bananapi-bpi-r2.dts (props changed) head/sys/gnu/dts/arm/mt7623n-rfb-nand.dts (props changed) head/sys/gnu/dts/arm/mt7623n-rfb.dtsi (props changed) head/sys/gnu/dts/arm/rk3229.dtsi (props changed) head/sys/gnu/dts/arm/stm32f429-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm/stm32f469-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm/sun8i-r16-bananapi-m2m.dts (props changed) Modified: head/sys/gnu/dts/arm/am33xx.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am33xx.dtsi Sat Feb 10 15:23:30 2018 (r329103) +++ head/sys/gnu/dts/arm/am33xx.dtsi Sat Feb 10 15:29:46 2018 (r329104) @@ -130,9 +130,11 @@ }; }; - pmu { + pmu@4b000000 { compatible = "arm,cortex-a8-pmu"; interrupts = <3>; + reg = <0x4b000000 0x1000000>; + ti,hwmods = "debugss"; }; /* @@ -628,6 +630,7 @@ reg-names = "phy"; status = "disabled"; ti,ctrl_mod = <&usb_ctrl_mod>; + #phy-cells = <0>; }; usb0: usb@47401000 { @@ -676,6 +679,7 @@ reg-names = "phy"; status = "disabled"; ti,ctrl_mod = <&usb_ctrl_mod>; + #phy-cells = <0>; }; usb1: usb@47401800 { @@ -927,6 +931,12 @@ #io-channel-cells = <1>; compatible = "ti,am3359-adc"; }; + }; + + emif: emif@4c000000 { + compatible = "ti,emif-am3352"; + reg = <0x4c000000 0x1000000>; + ti,hwmods = "emif"; }; gpmc: gpmc@50000000 { Modified: head/sys/gnu/dts/arm/am4372.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am4372.dtsi Sat Feb 10 15:23:30 2018 (r329103) +++ head/sys/gnu/dts/arm/am4372.dtsi Sat Feb 10 15:29:46 2018 (r329104) @@ -927,7 +927,8 @@ reg = <0x48038000 0x2000>, <0x46000000 0x400000>; reg-names = "mpu", "dat"; - interrupts = <80>, <81>; + interrupts = , + ; interrupt-names = "tx", "rx"; status = "disabled"; dmas = <&edma 8 2>, @@ -941,7 +942,8 @@ reg = <0x4803C000 0x2000>, <0x46400000 0x400000>; reg-names = "mpu", "dat"; - interrupts = <82>, <83>; + interrupts = , + ; interrupt-names = "tx", "rx"; status = "disabled"; dmas = <&edma 10 2>, Modified: head/sys/gnu/dts/arm/am437x-cm-t43.dts ============================================================================== --- head/sys/gnu/dts/arm/am437x-cm-t43.dts Sat Feb 10 15:23:30 2018 (r329103) +++ head/sys/gnu/dts/arm/am437x-cm-t43.dts Sat Feb 10 15:29:46 2018 (r329104) @@ -301,8 +301,8 @@ status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&spi0_pins>; - dmas = <&edma 16 - &edma 17>; + dmas = <&edma 16 0 + &edma 17 0>; dma-names = "tx0", "rx0"; flash: w25q64cvzpig@0 { Modified: head/sys/gnu/dts/arm/am43x-epos-evm.dts ============================================================================== --- head/sys/gnu/dts/arm/am43x-epos-evm.dts Sat Feb 10 15:23:30 2018 (r329103) +++ head/sys/gnu/dts/arm/am43x-epos-evm.dts Sat Feb 10 15:29:46 2018 (r329104) @@ -75,6 +75,9 @@ compatible = "gpio-matrix-keypad"; debounce-delay-ms = <5>; col-scan-delay-us = <2>; + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&matrix_keypad_default>; + pinctrl-1 = <&matrix_keypad_sleep>; row-gpios = <&gpio0 12 GPIO_ACTIVE_HIGH /* Bank0, pin12 */ &gpio0 13 GPIO_ACTIVE_HIGH /* Bank0, pin13 */ @@ -145,6 +148,43 @@ }; &am43xx_pinmux { + pinctrl-names = "default"; + pinctrl-0 = <&unused_pins>; + + unused_pins: unused_pins { + pinctrl-single,pins = < + AM4372_IOPAD(0x848, DS0_PIN_OUTPUT_PULLUP | PIN_OUTPUT_PULLUP | MUX_MODE7) + AM4372_IOPAD(0x850, DS0_PIN_INPUT | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x858, DS0_PIN_INPUT | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x860, DS0_PIN_INPUT | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x864, DS0_PIN_INPUT | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x868, DS0_PIN_INPUT | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x86c, DS0_PIN_INPUT | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x878, DS0_PIN_OUTPUT_PULLUP | PIN_OUTPUT_PULLUP | MUX_MODE7) + AM4372_IOPAD(0x908, DS0_PIN_INPUT_PULLDOWN | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x91c, DS0_PIN_OUTPUT_PULLDOWN | PIN_OUTPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x920, DS0_PIN_INPUT | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x9e0, DS0_PIN_INPUT_PULLDOWN | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0xA0c, DS0_PIN_OUTPUT_PULLDOWN | PIN_OUTPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0xA38, DS0_PIN_INPUT | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0xA3c, DS0_PIN_INPUT | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0xA40, DS0_PIN_INPUT | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0xA44, DS0_PIN_INPUT | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0xA48, DS0_PIN_INPUT | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0xA4c, DS0_PIN_INPUT | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0xA50, DS0_PIN_INPUT | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0xA54, DS0_PIN_INPUT | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0xA58, DS0_PIN_INPUT | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0xA5c, DS0_PIN_INPUT | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0xA60, DS0_PIN_INPUT | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0xA64, DS0_PIN_OUTPUT_PULLUP | PIN_OUTPUT_PULLUP | MUX_MODE7) + AM4372_IOPAD(0xA68, DS0_PIN_INPUT | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0xA6C, DS0_PIN_INPUT | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0xA74, DS0_PIN_INPUT_PULLDOWN | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0xA78, DS0_PIN_INPUT | PIN_INPUT_PULLDOWN | MUX_MODE7) + >; + }; + cpsw_default: cpsw_default { pinctrl-single,pins = < /* Slave 1 */ @@ -198,7 +238,7 @@ >; }; - nand_flash_x8: nand_flash_x8 { + nand_flash_x8_default: nand_flash_x8_default { pinctrl-single,pins = < AM4372_IOPAD(0x840, PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_a0.SELQSPIorNAND/GPIO */ AM4372_IOPAD(0x800, PIN_INPUT_PULLDOWN | MUX_MODE0) /* gpmc_ad0.gpmc_ad0 */ @@ -219,12 +259,39 @@ >; }; - ecap0_pins: backlight_pins { + nand_flash_x8_sleep: nand_flash_x8_sleep { pinctrl-single,pins = < + AM4372_IOPAD(0x840, DS0_PIN_OUTPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x800, DS0_PIN_OUTPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x804, DS0_PIN_OUTPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x808, DS0_PIN_OUTPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x80c, DS0_PIN_OUTPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x810, DS0_PIN_OUTPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x814, DS0_PIN_OUTPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x818, DS0_PIN_OUTPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x81c, DS0_PIN_OUTPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x870, DS0_PIN_OUTPUT_PULLUP | MUX_MODE7) + AM4372_IOPAD(0x874, DS0_PIN_OUTPUT_PULLUP | MUX_MODE7) + AM4372_IOPAD(0x87c, DS0_PIN_OUTPUT_PULLUP | MUX_MODE7) + AM4372_IOPAD(0x890, DS0_PIN_OUTPUT_PULLUP | MUX_MODE7) + AM4372_IOPAD(0x894, DS0_PIN_OUTPUT_PULLUP | MUX_MODE7) + AM4372_IOPAD(0x898, DS0_PIN_OUTPUT_PULLUP | MUX_MODE7) + AM4372_IOPAD(0x89c, DS0_PIN_OUTPUT_PULLUP | MUX_MODE7) + >; + }; + + ecap0_pins_default: backlight_pins_default { + pinctrl-single,pins = < AM4372_IOPAD(0x964, MUX_MODE0) /* eCAP0_in_PWM0_out.eCAP0_in_PWM0_out MODE0 */ >; }; + ecap0_pins_sleep: backlight_pins_sleep { + pinctrl-single,pins = < + AM4372_IOPAD(0x964, DS0_PIN_OUTPUT_PULLUP | MUX_MODE7) + >; + }; + i2c2_pins: pinmux_i2c2_pins { pinctrl-single,pins = < AM4372_IOPAD(0x9c0, PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE8) /* i2c2_sda.i2c2_sda */ @@ -232,7 +299,7 @@ >; }; - spi0_pins: pinmux_spi0_pins { + spi0_pins_default: pinmux_spi0_pins_default { pinctrl-single,pins = < AM4372_IOPAD(0x950, PIN_INPUT | MUX_MODE0) /* spi0_clk.spi0_clk */ AM4372_IOPAD(0x954, PIN_OUTPUT | MUX_MODE0) /* spi0_d0.spi0_d0 */ @@ -241,8 +308,17 @@ >; }; - spi1_pins: pinmux_spi1_pins { + spi0_pins_sleep: pinmux_spi0_pins_sleep { pinctrl-single,pins = < + AM4372_IOPAD(0x950, DS0_PIN_OUTPUT_PULLUP | PIN_OUTPUT_PULLUP | MUX_MODE7) + AM4372_IOPAD(0x954, DS0_PIN_OUTPUT_PULLUP | PIN_OUTPUT_PULLUP | MUX_MODE7) + AM4372_IOPAD(0x958, DS0_PIN_OUTPUT_PULLUP | PIN_OUTPUT_PULLUP | MUX_MODE7) + AM4372_IOPAD(0x95c, DS0_PIN_OUTPUT_PULLUP | PIN_OUTPUT_PULLUP | MUX_MODE7) + >; + }; + + spi1_pins_default: pinmux_spi1_pins_default { + pinctrl-single,pins = < AM4372_IOPAD(0x990, PIN_INPUT | MUX_MODE3) /* mcasp0_aclkx.spi1_clk */ AM4372_IOPAD(0x994, PIN_OUTPUT | MUX_MODE3) /* mcasp0_fsx.spi1_d0 */ AM4372_IOPAD(0x998, PIN_INPUT | MUX_MODE3) /* mcasp0_axr0.spi1_d1 */ @@ -250,14 +326,55 @@ >; }; - mmc1_pins: pinmux_mmc1_pins { + spi1_pins_sleep: pinmux_spi1_pins_sleep { pinctrl-single,pins = < + AM4372_IOPAD(0x990, DS0_PIN_OUTPUT_PULLDOWN | PIN_OUTPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x994, DS0_PIN_OUTPUT_PULLDOWN | PIN_OUTPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x998, DS0_PIN_OUTPUT_PULLDOWN | PIN_OUTPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x99c, DS0_PIN_OUTPUT_PULLDOWN | PIN_OUTPUT_PULLDOWN | MUX_MODE7) + >; + }; + + mmc1_pins_default: pinmux_mmc1_pins_default { + pinctrl-single,pins = < AM4372_IOPAD(0x960, PIN_INPUT | MUX_MODE7) /* spi0_cs1.gpio0_6 */ >; }; - qspi1_default: qspi1_default { + mmc1_pins_sleep: pinmux_mmc1_pins_sleep { pinctrl-single,pins = < + AM4372_IOPAD(0x960, DS0_PIN_OUTPUT_PULLUP | PIN_INPUT | MUX_MODE7) + >; + }; + + matrix_keypad_default: matrix_keypad_default { + pinctrl-single,pins = < + AM4372_IOPAD(0x92c, PIN_OUTPUT | MUX_MODE7) /* mii1_tx_clk.gpio3_9 */ + AM4372_IOPAD(0x930, PIN_OUTPUT | MUX_MODE7) /* mii1_rx_clk.gpio3_10 */ + AM4372_IOPAD(0x934, PIN_OUTPUT | MUX_MODE7) /* mii1_rxd3.gpio2_18 */ + AM4372_IOPAD(0x938, PIN_OUTPUT | MUX_MODE7) /* mii1_rxd2.gpio2_19 */ + AM4372_IOPAD(0x978, PIN_INPUT_PULLDOWN | MUX_MODE7) /* uart1_ctsn.gpio0_12 */ + AM4372_IOPAD(0x97C, PIN_INPUT_PULLDOWN | MUX_MODE7) /* uart1_rtsn.gpio0_13 */ + AM4372_IOPAD(0x980, PIN_INPUT_PULLDOWN | MUX_MODE7) /* uart1_rxd.gpio0_14 */ + AM4372_IOPAD(0x984, PIN_INPUT_PULLDOWN | MUX_MODE7) /* uart1_txd.gpio0_15 */ + >; + }; + + matrix_keypad_sleep: matrix_keypad_sleep { + pinctrl-single,pins = < + AM4372_IOPAD(0x92c, PIN_INPUT_PULLUP | MUX_MODE7) + AM4372_IOPAD(0x930, PIN_INPUT_PULLUP | MUX_MODE7) + AM4372_IOPAD(0x934, PIN_INPUT_PULLUP | MUX_MODE7) + AM4372_IOPAD(0x938, PIN_INPUT_PULLUP | MUX_MODE7) + AM4372_IOPAD(0x978, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x97C, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x980, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x984, PIN_INPUT_PULLDOWN | MUX_MODE7) + >; + }; + + qspi1_pins_default: qspi1_pins_default { + pinctrl-single,pins = < AM4372_IOPAD(0x87c, PIN_INPUT_PULLUP | MUX_MODE3) AM4372_IOPAD(0x888, PIN_INPUT_PULLUP | MUX_MODE2) AM4372_IOPAD(0x890, PIN_INPUT_PULLUP | MUX_MODE3) @@ -267,12 +384,29 @@ >; }; - pixcir_ts_pins: pixcir_ts_pins { + qspi1_pins_sleep: qspi1_pins_sleep { pinctrl-single,pins = < + AM4372_IOPAD(0x87c, DS0_PIN_OUTPUT_PULLUP | MUX_MODE7) + AM4372_IOPAD(0x888, DS0_PIN_OUTPUT_PULLUP | MUX_MODE7) + AM4372_IOPAD(0x890, DS0_PIN_OUTPUT_PULLUP | MUX_MODE7) + AM4372_IOPAD(0x894, DS0_PIN_OUTPUT_PULLUP | MUX_MODE7) + AM4372_IOPAD(0x898, DS0_PIN_OUTPUT_PULLUP | MUX_MODE7) + AM4372_IOPAD(0x89c, DS0_PIN_OUTPUT_PULLUP | MUX_MODE7) + >; + }; + + pixcir_ts_pins_default: pixcir_ts_pins_default { + pinctrl-single,pins = < AM4372_IOPAD(0x844, PIN_INPUT_PULLUP | MUX_MODE7) /* gpmc_a1.gpio1_17 */ >; }; + pixcir_ts_pins_sleep: pixcir_ts_pins_sleep { + pinctrl-single,pins = < + AM4372_IOPAD(0x844, DS0_PIN_OUTPUT_PULLUP | PIN_OUTPUT_PULLUP | MUX_MODE7) /* gpmc_a1.gpio1_17 */ + >; + }; + hdq_pins: pinmux_hdq_pins { pinctrl-single,pins = < AM4372_IOPAD(0xa34, PIN_INPUT_PULLUP | MUX_MODE1) /* cam1_wen.hdq_gpio */ @@ -355,6 +489,48 @@ >; }; + uart0_pins_default: uart0_pins_default { + pinctrl-single,pins = < + AM4372_IOPAD(0x968, DS0_PULL_UP_DOWN_EN | INPUT_EN | MUX_MODE0) /* uart0_ctsn.uart0_ctsn */ + AM4372_IOPAD(0x96C, DS0_PULL_UP_DOWN_EN | INPUT_EN | MUX_MODE0) /* uart0_rtsn.uart0_rtsn */ + AM4372_IOPAD(0x970, PIN_INPUT_PULLUP | SLEWCTRL_FAST | DS0_PULL_UP_DOWN_EN | MUX_MODE0) /* uart0_rxd.uart0_rxd */ + AM4372_IOPAD(0x974, PIN_INPUT | SLEWCTRL_FAST | DS0_PULL_UP_DOWN_EN | MUX_MODE0) /* uart0_txd.uart0_txd */ + >; + }; + + uart0_pins_sleep: uart0_pins_sleep { + pinctrl-single,pins = < + AM4372_IOPAD(0x968, DS0_PULL_UP_DOWN_EN | INPUT_EN | MUX_MODE7) + AM4372_IOPAD(0x96C, DS0_PULL_UP_DOWN_EN | INPUT_EN | MUX_MODE7) + AM4372_IOPAD(0x970, PIN_INPUT_PULLUP | SLEWCTRL_FAST | DS0_PULL_UP_DOWN_EN | MUX_MODE0) + AM4372_IOPAD(0x974, PIN_INPUT | SLEWCTRL_FAST | DS0_PULL_UP_DOWN_EN | MUX_MODE0) + >; + }; + + usb2_phy1_default: usb2_phy1_default { + pinctrl-single,pins = < + AM4372_IOPAD(0xac0, PIN_INPUT_PULLDOWN | MUX_MODE0) + >; + }; + + usb2_phy1_sleep: usb2_phy1_sleep { + pinctrl-single,pins = < + AM4372_IOPAD(0xac0, DS0_PULL_UP_DOWN_EN | PIN_INPUT_PULLDOWN | MUX_MODE7) + >; + }; + + usb2_phy2_default: usb2_phy2_default { + pinctrl-single,pins = < + AM4372_IOPAD(0xac4, PIN_INPUT_PULLDOWN | MUX_MODE0) + >; + }; + + usb2_phy2_sleep: usb2_phy2_sleep { + pinctrl-single,pins = < + AM4372_IOPAD(0xac4, DS0_PULL_UP_DOWN_EN | PIN_INPUT_PULLDOWN | MUX_MODE7) + >; + }; + mcasp1_pins: mcasp1_pins { pinctrl-single,pins = < AM4372_IOPAD(0x9a0, PIN_INPUT_PULLDOWN | MUX_MODE3) /* MCASP0_ACLKR/MCASP1_ACLKX */ @@ -378,8 +554,9 @@ status = "okay"; vmmc-supply = <&vmmcsd_fixed>; bus-width = <4>; - pinctrl-names = "default"; - pinctrl-0 = <&mmc1_pins>; + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&mmc1_pins_default>; + pinctrl-1 = <&mmc1_pins_sleep>; cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>; }; @@ -478,8 +655,10 @@ pixcir_ts@5c { compatible = "pixcir,pixcir_tangoc"; - pinctrl-names = "default"; - pinctrl-0 = <&pixcir_ts_pins>; + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&pixcir_ts_pins_default>; + pinctrl-1 = <&pixcir_ts_pins_sleep>; + reg = <0x5c>; interrupt-parent = <&gpio1>; interrupts = <17 IRQ_TYPE_EDGE_FALLING>; @@ -550,8 +729,9 @@ &gpmc { status = "okay"; /* Disable QSPI when enabling GPMC (NAND) */ - pinctrl-names = "default"; - pinctrl-0 = <&nand_flash_x8>; + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&nand_flash_x8_default>; + pinctrl-1 = <&nand_flash_x8_sleep>; ranges = <0 0 0x08000000 0x01000000>; /* CS0 space. Min partition = 16MB */ nand@0,0 { compatible = "ti,omap2-nand"; @@ -647,24 +827,30 @@ &ecap0 { status = "okay"; - pinctrl-names = "default"; - pinctrl-0 = <&ecap0_pins>; + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&ecap0_pins_default>; + pinctrl-1 = <&ecap0_pins_sleep>; }; &spi0 { - pinctrl-names = "default"; - pinctrl-0 = <&spi0_pins>; status = "okay"; + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&spi0_pins_default>; + pinctrl-1 = <&spi0_pins_sleep>; }; &spi1 { - pinctrl-names = "default"; - pinctrl-0 = <&spi1_pins>; status = "okay"; + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&spi1_pins_default>; + pinctrl-1 = <&spi1_pins_sleep>; }; &usb2_phy1 { status = "okay"; + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&usb2_phy1_default>; + pinctrl-1 = <&usb2_phy1_sleep>; }; &usb1 { @@ -674,6 +860,9 @@ &usb2_phy2 { status = "okay"; + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&usb2_phy2_default>; + pinctrl-1 = <&usb2_phy2_sleep>; }; &usb2 { @@ -683,8 +872,9 @@ &qspi { status = "disabled"; /* Disable GPMC (NAND) when enabling QSPI */ - pinctrl-names = "default"; - pinctrl-0 = <&qspi1_default>; + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&qspi1_pins_default>; + pinctrl-1 = <&qspi1_pins_sleep>; spi-max-frequency = <48000000>; m25p80@0 { @@ -768,6 +958,13 @@ vsync-active = <0>; }; }; +}; + +&uart0 { + status = "okay"; + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&uart0_pins_default>; + pinctrl-1 = <&uart0_pins_sleep>; }; &mcasp1 { Modified: head/sys/gnu/dts/arm/armada-370-synology-ds213j.dts ============================================================================== --- head/sys/gnu/dts/arm/armada-370-synology-ds213j.dts Sat Feb 10 15:23:30 2018 (r329103) +++ head/sys/gnu/dts/arm/armada-370-synology-ds213j.dts Sat Feb 10 15:29:46 2018 (r329104) @@ -316,32 +316,32 @@ * change the default environment, unless you know * what you are doing. */ - partition@00000000 { /* u-boot */ + partition@0 { /* u-boot */ label = "RedBoot"; reg = <0x00000000 0x000c0000>; /* 768KB */ }; - partition@000c0000 { /* uImage */ + partition@c0000 { /* uImage */ label = "zImage"; reg = <0x000c0000 0x002d0000>; /* 2880KB */ }; - partition@00390000 { /* uInitramfs */ + partition@390000 { /* uInitramfs */ label = "rd.gz"; reg = <0x00390000 0x00440000>; /* 4250KB */ }; - partition@007d0000 { /* MAC address and serial number */ + partition@7d0000 { /* MAC address and serial number */ label = "vendor"; reg = <0x007d0000 0x00010000>; /* 64KB */ }; - partition@007e0000 { + partition@7e0000 { label = "RedBoot config"; reg = <0x007e0000 0x00010000>; /* 64KB */ }; - partition@007f0000 { + partition@7f0000 { label = "FIS directory"; reg = <0x007f0000 0x00010000>; /* 64KB */ }; Modified: head/sys/gnu/dts/arm/armada-385-db-ap.dts ============================================================================== --- head/sys/gnu/dts/arm/armada-385-db-ap.dts Sat Feb 10 15:23:30 2018 (r329103) +++ head/sys/gnu/dts/arm/armada-385-db-ap.dts Sat Feb 10 15:29:46 2018 (r329104) @@ -236,6 +236,7 @@ usb3_phy: usb3_phy { compatible = "usb-nop-xceiv"; vcc-supply = <®_xhci0_vbus>; + #phy-cells = <0>; }; reg_xhci0_vbus: xhci0-vbus { Modified: head/sys/gnu/dts/arm/armada-385-linksys.dtsi ============================================================================== --- head/sys/gnu/dts/arm/armada-385-linksys.dtsi Sat Feb 10 15:23:30 2018 (r329103) +++ head/sys/gnu/dts/arm/armada-385-linksys.dtsi Sat Feb 10 15:29:46 2018 (r329104) @@ -66,6 +66,7 @@ usb3_1_phy: usb3_1-phy { compatible = "usb-nop-xceiv"; vcc-supply = <&usb3_1_vbus>; + #phy-cells = <0>; }; usb3_1_vbus: usb3_1-vbus { Modified: head/sys/gnu/dts/arm/armada-385-synology-ds116.dts ============================================================================== --- head/sys/gnu/dts/arm/armada-385-synology-ds116.dts Sat Feb 10 15:23:30 2018 (r329103) +++ head/sys/gnu/dts/arm/armada-385-synology-ds116.dts Sat Feb 10 15:29:46 2018 (r329104) @@ -191,11 +191,13 @@ usb3_0_phy: usb3_0_phy { compatible = "usb-nop-xceiv"; vcc-supply = <®_usb3_0_vbus>; + #phy-cells = <0>; }; usb3_1_phy: usb3_1_phy { compatible = "usb-nop-xceiv"; vcc-supply = <®_usb3_1_vbus>; + #phy-cells = <0>; }; reg_usb3_0_vbus: usb3-vbus0 { @@ -267,35 +269,35 @@ * enumerated. The MAC address and the serial number are listed * in the "vendor" partition. */ - partition@00000000 { + partition@0 { label = "RedBoot"; reg = <0x00000000 0x000f0000>; read-only; }; - partition@000c0000 { + partition@c0000 { label = "zImage"; reg = <0x000f0000 0x002d0000>; }; - partition@00390000 { + partition@390000 { label = "rd.gz"; reg = <0x003c0000 0x00410000>; }; - partition@007d0000 { + partition@7d0000 { label = "vendor"; reg = <0x007d0000 0x00010000>; read-only; }; - partition@007e0000 { + partition@7e0000 { label = "RedBoot config"; reg = <0x007e0000 0x00010000>; read-only; }; - partition@007f0000 { + partition@7f0000 { label = "FIS directory"; reg = <0x007f0000 0x00010000>; read-only; Modified: head/sys/gnu/dts/arm/armada-388-gp.dts ============================================================================== --- head/sys/gnu/dts/arm/armada-388-gp.dts Sat Feb 10 15:23:30 2018 (r329103) +++ head/sys/gnu/dts/arm/armada-388-gp.dts Sat Feb 10 15:29:46 2018 (r329104) @@ -276,11 +276,13 @@ usb2_1_phy: usb2_1_phy { compatible = "usb-nop-xceiv"; vcc-supply = <®_usb2_1_vbus>; + #phy-cells = <0>; }; usb3_phy: usb3_phy { compatible = "usb-nop-xceiv"; vcc-supply = <®_usb3_vbus>; + #phy-cells = <0>; }; reg_usb3_vbus: usb3-vbus { Modified: head/sys/gnu/dts/arm/armada-xp-synology-ds414.dts ============================================================================== --- head/sys/gnu/dts/arm/armada-xp-synology-ds414.dts Sat Feb 10 15:23:30 2018 (r329103) +++ head/sys/gnu/dts/arm/armada-xp-synology-ds414.dts Sat Feb 10 15:29:46 2018 (r329104) @@ -332,32 +332,32 @@ * change the default environment, unless you know * what you are doing. */ - partition@00000000 { /* u-boot */ + partition@0 { /* u-boot */ label = "RedBoot"; reg = <0x00000000 0x000d0000>; /* 832KB */ }; - partition@000c0000 { /* uImage */ + partition@c0000 { /* uImage */ label = "zImage"; reg = <0x000d0000 0x002d0000>; /* 2880KB */ }; - partition@003a0000 { /* uInitramfs */ + partition@3a0000 { /* uInitramfs */ label = "rd.gz"; reg = <0x003a0000 0x00430000>; /* 4250KB */ }; - partition@007d0000 { /* MAC address and serial number */ + partition@7d0000 { /* MAC address and serial number */ label = "vendor"; reg = <0x007d0000 0x00010000>; /* 64KB */ }; - partition@007e0000 { + partition@7e0000 { label = "RedBoot config"; reg = <0x007e0000 0x00010000>; /* 64KB */ }; - partition@007f0000 { + partition@7f0000 { label = "FIS directory"; reg = <0x007f0000 0x00010000>; /* 64KB */ }; Modified: head/sys/gnu/dts/arm/artpec6.dtsi ============================================================================== --- head/sys/gnu/dts/arm/artpec6.dtsi Sat Feb 10 15:23:30 2018 (r329103) +++ head/sys/gnu/dts/arm/artpec6.dtsi Sat Feb 10 15:29:46 2018 (r329104) @@ -151,7 +151,6 @@ interrupts = , ; interrupt-affinity = <&cpu0>, <&cpu1>; - interrupt-parent = <&intc>; }; pcie: pcie@f8050000 { @@ -185,7 +184,6 @@ compatible = "simple-bus"; #address-cells = <0x1>; #size-cells = <0x1>; - interrupt-parent = <&intc>; ranges; dma-ranges = <0x80000000 0x00000000 0x40000000>; dma-coherent; @@ -195,7 +193,6 @@ clocks = <ð_phy_ref_clk>, <&clkctrl ARTPEC6_CLK_ETH_ACLK>; compatible = "snps,dwc-qos-ethernet-4.10"; - interrupt-parent = <&intc>; interrupts = ; reg = <0xf8010000 0x4000>; Modified: head/sys/gnu/dts/arm/aspeed-ast2500-evb.dts ============================================================================== --- head/sys/gnu/dts/arm/aspeed-ast2500-evb.dts Sat Feb 10 15:23:30 2018 (r329103) +++ head/sys/gnu/dts/arm/aspeed-ast2500-evb.dts Sat Feb 10 15:29:46 2018 (r329104) @@ -60,3 +60,22 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_rgmii2_default &pinctrl_mdio2_default>; }; + +&i2c3 { + status = "okay"; + + eeprom@50 { + compatible = "atmel,24c08"; + reg = <0x50>; + pagesize = <16>; + }; +}; + +&i2c7 { + status = "okay"; + + lm75@4d { + compatible = "national,lm75"; + reg = <0x4d>; + }; +}; Modified: head/sys/gnu/dts/arm/aspeed-bmc-opp-palmetto.dts ============================================================================== --- head/sys/gnu/dts/arm/aspeed-bmc-opp-palmetto.dts Sat Feb 10 15:23:30 2018 (r329103) +++ head/sys/gnu/dts/arm/aspeed-bmc-opp-palmetto.dts Sat Feb 10 15:29:46 2018 (r329104) @@ -7,10 +7,6 @@ model = "Palmetto BMC"; compatible = "tyan,palmetto-bmc", "aspeed,ast2400"; - aliases { - serial4 = &uart5; - }; - chosen { stdout-path = &uart5; bootargs = "console=ttyS4,115200 earlyprintk"; @@ -61,4 +57,56 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_rmii1_default>; +}; + +&i2c0 { + status = "okay"; + + eeprom@50 { + compatible = "atmel,24c256"; + reg = <0x50>; + pagesize = <64>; + }; + + rtc@68 { + compatible = "dallas,ds3231"; + reg = <0x68>; + }; +}; + +&i2c1 { + status = "okay"; +}; + +&i2c2 { + status = "okay"; + + tmp423@4c { + compatible = "ti,tmp423"; + reg = <0x4c>; + }; +}; + +&i2c3 { + status = "okay"; +}; + +&i2c4 { + status = "okay"; +}; + +&i2c5 { + status = "okay"; +}; + +&i2c6 { + status = "okay"; +}; + +&i2c7 { + status = "okay"; +}; + +&vuart { + status = "okay"; }; Modified: head/sys/gnu/dts/arm/aspeed-bmc-opp-romulus.dts ============================================================================== --- head/sys/gnu/dts/arm/aspeed-bmc-opp-romulus.dts Sat Feb 10 15:23:30 2018 (r329103) +++ head/sys/gnu/dts/arm/aspeed-bmc-opp-romulus.dts Sat Feb 10 15:29:46 2018 (r329104) @@ -80,3 +80,61 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_rmii1_default>; }; + +&i2c2 { + status = "okay"; +}; + +&i2c3 { + status = "okay"; +}; + +&i2c4 { + status = "okay"; +}; + +&i2c5 { + status = "okay"; +}; + +&i2c6 { + /* PCIe slot 1 (x8) */ + status = "okay"; +}; + +&i2c7 { + /* PCIe slot 2 (x16) */ + status = "okay"; +}; + +&i2c8 { + /* PCIe slot 3 (x16) */ + status = "okay"; +}; + +&i2c9 { + /* PCIe slot 4 (x16) */ + status = "okay"; +}; + +&i2c10 { + /* PCIe slot 5 (x8) */ + status = "okay"; +}; + +&i2c11 { + status = "okay"; + + rtc@32 { + compatible = "epson,rx8900"; + reg = <0x32>; + }; +}; + +&i2c12 { + status = "okay"; +}; + +&vuart { + status = "okay"; +}; Modified: head/sys/gnu/dts/arm/aspeed-g4.dtsi ============================================================================== --- head/sys/gnu/dts/arm/aspeed-g4.dtsi Sat Feb 10 15:23:30 2018 (r329103) +++ head/sys/gnu/dts/arm/aspeed-g4.dtsi Sat Feb 10 15:29:46 2018 (r329104) @@ -8,6 +8,29 @@ #size-cells = <1>; interrupt-parent = <&vic>; + aliases { + i2c0 = &i2c0; + i2c1 = &i2c1; + i2c2 = &i2c2; + i2c3 = &i2c3; + i2c4 = &i2c4; + i2c5 = &i2c5; + i2c6 = &i2c6; + i2c7 = &i2c7; + i2c8 = &i2c8; + i2c9 = &i2c9; + i2c10 = &i2c10; + i2c11 = &i2c11; + i2c12 = &i2c12; + i2c13 = &i2c13; + serial0 = &uart1; + serial1 = &uart2; + serial2 = &uart3; + serial3 = &uart4; + serial4 = &uart5; + serial5 = &vuart; + }; + cpus { #address-cells = <1>; #size-cells = <0>; @@ -110,7 +133,7 @@ clock-frequency = <192000000>; }; - clk_apb: clk_apb@08 { + clk_apb: clk_apb@8 { #clock-cells = <0>; compatible = "aspeed,g4-apb-clock", "fixed-clock"; reg = <0x08>; @@ -127,856 +150,1091 @@ pinctrl: pinctrl { compatible = "aspeed,g4-pinctrl"; + }; + }; - pinctrl_acpi_default: acpi_default { - function = "ACPI"; - groups = "ACPI"; - }; + adc: adc@1e6e9000 { + compatible = "aspeed,ast2400-adc"; + reg = <0x1e6e9000 0xb0>; + clocks = <&clk_apb>; + #io-channel-cells = <1>; + status = "disabled"; + }; - pinctrl_adc0_default: adc0_default { - function = "ADC0"; - groups = "ADC0"; - }; + sram@1e720000 { + compatible = "mmio-sram"; + reg = <0x1e720000 0x8000>; // 32K + }; - pinctrl_adc1_default: adc1_default { - function = "ADC1"; - groups = "ADC1"; - }; + gpio: gpio@1e780000 { + #gpio-cells = <2>; + gpio-controller; + compatible = "aspeed,ast2400-gpio"; + reg = <0x1e780000 0x1000>; + interrupts = <20>; + gpio-ranges = <&pinctrl 0 0 220>; + interrupt-controller; + }; - pinctrl_adc10_default: adc10_default { - function = "ADC10"; - groups = "ADC10"; - }; + timer: timer@1e782000 { + /* This timer is a Faraday FTTMR010 derivative */ + compatible = "aspeed,ast2400-timer"; + reg = <0x1e782000 0x90>; + interrupts = <16 17 18 35 36 37 38 39>; + clocks = <&clk_apb>; + clock-names = "PCLK"; + }; - pinctrl_adc11_default: adc11_default { - function = "ADC11"; - groups = "ADC11"; - }; + uart1: serial@1e783000 { + compatible = "ns16550a"; + reg = <0x1e783000 0x20>; + reg-shift = <2>; + interrupts = <9>; + clocks = <&clk_uart>; + no-loopback-test; + status = "disabled"; + }; - pinctrl_adc12_default: adc12_default { - function = "ADC12"; - groups = "ADC12"; - }; + uart5: serial@1e784000 { + compatible = "ns16550a"; + reg = <0x1e784000 0x20>; + reg-shift = <2>; + interrupts = <10>; + clocks = <&clk_uart>; + no-loopback-test; + status = "disabled"; + }; - pinctrl_adc13_default: adc13_default { - function = "ADC13"; - groups = "ADC13"; - }; + wdt1: watchdog@1e785000 { + compatible = "aspeed,ast2400-wdt"; + reg = <0x1e785000 0x1c>; + }; - pinctrl_adc14_default: adc14_default { - function = "ADC14"; - groups = "ADC14"; - }; + wdt2: watchdog@1e785020 { + compatible = "aspeed,ast2400-wdt"; + reg = <0x1e785020 0x1c>; + }; - pinctrl_adc15_default: adc15_default { - function = "ADC15"; - groups = "ADC15"; - }; + vuart: serial@1e787000 { + compatible = "aspeed,ast2400-vuart"; + reg = <0x1e787000 0x40>; + reg-shift = <2>; + interrupts = <8>; + clocks = <&clk_uart>; + no-loopback-test; + status = "disabled"; + }; - pinctrl_adc2_default: adc2_default { - function = "ADC2"; - groups = "ADC2"; - }; + uart2: serial@1e78d000 { + compatible = "ns16550a"; + reg = <0x1e78d000 0x20>; + reg-shift = <2>; + interrupts = <32>; + clocks = <&clk_uart>; + no-loopback-test; + status = "disabled"; + }; - pinctrl_adc3_default: adc3_default { - function = "ADC3"; - groups = "ADC3"; - }; + uart3: serial@1e78e000 { + compatible = "ns16550a"; + reg = <0x1e78e000 0x20>; + reg-shift = <2>; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Feb 10 16:13:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9ADEEF07E57; Sat, 10 Feb 2018 16:13:46 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-lf0-x22e.google.com (mail-lf0-x22e.google.com [IPv6:2a00:1450:4010:c07::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 F1FC4853E7; Sat, 10 Feb 2018 16:13:45 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-lf0-x22e.google.com with SMTP id g72so15184134lfg.5; Sat, 10 Feb 2018 08:13:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Hcoh1hgpx7DXrsw4axUsVy8/UiH8uOXXu+gxRTEkhPg=; b=G/1dvoKTwzBKeXSuSLnz8v/9nu17cjf2nyLxaoLKX1CY42+6ig+hXtvFDaeG2z1jZ0 nJILGG5V92M/feOQTXY2E0j3FxniJZc28aaDIONPh8aybJrNlaXJ6q9F83OA/bpYE0Ql MhmHvt48FMFHWTm4dLAWT0l94yHCZDfeoCqVEjAaDzZ01k3BKsX/HiEwAHDhcNCFej+u GP1mHWH1arzOdSfOQuSbIDgC7ExcEk+fzE33RO17nTgcyv763o58FdKQBZI8zOFSz2WE B3VLWoLI2ME1knmEkT8BlYFLVEotQcVi9ZpdyqMaC7aKjhBA7JAWH1Dmj557kFrxyr1n F+bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Hcoh1hgpx7DXrsw4axUsVy8/UiH8uOXXu+gxRTEkhPg=; b=lBiLkGM2RgEuCvS0nq4Bg5EEnHMmP07+VkbeKKeOJZdpd2YJukHTZmTY9xhxKG05mr NSJvQaAhv4N3CXldAyfxt2WC6j0xAVdGd2l8duWF+ypgYfBs4Pc/10Msbz0B4HlxjKQI 771Y9bVqySnuh2yoGUYiPzx3cjsf8BDf11ch2oKAjygHY4H6nQs77HGW80gG02Xq6WO2 PzPMe08RxtbigO4bY+xE5is3F+OMXQGdLygq/1IVDPjWvW+i83QVkfqk9lgCnXJ4o0WK 5hGm4/m5rFwjYwYqIuUkIcelROg1SunzKjEyJ8jTOWwYK7nh2aj2RDDnFmT2pZ3ERr4s bjXw== X-Gm-Message-State: APf1xPCJ/VH3WPvLE9V4Mq0wXxmin9kH2zF2vW3T4IO9ElFveaHP/22n ykeJU0uUOWhw0qval3aTm0JAFvUQnou3OM5XlfgqBA== X-Google-Smtp-Source: AH8x226p9cKSIvYyBKp34jIjcpKS12gFfB407FO3QC9d0pUNmORNJxrMf9ZlnGuvMrGeJ63DMZPnl4cQ2c6L+q/hUGQ= X-Received: by 10.46.77.157 with SMTP id c29mr4255034ljd.116.1518279224157; Sat, 10 Feb 2018 08:13:44 -0800 (PST) MIME-Version: 1.0 Sender: chmeeedalf@gmail.com Received: by 10.46.75.1 with HTTP; Sat, 10 Feb 2018 08:13:43 -0800 (PST) In-Reply-To: References: <201802091946.w19Jkqb3038864@repo.freebsd.org> From: Justin Hibbits Date: Sat, 10 Feb 2018 10:13:43 -0600 X-Google-Sender-Auth: knT5JOVUO_WT8rRIxGH-sYBDCP8 Message-ID: Subject: Re: svn commit: r329077 - head/usr.bin/tftp To: Ed Maste Cc: Conrad Meyer , 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.25 Precedence: list List-Id: "SVN commit messages 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, 10 Feb 2018 16:13:46 -0000 On Fri, Feb 9, 2018 at 7:22 PM, Ed Maste wrote: > On 9 February 2018 at 14:46, Conrad Meyer wrote: >> Author: cem >> Date: Fri Feb 9 19:46:51 2018 >> New Revision: 329077 >> URL: https://svnweb.freebsd.org/changeset/base/329077 >> >> Log: >> tftp(1): Fix libedit state corruption involving signals > > From https://ci.freebsd.org/job/FreeBSD-head-mips-build/391/console: > > 01:15:24 --- all_subdir_usr.bin/tftp --- > 01:15:24 --- main.o --- > 01:15:24 cc1: warnings being treated as errors > 01:15:24 /usr/src/usr.bin/tftp/main.c: In function 'main': > 01:15:24 /usr/src/usr.bin/tftp/main.c:182: warning: 'hist' may be used > uninitialized in this function > 01:15:24 /usr/src/usr.bin/tftp/main.c:181: warning: 'el' may be used > uninitialized in this function > After initializing these, I see the following interesting error: /home/chmeee/freebsd/head/usr.bin/tftp/main.c:181: warning: variable 'el' might be clobbered by 'longjmp' or 'vfork' /home/chmeee/freebsd/head/usr.bin/tftp/main.c:182: warning: variable 'hist' might be clobbered by 'longjmp' or 'vfork' This appears to be a known bug in gcc, at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24239 so I don't know what the best way to fix it is. - Justin From owner-svn-src-all@freebsd.org Sat Feb 10 17:09:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 198BDF0BF59; Sat, 10 Feb 2018 17:09:53 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BD8F087913; Sat, 10 Feb 2018 17:09:52 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B87AE16DD9; Sat, 10 Feb 2018 17:09:52 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1AH9qY4009505; Sat, 10 Feb 2018 17:09:52 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1AH9quA009499; Sat, 10 Feb 2018 17:09:52 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201802101709.w1AH9quA009499@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Sat, 10 Feb 2018 17:09:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329105 - head/usr.sbin/ppp X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/usr.sbin/ppp X-SVN-Commit-Revision: 329105 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Feb 2018 17:09:53 -0000 Author: eugen Date: Sat Feb 10 17:09:51 2018 New Revision: 329105 URL: https://svnweb.freebsd.org/changeset/base/329105 Log: ppp(8): fix code producing debugging logs Fix several cases when long buffer is copied to shorter one using snprintf that results in contents truncation and clobbering unsaved errno value and creation of misleading logs. PR: 218517 Approved by: avg (mentor) MFC after: 1 month Modified: head/usr.sbin/ppp/defs.h head/usr.sbin/ppp/iface.c head/usr.sbin/ppp/ip.c head/usr.sbin/ppp/ipv6cp.c head/usr.sbin/ppp/ncpaddr.c head/usr.sbin/ppp/route.c Modified: head/usr.sbin/ppp/defs.h ============================================================================== --- head/usr.sbin/ppp/defs.h Sat Feb 10 15:29:46 2018 (r329104) +++ head/usr.sbin/ppp/defs.h Sat Feb 10 17:09:51 2018 (r329105) @@ -119,6 +119,8 @@ #define ROUNDUP(x) ((x) ? (1 + (((x) - 1) | (sizeof(long) - 1))) : sizeof(long)) +#define NCP_ASCIIBUFFERSIZE 52 + #ifdef __NetBSD__ extern void randinit(void); #else Modified: head/usr.sbin/ppp/iface.c ============================================================================== --- head/usr.sbin/ppp/iface.c Sat Feb 10 15:29:46 2018 (r329104) +++ head/usr.sbin/ppp/iface.c Sat Feb 10 17:09:51 2018 (r329105) @@ -209,7 +209,7 @@ iface_addr_Zap(const char *name, struct iface_addr *ad #endif struct sockaddr_in *me4, *msk4, *peer4; struct sockaddr_storage ssme, sspeer, ssmsk; - int res; + int res, saved_errno; ncprange_getsa(&addr->ifa, &ssme, &ssmsk); ncpaddr_getsa(&addr->peer, &sspeer); @@ -235,8 +235,9 @@ iface_addr_Zap(const char *name, struct iface_addr *ad memcpy(peer4, &sspeer, sizeof *peer4); res = ID0ioctl(s, SIOCDIFADDR, &ifra); + saved_errno = errno; if (log_IsKept(LogDEBUG)) { - char buf[100]; + char buf[NCP_ASCIIBUFFERSIZE]; snprintf(buf, sizeof buf, "%s", ncprange_ntoa(&addr->ifa)); log_Printf(LogWARN, "%s: DIFADDR %s -> %s returns %d\n", @@ -260,12 +261,13 @@ iface_addr_Zap(const char *name, struct iface_addr *ad ifra6.ifra_lifetime.ia6t_pltime = ND6_INFINITE_LIFETIME; res = ID0ioctl(s, SIOCDIFADDR_IN6, &ifra6); + saved_errno = errno; break; #endif } if (res == -1) { - char dst[40]; + char dst[NCP_ASCIIBUFFERSIZE]; const char *end = #ifndef NOINET6 ncprange_family(&addr->ifa) == AF_INET6 ? "_IN6" : @@ -274,11 +276,11 @@ iface_addr_Zap(const char *name, struct iface_addr *ad if (ncpaddr_family(&addr->peer) == AF_UNSPEC) log_Printf(LogWARN, "iface rm: ioctl(SIOCDIFADDR%s, %s): %s\n", - end, ncprange_ntoa(&addr->ifa), strerror(errno)); + end, ncprange_ntoa(&addr->ifa), strerror(saved_errno)); else { snprintf(dst, sizeof dst, "%s", ncpaddr_ntoa(&addr->peer)); log_Printf(LogWARN, "iface rm: ioctl(SIOCDIFADDR%s, %s -> %s): %s\n", - end, ncprange_ntoa(&addr->ifa), dst, strerror(errno)); + end, ncprange_ntoa(&addr->ifa), dst, strerror(saved_errno)); } } @@ -294,7 +296,7 @@ iface_addr_Add(const char *name, struct iface_addr *ad #endif struct sockaddr_in *me4, *msk4, *peer4; struct sockaddr_storage ssme, sspeer, ssmsk; - int res; + int res, saved_errno; ncprange_getsa(&addr->ifa, &ssme, &ssmsk); ncpaddr_getsa(&addr->peer, &sspeer); @@ -320,8 +322,9 @@ iface_addr_Add(const char *name, struct iface_addr *ad memcpy(peer4, &sspeer, sizeof *peer4); res = ID0ioctl(s, SIOCAIFADDR, &ifra); + saved_errno = errno; if (log_IsKept(LogDEBUG)) { - char buf[100]; + char buf[NCP_ASCIIBUFFERSIZE]; snprintf(buf, sizeof buf, "%s", ncprange_ntoa(&addr->ifa)); log_Printf(LogWARN, "%s: AIFADDR %s -> %s returns %d\n", @@ -345,12 +348,13 @@ iface_addr_Add(const char *name, struct iface_addr *ad ifra6.ifra_lifetime.ia6t_pltime = ND6_INFINITE_LIFETIME; res = ID0ioctl(s, SIOCAIFADDR_IN6, &ifra6); + saved_errno = errno; break; #endif } if (res == -1) { - char dst[40]; + char dst[NCP_ASCIIBUFFERSIZE]; const char *end = #ifndef NOINET6 ncprange_family(&addr->ifa) == AF_INET6 ? "_IN6" : @@ -359,11 +363,11 @@ iface_addr_Add(const char *name, struct iface_addr *ad if (ncpaddr_family(&addr->peer) == AF_UNSPEC) log_Printf(LogWARN, "iface add: ioctl(SIOCAIFADDR%s, %s): %s\n", - end, ncprange_ntoa(&addr->ifa), strerror(errno)); + end, ncprange_ntoa(&addr->ifa), strerror(saved_errno)); else { snprintf(dst, sizeof dst, "%s", ncpaddr_ntoa(&addr->peer)); log_Printf(LogWARN, "iface add: ioctl(SIOCAIFADDR%s, %s -> %s): %s\n", - end, ncprange_ntoa(&addr->ifa), dst, strerror(errno)); + end, ncprange_ntoa(&addr->ifa), dst, strerror(saved_errno)); } } Modified: head/usr.sbin/ppp/ip.c ============================================================================== --- head/usr.sbin/ppp/ip.c Sat Feb 10 15:29:46 2018 (r329104) +++ head/usr.sbin/ppp/ip.c Sat Feb 10 17:09:51 2018 (r329105) @@ -226,7 +226,7 @@ FilterCheck(const unsigned char *packet, int match; /* true if condition matched */ int mindata; /* minimum data size or zero */ const struct filterent *fp = filter->rule; - char dbuff[100], dstip[16]; + char dbuff[100], dstip[NCP_ASCIIBUFFERSIZE]; struct ncpaddr srcaddr, dstaddr; const char *payload; /* IP payload */ int datalen; /* IP datagram length */ Modified: head/usr.sbin/ppp/ipv6cp.c ============================================================================== --- head/usr.sbin/ppp/ipv6cp.c Sat Feb 10 15:29:46 2018 (r329104) +++ head/usr.sbin/ppp/ipv6cp.c Sat Feb 10 17:09:51 2018 (r329105) @@ -467,7 +467,7 @@ ipv6cp_LayerUp(struct fsm *fp) { /* We're now up */ struct ipv6cp *ipv6cp = fsm2ipv6cp(fp); - char tbuff[40]; + char tbuff[NCP_ASCIIBUFFERSIZE]; log_Printf(LogIPV6CP, "%s: LayerUp.\n", fp->link->name); if (!ipv6cp_InterfaceUp(ipv6cp)) @@ -524,7 +524,7 @@ ipv6cp_LayerDown(struct fsm *fp) /* About to come down */ struct ipv6cp *ipv6cp = fsm2ipv6cp(fp); static int recursing; - char addr[40]; + char addr[NCP_ASCIIBUFFERSIZE]; if (!recursing++) { snprintf(addr, sizeof addr, "%s", ncpaddr_ntoa(&ipv6cp->myaddr)); Modified: head/usr.sbin/ppp/ncpaddr.c ============================================================================== --- head/usr.sbin/ppp/ncpaddr.c Sat Feb 10 15:29:46 2018 (r329104) +++ head/usr.sbin/ppp/ncpaddr.c Sat Feb 10 17:09:51 2018 (r329105) @@ -78,8 +78,6 @@ #define ncpaddr_ip6addr u.ip6addr #endif -#define NCP_ASCIIBUFFERSIZE 52 - static struct in_addr bits2mask4(int bits) { Modified: head/usr.sbin/ppp/route.c ============================================================================== --- head/usr.sbin/ppp/route.c Sat Feb 10 15:29:46 2018 (r329104) +++ head/usr.sbin/ppp/route.c Sat Feb 10 17:09:51 2018 (r329105) @@ -437,7 +437,7 @@ route_IfDelete(struct bundle *bundle, int all) ) && (all || (rtm->rtm_flags & RTF_GATEWAY))) { if (log_IsKept(LogDEBUG)) { - char gwstr[41]; + char gwstr[NCP_ASCIIBUFFERSIZE]; struct ncpaddr gw; ncprange_setsa(&range, sa[RTAX_DST], sa[RTAX_NETMASK]); ncpaddr_setsa(&gw, sa[RTAX_GATEWAY]); @@ -843,7 +843,7 @@ failed: } if (log_IsKept(LogDEBUG)) { - char gwstr[40]; + char gwstr[NCP_ASCIIBUFFERSIZE]; if (gw) snprintf(gwstr, sizeof gwstr, "%s", ncpaddr_ntoa(gw)); From owner-svn-src-all@freebsd.org Sat Feb 10 17:17:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CB3AF0C9EC; Sat, 10 Feb 2018 17:17:16 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0C5F987F9A; Sat, 10 Feb 2018 17:17:16 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 02BCD16F8C; Sat, 10 Feb 2018 17:17:16 +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 w1AHHF9C014201; Sat, 10 Feb 2018 17:17:15 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1AHHFUE014200; Sat, 10 Feb 2018 17:17:15 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201802101717.w1AHHFUE014200@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 10 Feb 2018 17:17:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329106 - head/usr.bin/tftp X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/usr.bin/tftp X-SVN-Commit-Revision: 329106 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Feb 2018 17:17:16 -0000 Author: jhibbits Date: Sat Feb 10 17:17:15 2018 New Revision: 329106 URL: https://svnweb.freebsd.org/changeset/base/329106 Log: Fix uninitialized warning, and work around a bug in gcc over clobbering Summary: r329077 caused gcc to emit uninitialized use warnings. Attempting to fix those warnings yielded the following warnings: usr.bin/tftp/main.c: In function 'main': usr.bin/tftp/main.c:181: warning: variable 'el' might be clobbered by 'longjmp' or 'vfork' usr.bin/tftp/main.c:182: warning: variable 'hist' might be clobbered by 'longjmp' or 'vfork' This is a known bug in gcc, found at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24239 Work around that by simply marking hist and el as static. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D14302 Modified: head/usr.bin/tftp/main.c Modified: head/usr.bin/tftp/main.c ============================================================================== --- head/usr.bin/tftp/main.c Sat Feb 10 17:09:51 2018 (r329105) +++ head/usr.bin/tftp/main.c Sat Feb 10 17:17:15 2018 (r329106) @@ -178,8 +178,8 @@ int main(int argc, char *argv[]) { HistEvent he; - EditLine *el; - History *hist; + static EditLine *el; + static History *hist; bool interactive; acting_as_client = 1; From owner-svn-src-all@freebsd.org Sat Feb 10 17:20:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A54ACF0CDF0 for ; Sat, 10 Feb 2018 17:20:30 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic306-35.consmr.mail.ne1.yahoo.com (sonic306-35.consmr.mail.ne1.yahoo.com [66.163.189.97]) (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 CF590682A8 for ; Sat, 10 Feb 2018 17:20:29 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1518283222; bh=oMKjtLepHcqC8vc4B719YHHj3pVRaNhbUtknAFbgmCg=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=mCcB/9VVWFN7nOz08VZhMQYe/YiEk7xhSOx9zlP8Ml1NPv0p7RmSpqYrUVa4DJG/TwMXPUATC6uPeY1rBRmAftiCS4NtTzfOW0ZuldvkyFYgaevFyV5ewwAqvpeWh4r5x3Mod2OG/7bFbf103Y6YoCYXSeId4ZRvkDejOSbIRme4mNFM0Rbhx+Fiip5UEluNgBWwJ2FQuURoTjc1JDzR7djTbbIRGUlpsavJiSBd3/KdhGVdCnO7RVdAXqlRmzPsi4MOysEDAc0l+HMsd5Bdin2VKp7IIRsQkCl5VRkm0nAJyjjATDO8KwlxFPI3hbtOFodm6al5rE7tzCjsa6kfUA== X-YMail-OSG: tN2pZSQVM1m2bC5l.6aDmYbW2FT2NaEsG7M06gjKGtCao6R.cbZH6w1C5HyYY5N F822zP3v_4BgaCypKDAZqJ3MkomGJZkaELYIKwgKiBjJoYFn1lYyCrwn_eyXIeC5od2I26yIKp87 IyMca6kssQF7JF2oAFHSQiKo1kjZh2Kfgkpj2ZVxtPe0bqPjFdlex8C8JBqxp5fTuVNxjAL4nOde .NwW6GKSl63vlEYl5vPVDd78sNsvcgU0U7MqutzFxi4_ieMz5gMyb9YQcKcq_6inTHpXB9pXbKGs E6GmYvDaJt2qmLvRqo6X2sdyFwMA2m5Qi9yzsfrY_OEk4Pz02dICWCmFVqu9YeGvpk2giiyS6DyA aIccKYoZA9hCNrG9F1SN9tYjxWnNWa7kFGg4lZcNheTdPthQ8z8v46X0AuRX1Mwgyx2xfrMWRtcC ODhHCuAiWpKbLbLq..LJZB1tNtSW.A6cDg_t6j41xah4DTLX2vD8b9u2m9raRj_Ks7N6WKLUuyJO T0JvPF9GWKA-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.ne1.yahoo.com with HTTP; Sat, 10 Feb 2018 17:20:22 +0000 Received: from smtp235.mail.ne1.yahoo.com (EHLO [192.168.0.8]) ([10.218.253.206]) by smtp403.mail.ne1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID 9883850e26d98faa04ee84187afca94c; Sat, 10 Feb 2018 17:10:14 +0000 (UTC) Subject: Re: svn commit: r329077 - head/usr.bin/tftp To: Justin Hibbits , Ed Maste Cc: Conrad Meyer , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201802091946.w19Jkqb3038864@repo.freebsd.org> From: Pedro Giffuni Message-ID: Date: Sat, 10 Feb 2018 12:10:11 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------C66CCBE0737B54B1E4A9245D" Content-Language: en-US X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Feb 2018 17:20:30 -0000 This is a multi-part message in MIME format. --------------C66CCBE0737B54B1E4A9245D Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 02/10/18 11:13, Justin Hibbits wrote: > On Fri, Feb 9, 2018 at 7:22 PM, Ed Maste wrote: >> On 9 February 2018 at 14:46, Conrad Meyer wrote: >>> Author: cem >>> Date: Fri Feb 9 19:46:51 2018 >>> New Revision: 329077 >>> URL: https://svnweb.freebsd.org/changeset/base/329077 >>> >>> Log: >>> tftp(1): Fix libedit state corruption involving signals >> From https://ci.freebsd.org/job/FreeBSD-head-mips-build/391/console: >> >> 01:15:24 --- all_subdir_usr.bin/tftp --- >> 01:15:24 --- main.o --- >> 01:15:24 cc1: warnings being treated as errors >> 01:15:24 /usr/src/usr.bin/tftp/main.c: In function 'main': >> 01:15:24 /usr/src/usr.bin/tftp/main.c:182: warning: 'hist' may be used >> uninitialized in this function >> 01:15:24 /usr/src/usr.bin/tftp/main.c:181: warning: 'el' may be used >> uninitialized in this function >> > After initializing these, I see the following interesting error: > > /home/chmeee/freebsd/head/usr.bin/tftp/main.c:181: warning: variable > 'el' might be clobbered by 'longjmp' or 'vfork' > /home/chmeee/freebsd/head/usr.bin/tftp/main.c:182: warning: variable > 'hist' might be clobbered by 'longjmp' or 'vfork' > > This appears to be a known bug in gcc, at > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24239 so I don't know > what the best way to fix it is. Independent of the compiler bug, it does seem like 'el' and 'hist' can be used uninitialized for the non-interactive case. Untested, but perhaps an only-when-needed initialization like this may workaround the compiler bug. Cheers, Pedro. --------------C66CCBE0737B54B1E4A9245D Content-Type: text/x-patch; name="tftp-gcc.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="tftp-gcc.diff" Index: usr.bin/tftp/main.c =================================================================== --- usr.bin/tftp/main.c (revision 329104) +++ usr.bin/tftp/main.c (working copy) @@ -197,6 +197,9 @@ el_set(el, EL_PROMPT, command_prompt); el_set(el, EL_SIGNAL, 1); el_source(el, NULL); + } else { /* Quell GCC */ + el = NULL; + hist = NULL; } if (argc > 1) { --------------C66CCBE0737B54B1E4A9245D-- From owner-svn-src-all@freebsd.org Sat Feb 10 17:42:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C64B6F0E7B7; Sat, 10 Feb 2018 17:42:11 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-lf0-x233.google.com (mail-lf0-x233.google.com [IPv6:2a00:1450:4010:c07::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 0E55D692CA; Sat, 10 Feb 2018 17:42:11 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-lf0-x233.google.com with SMTP id a204so15349049lfa.2; Sat, 10 Feb 2018 09:42:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=O96WKeAmPvWkZgiUHMqiPP5VfcGo75PPpCLpP7INs/w=; b=AgPRnLSVyYN2bgW+IDT/mfUjDBE00eK8+XX8oFDuUNpSAZpDi1lcEOWgdScedr9Q51 3RjtfHaDpsMDRZxAIyZghlRyUPX7wkJt0bEry0bNlRCxm3ZleEMvqcTgJ7E72lVZKWyn qHmQnHLXkuKliIG/RVA4xFoNbvpJpxOLLHF1yHrJMT6dptnYNysx3bMCb6+YBJspwIhp KwDfV1gWqdm6MzujdJD6VeTOt5692sqeV6AMyfinuV6ZahTMnf0JYgf89eUbSkWreifv q7pI9mp24vSdGjL9I2IdFDiVRmKLKQEPkqRbOovgqCk0ppsOMdUrRJ7fiB+FPZ2eN+ep 8QbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=O96WKeAmPvWkZgiUHMqiPP5VfcGo75PPpCLpP7INs/w=; b=tjVIctAnDefoO2LGO3Ps9M9s4hVLP+xNYcL3m3rlJW56225xojhtGNzFYh2rVeZ0Rv UAZZuETbvzndOyeVK4eYk2yh7eK9NGkwVQXAecz56a/h2uTJWJyFsUAv8P+MTcQ3NqYU nRIpXtaYbCL6ZVEYOVYDtHclxEYZNvxym0Y9PR1V2OM5zugYS0v59DgpuOirxjXWj6KY yJXricZ6yoOaokU172SpDOiJ1J0dyWTyONErch0Z5JWUD5ML4cD9F/vqFJxMCkIbu6Vm LnfkrIeY6osB8cwof2oEgXlrvDCDMXC8TS1aUIRRH+sN0V8Lkp7W4HhbhN9/sMDAMi18 VVOQ== X-Gm-Message-State: APf1xPCjsZkXOlo1F6ujwrJhYwzBNvsPmH+f1QqmVM3Jkn2TCDRclhOr 89PxIlFEO0ttbC3yNCB9QYIOkVWDZrn9mL1SN0I= X-Google-Smtp-Source: AH8x224MEUIUoxpWi0nJ4ZBTZcvKPRifrbJ5vEJ6uPCr9RNfmaz0BvbK0K+fdZxIs9X9vNEl0dEsUHfiGx9N+LBfEUY= X-Received: by 10.25.56.86 with SMTP id d22mr4565870lfj.46.1518284529283; Sat, 10 Feb 2018 09:42:09 -0800 (PST) MIME-Version: 1.0 Sender: chmeeedalf@gmail.com Received: by 10.46.75.1 with HTTP; Sat, 10 Feb 2018 09:42:08 -0800 (PST) In-Reply-To: References: <201802091946.w19Jkqb3038864@repo.freebsd.org> From: Justin Hibbits Date: Sat, 10 Feb 2018 11:42:08 -0600 X-Google-Sender-Auth: nF_3a87PGcSK3NicVobnK0G_nNA Message-ID: Subject: Re: svn commit: r329077 - head/usr.bin/tftp To: Pedro Giffuni Cc: Ed Maste , Conrad Meyer , 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.25 Precedence: list List-Id: "SVN commit messages 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, 10 Feb 2018 17:42:12 -0000 On Sat, Feb 10, 2018 at 11:10 AM, Pedro Giffuni wrote: > > > On 02/10/18 11:13, Justin Hibbits wrote: >> >> On Fri, Feb 9, 2018 at 7:22 PM, Ed Maste wrote: >>> >>> On 9 February 2018 at 14:46, Conrad Meyer wrote: >>>> >>>> Author: cem >>>> Date: Fri Feb 9 19:46:51 2018 >>>> New Revision: 329077 >>>> URL: https://svnweb.freebsd.org/changeset/base/329077 >>>> >>>> Log: >>>> tftp(1): Fix libedit state corruption involving signals >>> >>> From https://ci.freebsd.org/job/FreeBSD-head-mips-build/391/console: >>> >>> 01:15:24 --- all_subdir_usr.bin/tftp --- >>> 01:15:24 --- main.o --- >>> 01:15:24 cc1: warnings being treated as errors >>> 01:15:24 /usr/src/usr.bin/tftp/main.c: In function 'main': >>> 01:15:24 /usr/src/usr.bin/tftp/main.c:182: warning: 'hist' may be used >>> uninitialized in this function >>> 01:15:24 /usr/src/usr.bin/tftp/main.c:181: warning: 'el' may be used >>> uninitialized in this function >>> >> After initializing these, I see the following interesting error: >> >> /home/chmeee/freebsd/head/usr.bin/tftp/main.c:181: warning: variable >> 'el' might be clobbered by 'longjmp' or 'vfork' >> /home/chmeee/freebsd/head/usr.bin/tftp/main.c:182: warning: variable >> 'hist' might be clobbered by 'longjmp' or 'vfork' >> >> This appears to be a known bug in gcc, at >> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24239 so I don't know >> what the best way to fix it is. > > > Independent of the compiler bug, it does seem like 'el' and 'hist' can be > used uninitialized for the non-interactive case. > > Untested, but perhaps an only-when-needed initialization like this may > workaround the compiler bug. > > Cheers, > > Pedro. Nope, I tried that as well, and hit the compiler bug. r329106 works around both. - Justin From owner-svn-src-all@freebsd.org Sat Feb 10 19:41:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 465E3F17E33; Sat, 10 Feb 2018 19:41:33 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E86DE6E458; Sat, 10 Feb 2018 19:41:32 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E351A187E9; Sat, 10 Feb 2018 19:41:32 +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 w1AJfWtY084728; Sat, 10 Feb 2018 19:41:32 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1AJfWHR084727; Sat, 10 Feb 2018 19:41:32 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802101941.w1AJfWHR084727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 10 Feb 2018 19:41:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329107 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 329107 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Feb 2018 19:41:33 -0000 Author: cem Date: Sat Feb 10 19:41:32 2018 New Revision: 329107 URL: https://svnweb.freebsd.org/changeset/base/329107 Log: socketpair.2: Reference relevant POSIX standards Sponsored by: Dell EMC Isilon Modified: head/lib/libc/sys/socketpair.2 Modified: head/lib/libc/sys/socketpair.2 ============================================================================== --- head/lib/libc/sys/socketpair.2 Sat Feb 10 17:17:15 2018 (r329106) +++ head/lib/libc/sys/socketpair.2 Sat Feb 10 19:41:32 2018 (r329107) @@ -28,7 +28,7 @@ .\" @(#)socketpair.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd May 4, 2015 +.Dd February 10, 2018 .Dt SOCKETPAIR 2 .Os .Sh NAME @@ -89,6 +89,13 @@ process address space. .Xr read 2 , .Xr socket 2 , .Xr write 2 +.Sh STANDARDS +The +.Fn socketpair +system call conforms to +.St -p1003.1-2001 +and +.St -p1003.1-2008 . .Sh HISTORY The .Fn socketpair From owner-svn-src-all@freebsd.org Sat Feb 10 19:42:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D816FF17F53; Sat, 10 Feb 2018 19:42:13 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f173.google.com (mail-io0-f173.google.com [209.85.223.173]) (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 98D746E643; Sat, 10 Feb 2018 19:42:13 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f173.google.com with SMTP id p188so13343422ioe.12; Sat, 10 Feb 2018 11:42:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=Hlcr5AqjqT1O1hY2Hzck6O2mvwZIilpnczPHjPqtniI=; b=CLWxH3/0mne9d3NisYeo9ynIKdl4GBFuhQrsdN+0S0e0DDswC+dq19LqeB9I97jDyv Sm4c40KB0mzYKS/41M/YVcuaXBfus+jtsuUJX/nHMXqlLZf0UumXNmtM8aVY1mOrItPw fK/mKKeXidb6MaY7GjeKvCzlZ6NumBYlJLc1kAIsie4JMuGakIlhNMot1OvOnmND8wo8 IPFdbAXarPTCqDqxTb6yLY7QosCZAVrLoMcODJinCkcVmkYOkf69Okvnd/YWMH8zN4m2 ryu2jwdfcNfQdV8hW0CpMM7HHDNzXMIFWhmxaOjVvvXZZcVEx2UJWuE8/C/Nf6291VAg 9YPQ== X-Gm-Message-State: APf1xPDJC0P+1PnKCKZNTOXJ0KGQ3Ms/rgRjpeU0X8+cEsDcBkR/9ZMu Y9i/UdnKyl7Yt3iK22STuHW4vZ0/ X-Google-Smtp-Source: AH8x2252YrLoh3eM74yFQdDEsm4RxbF927YpghKqM1HDZ+m1n0yD/OQxpVZw56JHrTeQbyzpotTTWQ== X-Received: by 10.107.4.133 with SMTP id 127mr7688333ioe.209.1518290478015; Sat, 10 Feb 2018 11:21:18 -0800 (PST) Received: from mail-io0-f175.google.com (mail-io0-f175.google.com. [209.85.223.175]) by smtp.gmail.com with ESMTPSA id n73sm6903856ioi.84.2018.02.10.11.21.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 Feb 2018 11:21:17 -0800 (PST) Received: by mail-io0-f175.google.com with SMTP id k80so1960292ioe.13; Sat, 10 Feb 2018 11:21:17 -0800 (PST) X-Received: by 10.107.15.8 with SMTP id x8mr3039896ioi.38.1518290477520; Sat, 10 Feb 2018 11:21:17 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.152.123 with HTTP; Sat, 10 Feb 2018 11:21:17 -0800 (PST) In-Reply-To: References: <201802091946.w19Jkqb3038864@repo.freebsd.org> From: Conrad Meyer Date: Sat, 10 Feb 2018 11:21:17 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r329077 - head/usr.bin/tftp To: Pedro Giffuni Cc: Justin Hibbits , Ed Maste , 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.25 Precedence: list List-Id: "SVN commit messages 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, 10 Feb 2018 19:42:14 -0000 Nah, both sets of warnings are spurious. The first set is arguably not a compiler bug, just lack of omniscience. The variables are never actually used uninitialized in the !interactive case. The second set is pure bug. Justin found the workaround (same as before this change) and has applied it. Thanks, Justin. Best, Conrad On Sat, Feb 10, 2018 at 9:10 AM, Pedro Giffuni wrote: > > > On 02/10/18 11:13, Justin Hibbits wrote: >> >> On Fri, Feb 9, 2018 at 7:22 PM, Ed Maste wrote: >>> >>> On 9 February 2018 at 14:46, Conrad Meyer wrote: >>>> >>>> Author: cem >>>> Date: Fri Feb 9 19:46:51 2018 >>>> New Revision: 329077 >>>> URL: https://svnweb.freebsd.org/changeset/base/329077 >>>> >>>> Log: >>>> tftp(1): Fix libedit state corruption involving signals >>> >>> From https://ci.freebsd.org/job/FreeBSD-head-mips-build/391/console: >>> >>> 01:15:24 --- all_subdir_usr.bin/tftp --- >>> 01:15:24 --- main.o --- >>> 01:15:24 cc1: warnings being treated as errors >>> 01:15:24 /usr/src/usr.bin/tftp/main.c: In function 'main': >>> 01:15:24 /usr/src/usr.bin/tftp/main.c:182: warning: 'hist' may be used >>> uninitialized in this function >>> 01:15:24 /usr/src/usr.bin/tftp/main.c:181: warning: 'el' may be used >>> uninitialized in this function >>> >> After initializing these, I see the following interesting error: >> >> /home/chmeee/freebsd/head/usr.bin/tftp/main.c:181: warning: variable >> 'el' might be clobbered by 'longjmp' or 'vfork' >> /home/chmeee/freebsd/head/usr.bin/tftp/main.c:182: warning: variable >> 'hist' might be clobbered by 'longjmp' or 'vfork' >> >> This appears to be a known bug in gcc, at >> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24239 so I don't know >> what the best way to fix it is. > > > Independent of the compiler bug, it does seem like 'el' and 'hist' can be > used uninitialized for the non-interactive case. > > Untested, but perhaps an only-when-needed initialization like this may > workaround the compiler bug. > > Cheers, > > Pedro. From owner-svn-src-all@freebsd.org Sat Feb 10 19:43:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 182AFF18113; Sat, 10 Feb 2018 19:43:53 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF7D26E83B; Sat, 10 Feb 2018 19:43:52 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA59518838; Sat, 10 Feb 2018 19:43:52 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1AJhqxO088797; Sat, 10 Feb 2018 19:43:52 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1AJhq7T088796; Sat, 10 Feb 2018 19:43:52 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201802101943.w1AJhq7T088796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sat, 10 Feb 2018 19:43:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329108 - in head: contrib/netbsd-tests/lib/libc/sys tools/regression/sockets/socketpair X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head: contrib/netbsd-tests/lib/libc/sys tools/regression/sockets/socketpair X-SVN-Commit-Revision: 329108 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Feb 2018 19:43:53 -0000 Author: asomers Date: Sat Feb 10 19:43:52 2018 New Revision: 329108 URL: https://svnweb.freebsd.org/changeset/base/329108 Log: Convert tools/regression/sockets/socketpair to ATF Reviewed by: cem MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D14305 Deleted: head/tools/regression/sockets/socketpair/ Modified: head/contrib/netbsd-tests/lib/libc/sys/t_socketpair.c Modified: head/contrib/netbsd-tests/lib/libc/sys/t_socketpair.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_socketpair.c Sat Feb 10 19:41:32 2018 (r329107) +++ head/contrib/netbsd-tests/lib/libc/sys/t_socketpair.c Sat Feb 10 19:43:52 2018 (r329108) @@ -56,7 +56,7 @@ connected(int fd) } static void -run(int flags) +run(int domain, int type, int flags) { int fd[2], i; @@ -69,7 +69,7 @@ run(int flags) ATF_REQUIRE(closefrom(3) != -1); #endif - ATF_REQUIRE(socketpair(AF_UNIX, SOCK_DGRAM | flags, 0, fd) == 0); + ATF_REQUIRE(socketpair(domain, type | flags, 0, fd) == 0); ATF_REQUIRE(fd[0] == 3); ATF_REQUIRE(fd[1] == 4); @@ -97,6 +97,42 @@ run(int flags) ATF_REQUIRE(close(fd[1]) != -1); } +ATF_TC(inet); +ATF_TC_HEAD(inet, tc) +{ + atf_tc_set_md_var(tc, "descr", + "socketpair(2) does not work in the PF_INET domain"); +} + +ATF_TC_BODY(inet, tc) +{ + int fd[2]; + + ATF_REQUIRE_EQ(socketpair(PF_INET, SOCK_DGRAM, 0, fd), -1); + ATF_REQUIRE_EQ(EOPNOTSUPP, errno); + ATF_REQUIRE_EQ(socketpair(PF_INET, SOCK_STREAM, 0, fd), -1); + ATF_REQUIRE_EQ(EOPNOTSUPP, errno); +} + +ATF_TC(null_sv); +ATF_TC_HEAD(null_sv, tc) +{ + atf_tc_set_md_var(tc, "descr", + "socketpair(2) should fail without return storage"); +} + +ATF_TC_BODY(null_sv, tc) +{ + int fd; + + closefrom(3); + ATF_REQUIRE_EQ(socketpair(AF_UNIX, SOCK_DGRAM, 0, NULL), -1); + ATF_REQUIRE_EQ(EFAULT, errno); + fd = open("/", O_RDONLY); + ATF_REQUIRE_EQ_MSG(fd, 3, + "socketpair(..., NULL) allocated descriptors"); +} + ATF_TC(socketpair_basic); ATF_TC_HEAD(socketpair_basic, tc) { @@ -105,7 +141,7 @@ ATF_TC_HEAD(socketpair_basic, tc) ATF_TC_BODY(socketpair_basic, tc) { - run(0); + run(AF_UNIX, SOCK_DGRAM, 0); } ATF_TC(socketpair_nonblock); @@ -116,7 +152,7 @@ ATF_TC_HEAD(socketpair_nonblock, tc) ATF_TC_BODY(socketpair_nonblock, tc) { - run(SOCK_NONBLOCK); + run(AF_UNIX, SOCK_DGRAM, SOCK_NONBLOCK); } ATF_TC(socketpair_cloexec); @@ -127,15 +163,29 @@ ATF_TC_HEAD(socketpair_cloexec, tc) ATF_TC_BODY(socketpair_cloexec, tc) { - run(SOCK_CLOEXEC); + run(AF_UNIX, SOCK_DGRAM, SOCK_CLOEXEC); } +ATF_TC(socketpair_stream); +ATF_TC_HEAD(socketpair_stream, tc) +{ + atf_tc_set_md_var(tc, "descr", "A stream-oriented socketpair(2)"); +} + +ATF_TC_BODY(socketpair_stream, tc) +{ + run(AF_UNIX, SOCK_STREAM, 0); +} + ATF_TP_ADD_TCS(tp) { + ATF_TP_ADD_TC(tp, inet); + ATF_TP_ADD_TC(tp, null_sv); ATF_TP_ADD_TC(tp, socketpair_basic); ATF_TP_ADD_TC(tp, socketpair_nonblock); ATF_TP_ADD_TC(tp, socketpair_cloexec); + ATF_TP_ADD_TC(tp, socketpair_stream); return atf_no_error(); } From owner-svn-src-all@freebsd.org Sat Feb 10 20:34:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39FCDF1C092; Sat, 10 Feb 2018 20:34:10 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E19EA7130C; Sat, 10 Feb 2018 20:34:09 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C245A19061; Sat, 10 Feb 2018 20:34:09 +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 w1AKY9fr015136; Sat, 10 Feb 2018 20:34:09 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1AKY9IP015134; Sat, 10 Feb 2018 20:34:09 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802102034.w1AKY9IP015134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 10 Feb 2018 20:34:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329109 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 329109 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Feb 2018 20:34:10 -0000 Author: cem Date: Sat Feb 10 20:34:09 2018 New Revision: 329109 URL: https://svnweb.freebsd.org/changeset/base/329109 Log: Document syscall_helper_register(9), syscall_helper_unregister(9) Added: head/share/man/man9/syscall_helper_register.9 (contents, props changed) Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Sat Feb 10 19:43:52 2018 (r329108) +++ head/share/man/man9/Makefile Sat Feb 10 20:34:09 2018 (r329109) @@ -285,6 +285,7 @@ MAN= accept_filter.9 \ style.9 \ swi.9 \ sx.9 \ + syscall_helper_register.9 \ SYSCALL_MODULE.9 \ sysctl.9 \ sysctl_add_oid.9 \ @@ -1921,6 +1922,11 @@ MLINKS+=sx.9 sx_assert.9 \ sx.9 sx_xlock_sig.9 \ sx.9 sx_xlocked.9 \ sx.9 sx_xunlock.9 +MLINKS+=syscall_helper_register.9 syscall_helper_unregister.9 \ + syscall_helper_register.9 SYSCALL_INIT_HELPER.9 \ + syscall_helper_register.9 SYSCALL_INIT_HELPER_COMPAT.9 \ + syscall_helper_register.9 SYSCALL_INIT_HELPER_COMPAT_F.9 \ + syscall_helper_register.9 SYSCALL_INIT_HELPER_F.9 MLINKS+=sysctl.9 SYSCTL_DECL.9 \ sysctl.9 SYSCTL_ADD_INT.9 \ sysctl.9 SYSCTL_ADD_LONG.9 \ Added: head/share/man/man9/syscall_helper_register.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/syscall_helper_register.9 Sat Feb 10 20:34:09 2018 (r329109) @@ -0,0 +1,139 @@ +.\" Copyright (c) 2018 Conrad Meyer +.\" 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 February 10, 2018 +.Dt SYSCALL_HELPER_REGISTER 9 +.Os +.Sh NAME +.Nm syscall_helper_register , +.Nm syscall_helper_unregister +.Nd kernel syscall registration routines +.\" +.Sh SYNOPSIS +.In sys/sysent.h +.Ft int +.Fn syscall_helper_register "struct syscall_helper_data *sd" "int flags" +.Ft int +.Fn syscall_helper_unregister "struct syscall_helper_data *sd" +.\" +.Ss INITIALIZER MACROS +.Ft struct syscall_helper_data +.Fn SYSCALL_INIT_HELPER "syscallname" +.Ft struct syscall_helper_data +.Fn SYSCALL_INIT_HELPER_F "syscallname" "int flags" +.\" +.Ss COMPATIBILITY INITIALIZER MACROS +.Ft struct syscall_helper_data +.Fn SYSCALL_INIT_HELPER_COMPAT "syscallname" +.Ft struct syscall_helper_data +.Fn SYSCALL_INIT_HELPER_COMPAT_F "syscallname" "int flags" +.\" +.Sh DESCRIPTION +The +.Fn syscall_helper_register +registers a system call. +This function takes the structure +.Va struct syscall_helper_data sd , +which specifies the parameters for syscall registration: +.Pp +.Bd -literal -offset indent -compact +struct syscall_helper_data { + struct sysent new_sysent; + struct sysent old_sysent; + int syscall_no; + int registered; +}; +.Ed +.Pp +The only valid flag for the +.Fa flags +argument to +.Fn syscall_helper_register +is +.Dv SY_THR_STATIC . +This flag prevents the syscall from being unregistered. +.\" +.Pp +Before use, the structure must be initialized with one of the +.Fn SYSCALL_INIT_HELPER* +macros. +In new code, syscall implementation functions shall be named +.Fn sys_syscallname +and the regular macros shall be used. +.Pp +For legacy syscall functions named without "sys_" prefixes, the "COMPAT" +versions of the macros may be used. +.Pp +The only valid flag for the +.Fa flags +argument to the "F" variants of the initializer macros is +.Dv SYF_CAPENABLED . +This flag indicates that the syscall is allowed in capability mode. +.Pp +The +.Fn syscall_helper_unregister +unregisters a system call. +This function takes the same structure +.Va struct syscall_helper_data sd +that was previously initialized in the manner described above and used in a +successful invocation of +.Fn syscall_helper_register . +.\" +.Sh RETURN VALUES +If successful, +.Fn syscall_helper_register +and +.Fn syscall_helper_unregister +will return 0. +Otherwise, they will return an error. +.\" +.Sh ERRORS +The +.Fn syscall_helper_register +call will fail and the syscall will not be registered if: +.Bl -tag -width Er +.It Bq Er EINVAL +The +.Fa flags +argument contained a value other than +.Dv SY_THR_STATIC . +.It Bq Er EINVAL +The specified syscall number, +.Dv sd.syscall_no +.Dv ( SYS_syscallname ) , +was outside of the valid range of system call numbers (zero through +.Dv SYS_MAXSYSCALL ) . +.It Bq Er ENFILE +The system call table does not have any available slots. +.It Bq Er EEXIST +The specified syscall number, +.Dv sd.syscall_no +.Dv ( SYS_syscallname ) , +was already in use. +.El +.\" +.Sh SEE ALSO +.Xr SYSCALL_MODULE 9 From owner-svn-src-all@freebsd.org Sat Feb 10 22:34:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BE1CF027F5; Sat, 10 Feb 2018 22:34:48 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C61B776086; Sat, 10 Feb 2018 22:34:47 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C11BF1A3B9; Sat, 10 Feb 2018 22:34:47 +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 w1AMYlce075796; Sat, 10 Feb 2018 22:34:47 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1AMYlRP075795; Sat, 10 Feb 2018 22:34:47 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201802102234.w1AMYlRP075795@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 10 Feb 2018 22:34:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329111 - stable/11/etc X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/etc X-SVN-Commit-Revision: 329111 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Feb 2018 22:34:48 -0000 Author: emaste Date: Sat Feb 10 22:34:47 2018 New Revision: 329111 URL: https://svnweb.freebsd.org/changeset/base/329111 Log: MFC r328895: Correct Russia spelling in regdomain.xml PR: 225658 Modified: stable/11/etc/regdomain.xml Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/regdomain.xml ============================================================================== --- stable/11/etc/regdomain.xml Sat Feb 10 22:34:46 2018 (r329110) +++ stable/11/etc/regdomain.xml Sat Feb 10 22:34:47 2018 (r329111) @@ -1595,7 +1595,7 @@ 642 Romania - 643 Rusia + 643 Russia 682 Saudi Arabia From owner-svn-src-all@freebsd.org Sat Feb 10 22:36:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91837F02A51; Sat, 10 Feb 2018 22:36:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4448676475; Sat, 10 Feb 2018 22:36: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F3501A3BD; Sat, 10 Feb 2018 22:36: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 w1AMahHJ075985; Sat, 10 Feb 2018 22:36:43 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1AMahBn075984; Sat, 10 Feb 2018 22:36:43 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201802102236.w1AMahBn075984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 10 Feb 2018 22:36: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: r329113 - stable/10/etc X-SVN-Group: stable-10 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/10/etc X-SVN-Commit-Revision: 329113 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages 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, 10 Feb 2018 22:36:43 -0000 Author: emaste Date: Sat Feb 10 22:36:42 2018 New Revision: 329113 URL: https://svnweb.freebsd.org/changeset/base/329113 Log: MFC r328895: Correct Russia spelling in regdomain.xml PR: 225658 Modified: stable/10/etc/regdomain.xml Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/regdomain.xml ============================================================================== --- stable/10/etc/regdomain.xml Sat Feb 10 22:35:46 2018 (r329112) +++ stable/10/etc/regdomain.xml Sat Feb 10 22:36:42 2018 (r329113) @@ -1595,7 +1595,7 @@ 642 Romania - 643 Rusia + 643 Russia 682 Saudi Arabia