From owner-svn-src-all@freebsd.org Sun Jul 30 00:00:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B70CDDCE1EC; Sun, 30 Jul 2017 00:00:31 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85387810B0; Sun, 30 Jul 2017 00:00:31 +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 v6U00URt029784; Sun, 30 Jul 2017 00:00:30 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6U00UTZ029783; Sun, 30 Jul 2017 00:00:30 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201707300000.v6U00UTZ029783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 30 Jul 2017 00:00:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321709 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 321709 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.23 Precedence: list List-Id: "SVN commit messages 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, 30 Jul 2017 00:00:31 -0000 Author: ian Date: Sun Jul 30 00:00:30 2017 New Revision: 321709 URL: https://svnweb.freebsd.org/changeset/base/321709 Log: Fix building this driver on non-FDT platforms. Modified: head/sys/dev/iicbus/ds1307.c Modified: head/sys/dev/iicbus/ds1307.c ============================================================================== --- head/sys/dev/iicbus/ds1307.c Sat Jul 29 23:45:57 2017 (r321708) +++ head/sys/dev/iicbus/ds1307.c Sun Jul 30 00:00:30 2017 (r321709) @@ -299,8 +299,10 @@ ds1307_attach(device_t dev) sc->enum_hook.ich_func = ds1307_start; sc->enum_hook.ich_arg = dev; +#ifdef FDT if (ofw_bus_is_compatible(dev, "microchip,mcp7941x")) sc->sc_mcp7941x = 1; +#endif /* * We have to wait until interrupts are enabled. Usually I2C read From owner-svn-src-all@freebsd.org Sun Jul 30 00:01:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 207A3DCE416; Sun, 30 Jul 2017 00:01:33 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DFA0C812C7; Sun, 30 Jul 2017 00:01:32 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6U01VhM032852; Sun, 30 Jul 2017 00:01:31 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6U01VhW032851; Sun, 30 Jul 2017 00:01:31 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201707300001.v6U01VhW032851@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 30 Jul 2017 00:01:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321710 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 321710 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.23 Precedence: list List-Id: "SVN commit messages 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, 30 Jul 2017 00:01:33 -0000 Author: ian Date: Sun Jul 30 00:01:31 2017 New Revision: 321710 URL: https://svnweb.freebsd.org/changeset/base/321710 Log: Add a few missing i2c devices that build fine on all arches. Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sun Jul 30 00:00:30 2017 (r321709) +++ head/sys/conf/NOTES Sun Jul 30 00:01:31 2017 (r321710) @@ -2523,14 +2523,24 @@ device iicoc # OpenCores I2C controller support # I2C peripheral devices # +# ds1307 Dallas Semiconductor DS1307 RTC and compatible # ds133x Dallas Semiconductor DS1337, DS1338 and DS1339 RTC # ds1374 Dallas Semiconductor DS1374 RTC # ds1672 Dallas Semiconductor DS1672 RTC +# ds3231 Dallas Semiconductor DS3231 RTC + temperature +# icee AT24Cxxx and compatible EEPROMs +# lm75 LM75 compatible temperature sensor +# nxprtc NXP RTCs: PCA2129 PCA8565 PCF2127 PCF2129 PCF8523 PCF8563 # s35390a Seiko Instruments S-35390A RTC # +device ds1307 device ds133x device ds1374 device ds1672 +device ds3231 +device icee +device lm75 +device nxprtc device s35390a # Parallel-Port Bus From owner-svn-src-all@freebsd.org Sun Jul 30 00:24:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A47CDCE980; Sun, 30 Jul 2017 00:24:17 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B13581C42; Sun, 30 Jul 2017 00:24:16 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6U0OGUY041711; Sun, 30 Jul 2017 00:24:16 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6U0OGO7041710; Sun, 30 Jul 2017 00:24:16 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201707300024.v6U0OGO7041710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 30 Jul 2017 00:24:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321711 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 321711 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.23 Precedence: list List-Id: "SVN commit messages 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, 30 Jul 2017 00:24:17 -0000 Author: ian Date: Sun Jul 30 00:24:15 2017 New Revision: 321711 URL: https://svnweb.freebsd.org/changeset/base/321711 Log: Move the device descriptions onto the device lines, so they cut and paste nicely into other config files. Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sun Jul 30 00:01:31 2017 (r321710) +++ head/sys/conf/NOTES Sun Jul 30 00:24:15 2017 (r321711) @@ -2523,25 +2523,15 @@ device iicoc # OpenCores I2C controller support # I2C peripheral devices # -# ds1307 Dallas Semiconductor DS1307 RTC and compatible -# ds133x Dallas Semiconductor DS1337, DS1338 and DS1339 RTC -# ds1374 Dallas Semiconductor DS1374 RTC -# ds1672 Dallas Semiconductor DS1672 RTC -# ds3231 Dallas Semiconductor DS3231 RTC + temperature -# icee AT24Cxxx and compatible EEPROMs -# lm75 LM75 compatible temperature sensor -# nxprtc NXP RTCs: PCA2129 PCA8565 PCF2127 PCF2129 PCF8523 PCF8563 -# s35390a Seiko Instruments S-35390A RTC -# -device ds1307 -device ds133x -device ds1374 -device ds1672 -device ds3231 -device icee -device lm75 -device nxprtc -device s35390a +device ds1307 # Dallas DS1307 RTC and compatible +device ds133x # Dallas DS1337, DS1338 and DS1339 RTC +device ds1374 # Dallas DS1374 RTC +device ds1672 # Dallas DS1672 RTC +device ds3231 # Dallas DS3231 RTC + temperature +device icee # AT24Cxxx and compatible EEPROMs +device lm75 # LM75 compatible temperature sensor +device nxprtc # NXP RTCs: PCA/PFC212x PCA/PCF85xx +device s35390a # Seiko Instruments S-35390A RTC # Parallel-Port Bus # From owner-svn-src-all@freebsd.org Sun Jul 30 00:25:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A71B5DCE9F0; Sun, 30 Jul 2017 00:25:30 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 74CCC81D9A; Sun, 30 Jul 2017 00:25:30 +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 v6U0PTKr041803; Sun, 30 Jul 2017 00:25:29 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6U0PTiO041802; Sun, 30 Jul 2017 00:25:29 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201707300025.v6U0PTiO041802@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 30 Jul 2017 00:25:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321712 - head/sys/arm/conf X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/conf X-SVN-Commit-Revision: 321712 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.23 Precedence: list List-Id: "SVN commit messages 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, 30 Jul 2017 00:25:30 -0000 Author: ian Date: Sun Jul 30 00:25:29 2017 New Revision: 321712 URL: https://svnweb.freebsd.org/changeset/base/321712 Log: Add the i2c RTC drivers found on various arm systems. Modified: head/sys/arm/conf/GENERIC Modified: head/sys/arm/conf/GENERIC ============================================================================== --- head/sys/arm/conf/GENERIC Sun Jul 30 00:24:15 2017 (r321711) +++ head/sys/arm/conf/GENERIC Sun Jul 30 00:25:29 2017 (r321712) @@ -128,15 +128,22 @@ device p2wi # Allwinner Push-Pull Two Wire device axp209 # AXP209 Power Management Unit device axp81x # AXP813/818 Power Management Unit device bcm2835_bsc -device icee +device icee # AT24Cxxx and compatible EEPROMs device sy8106a # SY8106A Buck Regulator device ti_i2c device am335x_pmic # AM335x Power Management IC (TPC65217) device am335x_rtc # RTC support (power management only) -#define am335x_dmtpps # Pulse Per Second capture driver device twl # TI TWLX0X0/TPS659x0 Power Management device twl_vreg # twl voltage regulation device twl_clks # twl external clocks + +# i2c RTCs +device ds1307 # Dallas DS1307 RTC and compatible +device ds133x # Dallas DS1337, DS1338 and DS1339 RTC +device ds1672 # Dallas DS1672 RTC +device ds3231 # Dallas DS3231 RTC + temperature +device nxprtc # NXP RTCs: PCA/PFC212x PCA/PCF85xx +device s35390a # Seiko Instruments S-35390A RTC # GPIO device gpio From owner-svn-src-all@freebsd.org Sun Jul 30 06:27:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E46CDB00E2; Sun, 30 Jul 2017 06:27:33 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E94F67321; Sun, 30 Jul 2017 06:27:33 +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 v6U6RWW6087128; Sun, 30 Jul 2017 06:27:32 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6U6RWPD087127; Sun, 30 Jul 2017 06:27:32 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201707300627.v6U6RWPD087127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 30 Jul 2017 06:27:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321713 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 321713 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.23 Precedence: list List-Id: "SVN commit messages 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, 30 Jul 2017 06:27:33 -0000 Author: delphij Date: Sun Jul 30 06:27:32 2017 New Revision: 321713 URL: https://svnweb.freebsd.org/changeset/base/321713 Log: Bump copyright year. MFC after: 3 days Modified: head/sys/sys/copyright.h Modified: head/sys/sys/copyright.h ============================================================================== --- head/sys/sys/copyright.h Sun Jul 30 00:25:29 2017 (r321712) +++ head/sys/sys/copyright.h Sun Jul 30 06:27:32 2017 (r321713) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 1992-2016 The FreeBSD Project. All rights reserved. + * Copyright (C) 1992-2017 The FreeBSD Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions From owner-svn-src-all@freebsd.org Sun Jul 30 06:54:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18B58DB08C3; Sun, 30 Jul 2017 06:54:00 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D965067CFE; Sun, 30 Jul 2017 06:53:59 +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 v6U6rwGo099102; Sun, 30 Jul 2017 06:53:58 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6U6rwLN099096; Sun, 30 Jul 2017 06:53:58 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201707300653.v6U6rwLN099096@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Sun, 30 Jul 2017 06:53:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321714 - 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: 321714 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.23 Precedence: list List-Id: "SVN commit messages 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, 30 Jul 2017 06:54:00 -0000 Author: scottl Date: Sun Jul 30 06:53:58 2017 New Revision: 321714 URL: https://svnweb.freebsd.org/changeset/base/321714 Log: Split the interrupt setup code into two parts: allocation and configuration. Do the allocation before requesting the IOCFacts message. This triggers the LSI firmware to recognize the multiqueue should be enabled if available. Multiqueue isn't used by the driver yet, but this also fixes a problem with the cached IOCFacts not matching latter checks, leading to potential problems with error recovery. As a side-effect, fetch the driver tunables as early as possible. Reviewed by: slm Obtained from: Netflix Differential Revision: D9243 Modified: head/sys/dev/mpr/mpr.c head/sys/dev/mpr/mpr_pci.c head/sys/dev/mpr/mprvar.h head/sys/dev/mps/mps.c head/sys/dev/mps/mps_pci.c head/sys/dev/mps/mpsvar.h Modified: head/sys/dev/mpr/mpr.c ============================================================================== --- head/sys/dev/mpr/mpr.c Sun Jul 30 06:27:32 2017 (r321713) +++ head/sys/dev/mpr/mpr.c Sun Jul 30 06:53:58 2017 (r321714) @@ -1482,7 +1482,7 @@ mpr_init_queues(struct mpr_softc *sc) * Next are the global settings, if they exist. Highest are the per-unit * settings, if they exist. */ -static void +void mpr_get_tunables(struct mpr_softc *sc) { char tmpstr[80]; @@ -1657,8 +1657,6 @@ int mpr_attach(struct mpr_softc *sc) { int error; - - mpr_get_tunables(sc); MPR_FUNCTRACE(sc); Modified: head/sys/dev/mpr/mpr_pci.c ============================================================================== --- head/sys/dev/mpr/mpr_pci.c Sun Jul 30 06:27:32 2017 (r321713) +++ head/sys/dev/mpr/mpr_pci.c Sun Jul 30 06:53:58 2017 (r321714) @@ -69,6 +69,7 @@ static int mpr_pci_resume(device_t); static void mpr_pci_free(struct mpr_softc *); static int mpr_alloc_msix(struct mpr_softc *sc, int msgs); static int mpr_alloc_msi(struct mpr_softc *sc, int msgs); +static int mpr_pci_alloc_interrupts(struct mpr_softc *sc); static device_method_t mpr_methods[] = { DEVMETHOD(device_probe, mpr_pci_probe), @@ -191,6 +192,8 @@ mpr_pci_attach(device_t dev) m = mpr_find_ident(dev); sc->mpr_flags = m->flags; + mpr_get_tunables(sc); + /* Twiddle basic PCI config bits for a sanity check */ pci_enable_busmaster(dev); @@ -240,28 +243,51 @@ mpr_pci_attach(device_t dev) return (ENOMEM); } - if ((error = mpr_attach(sc)) != 0) + if (((error = mpr_pci_alloc_interrupts(sc)) != 0) || + ((error = mpr_attach(sc)) != 0)) mpr_pci_free(sc); return (error); } +/* + * Allocate, but don't assign interrupts early. Doing it before requesting + * the IOCFacts message informs the firmware that we want to do MSI-X + * multiqueue. We might not use all of the available messages, but there's + * no reason to re-alloc if we don't. + */ int -mpr_pci_setup_interrupts(struct mpr_softc *sc) +mpr_pci_alloc_interrupts(struct mpr_softc *sc) { device_t dev; - int i, error, msgs; + int error, msgs; dev = sc->mpr_dev; - error = ENXIO; + error = 0; + if ((sc->disable_msix == 0) && ((msgs = pci_msix_count(dev)) >= MPR_MSI_COUNT)) error = mpr_alloc_msix(sc, MPR_MSI_COUNT); if ((error != 0) && (sc->disable_msi == 0) && ((msgs = pci_msi_count(dev)) >= MPR_MSI_COUNT)) error = mpr_alloc_msi(sc, MPR_MSI_COUNT); + else + msgs = 0; - if (error != 0) { + sc->msi_msgs = msgs; + return (error); +} + +int +mpr_pci_setup_interrupts(struct mpr_softc *sc) +{ + device_t dev; + int i, error; + + dev = sc->mpr_dev; + error = ENXIO; + + if (sc->msi_msgs == 0) { sc->mpr_flags |= MPR_FLAGS_INTX; sc->mpr_irq_rid[0] = 0; sc->mpr_irq[0] = bus_alloc_resource_any(dev, SYS_RES_IRQ, Modified: head/sys/dev/mpr/mprvar.h ============================================================================== --- head/sys/dev/mpr/mprvar.h Sun Jul 30 06:27:32 2017 (r321713) +++ head/sys/dev/mpr/mprvar.h Sun Jul 30 06:53:58 2017 (r321714) @@ -278,6 +278,7 @@ struct mpr_softc { u_int mpr_debug; u_int disable_msix; u_int disable_msi; + int msi_msgs; u_int atomic_desc_capable; int tm_cmds_active; int io_cmds_active; @@ -702,6 +703,7 @@ mpr_unmask_intr(struct mpr_softc *sc) int mpr_pci_setup_interrupts(struct mpr_softc *sc); int mpr_pci_restore(struct mpr_softc *sc); +void mpr_get_tunables(struct mpr_softc *sc); int mpr_attach(struct mpr_softc *sc); int mpr_free(struct mpr_softc *sc); void mpr_intr(void *); Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Sun Jul 30 06:27:32 2017 (r321713) +++ head/sys/dev/mps/mps.c Sun Jul 30 06:53:58 2017 (r321714) @@ -1341,7 +1341,7 @@ mps_init_queues(struct mps_softc *sc) * Next are the global settings, if they exist. Highest are the per-unit * settings, if they exist. */ -static void +void mps_get_tunables(struct mps_softc *sc) { char tmpstr[80]; @@ -1512,8 +1512,6 @@ int mps_attach(struct mps_softc *sc) { int error; - - mps_get_tunables(sc); MPS_FUNCTRACE(sc); Modified: head/sys/dev/mps/mps_pci.c ============================================================================== --- head/sys/dev/mps/mps_pci.c Sun Jul 30 06:27:32 2017 (r321713) +++ head/sys/dev/mps/mps_pci.c Sun Jul 30 06:53:58 2017 (r321714) @@ -68,6 +68,7 @@ static int mps_pci_resume(device_t); static void mps_pci_free(struct mps_softc *); static int mps_alloc_msix(struct mps_softc *sc, int msgs); static int mps_alloc_msi(struct mps_softc *sc, int msgs); +static int mps_pci_alloc_interrupts(struct mps_softc *sc); static device_method_t mps_methods[] = { DEVMETHOD(device_probe, mps_pci_probe), @@ -191,6 +192,8 @@ mps_pci_attach(device_t dev) m = mps_find_ident(dev); sc->mps_flags = m->flags; + mps_get_tunables(sc); + /* Twiddle basic PCI config bits for a sanity check */ pci_enable_busmaster(dev); @@ -221,28 +224,51 @@ mps_pci_attach(device_t dev) return (ENOMEM); } - if ((error = mps_attach(sc)) != 0) + if (((error = mps_pci_alloc_interrupts(sc)) != 0) || + ((error = mps_attach(sc)) != 0)) mps_pci_free(sc); return (error); } -int -mps_pci_setup_interrupts(struct mps_softc *sc) +/* + * Allocate, but don't assign interrupts early. Doing it before requesting + * the IOCFacts message informs the firmware that we want to do MSI-X + * multiqueue. We might not use all of the available messages, but there's + * no reason to re-alloc if we don't. + */ +static int +mps_pci_alloc_interrupts(struct mps_softc *sc) { device_t dev; - int i, error, msgs; + int error, msgs; dev = sc->mps_dev; - error = ENXIO; + error = 0; + if ((sc->disable_msix == 0) && ((msgs = pci_msix_count(dev)) >= MPS_MSI_COUNT)) error = mps_alloc_msix(sc, MPS_MSI_COUNT); if ((error != 0) && (sc->disable_msi == 0) && ((msgs = pci_msi_count(dev)) >= MPS_MSI_COUNT)) error = mps_alloc_msi(sc, MPS_MSI_COUNT); + else + msgs = 0; - if (error != 0) { + sc->msi_msgs = msgs; + return (error); +} + +int +mps_pci_setup_interrupts(struct mps_softc *sc) +{ + device_t dev; + int i, error; + + dev = sc->mps_dev; + error = ENXIO; + + if (sc->msi_msgs == 0) { sc->mps_flags |= MPS_FLAGS_INTX; sc->mps_irq_rid[0] = 0; sc->mps_irq[0] = bus_alloc_resource_any(dev, SYS_RES_IRQ, Modified: head/sys/dev/mps/mpsvar.h ============================================================================== --- head/sys/dev/mps/mpsvar.h Sun Jul 30 06:27:32 2017 (r321713) +++ head/sys/dev/mps/mpsvar.h Sun Jul 30 06:53:58 2017 (r321714) @@ -274,6 +274,7 @@ struct mps_softc { u_int mps_debug; u_int disable_msix; u_int disable_msi; + u_int msi_msgs; int tm_cmds_active; int io_cmds_active; int io_cmds_highwater; @@ -671,6 +672,7 @@ mps_unmask_intr(struct mps_softc *sc) int mps_pci_setup_interrupts(struct mps_softc *sc); int mps_pci_restore(struct mps_softc *sc); +void mps_get_tunables(struct mps_softc *sc); int mps_attach(struct mps_softc *sc); int mps_free(struct mps_softc *sc); void mps_intr(void *); From owner-svn-src-all@freebsd.org Sun Jul 30 08:00:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A9E2DB1938; Sun, 30 Jul 2017 08:00:56 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB976691B8; Sun, 30 Jul 2017 08:00:55 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6U80skS023131; Sun, 30 Jul 2017 08:00:54 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6U80sOI023130; Sun, 30 Jul 2017 08:00:54 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201707300800.v6U80sOI023130@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 30 Jul 2017 08:00: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: r321715 - stable/11/sys/fs/fdescfs X-SVN-Group: stable-11 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: stable/11/sys/fs/fdescfs X-SVN-Commit-Revision: 321715 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.23 Precedence: list List-Id: "SVN commit messages 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, 30 Jul 2017 08:00:56 -0000 Author: dchagin Date: Sun Jul 30 08:00:54 2017 New Revision: 321715 URL: https://svnweb.freebsd.org/changeset/base/321715 Log: MFC r320836: Eliminate bogus casts. Modified: stable/11/sys/fs/fdescfs/fdesc_vnops.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/fdescfs/fdesc_vnops.c ============================================================================== --- stable/11/sys/fs/fdescfs/fdesc_vnops.c Sun Jul 30 06:53:58 2017 (r321714) +++ stable/11/sys/fs/fdescfs/fdesc_vnops.c Sun Jul 30 08:00:54 2017 (r321715) @@ -162,7 +162,7 @@ loop: * If a forced unmount is progressing, we need to drop it. The flags are * protected by the hashmtx. */ - fmp = (struct fdescmount *)mp->mnt_data; + fmp = mp->mnt_data; if (fmp == NULL || fmp->flags & FMNT_UNMOUNTF) { mtx_unlock(&fdesc_hashmtx); return (-1); @@ -207,7 +207,7 @@ loop: * If a forced unmount is progressing, we need to drop it. The flags are * protected by the hashmtx. */ - fmp = (struct fdescmount *)mp->mnt_data; + fmp = mp->mnt_data; if (fmp == NULL || fmp->flags & FMNT_UNMOUNTF) { mtx_unlock(&fdesc_hashmtx); vgone(vp); From owner-svn-src-all@freebsd.org Sun Jul 30 08:02:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D982DB1B1F; Sun, 30 Jul 2017 08:02:08 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F07F369491; Sun, 30 Jul 2017 08:02:07 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6U827Wh027049; Sun, 30 Jul 2017 08:02:07 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6U8278X027048; Sun, 30 Jul 2017 08:02:07 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201707300802.v6U8278X027048@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 30 Jul 2017 08:02: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: r321716 - stable/11/sys/fs/fdescfs X-SVN-Group: stable-11 X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: stable/11/sys/fs/fdescfs X-SVN-Commit-Revision: 321716 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.23 Precedence: list List-Id: "SVN commit messages 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, 30 Jul 2017 08:02:08 -0000 Author: dchagin Date: Sun Jul 30 08:02:06 2017 New Revision: 321716 URL: https://svnweb.freebsd.org/changeset/base/321716 Log: MFC r320837: Style(9). Whitespace. Modified: stable/11/sys/fs/fdescfs/fdesc_vnops.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/fdescfs/fdesc_vnops.c ============================================================================== --- stable/11/sys/fs/fdescfs/fdesc_vnops.c Sun Jul 30 08:00:54 2017 (r321715) +++ stable/11/sys/fs/fdescfs/fdesc_vnops.c Sun Jul 30 08:02:06 2017 (r321716) @@ -358,7 +358,7 @@ fdesc_lookup(struct vop_lookup_args *ap) error = vn_vget_ino_gen(dvp, fdesc_get_ino_alloc, &arg, LK_EXCLUSIVE, &fvp); } - + if (error) goto bad; *vpp = fvp; From owner-svn-src-all@freebsd.org Sun Jul 30 10:36:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A8B2DB3EA6; Sun, 30 Jul 2017 10:36:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A5756C5C7; Sun, 30 Jul 2017 10:36:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6UAaLQE087544; Sun, 30 Jul 2017 10:36:21 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6UAaKOf087535; Sun, 30 Jul 2017 10:36:20 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707301036.v6UAaKOf087535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 30 Jul 2017 10:36:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321717 - in stable/10: lib/libc/sys sys/sys sys/vm X-SVN-Group: stable-10 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/10: lib/libc/sys sys/sys sys/vm X-SVN-Commit-Revision: 321717 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.23 Precedence: list List-Id: "SVN commit messages 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, 30 Jul 2017 10:36:22 -0000 Author: kib Date: Sun Jul 30 10:36:20 2017 New Revision: 321717 URL: https://svnweb.freebsd.org/changeset/base/321717 Log: Merge MAP_GUARD. MFC r316687 (by markj), r320314, r320317, r320338, r320339, r320344, r320430, r320560 (by alc), r320801, r320843, r321173, r321230. Tested by: pho Sponsored by: The FreeBSD Foundation Modified: stable/10/lib/libc/sys/mmap.2 stable/10/lib/libc/sys/munmap.2 stable/10/sys/sys/mman.h stable/10/sys/sys/param.h stable/10/sys/vm/vm.h stable/10/sys/vm/vm_fault.c stable/10/sys/vm/vm_map.c stable/10/sys/vm/vm_map.h stable/10/sys/vm/vm_mmap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/sys/mmap.2 ============================================================================== --- stable/10/lib/libc/sys/mmap.2 Sun Jul 30 08:02:06 2017 (r321716) +++ stable/10/lib/libc/sys/mmap.2 Sun Jul 30 10:36:20 2017 (r321717) @@ -28,7 +28,7 @@ .\" @(#)mmap.2 8.4 (Berkeley) 5/11/95 .\" $FreeBSD$ .\" -.Dd September 17, 2014 +.Dd June 22, 2017 .Dt MMAP 2 .Os .Sh NAME @@ -173,9 +173,21 @@ In contrast, if .Dv MAP_EXCL is specified, the request will fail if a mapping already exists within the range. -.It Dv MAP_HASSEMAPHORE -Notify the kernel that the region may contain semaphores and that special -handling may be necessary. +.It Dv MAP_GUARD +Instead of a mapping, create a guard of the specified size. +Guards allow a process to create reservations in its address space, +which can later be replaced by actual mappings. +.Pp +.Fa mmap +will not create mappings in the address range of a guard unless +the request specifies +.Dv MAP_FIXED . +Guards can be destroyed with +.Xr munmap 2 . +Any memory access by a thread to the guarded range results +in the delivery of a +.Dv SIGSEGV +signal to that thread. .It Dv MAP_NOCORE Region is not included in a core file. .It Dv MAP_NOSYNC @@ -278,6 +290,7 @@ must include at least .Dv PROT_READ and .Dv PROT_WRITE . +.Pp This option creates a memory region that grows to at most .Fa len @@ -288,6 +301,12 @@ stack top is the starting address returned by the call bytes. The bottom of the stack at maximum growth is the starting address returned by the call. +.Pp +Stacks created with +.Dv MAP_STACK +automatically grow. +Guards prevent inadvertent use of the regions into which those +stacks can grow without requiring mapping the whole stack in advance. .El .Pp The @@ -375,6 +394,7 @@ were specified. .It Bq Er EINVAL None of .Dv MAP_ANON , +.Dv MAP_GUARD , .Dv MAP_PRIVATE , .Dv MAP_SHARED , or @@ -424,6 +444,25 @@ were specified, but the requested region is already us was specified, but .Dv MAP_FIXED was not. +.It Bq Er EINVAL +.Dv MAP_GUARD +was specified, but the +.Fa offset +argument was not zero, the +.Fa fd +argument was not -1, or the +.Fa prot +argument was not +.Dv PROT_NONE . +.It Bq Er EINVAL +.Dv MAP_GUARD +was specified together with one of the flags +.Dv MAP_ANON , +.Dv MAP_PREFAULT , +.Dv MAP_PREFAULT_READ , +.Dv MAP_PRIVATE , +.Dv MAP_SHARED , +.Dv MAP_STACK . .It Bq Er ENODEV .Dv MAP_ANON has not been specified and Modified: stable/10/lib/libc/sys/munmap.2 ============================================================================== --- stable/10/lib/libc/sys/munmap.2 Sun Jul 30 08:02:06 2017 (r321716) +++ stable/10/lib/libc/sys/munmap.2 Sun Jul 30 10:36:20 2017 (r321717) @@ -28,7 +28,7 @@ .\" @(#)munmap.2 8.3 (Berkeley) 5/27/94 .\" $FreeBSD$ .\" -.Dd May 27, 1994 +.Dd June 22, 2017 .Dt MUNMAP 2 .Os .Sh NAME @@ -44,7 +44,7 @@ The .Fn munmap system call -deletes the mappings for the specified address range, +deletes the mappings and guards for the specified address range, and causes further references to addresses within the range to generate invalid memory references. .Sh RETURN VALUES Modified: stable/10/sys/sys/mman.h ============================================================================== --- stable/10/sys/sys/mman.h Sun Jul 30 08:02:06 2017 (r321716) +++ stable/10/sys/sys/mman.h Sun Jul 30 10:36:20 2017 (r321717) @@ -90,6 +90,7 @@ /* * Extended flags */ +#define MAP_GUARD 0x00002000 /* reserve but don't map address range */ #define MAP_EXCL 0x00004000 /* for MAP_FIXED, fail if address is used */ #define MAP_NOCORE 0x00020000 /* dont include these pages in a coredump */ #define MAP_PREFAULT_READ 0x00040000 /* prefault mapping for reading */ Modified: stable/10/sys/sys/param.h ============================================================================== --- stable/10/sys/sys/param.h Sun Jul 30 08:02:06 2017 (r321716) +++ stable/10/sys/sys/param.h Sun Jul 30 10:36:20 2017 (r321717) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1003515 /* Master, propagated to newvers */ +#define __FreeBSD_version 1003516 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, @@ -76,10 +76,11 @@ #undef __FreeBSD_kernel__ #define __FreeBSD_kernel__ -#ifdef _KERNEL +#if defined(_KERNEL) || defined(IN_RTLD) #define P_OSREL_SIGWAIT 700000 #define P_OSREL_SIGSEGV 700004 #define P_OSREL_MAP_ANON 800104 +#define P_OSREL_MAP_GUARD 1200035 #define P_OSREL_MAJOR(x) ((x) / 100000) #endif Modified: stable/10/sys/vm/vm.h ============================================================================== --- stable/10/sys/vm/vm.h Sun Jul 30 08:02:06 2017 (r321716) +++ stable/10/sys/vm/vm.h Sun Jul 30 10:36:20 2017 (r321717) @@ -78,6 +78,7 @@ typedef u_char vm_prot_t; /* protection codes */ #define VM_PROT_WRITE ((vm_prot_t) 0x02) #define VM_PROT_EXECUTE ((vm_prot_t) 0x04) #define VM_PROT_COPY ((vm_prot_t) 0x08) /* copy-on-read */ +#define VM_PROT_FAULT_LOOKUP ((vm_prot_t) 0x010) #define VM_PROT_ALL (VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE) #define VM_PROT_RW (VM_PROT_READ|VM_PROT_WRITE) Modified: stable/10/sys/vm/vm_fault.c ============================================================================== --- stable/10/sys/vm/vm_fault.c Sun Jul 30 08:02:06 2017 (r321716) +++ stable/10/sys/vm/vm_fault.c Sun Jul 30 10:36:20 2017 (r321717) @@ -336,7 +336,7 @@ vm_fault_hold(vm_map_t map, vm_offset_t vaddr, vm_prot vm_prot_t prot; long ahead, behind; int alloc_req, era, faultcount, nera, reqpage, result; - boolean_t dead, growstack, is_first_object_locked, wired; + boolean_t dead, is_first_object_locked, wired; vm_object_t next_object; vm_page_t marray[VM_FAULT_READ_MAX]; int hardfault; @@ -345,7 +345,6 @@ vm_fault_hold(vm_map_t map, vm_offset_t vaddr, vm_prot int locked, error; hardfault = 0; - growstack = TRUE; PCPU_INC(cnt.v_vm_faults); fs.vp = NULL; faultcount = reqpage = 0; @@ -357,17 +356,10 @@ RetryFault:; * search. */ fs.map = map; - result = vm_map_lookup(&fs.map, vaddr, fault_type, &fs.entry, - &fs.first_object, &fs.first_pindex, &prot, &wired); + result = vm_map_lookup(&fs.map, vaddr, fault_type | + VM_PROT_FAULT_LOOKUP, &fs.entry, &fs.first_object, + &fs.first_pindex, &prot, &wired); if (result != KERN_SUCCESS) { - if (growstack && result == KERN_INVALID_ADDRESS && - map != kernel_map) { - result = vm_map_growstack(curproc, vaddr); - if (result != KERN_SUCCESS) - return (KERN_FAILURE); - growstack = FALSE; - goto RetryFault; - } unlock_vp(&fs); return (result); } @@ -392,6 +384,8 @@ RetryFault:; vm_map_unlock(fs.map); goto RetryFault; } + + MPASS((fs.entry->eflags & MAP_ENTRY_GUARD) == 0); if (wired) fault_type = prot | (fault_type & VM_PROT_COPY); Modified: stable/10/sys/vm/vm_map.c ============================================================================== --- stable/10/sys/vm/vm_map.c Sun Jul 30 08:02:06 2017 (r321716) +++ stable/10/sys/vm/vm_map.c Sun Jul 30 10:36:20 2017 (r321717) @@ -133,6 +133,8 @@ static void _vm_map_init(vm_map_t map, pmap_t pmap, vm static void vm_map_entry_deallocate(vm_map_entry_t entry, boolean_t system_map); static void vm_map_entry_dispose(vm_map_t map, vm_map_entry_t entry); static void vm_map_entry_unwire(vm_map_t map, vm_map_entry_t entry); +static int vm_map_growstack(vm_map_t map, vm_offset_t addr, + vm_map_entry_t gap_entry); #ifdef INVARIANTS static void vm_map_zdtor(void *mem, int size, void *arg); static void vmspace_zdtor(void *mem, int size, void *arg); @@ -1167,6 +1169,10 @@ vm_map_insert(vm_map_t map, vm_object_t object, vm_oof if (prev_entry->next != &map->header && prev_entry->next->start < end) return (KERN_NO_SPACE); + if ((cow & MAP_CREATE_GUARD) != 0 && (object != NULL || + max != VM_PROT_NONE)) + return (KERN_INVALID_ARGUMENT); + protoeflags = 0; if (cow & MAP_COPY_ON_WRITE) protoeflags |= MAP_ENTRY_COW | MAP_ENTRY_NEEDS_COPY; @@ -1182,13 +1188,19 @@ vm_map_insert(vm_map_t map, vm_object_t object, vm_oof protoeflags |= MAP_ENTRY_GROWS_UP; if (cow & MAP_VN_WRITECOUNT) protoeflags |= MAP_ENTRY_VN_WRITECNT; + if ((cow & MAP_CREATE_GUARD) != 0) + protoeflags |= MAP_ENTRY_GUARD; + if ((cow & MAP_CREATE_STACK_GAP_DN) != 0) + protoeflags |= MAP_ENTRY_STACK_GAP_DN; + if ((cow & MAP_CREATE_STACK_GAP_UP) != 0) + protoeflags |= MAP_ENTRY_STACK_GAP_UP; if (cow & MAP_INHERIT_SHARE) inheritance = VM_INHERIT_SHARE; else inheritance = VM_INHERIT_DEFAULT; cred = NULL; - if (cow & (MAP_ACC_NO_CHARGE | MAP_NOFAULT)) + if ((cow & (MAP_ACC_NO_CHARGE | MAP_NOFAULT | MAP_CREATE_GUARD)) != 0) goto charged; if ((cow & MAP_ACC_CHARGED) || ((prot & VM_PROT_WRITE) && ((protoeflags & MAP_ENTRY_NEEDS_COPY) || object == NULL))) { @@ -1237,7 +1249,8 @@ charged: if (prev_entry->inheritance == inheritance && prev_entry->protection == prot && prev_entry->max_protection == max) { - map->size += end - prev_entry->end; + if ((prev_entry->eflags & MAP_ENTRY_GUARD) == 0) + map->size += end - prev_entry->end; prev_entry->end = end; vm_map_entry_resize_free(map, prev_entry); vm_map_simplify_entry(map, prev_entry); @@ -1274,7 +1287,6 @@ charged: new_entry->eflags = protoeflags; new_entry->object.vm_object = object; new_entry->offset = offset; - new_entry->avail_ssize = 0; new_entry->inheritance = inheritance; new_entry->protection = prot; @@ -1292,7 +1304,8 @@ charged: * Insert the new entry into the list */ vm_map_entry_link(map, prev_entry, new_entry); - map->size += new_entry->end - new_entry->start; + if ((new_entry->eflags & MAP_ENTRY_GUARD) == 0) + map->size += new_entry->end - new_entry->start; /* * Try to coalesce the new entry with both the previous and next @@ -1496,6 +1509,25 @@ again: return (result); } +int +vm_map_find_min(vm_map_t map, vm_object_t object, vm_ooffset_t offset, + vm_offset_t *addr, vm_size_t length, vm_offset_t min_addr, + vm_offset_t max_addr, int find_space, vm_prot_t prot, vm_prot_t max, + int cow) +{ + vm_offset_t hint; + int rv; + + hint = *addr; + for (;;) { + rv = vm_map_find(map, object, offset, addr, length, max_addr, + find_space, prot, max, cow); + if (rv == KERN_SUCCESS || min_addr >= hint) + return (rv); + *addr = hint = min_addr; + } +} + /* * vm_map_simplify_entry: * @@ -1625,7 +1657,8 @@ _vm_map_clip_start(vm_map_t map, vm_map_entry_t entry, * map. This is a bit of a hack, but is also about the best place to * put this improvement. */ - if (entry->object.vm_object == NULL && !map->system_map) { + if (entry->object.vm_object == NULL && !map->system_map && + (entry->eflags & MAP_ENTRY_GUARD) == 0) { vm_object_t object; object = vm_object_allocate(OBJT_DEFAULT, atop(entry->end - entry->start)); @@ -1702,7 +1735,8 @@ _vm_map_clip_end(vm_map_t map, vm_map_entry_t entry, v * map. This is a bit of a hack, but is also about the best place to * put this improvement. */ - if (entry->object.vm_object == NULL && !map->system_map) { + if (entry->object.vm_object == NULL && !map->system_map && + (entry->eflags & MAP_ENTRY_GUARD) == 0) { vm_object_t object; object = vm_object_allocate(OBJT_DEFAULT, atop(entry->end - entry->start)); @@ -1929,8 +1963,10 @@ vm_map_protect(vm_map_t map, vm_offset_t start, vm_off /* * Make a first pass to check for protection violations. */ - current = entry; - while ((current != &map->header) && (current->start < end)) { + for (current = entry; current != &map->header && current->start < end; + current = current->next) { + if ((current->eflags & MAP_ENTRY_GUARD) != 0) + continue; if (current->eflags & MAP_ENTRY_IS_SUB_MAP) { vm_map_unlock(map); return (KERN_INVALID_ARGUMENT); @@ -1939,23 +1975,22 @@ vm_map_protect(vm_map_t map, vm_offset_t start, vm_off vm_map_unlock(map); return (KERN_PROTECTION_FAILURE); } - current = current->next; } - /* * Do an accounting pass for private read-only mappings that * now will do cow due to allowed write (e.g. debugger sets * breakpoint on text segment) */ - for (current = entry; (current != &map->header) && - (current->start < end); current = current->next) { + for (current = entry; current != &map->header && current->start < end; + current = current->next) { vm_map_clip_end(map, current, end); if (set_max || ((new_prot & ~(current->protection)) & VM_PROT_WRITE) == 0 || - ENTRY_CHARGED(current)) { + ENTRY_CHARGED(current) || + (current->eflags & MAP_ENTRY_GUARD) != 0) { continue; } @@ -2002,8 +2037,11 @@ vm_map_protect(vm_map_t map, vm_offset_t start, vm_off * Go back and fix up protections. [Note that clipping is not * necessary the second time.] */ - current = entry; - while ((current != &map->header) && (current->start < end)) { + for (current = entry; current != &map->header && current->start < end; + current = current->next) { + if ((current->eflags & MAP_ENTRY_GUARD) != 0) + continue; + old_prot = current->protection; if (set_max) @@ -2037,7 +2075,6 @@ vm_map_protect(vm_map_t map, vm_offset_t start, vm_off #undef MASK } vm_map_simplify_entry(map, current); - current = current->next; } vm_map_unlock(map); return (KERN_SUCCESS); @@ -2258,7 +2295,9 @@ vm_map_inherit(vm_map_t map, vm_offset_t start, vm_off entry = temp_entry->next; while ((entry != &map->header) && (entry->start < end)) { vm_map_clip_end(map, entry, end); - entry->inheritance = new_inheritance; + if ((entry->eflags & MAP_ENTRY_GUARD) == 0 || + new_inheritance != VM_INHERIT_ZERO) + entry->inheritance = new_inheritance; vm_map_simplify_entry(map, entry); entry = entry->next; } @@ -2864,6 +2903,15 @@ vm_map_entry_delete(vm_map_t map, vm_map_entry_t entry vm_map_entry_unlink(map, entry); object = entry->object.vm_object; + + if ((entry->eflags & MAP_ENTRY_GUARD) != 0) { + MPASS(entry->cred == NULL); + MPASS((entry->eflags & MAP_ENTRY_IS_SUB_MAP) == 0); + MPASS(object == NULL); + vm_map_entry_deallocate(entry, map->system_map); + return; + } + size = entry->end - entry->start; map->size -= size; @@ -3222,6 +3270,8 @@ vmspace_map_entry_forked(const struct vmspace *vm1, st vm_size_t entrysize; vm_offset_t newend; + if ((entry->eflags & MAP_ENTRY_GUARD) != 0) + return; entrysize = entry->end - entry->start; vm2->vm_map.size += entrysize; if (entry->eflags & (MAP_ENTRY_GROWS_DOWN | MAP_ENTRY_GROWS_UP)) { @@ -3258,6 +3308,7 @@ vmspace_fork(struct vmspace *vm1, vm_ooffset_t *fork_c vm_map_entry_t new_entry, old_entry; vm_object_t object; int locked; + vm_inherit_t inh; old_map = &vm1->vm_map; /* Copy immutable fields of vm1 to vm2. */ @@ -3280,7 +3331,12 @@ vmspace_fork(struct vmspace *vm1, vm_ooffset_t *fork_c if (old_entry->eflags & MAP_ENTRY_IS_SUB_MAP) panic("vm_map_fork: encountered a submap"); - switch (old_entry->inheritance) { + inh = old_entry->inheritance; + if ((old_entry->eflags & MAP_ENTRY_GUARD) != 0 && + inh != VM_INHERIT_NONE) + inh = VM_INHERIT_COPY; + + switch (inh) { case VM_INHERIT_NONE: break; @@ -3413,7 +3469,6 @@ vmspace_fork(struct vmspace *vm1, vm_ooffset_t *fork_c new_entry->start = old_entry->start; new_entry->end = old_entry->end; - new_entry->avail_ssize = old_entry->avail_ssize; new_entry->eflags = old_entry->eflags & ~(MAP_ENTRY_USER_WIRED | MAP_ENTRY_IN_TRANSITION | MAP_ENTRY_VN_WRITECNT); @@ -3476,30 +3531,40 @@ out: return (rv); } +static int stack_guard_page = 1; +SYSCTL_INT(_security_bsd, OID_AUTO, stack_guard_page, CTLFLAG_RWTUN, + &stack_guard_page, 0, + "Specifies the number of guard pages for a stack that grows"); + static int vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, vm_size_t max_ssize, vm_size_t growsize, vm_prot_t prot, vm_prot_t max, int cow) { vm_map_entry_t new_entry, prev_entry; - vm_offset_t bot, top; - vm_size_t init_ssize; + vm_offset_t bot, gap_bot, gap_top, top; + vm_size_t init_ssize, sgp; int orient, rv; /* * The stack orientation is piggybacked with the cow argument. * Extract it into orient and mask the cow argument so that we * don't pass it around further. - * NOTE: We explicitly allow bi-directional stacks. */ - orient = cow & (MAP_STACK_GROWS_DOWN|MAP_STACK_GROWS_UP); + orient = cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP); KASSERT(orient != 0, ("No stack grow direction")); + KASSERT(orient != (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP), + ("bi-dir stack")); + sgp = (vm_size_t)stack_guard_page * PAGE_SIZE; if (addrbos < vm_map_min(map) || addrbos > vm_map_max(map) || - addrbos + max_ssize < addrbos) + addrbos + max_ssize < addrbos || + sgp >= max_ssize) return (KERN_NO_SPACE); - init_ssize = (max_ssize < growsize) ? max_ssize : growsize; + init_ssize = growsize; + if (max_ssize < init_ssize + sgp) + init_ssize = max_ssize - sgp; /* If addr is already mapped, no go */ if (vm_map_lookup_entry(map, addrbos, &prev_entry)) @@ -3507,12 +3572,6 @@ vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, /* * If we can't accomodate max_ssize in the current mapping, no go. - * However, we need to be aware that subsequent user mappings might - * map into the space we have reserved for stack, and currently this - * space is not protected. - * - * Hopefully we will at least detect this condition when we try to - * grow the stack. */ if ((prev_entry->next != &map->header) && (prev_entry->next->start < addrbos + max_ssize)) @@ -3528,58 +3587,53 @@ vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, * and cow to be 0. Possibly we should eliminate these as input * parameters, and just pass these values here in the insert call. */ - if (orient == MAP_STACK_GROWS_DOWN) + if (orient == MAP_STACK_GROWS_DOWN) { bot = addrbos + max_ssize - init_ssize; - else if (orient == MAP_STACK_GROWS_UP) + top = bot + init_ssize; + gap_bot = addrbos; + gap_top = bot; + } else /* if (orient == MAP_STACK_GROWS_UP) */ { bot = addrbos; - else - bot = round_page(addrbos + max_ssize/2 - init_ssize/2); - top = bot + init_ssize; - rv = vm_map_insert(map, NULL, 0, bot, top, prot, max, cow); - - /* Now set the avail_ssize amount. */ - if (rv == KERN_SUCCESS) { - new_entry = prev_entry->next; - if (new_entry->end != top || new_entry->start != bot) - panic("Bad entry start/end for new stack entry"); - - new_entry->avail_ssize = max_ssize - init_ssize; - KASSERT((orient & MAP_STACK_GROWS_DOWN) == 0 || - (new_entry->eflags & MAP_ENTRY_GROWS_DOWN) != 0, - ("new entry lacks MAP_ENTRY_GROWS_DOWN")); - KASSERT((orient & MAP_STACK_GROWS_UP) == 0 || - (new_entry->eflags & MAP_ENTRY_GROWS_UP) != 0, - ("new entry lacks MAP_ENTRY_GROWS_UP")); + top = bot + init_ssize; + gap_bot = top; + gap_top = addrbos + max_ssize; } - + rv = vm_map_insert(map, NULL, 0, bot, top, prot, max, cow); + if (rv != KERN_SUCCESS) + return (rv); + new_entry = prev_entry->next; + KASSERT(new_entry->end == top || new_entry->start == bot, + ("Bad entry start/end for new stack entry")); + KASSERT((orient & MAP_STACK_GROWS_DOWN) == 0 || + (new_entry->eflags & MAP_ENTRY_GROWS_DOWN) != 0, + ("new entry lacks MAP_ENTRY_GROWS_DOWN")); + KASSERT((orient & MAP_STACK_GROWS_UP) == 0 || + (new_entry->eflags & MAP_ENTRY_GROWS_UP) != 0, + ("new entry lacks MAP_ENTRY_GROWS_UP")); + rv = vm_map_insert(map, NULL, 0, gap_bot, gap_top, VM_PROT_NONE, + VM_PROT_NONE, MAP_CREATE_GUARD | (orient == MAP_STACK_GROWS_DOWN ? + MAP_CREATE_STACK_GAP_DN : MAP_CREATE_STACK_GAP_UP)); + if (rv != KERN_SUCCESS) + (void)vm_map_delete(map, bot, top); return (rv); } -static int stack_guard_page = 0; -TUNABLE_INT("security.bsd.stack_guard_page", &stack_guard_page); -SYSCTL_INT(_security_bsd, OID_AUTO, stack_guard_page, CTLFLAG_RW, - &stack_guard_page, 0, - "Insert stack guard page ahead of the growable segments."); - -/* Attempts to grow a vm stack entry. Returns KERN_SUCCESS if the - * desired address is already mapped, or if we successfully grow - * the stack. Also returns KERN_SUCCESS if addr is outside the - * stack range (this is strange, but preserves compatibility with - * the grow function in vm_machdep.c). +/* + * Attempts to grow a vm stack entry. Returns KERN_SUCCESS if we + * successfully grow the stack. */ -int -vm_map_growstack(struct proc *p, vm_offset_t addr) +static int +vm_map_growstack(vm_map_t map, vm_offset_t addr, vm_map_entry_t gap_entry) { - vm_map_entry_t next_entry, prev_entry; - vm_map_entry_t new_entry, stack_entry; - struct vmspace *vm = p->p_vmspace; - vm_map_t map = &vm->vm_map; - vm_offset_t end; - vm_size_t growsize; - size_t grow_amount, max_grow; - rlim_t lmemlim, stacklim, vmemlim; - int is_procstack, rv; + vm_map_entry_t stack_entry; + struct proc *p; + struct vmspace *vm; struct ucred *cred; + vm_offset_t gap_end, gap_start, grow_start; + size_t grow_amount, guard, max_grow; + rlim_t lmemlim, stacklim, vmemlim; + int rv, rv1; + bool gap_deleted, grow_down, is_procstack; #ifdef notyet uint64_t limit; #endif @@ -3587,127 +3641,84 @@ vm_map_growstack(struct proc *p, vm_offset_t addr) int error; #endif -Retry: + p = curproc; + vm = p->p_vmspace; + + /* + * Disallow stack growth when the access is performed by a + * debugger or AIO daemon. The reason is that the wrong + * resource limits are applied. + */ + if (map != &p->p_vmspace->vm_map || p->p_textvp == NULL) + return (KERN_FAILURE); + + MPASS(!map->system_map); + + guard = stack_guard_page * PAGE_SIZE; PROC_LOCK(p); lmemlim = lim_cur(p, RLIMIT_MEMLOCK); stacklim = lim_cur(p, RLIMIT_STACK); vmemlim = lim_cur(p, RLIMIT_VMEM); PROC_UNLOCK(p); - - vm_map_lock_read(map); - - /* If addr is already in the entry range, no need to grow.*/ - if (vm_map_lookup_entry(map, addr, &prev_entry)) { - vm_map_unlock_read(map); +retry: + /* If addr is not in a hole for a stack grow area, no need to grow. */ + if (gap_entry == NULL && !vm_map_lookup_entry(map, addr, &gap_entry)) + return (KERN_FAILURE); + if ((gap_entry->eflags & MAP_ENTRY_GUARD) == 0) return (KERN_SUCCESS); - } - - next_entry = prev_entry->next; - if (!(prev_entry->eflags & MAP_ENTRY_GROWS_UP)) { - /* - * This entry does not grow upwards. Since the address lies - * beyond this entry, the next entry (if one exists) has to - * be a downward growable entry. The entry list header is - * never a growable entry, so it suffices to check the flags. - */ - if (!(next_entry->eflags & MAP_ENTRY_GROWS_DOWN)) { - vm_map_unlock_read(map); - return (KERN_SUCCESS); - } - stack_entry = next_entry; + if ((gap_entry->eflags & MAP_ENTRY_STACK_GAP_DN) != 0) { + stack_entry = gap_entry->next; + if ((stack_entry->eflags & MAP_ENTRY_GROWS_DOWN) == 0 || + stack_entry->start != gap_entry->end) + return (KERN_FAILURE); + grow_amount = round_page(stack_entry->start - addr); + grow_down = true; + } else if ((gap_entry->eflags & MAP_ENTRY_STACK_GAP_UP) != 0) { + stack_entry = gap_entry->prev; + if ((stack_entry->eflags & MAP_ENTRY_GROWS_UP) == 0 || + stack_entry->end != gap_entry->start) + return (KERN_FAILURE); + grow_amount = round_page(addr + 1 - stack_entry->end); + grow_down = false; } else { - /* - * This entry grows upward. If the next entry does not at - * least grow downwards, this is the entry we need to grow. - * otherwise we have two possible choices and we have to - * select one. - */ - if (next_entry->eflags & MAP_ENTRY_GROWS_DOWN) { - /* - * We have two choices; grow the entry closest to - * the address to minimize the amount of growth. - */ - if (addr - prev_entry->end <= next_entry->start - addr) - stack_entry = prev_entry; - else - stack_entry = next_entry; - } else - stack_entry = prev_entry; + return (KERN_FAILURE); } - - if (stack_entry == next_entry) { - KASSERT(stack_entry->eflags & MAP_ENTRY_GROWS_DOWN, ("foo")); - KASSERT(addr < stack_entry->start, ("foo")); - end = (prev_entry != &map->header) ? prev_entry->end : - stack_entry->start - stack_entry->avail_ssize; - grow_amount = roundup(stack_entry->start - addr, PAGE_SIZE); - max_grow = stack_entry->start - end; - } else { - KASSERT(stack_entry->eflags & MAP_ENTRY_GROWS_UP, ("foo")); - KASSERT(addr >= stack_entry->end, ("foo")); - end = (next_entry != &map->header) ? next_entry->start : - stack_entry->end + stack_entry->avail_ssize; - grow_amount = roundup(addr + 1 - stack_entry->end, PAGE_SIZE); - max_grow = end - stack_entry->end; - } - - if (grow_amount > stack_entry->avail_ssize) { - vm_map_unlock_read(map); + max_grow = gap_entry->end - gap_entry->start; + if (guard > max_grow) return (KERN_NO_SPACE); - } - - /* - * If there is no longer enough space between the entries nogo, and - * adjust the available space. Note: this should only happen if the - * user has mapped into the stack area after the stack was created, - * and is probably an error. - * - * This also effectively destroys any guard page the user might have - * intended by limiting the stack size. - */ - if (grow_amount + (stack_guard_page ? PAGE_SIZE : 0) > max_grow) { - if (vm_map_lock_upgrade(map)) - goto Retry; - - stack_entry->avail_ssize = max_grow; - - vm_map_unlock(map); + max_grow -= guard; + if (grow_amount > max_grow) return (KERN_NO_SPACE); - } - is_procstack = (addr >= (vm_offset_t)vm->vm_maxsaddr && - addr < (vm_offset_t)p->p_sysent->sv_usrstack) ? 1 : 0; - /* * If this is the main process stack, see if we're over the stack * limit. */ - if (is_procstack && (ctob(vm->vm_ssize) + grow_amount > stacklim)) { - vm_map_unlock_read(map); + is_procstack = addr >= (vm_offset_t)vm->vm_maxsaddr && + addr < (vm_offset_t)p->p_sysent->sv_usrstack; + if (is_procstack && (ctob(vm->vm_ssize) + grow_amount > stacklim)) return (KERN_NO_SPACE); - } + #ifdef RACCT if (racct_enable) { PROC_LOCK(p); if (is_procstack && racct_set(p, RACCT_STACK, ctob(vm->vm_ssize) + grow_amount)) { PROC_UNLOCK(p); - vm_map_unlock_read(map); return (KERN_NO_SPACE); } PROC_UNLOCK(p); } #endif - /* Round up the grow amount modulo sgrowsiz */ - growsize = sgrowsiz; - grow_amount = roundup(grow_amount, growsize); - if (grow_amount > stack_entry->avail_ssize) - grow_amount = stack_entry->avail_ssize; + grow_amount = roundup(grow_amount, sgrowsiz); + if (grow_amount > max_grow) + grow_amount = max_grow; if (is_procstack && (ctob(vm->vm_ssize) + grow_amount > stacklim)) { grow_amount = trunc_page((vm_size_t)stacklim) - ctob(vm->vm_ssize); } + #ifdef notyet PROC_LOCK(p); limit = racct_get_available(p, RACCT_STACK); @@ -3715,9 +3726,9 @@ Retry: if (is_procstack && (ctob(vm->vm_ssize) + grow_amount > limit)) grow_amount = limit - ctob(vm->vm_ssize); #endif - if (!old_mlock && map->flags & MAP_WIREFUTURE) { + + if (!old_mlock && (map->flags & MAP_WIREFUTURE) != 0) { if (ptoa(pmap_wired_count(map->pmap)) + grow_amount > lmemlim) { - vm_map_unlock_read(map); rv = KERN_NO_SPACE; goto out; } @@ -3727,7 +3738,6 @@ Retry: if (racct_set(p, RACCT_MEMLOCK, ptoa(pmap_wired_count(map->pmap)) + grow_amount)) { PROC_UNLOCK(p); - vm_map_unlock_read(map); rv = KERN_NO_SPACE; goto out; } @@ -3735,9 +3745,9 @@ Retry: } #endif } + /* If we would blow our VMEM resource limit, no go */ if (map->size + grow_amount > vmemlim) { - vm_map_unlock_read(map); rv = KERN_NO_SPACE; goto out; } @@ -3746,7 +3756,6 @@ Retry: PROC_LOCK(p); if (racct_set(p, RACCT_VMEM, map->size + grow_amount)) { PROC_UNLOCK(p); - vm_map_unlock_read(map); rv = KERN_NO_SPACE; goto out; } @@ -3754,62 +3763,42 @@ Retry: } #endif - if (vm_map_lock_upgrade(map)) - goto Retry; + if (vm_map_lock_upgrade(map)) { + gap_entry = NULL; + vm_map_lock_read(map); + goto retry; + } - if (stack_entry == next_entry) { - /* - * Growing downward. - */ - /* Get the preliminary new entry start value */ - addr = stack_entry->start - grow_amount; - - /* - * If this puts us into the previous entry, cut back our - * growth to the available space. Also, see the note above. - */ - if (addr < end) { - stack_entry->avail_ssize = max_grow; - addr = end; - if (stack_guard_page) - addr += PAGE_SIZE; + if (grow_down) { + grow_start = gap_entry->end - grow_amount; + if (gap_entry->start + grow_amount == gap_entry->end) { + gap_start = gap_entry->start; + gap_end = gap_entry->end; + vm_map_entry_delete(map, gap_entry); + gap_deleted = true; + } else { + MPASS(gap_entry->start < gap_entry->end - grow_amount); + gap_entry->end -= grow_amount; + vm_map_entry_resize_free(map, gap_entry); + gap_deleted = false; } - - rv = vm_map_insert(map, NULL, 0, addr, stack_entry->start, - next_entry->protection, next_entry->max_protection, + rv = vm_map_insert(map, NULL, 0, grow_start, + grow_start + grow_amount, + stack_entry->protection, stack_entry->max_protection, MAP_STACK_GROWS_DOWN); - - /* Adjust the available stack space by the amount we grew. */ - if (rv == KERN_SUCCESS) { - new_entry = prev_entry->next; - KASSERT(new_entry == stack_entry->prev, ("foo")); - KASSERT(new_entry->end == stack_entry->start, ("foo")); - KASSERT(new_entry->start == addr, ("foo")); - KASSERT((new_entry->eflags & MAP_ENTRY_GROWS_DOWN) != - 0, ("new entry lacks MAP_ENTRY_GROWS_DOWN")); - grow_amount = new_entry->end - new_entry->start; - new_entry->avail_ssize = stack_entry->avail_ssize - - grow_amount; - stack_entry->eflags &= ~MAP_ENTRY_GROWS_DOWN; + if (rv != KERN_SUCCESS) { + if (gap_deleted) { + rv1 = vm_map_insert(map, NULL, 0, gap_start, + gap_end, VM_PROT_NONE, VM_PROT_NONE, + MAP_CREATE_GUARD | MAP_CREATE_STACK_GAP_DN); + MPASS(rv1 == KERN_SUCCESS); + } else { + gap_entry->end += grow_amount; + vm_map_entry_resize_free(map, gap_entry); + } } } else { - /* - * Growing upward. - */ - addr = stack_entry->end + grow_amount; - - /* - * If this puts us into the next entry, cut back our growth - * to the available space. Also, see the note above. - */ - if (addr > end) { - stack_entry->avail_ssize = end - stack_entry->end; - addr = end; - if (stack_guard_page) - addr -= PAGE_SIZE; - } - - grow_amount = addr - stack_entry->end; + grow_start = stack_entry->end; cred = stack_entry->cred; if (cred == NULL && stack_entry->object.vm_object != NULL) cred = stack_entry->object.vm_object->cred; @@ -3821,35 +3810,32 @@ Retry: stack_entry->offset, (vm_size_t)(stack_entry->end - stack_entry->start), (vm_size_t)grow_amount, cred != NULL)) { - map->size += (addr - stack_entry->end); - /* Update the current entry. */ - stack_entry->end = addr; - stack_entry->avail_ssize -= grow_amount; + if (gap_entry->start + grow_amount == gap_entry->end) + vm_map_entry_delete(map, gap_entry); + else + gap_entry->start += grow_amount; + stack_entry->end += grow_amount; + map->size += grow_amount; vm_map_entry_resize_free(map, stack_entry); rv = KERN_SUCCESS; - - if (next_entry != &map->header) - vm_map_clip_start(map, next_entry, addr); } else rv = KERN_FAILURE; } - if (rv == KERN_SUCCESS && is_procstack) vm->vm_ssize += btoc(grow_amount); - vm_map_unlock(map); - /* * Heed the MAP_WIREFUTURE flag if it was set for this process. */ - if (rv == KERN_SUCCESS && (map->flags & MAP_WIREFUTURE)) { - vm_map_wire(map, - (stack_entry == next_entry) ? addr : addr - grow_amount, - (stack_entry == next_entry) ? stack_entry->start : addr, + if (rv == KERN_SUCCESS && (map->flags & MAP_WIREFUTURE) != 0) { + vm_map_unlock(map); + vm_map_wire(map, grow_start, grow_start + grow_amount, (p->p_flag & P_SYSTEM) ? VM_MAP_WIRE_SYSTEM|VM_MAP_WIRE_NOHOLES : VM_MAP_WIRE_USER|VM_MAP_WIRE_NOHOLES); - } + vm_map_lock_read(map); + } else + vm_map_lock_downgrade(map); out: #ifdef RACCT @@ -3973,10 +3959,11 @@ vm_map_lookup(vm_map_t *var_map, /* IN/OUT */ vm_size_t size; struct ucred *cred; -RetryLookup:; +RetryLookup: vm_map_lock_read(map); +RetryLookupLocked: /* * Lookup the faulting address. */ @@ -4002,7 +3989,16 @@ RetryLookup:; * Check whether this task is allowed to have this page. */ prot = entry->protection; - fault_type &= (VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE); + if ((fault_typea & VM_PROT_FAULT_LOOKUP) != 0) { + fault_typea &= ~VM_PROT_FAULT_LOOKUP; + if (prot == VM_PROT_NONE && map != kernel_map && + (entry->eflags & MAP_ENTRY_GUARD) != 0 && + (entry->eflags & (MAP_ENTRY_STACK_GAP_DN | + MAP_ENTRY_STACK_GAP_UP)) != 0 && + vm_map_growstack(map, vaddr, entry) == KERN_SUCCESS) + goto RetryLookupLocked; + } + fault_type &= VM_PROT_READ | VM_PROT_WRITE | VM_PROT_EXECUTE; if ((fault_type & prot) != fault_type || prot == VM_PROT_NONE) { vm_map_unlock_read(map); return (KERN_PROTECTION_FAILURE); @@ -4236,8 +4232,9 @@ vm_map_print(vm_map_t map) db_indent += 2; for (entry = map->header.next; entry != &map->header; entry = entry->next) { - db_iprintf("map entry %p: start=%p, end=%p\n", - (void *)entry, (void *)entry->start, (void *)entry->end); + db_iprintf("map entry %p: start=%p, end=%p, eflags=%#x, \n", *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Jul 30 10:49:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53D62DB437F; Sun, 30 Jul 2017 10:49:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1CEF16CB63; Sun, 30 Jul 2017 10:49:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6UAnE1u091571; Sun, 30 Jul 2017 10:49:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6UAnEuZ091570; Sun, 30 Jul 2017 10:49:14 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707301049.v6UAnEuZ091570@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 30 Jul 2017 10:49:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321718 - stable/10/sys/vm X-SVN-Group: stable-10 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/10/sys/vm X-SVN-Commit-Revision: 321718 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.23 Precedence: list List-Id: "SVN commit messages 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, 30 Jul 2017 10:49:15 -0000 Author: kib Date: Sun Jul 30 10:49:13 2017 New Revision: 321718 URL: https://svnweb.freebsd.org/changeset/base/321718 Log: Restore layout of struct vm_map_entry after r321717, same as was done in r320889 for stable/11. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/vm/vm_map.h Modified: stable/10/sys/vm/vm_map.h ============================================================================== --- stable/10/sys/vm/vm_map.h Sun Jul 30 10:36:20 2017 (r321717) +++ stable/10/sys/vm/vm_map.h Sun Jul 30 10:49:13 2017 (r321718) @@ -103,6 +103,7 @@ struct vm_map_entry { struct vm_map_entry *right; /* right child in binary search tree */ vm_offset_t start; /* start address */ vm_offset_t end; /* end address */ + vm_offset_t pad0; vm_size_t adj_free; /* amount of adjacent free space */ vm_size_t max_free; /* max free space in subtree */ union vm_map_object object; /* object I point to */ From owner-svn-src-all@freebsd.org Sun Jul 30 11:50:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 209ABDB56DB; Sun, 30 Jul 2017 11:50:18 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E366E6E45E; Sun, 30 Jul 2017 11:50:17 +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 v6UBoH7v015949; Sun, 30 Jul 2017 11:50:17 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6UBoHBN015948; Sun, 30 Jul 2017 11:50:17 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707301150.v6UBoHBN015948@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 30 Jul 2017 11:50:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321719 - head/contrib/llvm/tools/clang/lib/Lex X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/llvm/tools/clang/lib/Lex X-SVN-Commit-Revision: 321719 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.23 Precedence: list List-Id: "SVN commit messages 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, 30 Jul 2017 11:50:18 -0000 Author: dim Date: Sun Jul 30 11:50:16 2017 New Revision: 321719 URL: https://svnweb.freebsd.org/changeset/base/321719 Log: Pull in r309503 from upstream clang trunk (by Richard Smith): PR33902: Invalidate line number cache when adding more text to existing buffer. This led to crashes as the line number cache would report a bogus line number for a line of code, and we'd try to find a nonexistent column within the line when printing diagnostics. This fixes an assertion when building the graphics/champlain port. Reported by: antoine, kwm PR: 219139 Modified: head/contrib/llvm/tools/clang/lib/Lex/ScratchBuffer.cpp Modified: head/contrib/llvm/tools/clang/lib/Lex/ScratchBuffer.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Lex/ScratchBuffer.cpp Sun Jul 30 10:49:13 2017 (r321718) +++ head/contrib/llvm/tools/clang/lib/Lex/ScratchBuffer.cpp Sun Jul 30 11:50:16 2017 (r321719) @@ -35,6 +35,14 @@ SourceLocation ScratchBuffer::getToken(const char *Buf const char *&DestPtr) { if (BytesUsed+Len+2 > ScratchBufSize) AllocScratchBuffer(Len+2); + else { + // Clear out the source line cache if it's already been computed. + // FIXME: Allow this to be incrementally extended. + auto *ContentCache = const_cast( + SourceMgr.getSLocEntry(SourceMgr.getFileID(BufferStartLoc)) + .getFile().getContentCache()); + ContentCache->SourceLineCache = nullptr; + } // Prefix the token with a \n, so that it looks like it is the first thing on // its own virtual line in caret diagnostics. From owner-svn-src-all@freebsd.org Sun Jul 30 15:19:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F911DBD6C8; Sun, 30 Jul 2017 15:19:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2BAF074928; Sun, 30 Jul 2017 15:19:08 +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 v6UFJ7Ed004184; Sun, 30 Jul 2017 15:19:07 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6UFJ7AT004183; Sun, 30 Jul 2017 15:19:07 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201707301519.v6UFJ7AT004183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 30 Jul 2017 15:19:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321720 - head/sys/dev/ichwd X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/ichwd X-SVN-Commit-Revision: 321720 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.23 Precedence: list List-Id: "SVN commit messages 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, 30 Jul 2017 15:19:08 -0000 Author: mav Date: Sun Jul 30 15:19:07 2017 New Revision: 321720 URL: https://svnweb.freebsd.org/changeset/base/321720 Log: Attach ichwd(4) only to ISA bus of the LPC bridge. Resource allocation for parent device does not look good by itself, but attempt to allocate them for unrelated device just does not end up good. On Asus X99-E WS/USB3.1 system reporting ISA bridge via both PCI and ACPI this reported to cause kernel panic on shutdown due to messed resources: https://bugs.freenas.org/issues/25237. MFC after: 1 week Modified: head/sys/dev/ichwd/ichwd.c Modified: head/sys/dev/ichwd/ichwd.c ============================================================================== --- head/sys/dev/ichwd/ichwd.c Sun Jul 30 11:50:16 2017 (r321719) +++ head/sys/dev/ichwd/ichwd.c Sun Jul 30 15:19:07 2017 (r321720) @@ -533,23 +533,26 @@ ichwd_event(void *arg, unsigned int cmd, int *error) } static device_t -ichwd_find_ich_lpc_bridge(struct ichwd_device **id_p) +ichwd_find_ich_lpc_bridge(device_t isa, struct ichwd_device **id_p) { struct ichwd_device *id; - device_t ich = NULL; + device_t isab; + uint16_t devid; - /* look for an ICH LPC interface bridge */ - for (id = ichwd_devices; id->desc != NULL; ++id) - if ((ich = pci_find_device(VENDORID_INTEL, id->device)) != NULL) - break; - - if (ich == NULL) + /* Check whether parent ISA bridge looks familiar. */ + isab = device_get_parent(isa); + if (pci_get_vendor(isab) != VENDORID_INTEL) return (NULL); + devid = pci_get_device(isab); + for (id = ichwd_devices; id->desc != NULL; ++id) { + if (devid == id->device) { + if (id_p != NULL) + *id_p = id; + return (isab); + } + } - if (id_p) - *id_p = id; - - return (ich); + return (NULL); } /* @@ -565,7 +568,7 @@ ichwd_identify(driver_t *driver, device_t parent) uint32_t base_address; int rc; - ich = ichwd_find_ich_lpc_bridge(&id_p); + ich = ichwd_find_ich_lpc_bridge(parent, &id_p); if (ich == NULL) return; @@ -618,7 +621,7 @@ ichwd_probe(device_t dev) if (isa_get_logicalid(dev) != 0) return (ENXIO); - if (ichwd_find_ich_lpc_bridge(&id_p) == NULL) + if (ichwd_find_ich_lpc_bridge(device_get_parent(dev), &id_p) == NULL) return (ENXIO); device_set_desc_copy(dev, id_p->desc); @@ -636,7 +639,7 @@ ichwd_attach(device_t dev) sc = device_get_softc(dev); sc->device = dev; - ich = ichwd_find_ich_lpc_bridge(&id_p); + ich = ichwd_find_ich_lpc_bridge(device_get_parent(dev), &id_p); if (ich == NULL) { device_printf(sc->device, "Can not find ICH device.\n"); goto fail; @@ -726,7 +729,6 @@ static int ichwd_detach(device_t dev) { struct ichwd_softc *sc; - device_t ich = NULL; sc = device_get_softc(dev); @@ -751,9 +753,8 @@ ichwd_detach(device_t dev) bus_release_resource(dev, SYS_RES_IOPORT, sc->smi_rid, sc->smi_res); /* deallocate memory resource */ - ich = ichwd_find_ich_lpc_bridge(NULL); - if (sc->gcs_res && ich) - bus_release_resource(ich, SYS_RES_MEMORY, sc->gcs_rid, + if (sc->gcs_res) + bus_release_resource(sc->ich, SYS_RES_MEMORY, sc->gcs_rid, sc->gcs_res); return (0); From owner-svn-src-all@freebsd.org Sun Jul 30 16:17:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AAE5DBE521; Sun, 30 Jul 2017 16:17:07 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46FF27602E; Sun, 30 Jul 2017 16:17:07 +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 v6UGH6uj028695; Sun, 30 Jul 2017 16:17:06 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6UGH6ZE028694; Sun, 30 Jul 2017 16:17:06 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201707301617.v6UGH6ZE028694@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 30 Jul 2017 16:17:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321721 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 321721 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.23 Precedence: list List-Id: "SVN commit messages 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, 30 Jul 2017 16:17:07 -0000 Author: ian Date: Sun Jul 30 16:17:06 2017 New Revision: 321721 URL: https://svnweb.freebsd.org/changeset/base/321721 Log: Switch from using iic_transfer() to iicdev_readfrom/writeto(), mostly so that transfers will be done with proper ownership of the bus. No behavioral changes. Modified: head/sys/dev/iicbus/ds1307.c Modified: head/sys/dev/iicbus/ds1307.c ============================================================================== --- head/sys/dev/iicbus/ds1307.c Sun Jul 30 15:19:07 2017 (r321720) +++ head/sys/dev/iicbus/ds1307.c Sun Jul 30 16:17:06 2017 (r321721) @@ -75,24 +75,17 @@ static const struct ofw_compat_data ds1307_compat_data #endif static int -ds1307_read(device_t dev, uint16_t addr, uint8_t reg, uint8_t *data, size_t len) +ds1307_read1(device_t dev, uint8_t reg, uint8_t *data) { - struct iic_msg msg[2] = { - { addr, IIC_M_WR | IIC_M_NOSTOP, 1, ® }, - { addr, IIC_M_RD, len, data }, - }; - return (iicbus_transfer(dev, msg, nitems(msg))); + return(iicdev_readfrom(dev, reg, data, 1, IIC_INTRWAIT)); } static int -ds1307_write(device_t dev, uint16_t addr, uint8_t *data, size_t len) +ds1307_write1(device_t dev, uint8_t reg, uint8_t data) { - struct iic_msg msg[1] = { - { addr, IIC_M_WR, len, data }, - }; - return (iicbus_transfer(dev, msg, nitems(msg))); + return(iicdev_writeto(dev, reg, &data, 1, IIC_INTRWAIT)); } static int @@ -101,8 +94,7 @@ ds1307_ctrl_read(struct ds1307_softc *sc) int error; sc->sc_ctrl = 0; - error = ds1307_read(sc->sc_dev, sc->sc_addr, DS1307_CONTROL, - &sc->sc_ctrl, sizeof(sc->sc_ctrl)); + error = ds1307_read1(sc->sc_dev, DS1307_CONTROL, &sc->sc_ctrl); if (error) { device_printf(sc->sc_dev, "cannot read from RTC.\n"); return (error); @@ -115,11 +107,10 @@ static int ds1307_ctrl_write(struct ds1307_softc *sc) { int error; - uint8_t data[2]; + uint8_t ctrl; - data[0] = DS1307_CONTROL; - data[1] = sc->sc_ctrl & DS1307_CTRL_MASK; - error = ds1307_write(sc->sc_dev, sc->sc_addr, data, sizeof(data)); + ctrl = sc->sc_ctrl & DS1307_CTRL_MASK; + error = ds1307_write1(sc->sc_dev, DS1307_CONTROL, ctrl); if (error != 0) device_printf(sc->sc_dev, "cannot write to RTC.\n"); @@ -130,11 +121,9 @@ static int ds1307_osc_enable(struct ds1307_softc *sc) { int error; - uint8_t data[2], secs; + uint8_t secs; - secs = 0; - error = ds1307_read(sc->sc_dev, sc->sc_addr, DS1307_SECS, - &secs, sizeof(secs)); + error = ds1307_read1(sc->sc_dev, DS1307_SECS, &secs); if (error) { device_printf(sc->sc_dev, "cannot read from RTC.\n"); return (error); @@ -143,9 +132,8 @@ ds1307_osc_enable(struct ds1307_softc *sc) if ((secs & DS1307_SECS_CH) == 0) return (0); device_printf(sc->sc_dev, "clock was halted, check the battery.\n"); - data[0] = DS1307_SECS; - data[1] = secs & DS1307_SECS_MASK; - error = ds1307_write(sc->sc_dev, sc->sc_addr, data, sizeof(data)); + secs &= DS1307_SECS_MASK; + error = ds1307_write1(sc->sc_dev, DS1307_SECS, secs); if (error != 0) device_printf(sc->sc_dev, "cannot write to RTC.\n"); @@ -156,18 +144,15 @@ static int ds1307_set_24hrs_mode(struct ds1307_softc *sc) { int error; - uint8_t data[2], hour; + uint8_t hour; - hour = 0; - error = ds1307_read(sc->sc_dev, sc->sc_addr, DS1307_HOUR, - &hour, sizeof(hour)); + error = ds1307_read1(sc->sc_dev, DS1307_HOUR, &hour); if (error) { device_printf(sc->sc_dev, "cannot read from RTC.\n"); return (error); } - data[0] = DS1307_HOUR; - data[1] = hour & DS1307_HOUR_MASK; - error = ds1307_write(sc->sc_dev, sc->sc_addr, data, sizeof(data)); + hour &= DS1307_HOUR_MASK; + error = ds1307_write1(sc->sc_dev, DS1307_HOUR, hour); if (error != 0) device_printf(sc->sc_dev, "cannot write to RTC.\n"); @@ -362,9 +347,8 @@ ds1307_gettime(device_t dev, struct timespec *ts) uint8_t data[7]; sc = device_get_softc(dev); - memset(data, 0, sizeof(data)); - error = ds1307_read(sc->sc_dev, sc->sc_addr, DS1307_SECS, - data, sizeof(data)); + error = iicdev_readfrom(sc->sc_dev, DS1307_SECS, data, sizeof(data), + IIC_INTRWAIT); if (error != 0) { device_printf(dev, "cannot read from RTC.\n"); return (error); @@ -377,9 +361,6 @@ ds1307_gettime(device_t dev, struct timespec *ts) ct.dow = data[DS1307_WEEKDAY] & DS1307_WEEKDAY_MASK; ct.mon = FROMBCD(data[DS1307_MONTH] & DS1307_MONTH_MASK); ct.year = FROMBCD(data[DS1307_YEAR] & DS1307_YEAR_MASK); - ct.year += sc->sc_year0; - if (ct.year < POSIX_BASE_YEAR) - ct.year += 100; /* assume [1970, 2069] */ return (clock_ct_to_ts(&ct, ts)); } @@ -390,25 +371,21 @@ ds1307_settime(device_t dev, struct timespec *ts) int error; struct clocktime ct; struct ds1307_softc *sc; - uint8_t data[8]; + uint8_t data[7]; sc = device_get_softc(dev); - /* Accuracy is only one second. */ - if (ts->tv_nsec >= 500000000) - ts->tv_sec++; ts->tv_nsec = 0; clock_ts_to_ct(ts, &ct); - memset(data, 0, sizeof(data)); - data[0] = DS1307_SECS; - data[DS1307_SECS + 1] = TOBCD(ct.sec); - data[DS1307_MINS + 1] = TOBCD(ct.min); - data[DS1307_HOUR + 1] = TOBCD(ct.hour); - data[DS1307_DATE + 1] = TOBCD(ct.day); - data[DS1307_WEEKDAY + 1] = ct.dow; - data[DS1307_MONTH + 1] = TOBCD(ct.mon); - data[DS1307_YEAR + 1] = TOBCD(ct.year % 100); + data[DS1307_SECS] = TOBCD(ct.sec); + data[DS1307_MINS] = TOBCD(ct.min); + data[DS1307_HOUR] = TOBCD(ct.hour); + data[DS1307_DATE] = TOBCD(ct.day); + data[DS1307_WEEKDAY] = ct.dow; + data[DS1307_MONTH] = TOBCD(ct.mon); + data[DS1307_YEAR] = TOBCD(ct.year % 100); /* Write the time back to RTC. */ - error = ds1307_write(dev, sc->sc_addr, data, sizeof(data)); + error = iicdev_writeto(sc->sc_dev, DS1307_SECS, data, sizeof(data), + IIC_INTRWAIT); if (error != 0) device_printf(dev, "cannot write to RTC.\n"); From owner-svn-src-all@freebsd.org Sun Jul 30 16:45:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C32A5DBE990; Sun, 30 Jul 2017 16:45:29 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 990DE76A7D; Sun, 30 Jul 2017 16:45:29 +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 v6UGjSM9040895; Sun, 30 Jul 2017 16:45:28 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6UGjSi6040894; Sun, 30 Jul 2017 16:45:28 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201707301645.v6UGjSi6040894@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 30 Jul 2017 16:45:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321722 - head/sys/dev/usb/wlan X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/usb/wlan X-SVN-Commit-Revision: 321722 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.23 Precedence: list List-Id: "SVN commit messages 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, 30 Jul 2017 16:45:29 -0000 Author: hselasky Date: Sun Jul 30 16:45:28 2017 New Revision: 321722 URL: https://svnweb.freebsd.org/changeset/base/321722 Log: Properly range check length of parsed information elements in RSU driver. Found by: Ilja van Sprundel MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/wlan/if_rsu.c Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Sun Jul 30 16:17:06 2017 (r321721) +++ head/sys/dev/usb/wlan/if_rsu.c Sun Jul 30 16:45:28 2017 (r321722) @@ -2031,6 +2031,8 @@ rsu_hwrssi_to_rssi(struct rsu_softc *sc, int hw_rssi) return (v); } +CTASSERT(MCLBYTES > sizeof(struct ieee80211_frame)); + static void rsu_event_survey(struct rsu_softc *sc, uint8_t *buf, int len) { @@ -2039,28 +2041,31 @@ rsu_event_survey(struct rsu_softc *sc, uint8_t *buf, i struct ndis_wlan_bssid_ex *bss; struct ieee80211_rx_stats rxs; struct mbuf *m; - int pktlen; + uint32_t ieslen; + uint32_t pktlen; if (__predict_false(len < sizeof(*bss))) return; bss = (struct ndis_wlan_bssid_ex *)buf; - if (__predict_false(len < sizeof(*bss) + le32toh(bss->ieslen))) + ieslen = le32toh(bss->ieslen); + /* range check length of information element */ + if (__predict_false(ieslen > (uint32_t)(len - sizeof(*bss)))) return; RSU_DPRINTF(sc, RSU_DEBUG_SCAN, "%s: found BSS %s: len=%d chan=%d inframode=%d " "networktype=%d privacy=%d, RSSI=%d\n", __func__, - ether_sprintf(bss->macaddr), le32toh(bss->len), + ether_sprintf(bss->macaddr), ieslen, le32toh(bss->config.dsconfig), le32toh(bss->inframode), le32toh(bss->networktype), le32toh(bss->privacy), le32toh(bss->rssi)); /* Build a fake beacon frame to let net80211 do all the parsing. */ /* XXX TODO: just call the new scan API methods! */ - pktlen = sizeof(*wh) + le32toh(bss->ieslen); - if (__predict_false(pktlen > MCLBYTES)) + if (__predict_false(ieslen > (size_t)(MCLBYTES - sizeof(*wh)))) return; + pktlen = sizeof(*wh) + ieslen; m = m_get2(pktlen, M_NOWAIT, MT_DATA, M_PKTHDR); if (__predict_false(m == NULL)) return; @@ -2073,7 +2078,7 @@ rsu_event_survey(struct rsu_softc *sc, uint8_t *buf, i IEEE80211_ADDR_COPY(wh->i_addr2, bss->macaddr); IEEE80211_ADDR_COPY(wh->i_addr3, bss->macaddr); *(uint16_t *)wh->i_seq = 0; - memcpy(&wh[1], (uint8_t *)&bss[1], le32toh(bss->ieslen)); + memcpy(&wh[1], (uint8_t *)&bss[1], ieslen); /* Finalize mbuf. */ m->m_pkthdr.len = m->m_len = pktlen; @@ -3373,6 +3378,8 @@ rsu_fw_loadsection(struct rsu_softc *sc, const uint8_t return (0); } +CTASSERT(sizeof(size_t) >= sizeof(uint32_t)); + static int rsu_load_firmware(struct rsu_softc *sc) { @@ -3380,7 +3387,7 @@ rsu_load_firmware(struct rsu_softc *sc) struct r92s_fw_priv *dmem; struct ieee80211com *ic = &sc->sc_ic; const uint8_t *imem, *emem; - int imemsz, ememsz; + uint32_t imemsz, ememsz; const struct firmware *fw; size_t size; uint32_t reg; @@ -3432,7 +3439,8 @@ rsu_load_firmware(struct rsu_softc *sc) imemsz = le32toh(hdr->imemsz); ememsz = le32toh(hdr->sramsz); /* Check that all FW sections fit in image. */ - if (size < sizeof(*hdr) + imemsz + ememsz) { + if (imemsz > (size_t)(size - sizeof(*hdr)) || + ememsz > (size_t)(size - sizeof(*hdr) - imemsz)) { device_printf(sc->sc_dev, "firmware too short\n"); error = EINVAL; goto fail; From owner-svn-src-all@freebsd.org Sun Jul 30 18:01:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CCD5DBF8CB; Sun, 30 Jul 2017 18:01:39 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 090BD7C316; Sun, 30 Jul 2017 18:01:38 +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 v6UI1ccA072891; Sun, 30 Jul 2017 18:01:38 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6UI1YXl072853; Sun, 30 Jul 2017 18:01:34 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201707301801.v6UI1YXl072853@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 30 Jul 2017 18:01:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321723 - in head: contrib/llvm/include/llvm/CodeGen/GlobalISel contrib/llvm/include/llvm/Support contrib/llvm/include/llvm/Transforms/Utils contrib/llvm/lib/CodeGen contrib/llvm/lib/Co... X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head: contrib/llvm/include/llvm/CodeGen/GlobalISel contrib/llvm/include/llvm/Support contrib/llvm/include/llvm/Transforms/Utils contrib/llvm/lib/CodeGen contrib/llvm/lib/CodeGen/SelectionDAG contri... X-SVN-Commit-Revision: 321723 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.23 Precedence: list List-Id: "SVN commit messages 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, 30 Jul 2017 18:01:39 -0000 Author: dim Date: Sun Jul 30 18:01:34 2017 New Revision: 321723 URL: https://svnweb.freebsd.org/changeset/base/321723 Log: Upgrade our copies of clang, llvm, lld and lldb to r309439 from the upstream release_50 branch. This is just after upstream's 5.0.0-rc1. MFC after: 2 months X-MFC-with: r321369 Modified: head/contrib/llvm/include/llvm/CodeGen/GlobalISel/InstructionSelector.h head/contrib/llvm/include/llvm/Support/CommandLine.h head/contrib/llvm/include/llvm/Support/TargetRegistry.h head/contrib/llvm/include/llvm/Transforms/Utils/LoopUtils.h head/contrib/llvm/lib/CodeGen/InlineSpiller.cpp head/contrib/llvm/lib/CodeGen/RegAllocBase.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp head/contrib/llvm/lib/Option/OptTable.cpp head/contrib/llvm/lib/Support/CommandLine.cpp head/contrib/llvm/lib/Support/ErrorHandling.cpp head/contrib/llvm/lib/Support/TargetRegistry.cpp head/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp head/contrib/llvm/lib/Target/AMDGPU/InstPrinter/AMDGPUInstPrinter.cpp head/contrib/llvm/lib/Target/AMDGPU/SIRegisterInfo.td head/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcAsmBackend.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZScheduleZ14.td head/contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp head/contrib/llvm/lib/Transforms/Scalar/JumpThreading.cpp head/contrib/llvm/lib/Transforms/Utils/LoopUtils.cpp head/contrib/llvm/lib/Transforms/Utils/SimplifyCFG.cpp head/contrib/llvm/tools/clang/include/clang/AST/Type.h head/contrib/llvm/tools/clang/lib/AST/StmtProfile.cpp head/contrib/llvm/tools/clang/lib/AST/Type.cpp head/contrib/llvm/tools/clang/lib/Basic/DiagnosticIDs.cpp head/contrib/llvm/tools/clang/lib/Basic/Version.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTBAA.cpp head/contrib/llvm/tools/clang/lib/Driver/Driver.cpp head/contrib/llvm/tools/clang/lib/Headers/unwind.h head/contrib/llvm/tools/clang/lib/Sema/SemaCodeComplete.cpp head/contrib/llvm/tools/clang/tools/clang-format/ClangFormat.cpp head/contrib/llvm/tools/lld/COFF/Config.h head/contrib/llvm/tools/lld/COFF/Driver.cpp head/contrib/llvm/tools/lld/ELF/InputFiles.cpp head/contrib/llvm/tools/lld/ELF/InputFiles.h head/contrib/llvm/tools/lld/ELF/SymbolTable.cpp head/contrib/llvm/tools/lld/lib/ReaderWriter/MachO/ObjCPass.cpp head/contrib/llvm/tools/lldb/include/lldb/API/SBAttachInfo.h head/contrib/llvm/tools/lldb/include/lldb/API/SBBreakpoint.h head/contrib/llvm/tools/lldb/include/lldb/API/SBProcess.h head/lib/clang/include/clang/Basic/Version.inc head/lib/clang/include/clang/Config/config.h head/lib/clang/include/lld/Config/Version.inc head/lib/clang/include/llvm/Support/VCSRevision.h head/lib/clang/libllvm/Makefile Directory Properties: head/contrib/compiler-rt/ (props changed) head/contrib/libc++/ (props changed) head/contrib/llvm/ (props changed) head/contrib/llvm/tools/clang/ (props changed) head/contrib/llvm/tools/lld/ (props changed) head/contrib/llvm/tools/lldb/ (props changed) Modified: head/contrib/llvm/include/llvm/CodeGen/GlobalISel/InstructionSelector.h ============================================================================== --- head/contrib/llvm/include/llvm/CodeGen/GlobalISel/InstructionSelector.h Sun Jul 30 16:45:28 2017 (r321722) +++ head/contrib/llvm/include/llvm/CodeGen/GlobalISel/InstructionSelector.h Sun Jul 30 18:01:34 2017 (r321723) @@ -40,7 +40,8 @@ class TargetRegisterInfo; /// This is convenient because std::bitset does not have a constructor /// with an initializer list of set bits. /// -/// Each InstructionSelector subclass should define a PredicateBitset class with: +/// Each InstructionSelector subclass should define a PredicateBitset class +/// with: /// const unsigned MAX_SUBTARGET_PREDICATES = 192; /// using PredicateBitset = PredicateBitsetImpl; /// and updating the constant to suit the target. Tablegen provides a suitable @@ -102,7 +103,8 @@ enum { /// - OpIdx - Operand index /// - Expected integer GIM_CheckConstantInt, - /// Check the operand is a specific literal integer (i.e. MO.isImm() or MO.isCImm() is true). + /// Check the operand is a specific literal integer (i.e. MO.isImm() or + /// MO.isCImm() is true). /// - InsnID - Instruction ID /// - OpIdx - Operand index /// - Expected integer Modified: head/contrib/llvm/include/llvm/Support/CommandLine.h ============================================================================== --- head/contrib/llvm/include/llvm/Support/CommandLine.h Sun Jul 30 16:45:28 2017 (r321722) +++ head/contrib/llvm/include/llvm/Support/CommandLine.h Sun Jul 30 18:01:34 2017 (r321723) @@ -66,15 +66,12 @@ bool ParseCommandLineOptions(int argc, const char *con void ParseEnvironmentOptions(const char *progName, const char *envvar, const char *Overview = ""); -// Function pointer type for printing version information. -using VersionPrinterTy = std::function; - ///===---------------------------------------------------------------------===// /// SetVersionPrinter - Override the default (LLVM specific) version printer /// used to print out the version when --version is given /// on the command line. This allows other systems using the /// CommandLine utilities to print their own version string. -void SetVersionPrinter(VersionPrinterTy func); +void SetVersionPrinter(void (*func)()); ///===---------------------------------------------------------------------===// /// AddExtraVersionPrinter - Add an extra printer to use in addition to the @@ -83,7 +80,7 @@ void SetVersionPrinter(VersionPrinterTy func); /// which will be called after the basic LLVM version /// printing is complete. Each can then add additional /// information specific to the tool. -void AddExtraVersionPrinter(VersionPrinterTy func); +void AddExtraVersionPrinter(void (*func)()); // PrintOptionValues - Print option values. // With -print-options print the difference between option values and defaults. Modified: head/contrib/llvm/include/llvm/Support/TargetRegistry.h ============================================================================== --- head/contrib/llvm/include/llvm/Support/TargetRegistry.h Sun Jul 30 16:45:28 2017 (r321722) +++ head/contrib/llvm/include/llvm/Support/TargetRegistry.h Sun Jul 30 18:01:34 2017 (r321723) @@ -599,7 +599,7 @@ struct TargetRegistry { /// printRegisteredTargetsForVersion - Print the registered targets /// appropriately for inclusion in a tool's version output. - static void printRegisteredTargetsForVersion(raw_ostream &OS); + static void printRegisteredTargetsForVersion(); /// @name Registry Access /// @{ Modified: head/contrib/llvm/include/llvm/Transforms/Utils/LoopUtils.h ============================================================================== --- head/contrib/llvm/include/llvm/Transforms/Utils/LoopUtils.h Sun Jul 30 16:45:28 2017 (r321722) +++ head/contrib/llvm/include/llvm/Transforms/Utils/LoopUtils.h Sun Jul 30 18:01:34 2017 (r321723) @@ -531,8 +531,10 @@ Value *createTargetReduction(IRBuilder<> &B, const Tar /// Get the intersection (logical and) of all of the potential IR flags /// of each scalar operation (VL) that will be converted into a vector (I). +/// If OpValue is non-null, we only consider operations similar to OpValue +/// when intersecting. /// Flag set: NSW, NUW, exact, and all of fast-math. -void propagateIRFlags(Value *I, ArrayRef VL); +void propagateIRFlags(Value *I, ArrayRef VL, Value *OpValue = nullptr); } // end namespace llvm Modified: head/contrib/llvm/lib/CodeGen/InlineSpiller.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/InlineSpiller.cpp Sun Jul 30 16:45:28 2017 (r321722) +++ head/contrib/llvm/lib/CodeGen/InlineSpiller.cpp Sun Jul 30 18:01:34 2017 (r321723) @@ -643,8 +643,11 @@ void InlineSpiller::reMaterializeAll() { Edit->eraseVirtReg(Reg); continue; } - assert((LIS.hasInterval(Reg) && !LIS.getInterval(Reg).empty()) && - "Reg with empty interval has reference"); + + assert(LIS.hasInterval(Reg) && + (!LIS.getInterval(Reg).empty() || !MRI.reg_nodbg_empty(Reg)) && + "Empty and not used live-range?!"); + RegsToSpill[ResultPos++] = Reg; } RegsToSpill.erase(RegsToSpill.begin() + ResultPos, RegsToSpill.end()); Modified: head/contrib/llvm/lib/CodeGen/RegAllocBase.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/RegAllocBase.cpp Sun Jul 30 16:45:28 2017 (r321722) +++ head/contrib/llvm/lib/CodeGen/RegAllocBase.cpp Sun Jul 30 18:01:34 2017 (r321723) @@ -133,18 +133,19 @@ void RegAllocBase::allocatePhysRegs() { if (AvailablePhysReg) Matrix->assign(*VirtReg, AvailablePhysReg); - for (VirtRegVec::iterator I = SplitVRegs.begin(), E = SplitVRegs.end(); - I != E; ++I) { - LiveInterval *SplitVirtReg = &LIS->getInterval(*I); + for (unsigned Reg : SplitVRegs) { + assert(LIS->hasInterval(Reg)); + + LiveInterval *SplitVirtReg = &LIS->getInterval(Reg); assert(!VRM->hasPhys(SplitVirtReg->reg) && "Register already assigned"); if (MRI->reg_nodbg_empty(SplitVirtReg->reg)) { + assert(SplitVirtReg->empty() && "Non-empty but used interval"); DEBUG(dbgs() << "not queueing unused " << *SplitVirtReg << '\n'); aboutToRemoveInterval(*SplitVirtReg); LIS->removeInterval(SplitVirtReg->reg); continue; } DEBUG(dbgs() << "queuing new interval: " << *SplitVirtReg << "\n"); - assert(!SplitVirtReg->empty() && "expecting non-empty interval"); assert(TargetRegisterInfo::isVirtualRegister(SplitVirtReg->reg) && "expect split value in virtual register"); enqueue(SplitVirtReg); Modified: head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Sun Jul 30 16:45:28 2017 (r321722) +++ head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Sun Jul 30 18:01:34 2017 (r321723) @@ -2965,7 +2965,12 @@ static inline bool isSETCCorConvertedSETCC(SDValue N) else if (N.getOpcode() == ISD::SIGN_EXTEND) N = N.getOperand(0); - return (N.getOpcode() == ISD::SETCC); + if (isLogicalMaskOp(N.getOpcode())) + return isSETCCorConvertedSETCC(N.getOperand(0)) && + isSETCCorConvertedSETCC(N.getOperand(1)); + + return (N.getOpcode() == ISD::SETCC || + ISD::isBuildVectorOfConstantSDNodes(N.getNode())); } #endif @@ -2973,28 +2978,20 @@ static inline bool isSETCCorConvertedSETCC(SDValue N) // to ToMaskVT if needed with vector extension or truncation. SDValue DAGTypeLegalizer::convertMask(SDValue InMask, EVT MaskVT, EVT ToMaskVT) { - LLVMContext &Ctx = *DAG.getContext(); - // Currently a SETCC or a AND/OR/XOR with two SETCCs are handled. - unsigned InMaskOpc = InMask->getOpcode(); - // FIXME: This code seems to be too restrictive, we might consider // generalizing it or dropping it. - assert((InMaskOpc == ISD::SETCC || - ISD::isBuildVectorOfConstantSDNodes(InMask.getNode()) || - (isLogicalMaskOp(InMaskOpc) && - isSETCCorConvertedSETCC(InMask->getOperand(0)) && - isSETCCorConvertedSETCC(InMask->getOperand(1)))) && - "Unexpected mask argument."); + assert(isSETCCorConvertedSETCC(InMask) && "Unexpected mask argument."); // Make a new Mask node, with a legal result VT. SmallVector Ops; for (unsigned i = 0; i < InMask->getNumOperands(); ++i) Ops.push_back(InMask->getOperand(i)); - SDValue Mask = DAG.getNode(InMaskOpc, SDLoc(InMask), MaskVT, Ops); + SDValue Mask = DAG.getNode(InMask->getOpcode(), SDLoc(InMask), MaskVT, Ops); // If MaskVT has smaller or bigger elements than ToMaskVT, a vector sign // extend or truncate is needed. + LLVMContext &Ctx = *DAG.getContext(); unsigned MaskScalarBits = MaskVT.getScalarSizeInBits(); unsigned ToMaskScalBits = ToMaskVT.getScalarSizeInBits(); if (MaskScalarBits < ToMaskScalBits) { Modified: head/contrib/llvm/lib/Option/OptTable.cpp ============================================================================== --- head/contrib/llvm/lib/Option/OptTable.cpp Sun Jul 30 16:45:28 2017 (r321722) +++ head/contrib/llvm/lib/Option/OptTable.cpp Sun Jul 30 18:01:34 2017 (r321723) @@ -235,7 +235,9 @@ OptTable::findByPrefix(StringRef Cur, unsigned short D continue; for (int I = 0; In.Prefixes[I]; I++) { - std::string S = std::string(In.Prefixes[I]) + std::string(In.Name); + std::string S = std::string(In.Prefixes[I]) + std::string(In.Name) + "\t"; + if (In.HelpText) + S += In.HelpText; if (StringRef(S).startswith(Cur)) Ret.push_back(S); } Modified: head/contrib/llvm/lib/Support/CommandLine.cpp ============================================================================== --- head/contrib/llvm/lib/Support/CommandLine.cpp Sun Jul 30 16:45:28 2017 (r321722) +++ head/contrib/llvm/lib/Support/CommandLine.cpp Sun Jul 30 18:01:34 2017 (r321723) @@ -2039,9 +2039,9 @@ void CommandLineParser::printOptionValues() { Opts[i].second->printOptionValue(MaxArgLen, PrintAllOptions); } -static VersionPrinterTy OverrideVersionPrinter = nullptr; +static void (*OverrideVersionPrinter)() = nullptr; -static std::vector *ExtraVersionPrinters = nullptr; +static std::vector *ExtraVersionPrinters = nullptr; namespace { class VersionPrinter { @@ -2081,7 +2081,7 @@ class VersionPrinter { (public) return; if (OverrideVersionPrinter != nullptr) { - OverrideVersionPrinter(outs()); + (*OverrideVersionPrinter)(); exit(0); } print(); @@ -2090,8 +2090,10 @@ class VersionPrinter { (public) // information. if (ExtraVersionPrinters != nullptr) { outs() << '\n'; - for (auto I : *ExtraVersionPrinters) - I(outs()); + for (std::vector::iterator I = ExtraVersionPrinters->begin(), + E = ExtraVersionPrinters->end(); + I != E; ++I) + (*I)(); } exit(0); @@ -2129,11 +2131,11 @@ void cl::PrintHelpMessage(bool Hidden, bool Categorize /// Utility function for printing version number. void cl::PrintVersionMessage() { VersionPrinterInstance.print(); } -void cl::SetVersionPrinter(VersionPrinterTy func) { OverrideVersionPrinter = func; } +void cl::SetVersionPrinter(void (*func)()) { OverrideVersionPrinter = func; } -void cl::AddExtraVersionPrinter(VersionPrinterTy func) { +void cl::AddExtraVersionPrinter(void (*func)()) { if (!ExtraVersionPrinters) - ExtraVersionPrinters = new std::vector; + ExtraVersionPrinters = new std::vector; ExtraVersionPrinters->push_back(func); } Modified: head/contrib/llvm/lib/Support/ErrorHandling.cpp ============================================================================== --- head/contrib/llvm/lib/Support/ErrorHandling.cpp Sun Jul 30 16:45:28 2017 (r321722) +++ head/contrib/llvm/lib/Support/ErrorHandling.cpp Sun Jul 30 18:01:34 2017 (r321723) @@ -169,7 +169,8 @@ void llvm::report_bad_alloc_error(const char *Reason, // Don't call the normal error handler. It may allocate memory. Directly write // an OOM to stderr and abort. char OOMMessage[] = "LLVM ERROR: out of memory\n"; - (void)::write(2, OOMMessage, strlen(OOMMessage)); + ssize_t written = ::write(2, OOMMessage, strlen(OOMMessage)); + (void)written; abort(); #endif } Modified: head/contrib/llvm/lib/Support/TargetRegistry.cpp ============================================================================== --- head/contrib/llvm/lib/Support/TargetRegistry.cpp Sun Jul 30 16:45:28 2017 (r321722) +++ head/contrib/llvm/lib/Support/TargetRegistry.cpp Sun Jul 30 18:01:34 2017 (r321723) @@ -114,7 +114,7 @@ static int TargetArraySortFn(const std::pairfirst.compare(RHS->first); } -void TargetRegistry::printRegisteredTargetsForVersion(raw_ostream &OS) { +void TargetRegistry::printRegisteredTargetsForVersion() { std::vector > Targets; size_t Width = 0; for (const auto &T : TargetRegistry::targets()) { @@ -123,6 +123,7 @@ void TargetRegistry::printRegisteredTargetsForVersion( } array_pod_sort(Targets.begin(), Targets.end(), TargetArraySortFn); + raw_ostream &OS = outs(); OS << " Registered Targets:\n"; for (unsigned i = 0, e = Targets.size(); i != e; ++i) { OS << " " << Targets[i].first; Modified: head/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp Sun Jul 30 16:45:28 2017 (r321722) +++ head/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp Sun Jul 30 18:01:34 2017 (r321723) @@ -2889,9 +2889,12 @@ void AArch64TargetLowering::saveVarArgRegisters(CCStat unsigned GPRSaveSize = 8 * (NumGPRArgRegs - FirstVariadicGPR); int GPRIdx = 0; if (GPRSaveSize != 0) { - if (IsWin64) + if (IsWin64) { GPRIdx = MFI.CreateFixedObject(GPRSaveSize, -(int)GPRSaveSize, false); - else + if (GPRSaveSize & 15) + // The extra size here, if triggered, will always be 8. + MFI.CreateFixedObject(16 - (GPRSaveSize & 15), -(int)alignTo(GPRSaveSize, 16), false); + } else GPRIdx = MFI.CreateStackObject(GPRSaveSize, 8, false); SDValue FIN = DAG.getFrameIndex(GPRIdx, PtrVT); Modified: head/contrib/llvm/lib/Target/AMDGPU/InstPrinter/AMDGPUInstPrinter.cpp ============================================================================== --- head/contrib/llvm/lib/Target/AMDGPU/InstPrinter/AMDGPUInstPrinter.cpp Sun Jul 30 16:45:28 2017 (r321722) +++ head/contrib/llvm/lib/Target/AMDGPU/InstPrinter/AMDGPUInstPrinter.cpp Sun Jul 30 18:01:34 2017 (r321723) @@ -297,6 +297,11 @@ void AMDGPUInstPrinter::printRegOperand(unsigned RegNo case AMDGPU::FLAT_SCR_HI: O << "flat_scratch_hi"; return; + case AMDGPU::FP_REG: + case AMDGPU::SP_REG: + case AMDGPU::SCRATCH_WAVE_OFFSET_REG: + case AMDGPU::PRIVATE_RSRC_REG: + llvm_unreachable("pseudo-register should not ever be emitted"); default: break; } Modified: head/contrib/llvm/lib/Target/AMDGPU/SIRegisterInfo.td ============================================================================== --- head/contrib/llvm/lib/Target/AMDGPU/SIRegisterInfo.td Sun Jul 30 16:45:28 2017 (r321722) +++ head/contrib/llvm/lib/Target/AMDGPU/SIRegisterInfo.td Sun Jul 30 18:01:34 2017 (r321723) @@ -274,8 +274,7 @@ def VGPR_512 : RegisterTuples<[sub0, sub1, sub2, sub3, def SReg_32_XM0_XEXEC : RegisterClass<"AMDGPU", [i32, f32, i16, f16, v2i16, v2f16], 32, (add SGPR_32, VCC_LO, VCC_HI, FLAT_SCR_LO, FLAT_SCR_HI, TTMP_32, TMA_LO, TMA_HI, TBA_LO, TBA_HI, SRC_SHARED_BASE, SRC_SHARED_LIMIT, - SRC_PRIVATE_BASE, SRC_PRIVATE_LIMIT, - FP_REG, SP_REG, SCRATCH_WAVE_OFFSET_REG)> { + SRC_PRIVATE_BASE, SRC_PRIVATE_LIMIT)> { let AllocationPriority = 7; } Modified: head/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcAsmBackend.cpp ============================================================================== --- head/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcAsmBackend.cpp Sun Jul 30 16:45:28 2017 (r321722) +++ head/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcAsmBackend.cpp Sun Jul 30 18:01:34 2017 (r321723) @@ -61,14 +61,6 @@ static unsigned adjustFixupValue(unsigned Kind, uint64 case Sparc::fixup_sparc_lo10: return Value & 0x3ff; - case Sparc::fixup_sparc_tls_ldo_hix22: - case Sparc::fixup_sparc_tls_le_hix22: - return (~Value >> 10) & 0x3fffff; - - case Sparc::fixup_sparc_tls_ldo_lox10: - case Sparc::fixup_sparc_tls_le_lox10: - return (~(~Value & 0x3ff)) & 0x1fff; - case Sparc::fixup_sparc_h44: return (Value >> 22) & 0x3fffff; @@ -83,6 +75,13 @@ static unsigned adjustFixupValue(unsigned Kind, uint64 case Sparc::fixup_sparc_hm: return (Value >> 32) & 0x3ff; + + case Sparc::fixup_sparc_tls_ldo_hix22: + case Sparc::fixup_sparc_tls_le_hix22: + case Sparc::fixup_sparc_tls_ldo_lox10: + case Sparc::fixup_sparc_tls_le_lox10: + assert(Value == 0 && "Sparc TLS relocs expect zero Value"); + return 0; case Sparc::fixup_sparc_tls_gd_add: case Sparc::fixup_sparc_tls_gd_call: Modified: head/contrib/llvm/lib/Target/SystemZ/SystemZScheduleZ14.td ============================================================================== --- head/contrib/llvm/lib/Target/SystemZ/SystemZScheduleZ14.td Sun Jul 30 16:45:28 2017 (r321722) +++ head/contrib/llvm/lib/Target/SystemZ/SystemZScheduleZ14.td Sun Jul 30 18:01:34 2017 (r321723) @@ -455,10 +455,10 @@ def : InstRW<[FXa, LSU, Lat8], (instregex "MH(Y)?$")>; def : InstRW<[FXa2, Lat6, GroupAlone], (instregex "M(L)?R$")>; def : InstRW<[FXa2, LSU, Lat10, GroupAlone], (instregex "M(FY|L)?$")>; def : InstRW<[FXa, LSU, Lat8], (instregex "MGH$")>; -def : InstRW<[FXa, LSU, Lat12, GroupAlone], (instregex "MG$")>; -def : InstRW<[FXa, Lat8, GroupAlone], (instregex "MGRK$")>; -def : InstRW<[FXa, LSU, Lat9, GroupAlone], (instregex "MSC$")>; -def : InstRW<[FXa, LSU, Lat11, GroupAlone], (instregex "MSGC$")>; +def : InstRW<[FXa, FXa, LSU, Lat12, GroupAlone], (instregex "MG$")>; +def : InstRW<[FXa, FXa, Lat8, GroupAlone], (instregex "MGRK$")>; +def : InstRW<[FXa, LSU, Lat9], (instregex "MSC$")>; +def : InstRW<[FXa, LSU, Lat11], (instregex "MSGC$")>; def : InstRW<[FXa, Lat5], (instregex "MSRKC$")>; def : InstRW<[FXa, Lat7], (instregex "MSGRKC$")>; @@ -620,7 +620,7 @@ def : InstRW<[FXa, Lat30], (instregex "(PCC|PPNO|PRNO) def : InstRW<[LSU], (instregex "LGG$")>; def : InstRW<[LSU, Lat5], (instregex "LLGFSG$")>; -def : InstRW<[LSU, Lat30, GroupAlone], (instregex "(L|ST)GSC$")>; +def : InstRW<[LSU, Lat30], (instregex "(L|ST)GSC$")>; //===----------------------------------------------------------------------===// // Decimal arithmetic @@ -708,7 +708,7 @@ def : InstRW<[FXb, LSU, Lat5], (instregex "NTSTG$")>; // Processor assist //===----------------------------------------------------------------------===// -def : InstRW<[FXb], (instregex "PPA$")>; +def : InstRW<[FXb, GroupAlone], (instregex "PPA$")>; //===----------------------------------------------------------------------===// // Miscellaneous Instructions. @@ -1276,9 +1276,9 @@ def : InstRW<[VecXsPm], (instregex "VESRL(B|F|G|H)?$") def : InstRW<[VecXsPm], (instregex "VESRLV(B|F|G|H)?$")>; def : InstRW<[VecXsPm], (instregex "VSL(DB)?$")>; -def : InstRW<[VecXsPm, VecXsPm, Lat8], (instregex "VSLB$")>; +def : InstRW<[VecXsPm], (instregex "VSLB$")>; def : InstRW<[VecXsPm], (instregex "VSR(A|L)$")>; -def : InstRW<[VecXsPm, VecXsPm, Lat8], (instregex "VSR(A|L)B$")>; +def : InstRW<[VecXsPm], (instregex "VSR(A|L)B$")>; def : InstRW<[VecXsPm], (instregex "VSB(I|IQ|CBI|CBIQ)?$")>; def : InstRW<[VecXsPm], (instregex "VSCBI(B|F|G|H|Q)?$")>; @@ -1435,9 +1435,9 @@ def : InstRW<[VecStr, Lat5], (instregex "VSTRCZ(B|F|H) // Vector: Packed-decimal instructions //===----------------------------------------------------------------------===// -def : InstRW<[VecDF, VecDF, Lat10, GroupAlone], (instregex "VLIP$")>; -def : InstRW<[VecDFX, LSU, Lat12, GroupAlone], (instregex "VPKZ$")>; -def : InstRW<[VecDFX, FXb, LSU, Lat12, GroupAlone], (instregex "VUPKZ$")>; +def : InstRW<[VecDF, VecDF, Lat10], (instregex "VLIP$")>; +def : InstRW<[VecDFX, LSU, GroupAlone], (instregex "VPKZ$")>; +def : InstRW<[VecDFX, FXb, LSU, Lat12, BeginGroup], (instregex "VUPKZ$")>; def : InstRW<[VecDF, VecDF, FXb, Lat20, GroupAlone], (instregex "VCVB(G)?$")>; def : InstRW<[VecDF, VecDF, FXb, Lat20, GroupAlone], (instregex "VCVD(G)?$")>; def : InstRW<[VecDFX], (instregex "V(A|S)P$")>; Modified: head/contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Sun Jul 30 16:45:28 2017 (r321722) +++ head/contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp Sun Jul 30 18:01:34 2017 (r321723) @@ -1055,7 +1055,10 @@ static bool foldMaskAndShiftToScale(SelectionDAG &DAG, // Scale the leading zero count down based on the actual size of the value. // Also scale it down based on the size of the shift. - MaskLZ -= (64 - X.getSimpleValueType().getSizeInBits()) + ShiftAmt; + unsigned ScaleDown = (64 - X.getSimpleValueType().getSizeInBits()) + ShiftAmt; + if (MaskLZ < ScaleDown) + return true; + MaskLZ -= ScaleDown; // The final check is to ensure that any masked out high bits of X are // already known to be zero. Otherwise, the mask has a semantic impact Modified: head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Sun Jul 30 16:45:28 2017 (r321722) +++ head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Sun Jul 30 18:01:34 2017 (r321723) @@ -22022,8 +22022,9 @@ static SDValue LowerScalarImmediateShift(SDValue Op, S return getTargetVShiftByConstNode(X86Opc, dl, VT, R, ShiftAmt, DAG); // i64 SRA needs to be performed as partial shifts. - if ((VT == MVT::v2i64 || (Subtarget.hasInt256() && VT == MVT::v4i64)) && - Op.getOpcode() == ISD::SRA && !Subtarget.hasXOP()) + if (((!Subtarget.hasXOP() && VT == MVT::v2i64) || + (Subtarget.hasInt256() && VT == MVT::v4i64)) && + Op.getOpcode() == ISD::SRA) return ArithmeticShiftRight64(ShiftAmt); if (VT == MVT::v16i8 || Modified: head/contrib/llvm/lib/Transforms/Scalar/JumpThreading.cpp ============================================================================== --- head/contrib/llvm/lib/Transforms/Scalar/JumpThreading.cpp Sun Jul 30 16:45:28 2017 (r321722) +++ head/contrib/llvm/lib/Transforms/Scalar/JumpThreading.cpp Sun Jul 30 18:01:34 2017 (r321723) @@ -64,6 +64,11 @@ ImplicationSearchThreshold( "condition to use to thread over a weaker condition"), cl::init(3), cl::Hidden); +static cl::opt PrintLVIAfterJumpThreading( + "print-lvi-after-jump-threading", + cl::desc("Print the LazyValueInfo cache after JumpThreading"), cl::init(false), + cl::Hidden); + namespace { /// This pass performs 'jump threading', which looks at blocks that have /// multiple predecessors and multiple successors. If one or more of the @@ -93,9 +98,10 @@ namespace { bool runOnFunction(Function &F) override; void getAnalysisUsage(AnalysisUsage &AU) const override { + if (PrintLVIAfterJumpThreading) + AU.addRequired(); AU.addRequired(); AU.addRequired(); - AU.addPreserved(); AU.addPreserved(); AU.addRequired(); } @@ -137,8 +143,14 @@ bool JumpThreading::runOnFunction(Function &F) { BFI.reset(new BlockFrequencyInfo(F, *BPI, LI)); } - return Impl.runImpl(F, TLI, LVI, AA, HasProfileData, std::move(BFI), - std::move(BPI)); + bool Changed = Impl.runImpl(F, TLI, LVI, AA, HasProfileData, std::move(BFI), + std::move(BPI)); + if (PrintLVIAfterJumpThreading) { + dbgs() << "LVI for function '" << F.getName() << "':\n"; + LVI->printLVI(F, getAnalysis().getDomTree(), + dbgs()); + } + return Changed; } PreservedAnalyses JumpThreadingPass::run(Function &F, @@ -231,13 +243,15 @@ bool JumpThreadingPass::runImpl(Function &F, TargetLib // Can't thread an unconditional jump, but if the block is "almost // empty", we can replace uses of it with uses of the successor and make // this dead. - // We should not eliminate the loop header either, because eliminating - // a loop header might later prevent LoopSimplify from transforming nested - // loops into simplified form. + // We should not eliminate the loop header or latch either, because + // eliminating a loop header or latch might later prevent LoopSimplify + // from transforming nested loops into simplified form. We will rely on + // later passes in backend to clean up empty blocks. if (BI && BI->isUnconditional() && BB != &BB->getParent()->getEntryBlock() && // If the terminator is the only non-phi instruction, try to nuke it. - BB->getFirstNonPHIOrDbg()->isTerminator() && !LoopHeaders.count(BB)) { + BB->getFirstNonPHIOrDbg()->isTerminator() && !LoopHeaders.count(BB) && + !LoopHeaders.count(BI->getSuccessor(0))) { // FIXME: It is always conservatively correct to drop the info // for a block even if it doesn't get erased. This isn't totally // awesome, but it allows us to use AssertingVH to prevent nasty Modified: head/contrib/llvm/lib/Transforms/Utils/LoopUtils.cpp ============================================================================== --- head/contrib/llvm/lib/Transforms/Utils/LoopUtils.cpp Sun Jul 30 16:45:28 2017 (r321722) +++ head/contrib/llvm/lib/Transforms/Utils/LoopUtils.cpp Sun Jul 30 18:01:34 2017 (r321723) @@ -1376,16 +1376,21 @@ Value *llvm::createTargetReduction(IRBuilder<> &Builde } } -void llvm::propagateIRFlags(Value *I, ArrayRef VL) { - if (auto *VecOp = dyn_cast(I)) { - if (auto *I0 = dyn_cast(VL[0])) { - // VecOVp is initialized to the 0th scalar, so start counting from index - // '1'. - VecOp->copyIRFlags(I0); - for (int i = 1, e = VL.size(); i < e; ++i) { - if (auto *Scalar = dyn_cast(VL[i])) - VecOp->andIRFlags(Scalar); - } - } +void llvm::propagateIRFlags(Value *I, ArrayRef VL, Value *OpValue) { + auto *VecOp = dyn_cast(I); + if (!VecOp) + return; + auto *Intersection = (OpValue == nullptr) ? dyn_cast(VL[0]) + : dyn_cast(OpValue); + if (!Intersection) + return; + const unsigned Opcode = Intersection->getOpcode(); + VecOp->copyIRFlags(Intersection); + for (auto *V : VL) { + auto *Instr = dyn_cast(V); + if (!Instr) + continue; + if (OpValue == nullptr || Opcode == Instr->getOpcode()) + VecOp->andIRFlags(V); } } Modified: head/contrib/llvm/lib/Transforms/Utils/SimplifyCFG.cpp ============================================================================== --- head/contrib/llvm/lib/Transforms/Utils/SimplifyCFG.cpp Sun Jul 30 16:45:28 2017 (r321722) +++ head/contrib/llvm/lib/Transforms/Utils/SimplifyCFG.cpp Sun Jul 30 18:01:34 2017 (r321723) @@ -5656,20 +5656,22 @@ static bool TryToMergeLandingPad(LandingPadInst *LPad, bool SimplifyCFGOpt::SimplifyUncondBranch(BranchInst *BI, IRBuilder<> &Builder) { BasicBlock *BB = BI->getParent(); + BasicBlock *Succ = BI->getSuccessor(0); if (SinkCommon && SinkThenElseCodeToEnd(BI)) return true; // If the Terminator is the only non-phi instruction, simplify the block. - // if LoopHeader is provided, check if the block is a loop header - // (This is for early invocations before loop simplify and vectorization - // to keep canonical loop forms for nested loops. - // These blocks can be eliminated when the pass is invoked later - // in the back-end.) + // if LoopHeader is provided, check if the block or its successor is a loop + // header (This is for early invocations before loop simplify and + // vectorization to keep canonical loop forms for nested loops. These blocks + // can be eliminated when the pass is invoked later in the back-end.) + bool NeedCanonicalLoop = + !LateSimplifyCFG && + (LoopHeaders && (LoopHeaders->count(BB) || LoopHeaders->count(Succ))); BasicBlock::iterator I = BB->getFirstNonPHIOrDbg()->getIterator(); if (I->isTerminator() && BB != &BB->getParent()->getEntryBlock() && - (!LoopHeaders || !LoopHeaders->count(BB)) && - TryToSimplifyUncondBranchFromEmptyBlock(BB)) + !NeedCanonicalLoop && TryToSimplifyUncondBranchFromEmptyBlock(BB)) return true; // If the only instruction in the block is a seteq/setne comparison Modified: head/contrib/llvm/tools/clang/include/clang/AST/Type.h ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/AST/Type.h Sun Jul 30 16:45:28 2017 (r321722) +++ head/contrib/llvm/tools/clang/include/clang/AST/Type.h Sun Jul 30 18:01:34 2017 (r321723) @@ -1752,6 +1752,7 @@ class Type : public ExtQualsTypeCommonBase { (public) bool isTemplateTypeParmType() const; // C++ template type parameter bool isNullPtrType() const; // C++11 std::nullptr_t bool isAlignValT() const; // C++17 std::align_val_t + bool isStdByteType() const; // C++17 std::byte bool isAtomicType() const; // C11 _Atomic() #define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \ Modified: head/contrib/llvm/tools/clang/lib/AST/StmtProfile.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/AST/StmtProfile.cpp Sun Jul 30 16:45:28 2017 (r321722) +++ head/contrib/llvm/tools/clang/lib/AST/StmtProfile.cpp Sun Jul 30 18:01:34 2017 (r321723) @@ -1388,6 +1388,15 @@ static Stmt::StmtClass DecodeOperatorCall(const CXXOpe llvm_unreachable("Invalid overloaded operator expression"); } +#if defined(_MSC_VER) +#if _MSC_VER == 1911 +// Work around https://developercommunity.visualstudio.com/content/problem/84002/clang-cl-when-built-with-vc-2017-crashes-cause-vc.html +// MSVC 2017 update 3 miscompiles this function, and a clang built with it +// will crash in stage 2 of a bootstrap build. +#pragma optimize("", off) +#endif +#endif + void StmtProfiler::VisitCXXOperatorCallExpr(const CXXOperatorCallExpr *S) { if (S->isTypeDependent()) { // Type-dependent operator calls are profiled like their underlying @@ -1419,6 +1428,12 @@ void StmtProfiler::VisitCXXOperatorCallExpr(const CXXO VisitCallExpr(S); ID.AddInteger(S->getOperator()); } + +#if defined(_MSC_VER) +#if _MSC_VER == 1911 +#pragma optimize("", on) +#endif +#endif void StmtProfiler::VisitCXXMemberCallExpr(const CXXMemberCallExpr *S) { VisitCallExpr(S); Modified: head/contrib/llvm/tools/clang/lib/AST/Type.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/AST/Type.cpp Sun Jul 30 16:45:28 2017 (r321722) +++ head/contrib/llvm/tools/clang/lib/AST/Type.cpp Sun Jul 30 18:01:34 2017 (r321723) @@ -2313,6 +2313,15 @@ bool Type::isAlignValT() const { return false; } +bool Type::isStdByteType() const { + if (auto *ET = getAs()) { + auto *II = ET->getDecl()->getIdentifier(); + if (II && II->isStr("byte") && ET->getDecl()->isInStdNamespace()) + return true; + } + return false; +} + bool Type::isPromotableIntegerType() const { if (const BuiltinType *BT = getAs()) switch (BT->getKind()) { Modified: head/contrib/llvm/tools/clang/lib/Basic/DiagnosticIDs.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Basic/DiagnosticIDs.cpp Sun Jul 30 16:45:28 2017 (r321722) +++ head/contrib/llvm/tools/clang/lib/Basic/DiagnosticIDs.cpp Sun Jul 30 18:01:34 2017 (r321723) @@ -516,7 +516,7 @@ std::vector DiagnosticIDs::getDiagnosticF std::string Diag(DiagGroupNames + I + 1, DiagGroupNames[I]); I += DiagGroupNames[I] + 1; Res.push_back("-W" + Diag); - Res.push_back("-Wno" + Diag); + Res.push_back("-Wno-" + Diag); } return Res; Modified: head/contrib/llvm/tools/clang/lib/Basic/Version.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Basic/Version.cpp Sun Jul 30 16:45:28 2017 (r321722) +++ head/contrib/llvm/tools/clang/lib/Basic/Version.cpp Sun Jul 30 18:01:34 2017 (r321723) @@ -36,7 +36,7 @@ std::string getClangRepositoryPath() { // If the SVN_REPOSITORY is empty, try to use the SVN keyword. This helps us // pick up a tag in an SVN export, for example. - StringRef SVNRepository("$URL: https://llvm.org/svn/llvm-project/cfe/trunk/lib/Basic/Version.cpp $"); + StringRef SVNRepository("$URL: https://llvm.org/svn/llvm-project/cfe/branches/release_50/lib/Basic/Version.cpp $"); if (URL.empty()) { URL = SVNRepository.slice(SVNRepository.find(':'), SVNRepository.find("/lib/Basic")); Modified: head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTBAA.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTBAA.cpp Sun Jul 30 16:45:28 2017 (r321722) +++ head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTBAA.cpp Sun Jul 30 18:01:34 2017 (r321723) @@ -139,6 +139,12 @@ CodeGenTBAA::getTBAAInfo(QualType QTy) { } } + // C++1z [basic.lval]p10: "If a program attempts to access the stored value of + // an object through a glvalue of other than one of the following types the + // behavior is undefined: [...] a char, unsigned char, or std::byte type." + if (Ty->isStdByteType()) + return MetadataCache[Ty] = getChar(); + // Handle pointers. // TODO: Implement C++'s type "similarity" and consider dis-"similar" // pointers distinct. Modified: head/contrib/llvm/tools/clang/lib/Driver/Driver.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Driver/Driver.cpp Sun Jul 30 16:45:28 2017 (r321722) +++ head/contrib/llvm/tools/clang/lib/Driver/Driver.cpp Sun Jul 30 18:01:34 2017 (r321723) @@ -69,7 +69,6 @@ #include "llvm/Support/PrettyStackTrace.h" #include "llvm/Support/Process.h" #include "llvm/Support/Program.h" -#include "llvm/Support/TargetRegistry.h" #include "llvm/Support/raw_ostream.h" #include #include @@ -1193,10 +1192,6 @@ bool Driver::HandleImmediateArgs(const Compilation &C) if (C.getArgs().hasArg(options::OPT__version)) { // Follow gcc behavior and use stdout for --version and stderr for -v. PrintVersion(C, llvm::outs()); - - // Print registered targets. - llvm::outs() << '\n'; - llvm::TargetRegistry::printRegisteredTargetsForVersion(llvm::outs()); return false; } @@ -1299,7 +1294,7 @@ bool Driver::HandleImmediateArgs(const Compilation &C) std::sort(SuggestedCompletions.begin(), SuggestedCompletions.end(), [](StringRef A, StringRef B) { return A.compare_lower(B) < 0; }); - llvm::outs() << llvm::join(SuggestedCompletions, " ") << '\n'; + llvm::outs() << llvm::join(SuggestedCompletions, "\n") << '\n'; return false; } Modified: head/contrib/llvm/tools/clang/lib/Headers/unwind.h ============================================================================== --- head/contrib/llvm/tools/clang/lib/Headers/unwind.h Sun Jul 30 16:45:28 2017 (r321722) +++ head/contrib/llvm/tools/clang/lib/Headers/unwind.h Sun Jul 30 18:01:34 2017 (r321723) @@ -76,7 +76,13 @@ typedef intptr_t _sleb128_t; typedef uintptr_t _uleb128_t; struct _Unwind_Context; +#if defined(__arm__) && !(defined(__USING_SJLJ_EXCEPTIONS__) || defined(__ARM_DWARF_EH___)) +struct _Unwind_Control_Block; +typedef struct _Unwind_Control_Block _Unwind_Exception; /* Alias */ +#else struct _Unwind_Exception; +typedef struct _Unwind_Exception _Unwind_Exception; +#endif typedef enum { _URC_NO_REASON = 0, #if defined(__arm__) && !defined(__USING_SJLJ_EXCEPTIONS__) && \ @@ -109,8 +115,42 @@ typedef enum { } _Unwind_Action; typedef void (*_Unwind_Exception_Cleanup_Fn)(_Unwind_Reason_Code, - struct _Unwind_Exception *); + _Unwind_Exception *); +#if defined(__arm__) && !(defined(__USING_SJLJ_EXCEPTIONS__) || defined(__ARM_DWARF_EH___)) +typedef struct _Unwind_Control_Block _Unwind_Control_Block; +typedef uint32_t _Unwind_EHT_Header; + +struct _Unwind_Control_Block { + uint64_t exception_class; + void (*exception_cleanup)(_Unwind_Reason_Code, _Unwind_Control_Block *); + /* unwinder cache (private fields for the unwinder's use) */ + struct { + uint32_t reserved1; /* forced unwind stop function, 0 if not forced */ + uint32_t reserved2; /* personality routine */ + uint32_t reserved3; /* callsite */ + uint32_t reserved4; /* forced unwind stop argument */ + uint32_t reserved5; + } unwinder_cache; + /* propagation barrier cache (valid after phase 1) */ + struct { + uint32_t sp; + uint32_t bitpattern[5]; + } barrier_cache; + /* cleanup cache (preserved over cleanup) */ + struct { + uint32_t bitpattern[4]; + } cleanup_cache; + /* personality cache (for personality's benefit) */ + struct { + uint32_t fnstart; /* function start address */ + _Unwind_EHT_Header *ehtp; /* pointer to EHT entry header word */ + uint32_t additional; /* additional data */ + uint32_t reserved1; + } pr_cache; + long long int : 0; /* force alignment of next item to 8-byte boundary */ +}; +#else struct _Unwind_Exception { _Unwind_Exception_Class exception_class; _Unwind_Exception_Cleanup_Fn exception_cleanup; @@ -120,23 +160,24 @@ struct _Unwind_Exception { * aligned". GCC has interpreted this to mean "use the maximum useful * alignment for the target"; so do we. */ } __attribute__((__aligned__)); +#endif typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn)(int, _Unwind_Action, _Unwind_Exception_Class, - struct _Unwind_Exception *, + _Unwind_Exception *, struct _Unwind_Context *, void *); -typedef _Unwind_Reason_Code (*_Unwind_Personality_Fn)( - int, _Unwind_Action, _Unwind_Exception_Class, struct _Unwind_Exception *, - struct _Unwind_Context *); +typedef _Unwind_Reason_Code (*_Unwind_Personality_Fn)(int, _Unwind_Action, + _Unwind_Exception_Class, + _Unwind_Exception *, + struct _Unwind_Context *); typedef _Unwind_Personality_Fn __personality_routine; typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn)(struct _Unwind_Context *, void *); -#if defined(__arm__) && !defined(__APPLE__) - +#if defined(__arm__) && !(defined(__USING_SJLJ_EXCEPTIONS__) || defined(__ARM_DWARF_EH___)) typedef enum { _UVRSC_CORE = 0, /* integer register */ _UVRSC_VFP = 1, /* vfp */ @@ -158,14 +199,12 @@ typedef enum { _UVRSR_FAILED = 2 } _Unwind_VRS_Result; -#if !defined(__USING_SJLJ_EXCEPTIONS__) && !defined(__ARM_DWARF_EH__) typedef uint32_t _Unwind_State; #define _US_VIRTUAL_UNWIND_FRAME ((_Unwind_State)0) #define _US_UNWIND_FRAME_STARTING ((_Unwind_State)1) #define _US_UNWIND_FRAME_RESUME ((_Unwind_State)2) #define _US_ACTION_MASK ((_Unwind_State)3) #define _US_FORCE_UNWIND ((_Unwind_State)8) -#endif _Unwind_VRS_Result _Unwind_VRS_Get(struct _Unwind_Context *__context, _Unwind_VRS_RegClass __regclass, @@ -224,14 +263,13 @@ _Unwind_Ptr _Unwind_GetRegionStart(struct _Unwind_Cont /* DWARF EH functions; currently not available on Darwin/ARM */ #if !defined(__APPLE__) || !defined(__arm__) +_Unwind_Reason_Code _Unwind_RaiseException(_Unwind_Exception *); +_Unwind_Reason_Code _Unwind_ForcedUnwind(_Unwind_Exception *, _Unwind_Stop_Fn, + void *); +void _Unwind_DeleteException(_Unwind_Exception *); +void _Unwind_Resume(_Unwind_Exception *); +_Unwind_Reason_Code _Unwind_Resume_or_Rethrow(_Unwind_Exception *); -_Unwind_Reason_Code _Unwind_RaiseException(struct _Unwind_Exception *); -_Unwind_Reason_Code _Unwind_ForcedUnwind(struct _Unwind_Exception *, - _Unwind_Stop_Fn, void *); -void _Unwind_DeleteException(struct _Unwind_Exception *); -void _Unwind_Resume(struct _Unwind_Exception *); -_Unwind_Reason_Code _Unwind_Resume_or_Rethrow(struct _Unwind_Exception *); - #endif _Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn, void *); @@ -241,11 +279,11 @@ typedef struct SjLj_Function_Context *_Unwind_Function void _Unwind_SjLj_Register(_Unwind_FunctionContext_t); void _Unwind_SjLj_Unregister(_Unwind_FunctionContext_t); -_Unwind_Reason_Code _Unwind_SjLj_RaiseException(struct _Unwind_Exception *); -_Unwind_Reason_Code _Unwind_SjLj_ForcedUnwind(struct _Unwind_Exception *, +_Unwind_Reason_Code _Unwind_SjLj_RaiseException(_Unwind_Exception *); +_Unwind_Reason_Code _Unwind_SjLj_ForcedUnwind(_Unwind_Exception *, _Unwind_Stop_Fn, void *); -void _Unwind_SjLj_Resume(struct _Unwind_Exception *); -_Unwind_Reason_Code _Unwind_SjLj_Resume_or_Rethrow(struct _Unwind_Exception *); +void _Unwind_SjLj_Resume(_Unwind_Exception *); +_Unwind_Reason_Code _Unwind_SjLj_Resume_or_Rethrow(_Unwind_Exception *); void *_Unwind_FindEnclosingFunction(void *); Modified: head/contrib/llvm/tools/clang/lib/Sema/SemaCodeComplete.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Sema/SemaCodeComplete.cpp Sun Jul 30 16:45:28 2017 (r321722) +++ head/contrib/llvm/tools/clang/lib/Sema/SemaCodeComplete.cpp Sun Jul 30 18:01:34 2017 (r321723) @@ -2398,6 +2398,37 @@ formatBlockPlaceholder(const PrintingPolicy &Policy, c return Result; } +static std::string GetDefaultValueString(const ParmVarDecl *Param, + const SourceManager &SM, + const LangOptions &LangOpts) { + const Expr *defaultArg = Param->getDefaultArg(); + if (!defaultArg) + return ""; + const SourceRange SrcRange = defaultArg->getSourceRange(); + CharSourceRange CharSrcRange = CharSourceRange::getTokenRange(SrcRange); + bool Invalid = CharSrcRange.isInvalid(); + if (Invalid) + return ""; + StringRef srcText = Lexer::getSourceText(CharSrcRange, SM, LangOpts, &Invalid); + if (Invalid) + return ""; + + if (srcText.empty() || srcText == "=") { + // Lexer can't determine the value. + // This happens if the code is incorrect (for example class is forward declared). + return ""; + } + std::string DefValue(srcText.str()); + // FIXME: remove this check if the Lexer::getSourceText value is fixed and + // this value always has (or always does not have) '=' in front of it + if (DefValue.at(0) != '=') { + // If we don't have '=' in front of value. + // Lexer returns built-in types values without '=' and user-defined types values with it. + return " = " + DefValue; + } + return " " + DefValue; +} + /// \brief Add function parameter chunks to the given code completion string. static void AddFunctionParameterChunks(Preprocessor &PP, const PrintingPolicy &Policy, @@ -2431,6 +2462,8 @@ static void AddFunctionParameterChunks(Preprocessor &P // Format the placeholder string. std::string PlaceholderStr = FormatFunctionParameter(Policy, Param); + if (Param->hasDefaultArg()) + PlaceholderStr += GetDefaultValueString(Param, PP.getSourceManager(), PP.getLangOpts()); if (Function->isVariadic() && P == N - 1) PlaceholderStr += ", ..."; @@ -3012,10 +3045,14 @@ static void AddOverloadParameterChunks(ASTContext &Con // Format the placeholder string. std::string Placeholder; - if (Function) - Placeholder = FormatFunctionParameter(Policy, Function->getParamDecl(P)); - else + if (Function) { + const ParmVarDecl *Param = Function->getParamDecl(P); + Placeholder = FormatFunctionParameter(Policy, Param); + if (Param->hasDefaultArg()) + Placeholder += GetDefaultValueString(Param, Context.getSourceManager(), Context.getLangOpts()); + } else { Placeholder = Prototype->getParamType(P).getAsString(Policy); + } if (P == CurrentArg) Result.AddCurrentParameterChunk( Modified: head/contrib/llvm/tools/clang/tools/clang-format/ClangFormat.cpp ============================================================================== --- head/contrib/llvm/tools/clang/tools/clang-format/ClangFormat.cpp Sun Jul 30 16:45:28 2017 (r321722) +++ head/contrib/llvm/tools/clang/tools/clang-format/ClangFormat.cpp Sun Jul 30 18:01:34 2017 (r321723) @@ -328,7 +328,8 @@ static bool format(StringRef FileName) { } // namespace format } // namespace clang -static void PrintVersion(raw_ostream &OS) { +static void PrintVersion() { + raw_ostream &OS = outs(); OS << clang::getClangToolFullVersion("clang-format") << '\n'; } Modified: head/contrib/llvm/tools/lld/COFF/Config.h ============================================================================== --- head/contrib/llvm/tools/lld/COFF/Config.h Sun Jul 30 16:45:28 2017 (r321722) +++ head/contrib/llvm/tools/lld/COFF/Config.h Sun Jul 30 18:01:34 2017 (r321723) @@ -130,7 +130,7 @@ struct Configuration { std::map Section; // Options for manifest files. - ManifestKind Manifest = SideBySide; + ManifestKind Manifest = No; int ManifestID = 1; StringRef ManifestDependency; bool ManifestUAC = true; Modified: head/contrib/llvm/tools/lld/COFF/Driver.cpp ============================================================================== --- head/contrib/llvm/tools/lld/COFF/Driver.cpp Sun Jul 30 16:45:28 2017 (r321722) +++ head/contrib/llvm/tools/lld/COFF/Driver.cpp Sun Jul 30 18:01:34 2017 (r321723) @@ -899,18 +899,25 @@ void LinkerDriver::link(ArrayRef ArgsArr for (auto *Arg : Args.filtered(OPT_section)) parseSection(Arg->getValue()); - // Handle /manifest - if (auto *Arg = Args.getLastArg(OPT_manifest_colon)) - parseManifest(Arg->getValue()); + // Handle /manifestdependency. This enables /manifest unless /manifest:no is + // also passed. + if (auto *Arg = Args.getLastArg(OPT_manifestdependency)) { + Config->ManifestDependency = Arg->getValue(); + Config->Manifest = Configuration::SideBySide; + } + // Handle /manifest and /manifest: + if (auto *Arg = Args.getLastArg(OPT_manifest, OPT_manifest_colon)) { + if (Arg->getOption().getID() == OPT_manifest) + Config->Manifest = Configuration::SideBySide; + else + parseManifest(Arg->getValue()); + } + // Handle /manifestuac if (auto *Arg = Args.getLastArg(OPT_manifestuac)) parseManifestUAC(Arg->getValue()); - // Handle /manifestdependency - if (auto *Arg = Args.getLastArg(OPT_manifestdependency)) - Config->ManifestDependency = Arg->getValue(); - // Handle /manifestfile if (auto *Arg = Args.getLastArg(OPT_manifestfile)) Config->ManifestFile = Arg->getValue(); @@ -918,6 +925,11 @@ void LinkerDriver::link(ArrayRef ArgsArr // Handle /manifestinput for (auto *Arg : Args.filtered(OPT_manifestinput)) Config->ManifestInput.push_back(Arg->getValue()); + + if (!Config->ManifestInput.empty() && + Config->Manifest != Configuration::Embed) { + fatal("/MANIFESTINPUT: requires /MANIFEST:EMBED"); + } // Handle miscellaneous boolean flags. if (Args.hasArg(OPT_allowisolation_no)) Modified: head/contrib/llvm/tools/lld/ELF/InputFiles.cpp ============================================================================== --- head/contrib/llvm/tools/lld/ELF/InputFiles.cpp Sun Jul 30 16:45:28 2017 (r321722) +++ head/contrib/llvm/tools/lld/ELF/InputFiles.cpp Sun Jul 30 18:01:34 2017 (r321723) @@ -91,8 +91,7 @@ template void elf::ObjectFile::init template Optional elf::ObjectFile::getDILineInfo(InputSectionBase *S, uint64_t Offset) { - if (!DwarfLine) - initializeDwarfLine(); + llvm::call_once(InitDwarfLine, [this]() { initializeDwarfLine(); }); // The offset to CU is 0. const DWARFDebugLine::LineTable *Tbl = DwarfLine->getLineTable(0); Modified: head/contrib/llvm/tools/lld/ELF/InputFiles.h ============================================================================== --- head/contrib/llvm/tools/lld/ELF/InputFiles.h Sun Jul 30 16:45:28 2017 (r321722) +++ head/contrib/llvm/tools/lld/ELF/InputFiles.h Sun Jul 30 18:01:34 2017 (r321723) @@ -24,6 +24,7 @@ #include "llvm/Object/Archive.h" #include "llvm/Object/ELF.h" #include "llvm/Object/IRObjectFile.h" +#include "llvm/Support/Threading.h" #include @@ -211,6 +212,7 @@ template class ObjectFile : public ELFFil // single object file, so we cache debugging information in order to // parse it only once for each object file we link. std::unique_ptr DwarfLine; + llvm::once_flag InitDwarfLine; }; // LazyObjectFile is analogous to ArchiveFile in the sense that Modified: head/contrib/llvm/tools/lld/ELF/SymbolTable.cpp ============================================================================== --- head/contrib/llvm/tools/lld/ELF/SymbolTable.cpp Sun Jul 30 16:45:28 2017 (r321722) +++ head/contrib/llvm/tools/lld/ELF/SymbolTable.cpp Sun Jul 30 18:01:34 2017 (r321723) @@ -211,6 +211,12 @@ static uint8_t getMinVisibility(uint8_t VA, uint8_t VB // Find an existing symbol or create and insert a new one. template std::pair SymbolTable::insert(StringRef Name) { + // @@ means the symbol is the default version. In that + // case @@ will be used to resolve references to . + size_t Pos = Name.find("@@"); + if (Pos != StringRef::npos) + Name = Name.take_front(Pos); + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Jul 30 18:29:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58CE6DBFE8E; Sun, 30 Jul 2017 18:29:29 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B39E7CCB2; Sun, 30 Jul 2017 18:29:29 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6UITSwd081376; Sun, 30 Jul 2017 18:29:28 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6UITS4R081374; Sun, 30 Jul 2017 18:29:28 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201707301829.v6UITS4R081374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 30 Jul 2017 18:29:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321724 - stable/11/sys/net80211 X-SVN-Group: stable-11 X-SVN-Commit-Author: avos X-SVN-Commit-Paths: stable/11/sys/net80211 X-SVN-Commit-Revision: 321724 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.23 Precedence: list List-Id: "SVN commit messages 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, 30 Jul 2017 18:29:29 -0000 Author: avos Date: Sun Jul 30 18:29:28 2017 New Revision: 321724 URL: https://svnweb.freebsd.org/changeset/base/321724 Log: MFC r321401: net80211: do not allow to unload rate control module if it is still in use. Keep 'nrefs' counter up-to-date, so 'kldunload wlan_amrr' with 1+ active wlan(4) interface will not lead to kernel panic. Modified: stable/11/sys/net80211/ieee80211_amrr.c stable/11/sys/net80211/ieee80211_rssadapt.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net80211/ieee80211_amrr.c ============================================================================== --- stable/11/sys/net80211/ieee80211_amrr.c Sun Jul 30 18:01:34 2017 (r321723) +++ stable/11/sys/net80211/ieee80211_amrr.c Sun Jul 30 18:29:28 2017 (r321724) @@ -117,6 +117,7 @@ amrr_init(struct ieee80211vap *vap) KASSERT(vap->iv_rs == NULL, ("%s called multiple times", __func__)); + nrefs++; /* XXX locking */ amrr = vap->iv_rs = IEEE80211_MALLOC(sizeof(struct ieee80211_amrr), M_80211_RATECTL, IEEE80211_M_NOWAIT | IEEE80211_M_ZERO); if (amrr == NULL) { @@ -133,6 +134,8 @@ static void amrr_deinit(struct ieee80211vap *vap) { IEEE80211_FREE(vap->iv_rs, M_80211_RATECTL); + KASSERT(nrefs > 0, ("imbalanced attach/detach")); + nrefs--; /* XXX locking */ } /* Modified: stable/11/sys/net80211/ieee80211_rssadapt.c ============================================================================== --- stable/11/sys/net80211/ieee80211_rssadapt.c Sun Jul 30 18:01:34 2017 (r321723) +++ stable/11/sys/net80211/ieee80211_rssadapt.c Sun Jul 30 18:29:28 2017 (r321724) @@ -131,7 +131,8 @@ rssadapt_init(struct ieee80211vap *vap) KASSERT(vap->iv_rs == NULL, ("%s: iv_rs already initialized", __func__)); - + + nrefs++; /* XXX locking */ vap->iv_rs = rs = IEEE80211_MALLOC(sizeof(struct ieee80211_rssadapt), M_80211_RATECTL, IEEE80211_M_NOWAIT | IEEE80211_M_ZERO); if (rs == NULL) { @@ -147,6 +148,8 @@ static void rssadapt_deinit(struct ieee80211vap *vap) { IEEE80211_FREE(vap->iv_rs, M_80211_RATECTL); + KASSERT(nrefs > 0, ("imbalanced attach/detach")); + nrefs--; /* XXX locking */ } static void From owner-svn-src-all@freebsd.org Sun Jul 30 18:38:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95DC5DC000B; Sun, 30 Jul 2017 18:38:06 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 55BCA7D08B; Sun, 30 Jul 2017 18:38:06 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6UIc57e085408; Sun, 30 Jul 2017 18:38:05 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6UIc5SA085406; Sun, 30 Jul 2017 18:38:05 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201707301838.v6UIc5SA085406@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 30 Jul 2017 18:38:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321725 - stable/10/sys/net80211 X-SVN-Group: stable-10 X-SVN-Commit-Author: avos X-SVN-Commit-Paths: stable/10/sys/net80211 X-SVN-Commit-Revision: 321725 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.23 Precedence: list List-Id: "SVN commit messages 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, 30 Jul 2017 18:38:06 -0000 Author: avos Date: Sun Jul 30 18:38:05 2017 New Revision: 321725 URL: https://svnweb.freebsd.org/changeset/base/321725 Log: MFC r321401: net80211: do not allow to unload rate control module if it is still in use. Keep 'nrefs' counter up-to-date, so 'kldunload wlan_amrr' with 1+ active wlan(4) interface will not lead to kernel panic. Modified: stable/10/sys/net80211/ieee80211_amrr.c stable/10/sys/net80211/ieee80211_rssadapt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net80211/ieee80211_amrr.c ============================================================================== --- stable/10/sys/net80211/ieee80211_amrr.c Sun Jul 30 18:29:28 2017 (r321724) +++ stable/10/sys/net80211/ieee80211_amrr.c Sun Jul 30 18:38:05 2017 (r321725) @@ -111,6 +111,7 @@ amrr_init(struct ieee80211vap *vap) KASSERT(vap->iv_rs == NULL, ("%s called multiple times", __func__)); + nrefs++; /* XXX locking */ amrr = vap->iv_rs = malloc(sizeof(struct ieee80211_amrr), M_80211_RATECTL, M_NOWAIT|M_ZERO); if (amrr == NULL) { @@ -127,6 +128,8 @@ static void amrr_deinit(struct ieee80211vap *vap) { free(vap->iv_rs, M_80211_RATECTL); + KASSERT(nrefs > 0, ("imbalanced attach/detach")); + nrefs--; /* XXX locking */ } static int Modified: stable/10/sys/net80211/ieee80211_rssadapt.c ============================================================================== --- stable/10/sys/net80211/ieee80211_rssadapt.c Sun Jul 30 18:29:28 2017 (r321724) +++ stable/10/sys/net80211/ieee80211_rssadapt.c Sun Jul 30 18:38:05 2017 (r321725) @@ -127,7 +127,8 @@ rssadapt_init(struct ieee80211vap *vap) KASSERT(vap->iv_rs == NULL, ("%s: iv_rs already initialized", __func__)); - + + nrefs++; /* XXX locking */ vap->iv_rs = rs = malloc(sizeof(struct ieee80211_rssadapt), M_80211_RATECTL, M_NOWAIT|M_ZERO); if (rs == NULL) { @@ -143,6 +144,8 @@ static void rssadapt_deinit(struct ieee80211vap *vap) { free(vap->iv_rs, M_80211_RATECTL); + KASSERT(nrefs > 0, ("imbalanced attach/detach")); + nrefs--; /* XXX locking */ } static void From owner-svn-src-all@freebsd.org Sun Jul 30 18:46:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D239DC01DB; Sun, 30 Jul 2017 18:46:39 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 630A67D490; Sun, 30 Jul 2017 18:46:39 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6UIkcFY089516; Sun, 30 Jul 2017 18:46:38 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6UIkcnx089514; Sun, 30 Jul 2017 18:46:38 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201707301846.v6UIkcnx089514@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 30 Jul 2017 18:46:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321726 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 321726 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.23 Precedence: list List-Id: "SVN commit messages 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, 30 Jul 2017 18:46:39 -0000 Author: ian Date: Sun Jul 30 18:46:38 2017 New Revision: 321726 URL: https://svnweb.freebsd.org/changeset/base/321726 Log: Bugfixes and enhancements... Don't enable the oscillator when it is found to be stopped at init time, just let the first setting of valid time start it. But still report a dead battery if it's stopped at init time. Don't force the chip into 24hr mode, just cope with whatever mode it is already in. Align the RTC clock to top of second when setting it. Modified: head/sys/dev/iicbus/ds1307.c head/sys/dev/iicbus/ds1307reg.h Modified: head/sys/dev/iicbus/ds1307.c ============================================================================== --- head/sys/dev/iicbus/ds1307.c Sun Jul 30 18:38:05 2017 (r321725) +++ head/sys/dev/iicbus/ds1307.c Sun Jul 30 18:46:38 2017 (r321726) @@ -56,20 +56,20 @@ __FBSDID("$FreeBSD$"); struct ds1307_softc { device_t sc_dev; - int sc_year0; - struct intr_config_hook enum_hook; - uint16_t sc_addr; /* DS1307 slave address. */ + struct intr_config_hook + enum_hook; uint8_t sc_ctrl; - int sc_mcp7941x; + bool sc_mcp7941x; + bool sc_use_ampm; }; static void ds1307_start(void *); #ifdef FDT static const struct ofw_compat_data ds1307_compat_data[] = { - {"dallas,ds1307", (uintptr_t)"Maxim DS1307 RTC"}, - {"maxim,ds1307", (uintptr_t)"Maxim DS1307 RTC"}, - {"microchip,mcp7941x", (uintptr_t)"Microchip MCP7941x RTC"}, + {"dallas,ds1307", (uintptr_t)"Dallas DS1307 RTC"}, + {"maxim,ds1307", (uintptr_t)"Maxim DS1307 RTC"}, + {"microchip,mcp7941x", (uintptr_t)"Microchip MCP7941x RTC"}, { NULL, 0 } }; #endif @@ -118,48 +118,6 @@ ds1307_ctrl_write(struct ds1307_softc *sc) } static int -ds1307_osc_enable(struct ds1307_softc *sc) -{ - int error; - uint8_t secs; - - error = ds1307_read1(sc->sc_dev, DS1307_SECS, &secs); - if (error) { - device_printf(sc->sc_dev, "cannot read from RTC.\n"); - return (error); - } - /* Check if the oscillator is disabled. */ - if ((secs & DS1307_SECS_CH) == 0) - return (0); - device_printf(sc->sc_dev, "clock was halted, check the battery.\n"); - secs &= DS1307_SECS_MASK; - error = ds1307_write1(sc->sc_dev, DS1307_SECS, secs); - if (error != 0) - device_printf(sc->sc_dev, "cannot write to RTC.\n"); - - return (error); -} - -static int -ds1307_set_24hrs_mode(struct ds1307_softc *sc) -{ - int error; - uint8_t hour; - - error = ds1307_read1(sc->sc_dev, DS1307_HOUR, &hour); - if (error) { - device_printf(sc->sc_dev, "cannot read from RTC.\n"); - return (error); - } - hour &= DS1307_HOUR_MASK; - error = ds1307_write1(sc->sc_dev, DS1307_HOUR, hour); - if (error != 0) - device_printf(sc->sc_dev, "cannot write to RTC.\n"); - - return (error); -} - -static int ds1307_sqwe_sysctl(SYSCTL_HANDLER_ARGS) { int sqwe, error, newv, sqwe_bit; @@ -268,7 +226,7 @@ ds1307_probe(device_t dev) #else device_set_desc(dev, "Maxim DS1307 RTC"); - return (BUS_PROBE_DEFAULT); + return (BUS_PROBE_NOWILDCARD); #endif } @@ -279,8 +237,6 @@ ds1307_attach(device_t dev) sc = device_get_softc(dev); sc->sc_dev = dev; - sc->sc_addr = iicbus_get_addr(dev); - sc->sc_year0 = 1900; sc->enum_hook.ich_func = ds1307_start; sc->enum_hook.ich_arg = dev; @@ -307,6 +263,7 @@ ds1307_start(void *xdev) struct sysctl_ctx_list *ctx; struct sysctl_oid *tree_node; struct sysctl_oid_list *tree; + uint8_t secs; dev = (device_t)xdev; sc = device_get_softc(dev); @@ -315,12 +272,16 @@ ds1307_start(void *xdev) tree = SYSCTL_CHILDREN(tree_node); config_intrhook_disestablish(&sc->enum_hook); - /* Set the 24 hours mode. */ - if (ds1307_set_24hrs_mode(sc) != 0) + + /* Check if the oscillator is disabled. */ + if (ds1307_read1(sc->sc_dev, DS1307_SECS, &secs) != 0) { + device_printf(sc->sc_dev, "cannot read from RTC.\n"); return; - /* Enable the oscillator if halted. */ - if (ds1307_osc_enable(sc) != 0) - return; + } + if ((secs & DS1307_SECS_CH) != 0) { + device_printf(sc->sc_dev, + "WARNING: RTC clock stopped, check the battery.\n"); + } /* Configuration parameters. */ SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "sqwe", @@ -334,8 +295,8 @@ ds1307_start(void *xdev) CTLFLAG_RW | CTLTYPE_UINT | CTLFLAG_MPSAFE, sc, 0, ds1307_sqw_out_sysctl, "IU", "DS1307 square-wave output state"); - /* 1 second resolution. */ - clock_register(dev, 1000000); + /* Register as a clock with 1 second resolution. */ + clock_register_flags(dev, 1000000, CLOCKF_SETTIME_NO_TS); } static int @@ -344,7 +305,7 @@ ds1307_gettime(device_t dev, struct timespec *ts) int error; struct clocktime ct; struct ds1307_softc *sc; - uint8_t data[7]; + uint8_t data[7], hourmask; sc = device_get_softc(dev); error = iicdev_readfrom(sc->sc_dev, DS1307_SECS, data, sizeof(data), @@ -353,32 +314,72 @@ ds1307_gettime(device_t dev, struct timespec *ts) device_printf(dev, "cannot read from RTC.\n"); return (error); } + + /* If chip is in AM/PM mode remember that. */ + if (data[DS1307_HOUR] & DS1307_HOUR_USE_AMPM) { + sc->sc_use_ampm = true; + hourmask = DS1307_HOUR_MASK_12HR; + } else + hourmask = DS1307_HOUR_MASK_24HR; + ct.nsec = 0; - ct.sec = FROMBCD(data[DS1307_SECS] & DS1307_SECS_MASK); - ct.min = FROMBCD(data[DS1307_MINS] & DS1307_MINS_MASK); - ct.hour = FROMBCD(data[DS1307_HOUR] & DS1307_HOUR_MASK); - ct.day = FROMBCD(data[DS1307_DATE] & DS1307_DATE_MASK); - ct.dow = data[DS1307_WEEKDAY] & DS1307_WEEKDAY_MASK; - ct.mon = FROMBCD(data[DS1307_MONTH] & DS1307_MONTH_MASK); - ct.year = FROMBCD(data[DS1307_YEAR] & DS1307_YEAR_MASK); + ct.sec = FROMBCD(data[DS1307_SECS] & DS1307_SECS_MASK); + ct.min = FROMBCD(data[DS1307_MINS] & DS1307_MINS_MASK); + ct.hour = FROMBCD(data[DS1307_HOUR] & hourmask); + ct.day = FROMBCD(data[DS1307_DATE] & DS1307_DATE_MASK); + ct.mon = FROMBCD(data[DS1307_MONTH] & DS1307_MONTH_MASK); + ct.year = FROMBCD(data[DS1307_YEAR] & DS1307_YEAR_MASK); + if (sc->sc_use_ampm) { + if (ct.hour == 12) + ct.hour = 0; + if (data[DS1307_HOUR] & DS1307_HOUR_IS_PM) + ct.hour += 12; + } + return (clock_ct_to_ts(&ct, ts)); } static int ds1307_settime(device_t dev, struct timespec *ts) { - int error; struct clocktime ct; struct ds1307_softc *sc; + long waitns; + int error; uint8_t data[7]; + uint8_t pmflags; sc = device_get_softc(dev); + + /* Sleep until 1ms into the second, to align RTC's second to ours. */ + getnanotime(ts); + waitns = 1000000 - ts->tv_nsec; + if (waitns < 0) + waitns += 1000000000; + pause_sbt("set1307", nstosbt(waitns), 0, C_PREL(31)); + + /* Grab a fresh post-sleep idea of the time. */ + getnanotime(ts); + ts->tv_sec -= utc_offset(); ts->tv_nsec = 0; clock_ts_to_ct(ts, &ct); + + /* If the chip is in AM/PM mode, adjust hour and set flags as needed. */ + if (sc->sc_use_ampm) { + pmflags = DS1307_HOUR_USE_AMPM; + if (ct.hour >= 12) { + ct.hour -= 12; + pmflags |= DS1307_HOUR_IS_PM; + } + if (ct.hour == 0) + ct.hour = 12; + } else + pmflags = 0; + data[DS1307_SECS] = TOBCD(ct.sec); data[DS1307_MINS] = TOBCD(ct.min); - data[DS1307_HOUR] = TOBCD(ct.hour); + data[DS1307_HOUR] = TOBCD(ct.hour) | pmflags; data[DS1307_DATE] = TOBCD(ct.day); data[DS1307_WEEKDAY] = ct.dow; data[DS1307_MONTH] = TOBCD(ct.mon); Modified: head/sys/dev/iicbus/ds1307reg.h ============================================================================== --- head/sys/dev/iicbus/ds1307reg.h Sun Jul 30 18:38:05 2017 (r321725) +++ head/sys/dev/iicbus/ds1307reg.h Sun Jul 30 18:46:38 2017 (r321726) @@ -39,7 +39,10 @@ #define DS1307_MINS 0x01 #define DS1307_MINS_MASK 0x7f #define DS1307_HOUR 0x02 -#define DS1307_HOUR_MASK 0x3f +#define DS1307_HOUR_MASK_12HR 0x1f +#define DS1307_HOUR_MASK_24HR 0x3f +#define DS1307_HOUR_IS_PM 0x20 +#define DS1307_HOUR_USE_AMPM 0x40 #define DS1307_WEEKDAY 0x03 #define DS1307_WEEKDAY_MASK 0x07 #define DS1307_DATE 0x04 From owner-svn-src-all@freebsd.org Sun Jul 30 19:58:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F69ADC1149; Sun, 30 Jul 2017 19:58:32 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6BB5C7EDBA; Sun, 30 Jul 2017 19:58:32 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6UJwVaV018163; Sun, 30 Jul 2017 19:58:31 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6UJwVKo018162; Sun, 30 Jul 2017 19:58:31 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201707301958.v6UJwVKo018162@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 30 Jul 2017 19:58:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321727 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 321727 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.23 Precedence: list List-Id: "SVN commit messages 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, 30 Jul 2017 19:58:32 -0000 Author: ian Date: Sun Jul 30 19:58:31 2017 New Revision: 321727 URL: https://svnweb.freebsd.org/changeset/base/321727 Log: Fix AM/PM mode handling. The bits to mask off in the hours register changes between 12/24 hour mode. Also fix conversion between 12 and 24 hour mode. It's not as easy as adding/subtracting 12, because the clock doesn't roll over 11->0, it rolls over 12->1; 0 isn't a valid hour in AM/PM mode. Modified: head/sys/dev/iicbus/nxprtc.c Modified: head/sys/dev/iicbus/nxprtc.c ============================================================================== --- head/sys/dev/iicbus/nxprtc.c Sun Jul 30 18:46:38 2017 (r321726) +++ head/sys/dev/iicbus/nxprtc.c Sun Jul 30 19:58:31 2017 (r321727) @@ -83,7 +83,8 @@ __FBSDID("$FreeBSD$"); #define PCF85xx_M_SECOND 0x7f /* Masks for all BCD time regs... */ #define PCF85xx_M_MINUTE 0x7f -#define PCF85xx_M_HOUR 0x3f +#define PCF85xx_M_12HOUR 0x1f +#define PCF85xx_M_24HOUR 0x3f #define PCF85xx_M_DAY 0x3f #define PCF85xx_M_MONTH 0x1f #define PCF85xx_M_YEAR 0xff @@ -525,7 +526,7 @@ nxprtc_gettime(device_t dev, struct timespec *ts) struct time_regs tregs; struct nxprtc_softc *sc; int err; - uint8_t cs1, tmrcount; + uint8_t cs1, hourmask, tmrcount; sc = device_get_softc(dev); @@ -548,10 +549,15 @@ nxprtc_gettime(device_t dev, struct timespec *ts) return (EINVAL); /* hardware is good, time is not. */ } + if (sc->flags & SC_F_AMPM) + hourmask = PCF85xx_M_12HOUR; + else + hourmask = PCF85xx_M_24HOUR; + ct.nsec = ((uint64_t)tmrcount * 1000000000) / TMR_TICKS_SEC; ct.sec = FROMBCD(tregs.sec & PCF85xx_M_SECOND); ct.min = FROMBCD(tregs.min & PCF85xx_M_MINUTE); - ct.hour = FROMBCD(tregs.hour & PCF85xx_M_HOUR); + ct.hour = FROMBCD(tregs.hour & hourmask); ct.day = FROMBCD(tregs.day & PCF85xx_M_DAY); ct.mon = FROMBCD(tregs.month & PCF85xx_M_MONTH); ct.year = FROMBCD(tregs.year & PCF85xx_M_YEAR); @@ -574,8 +580,12 @@ nxprtc_gettime(device_t dev, struct timespec *ts) } /* If this chip is running in 12-hour/AMPM mode, deal with it. */ - if ((sc->flags & SC_F_AMPM) && (tregs.hour & PCF8523_B_HOUR_PM)) - ct.hour += 12; + if (sc->flags & SC_F_AMPM) { + if (ct.hour == 12) + ct.hour = 0; + if (tregs.hour & PCF8523_B_HOUR_PM) + ct.hour += 12; + } err = clock_ct_to_ts(&ct, ts); ts->tv_sec += utc_offset(); @@ -628,9 +638,13 @@ nxprtc_settime(device_t dev, struct timespec *ts) /* If the chip is in AMPM mode deal with the PM flag. */ pmflag = 0; - if ((sc->flags & SC_F_AMPM) && ct.hour > 12) { - ct.hour -= 12; - pmflag = PCF8523_B_HOUR_PM; + if (sc->flags & SC_F_AMPM) { + if (ct.hour >= 12) { + ct.hour -= 12; + pmflag = PCF8523_B_HOUR_PM; + } + if (ct.hour == 0) + ct.hour = 12; } /* On 8563 set the century based on the polarity seen when reading. */ From owner-svn-src-all@freebsd.org Sun Jul 30 21:24:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58CF0DC29CF; Sun, 30 Jul 2017 21:24:22 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3202A8144E; Sun, 30 Jul 2017 21:24:22 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6ULOLKd054089; Sun, 30 Jul 2017 21:24:21 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6ULOKVf054084; Sun, 30 Jul 2017 21:24:20 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201707302124.v6ULOKVf054084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 30 Jul 2017 21:24:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321728 - in head/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Group: head X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in head/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Commit-Revision: 321728 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.23 Precedence: list List-Id: "SVN commit messages 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, 30 Jul 2017 21:24:22 -0000 Author: dchagin Date: Sun Jul 30 21:24:20 2017 New Revision: 321728 URL: https://svnweb.freebsd.org/changeset/base/321728 Log: Avoid using [LINUX_]SHAREDPAGE constant directly in the vdso code. This is needed for https://reviews.freebsd.org/D11780. Reported by: kib@ Modified: head/sys/amd64/linux/linux_sysvec.c head/sys/amd64/linux32/linux32_sysvec.c head/sys/compat/linux/linux_vdso.c head/sys/compat/linux/linux_vdso.h head/sys/i386/linux/linux_sysvec.c Modified: head/sys/amd64/linux/linux_sysvec.c ============================================================================== --- head/sys/amd64/linux/linux_sysvec.c Sun Jul 30 19:58:31 2017 (r321727) +++ head/sys/amd64/linux/linux_sysvec.c Sun Jul 30 21:24:20 2017 (r321728) @@ -844,14 +844,14 @@ linux_vdso_install(void *param) linux_shared_page_obj = __elfN(linux_shared_page_init) (&linux_shared_page_mapping); - __elfN(linux_vdso_reloc)(&elf_linux_sysvec, SHAREDPAGE); + __elfN(linux_vdso_reloc)(&elf_linux_sysvec); bcopy(elf_linux_sysvec.sv_sigcode, linux_shared_page_mapping, linux_szsigcode); elf_linux_sysvec.sv_shared_page_obj = linux_shared_page_obj; linux_kplatform = linux_shared_page_mapping + - (linux_platform - (caddr_t)SHAREDPAGE); + (linux_platform - (caddr_t)elf_linux_sysvec.sv_shared_page_base); } SYSINIT(elf_linux_vdso_init, SI_SUB_EXEC, SI_ORDER_ANY, (sysinit_cfunc_t)linux_vdso_install, NULL); Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Sun Jul 30 19:58:31 2017 (r321727) +++ head/sys/amd64/linux32/linux32_sysvec.c Sun Jul 30 21:24:20 2017 (r321728) @@ -1062,14 +1062,14 @@ linux_vdso_install(void *param) linux_shared_page_obj = __elfN(linux_shared_page_init) (&linux_shared_page_mapping); - __elfN(linux_vdso_reloc)(&elf_linux_sysvec, LINUX32_SHAREDPAGE); + __elfN(linux_vdso_reloc)(&elf_linux_sysvec); bcopy(elf_linux_sysvec.sv_sigcode, linux_shared_page_mapping, linux_szsigcode); elf_linux_sysvec.sv_shared_page_obj = linux_shared_page_obj; linux_kplatform = linux_shared_page_mapping + - (linux_platform - (caddr_t)LINUX32_SHAREDPAGE); + (linux_platform - (caddr_t)elf_linux_sysvec.sv_shared_page_base); } SYSINIT(elf_linux_vdso_init, SI_SUB_EXEC, SI_ORDER_ANY, (sysinit_cfunc_t)linux_vdso_install, NULL); Modified: head/sys/compat/linux/linux_vdso.c ============================================================================== --- head/sys/compat/linux/linux_vdso.c Sun Jul 30 19:58:31 2017 (r321727) +++ head/sys/compat/linux/linux_vdso.c Sun Jul 30 21:24:20 2017 (r321728) @@ -139,7 +139,7 @@ __elfN(linux_vdso_fixup)(struct sysentvec *sv) } void -__elfN(linux_vdso_reloc)(struct sysentvec *sv, long vdso_adjust) +__elfN(linux_vdso_reloc)(struct sysentvec *sv) { struct linux_vdso_sym *lsym; Elf_Ehdr *ehdr; @@ -152,13 +152,13 @@ __elfN(linux_vdso_reloc)(struct sysentvec *sv, long vd ehdr = (Elf_Ehdr *) sv->sv_sigcode; /* Adjust our so relative to the sigcode_base */ - if (vdso_adjust != 0) { - ehdr->e_entry += vdso_adjust; + if (sv->sv_shared_page_base != 0) { + ehdr->e_entry += sv->sv_shared_page_base; phdr = (Elf_Phdr *)((caddr_t)ehdr + ehdr->e_phoff); /* phdrs */ for (i = 0; i < ehdr->e_phnum; i++) { - phdr[i].p_vaddr += vdso_adjust; + phdr[i].p_vaddr += sv->sv_shared_page_base; if (phdr[i].p_type != PT_DYNAMIC) continue; dyn = (Elf_Dyn *)((caddr_t)ehdr + phdr[i].p_offset); @@ -178,13 +178,13 @@ __elfN(linux_vdso_reloc)(struct sysentvec *sv, long vd case DT_VERDEF: case DT_VERNEED: case DT_ADDRRNGLO ... DT_ADDRRNGHI: - dyn->d_un.d_ptr += vdso_adjust; + dyn->d_un.d_ptr += sv->sv_shared_page_base; break; case DT_ENCODING ... DT_LOOS-1: case DT_LOOS ... DT_HIOS: if (dyn->d_tag >= DT_ENCODING && (dyn->d_tag & 1) == 0) - dyn->d_un.d_ptr += vdso_adjust; + dyn->d_un.d_ptr += sv->sv_shared_page_base; break; default: break; @@ -197,7 +197,7 @@ __elfN(linux_vdso_reloc)(struct sysentvec *sv, long vd for(i = 0; i < ehdr->e_shnum; i++) { if (!(shdr[i].sh_flags & SHF_ALLOC)) continue; - shdr[i].sh_addr += vdso_adjust; + shdr[i].sh_addr += sv->sv_shared_page_base; if (shdr[i].sh_type != SHT_SYMTAB && shdr[i].sh_type != SHT_DYNSYM) continue; @@ -209,7 +209,7 @@ __elfN(linux_vdso_reloc)(struct sysentvec *sv, long vd if (sym->st_shndx == SHN_UNDEF || sym->st_shndx == SHN_ABS) continue; - sym->st_value += vdso_adjust; + sym->st_value += sv->sv_shared_page_base; } } } Modified: head/sys/compat/linux/linux_vdso.h ============================================================================== --- head/sys/compat/linux/linux_vdso.h Sun Jul 30 19:58:31 2017 (r321727) +++ head/sys/compat/linux/linux_vdso.h Sun Jul 30 21:24:20 2017 (r321728) @@ -41,7 +41,7 @@ struct linux_vdso_sym { vm_object_t __elfN(linux_shared_page_init)(char **); void __elfN(linux_shared_page_fini)(vm_object_t); void __elfN(linux_vdso_fixup)(struct sysentvec *); -void __elfN(linux_vdso_reloc)(struct sysentvec *, long); +void __elfN(linux_vdso_reloc)(struct sysentvec *); void __elfN(linux_vdso_sym_init)(struct linux_vdso_sym *); #define LINUX_VDSO_SYM_INTPTR(name) \ Modified: head/sys/i386/linux/linux_sysvec.c ============================================================================== --- head/sys/i386/linux/linux_sysvec.c Sun Jul 30 19:58:31 2017 (r321727) +++ head/sys/i386/linux/linux_sysvec.c Sun Jul 30 21:24:20 2017 (r321728) @@ -1044,7 +1044,7 @@ linux_vdso_install(void *param) linux_shared_page_obj = __elfN(linux_shared_page_init) (&linux_shared_page_mapping); - __elfN(linux_vdso_reloc)(&elf_linux_sysvec, LINUX_SHAREDPAGE); + __elfN(linux_vdso_reloc)(&elf_linux_sysvec); bcopy(elf_linux_sysvec.sv_sigcode, linux_shared_page_mapping, linux_szsigcode); From owner-svn-src-all@freebsd.org Sun Jul 30 21:50:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50C70DC324F; Sun, 30 Jul 2017 21:50:47 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A8B081DB5; Sun, 30 Jul 2017 21:50:47 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6ULokbk062792; Sun, 30 Jul 2017 21:50:46 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6ULokh6062791; Sun, 30 Jul 2017 21:50:46 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201707302150.v6ULokh6062791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 30 Jul 2017 21:50:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321729 - head/sys/dev/rtwn/rtl8188e X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/dev/rtwn/rtl8188e X-SVN-Commit-Revision: 321729 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.23 Precedence: list List-Id: "SVN commit messages 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, 30 Jul 2017 21:50:47 -0000 Author: avos Date: Sun Jul 30 21:50:45 2017 New Revision: 321729 URL: https://svnweb.freebsd.org/changeset/base/321729 Log: rtwn: drop unnecessary / wrong conversion. The 'chan' field occupies only one byte. Modified: head/sys/dev/rtwn/rtl8188e/r88e_rx.c Modified: head/sys/dev/rtwn/rtl8188e/r88e_rx.c ============================================================================== --- head/sys/dev/rtwn/rtl8188e/r88e_rx.c Sun Jul 30 21:24:20 2017 (r321728) +++ head/sys/dev/rtwn/rtl8188e/r88e_rx.c Sun Jul 30 21:50:45 2017 (r321729) @@ -221,7 +221,7 @@ r88e_get_rx_stats(struct rtwn_softc *sc, struct ieee80 if (!sc->sc_ht40) { /* XXX center channel */ rxs->r_flags |= IEEE80211_R_IEEE | IEEE80211_R_FREQ; - rxs->c_ieee = le16toh(physt->chan); + rxs->c_ieee = physt->chan; rxs->c_freq = ieee80211_ieee2mhz(rxs->c_ieee, IEEE80211_CHAN_2GHZ); } From owner-svn-src-all@freebsd.org Sun Jul 30 21:52:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89DE4DC32D1; Sun, 30 Jul 2017 21:52:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 56C9A82111; Sun, 30 Jul 2017 21:52:23 +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 v6ULqMEG066399; Sun, 30 Jul 2017 21:52:22 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6ULqMM4066397; Sun, 30 Jul 2017 21:52:22 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201707302152.v6ULqMM4066397@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 30 Jul 2017 21:52:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321730 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 321730 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.23 Precedence: list List-Id: "SVN commit messages 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, 30 Jul 2017 21:52:23 -0000 Author: kib Date: Sun Jul 30 21:52:22 2017 New Revision: 321730 URL: https://svnweb.freebsd.org/changeset/base/321730 Log: Remove unused symbols. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/genassym.c head/sys/i386/i386/genassym.c Modified: head/sys/amd64/amd64/genassym.c ============================================================================== --- head/sys/amd64/amd64/genassym.c Sun Jul 30 21:50:45 2017 (r321729) +++ head/sys/amd64/amd64/genassym.c Sun Jul 30 21:52:22 2017 (r321730) @@ -108,12 +108,10 @@ ASSYM(PML4SHIFT, PML4SHIFT); ASSYM(val_KPDPI, KPDPI); ASSYM(val_KPML4I, KPML4I); ASSYM(val_PML4PML4I, PML4PML4I); -ASSYM(USRSTACK, USRSTACK); ASSYM(VM_MAXUSER_ADDRESS, VM_MAXUSER_ADDRESS); ASSYM(KERNBASE, KERNBASE); ASSYM(DMAP_MIN_ADDRESS, DMAP_MIN_ADDRESS); ASSYM(DMAP_MAX_ADDRESS, DMAP_MAX_ADDRESS); -ASSYM(MCLBYTES, MCLBYTES); ASSYM(PCB_R15, offsetof(struct pcb, pcb_r15)); ASSYM(PCB_R14, offsetof(struct pcb, pcb_r14)); Modified: head/sys/i386/i386/genassym.c ============================================================================== --- head/sys/i386/i386/genassym.c Sun Jul 30 21:50:45 2017 (r321729) +++ head/sys/i386/i386/genassym.c Sun Jul 30 21:52:22 2017 (r321730) @@ -112,11 +112,9 @@ ASSYM(PAGE_SHIFT, PAGE_SHIFT); ASSYM(PAGE_MASK, PAGE_MASK); ASSYM(PDRSHIFT, PDRSHIFT); ASSYM(PDRMASK, PDRMASK); -ASSYM(USRSTACK, USRSTACK); ASSYM(VM_MAXUSER_ADDRESS, VM_MAXUSER_ADDRESS); ASSYM(KERNBASE, KERNBASE); ASSYM(KERNLOAD, KERNLOAD); -ASSYM(MCLBYTES, MCLBYTES); ASSYM(PCB_CR0, offsetof(struct pcb, pcb_cr0)); ASSYM(PCB_CR2, offsetof(struct pcb, pcb_cr2)); ASSYM(PCB_CR3, offsetof(struct pcb, pcb_cr3)); From owner-svn-src-all@freebsd.org Sun Jul 30 22:17:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2624DC380D; Sun, 30 Jul 2017 22:17:09 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2DCE82B55; Sun, 30 Jul 2017 22:17:09 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6UMH8lQ074932; Sun, 30 Jul 2017 22:17:08 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6UMH8ff074931; Sun, 30 Jul 2017 22:17:08 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201707302217.v6UMH8ff074931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 30 Jul 2017 22:17:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321732 - head/sys/dev/usb/wlan X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/dev/usb/wlan X-SVN-Commit-Revision: 321732 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.23 Precedence: list List-Id: "SVN commit messages 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, 30 Jul 2017 22:17:10 -0000 Author: avos Date: Sun Jul 30 22:17:08 2017 New Revision: 321732 URL: https://svnweb.freebsd.org/changeset/base/321732 Log: zyd: code cleanup + drop unneeded cast. No functional change intended. Modified: head/sys/dev/usb/wlan/if_zyd.c Modified: head/sys/dev/usb/wlan/if_zyd.c ============================================================================== --- head/sys/dev/usb/wlan/if_zyd.c Sun Jul 30 21:57:19 2017 (r321731) +++ head/sys/dev/usb/wlan/if_zyd.c Sun Jul 30 22:17:08 2017 (r321732) @@ -648,11 +648,12 @@ zyd_intr_read_callback(struct usb_xfer *xfer, usb_erro { struct zyd_notif_retry *retry = (struct zyd_notif_retry *)cmd->data; + uint16_t count = le16toh(retry->count); DPRINTF(sc, ZYD_DEBUG_TX_PROC, "retry intr: rate=0x%x addr=%s count=%d (0x%x)\n", le16toh(retry->rate), ether_sprintf(retry->macaddr), - le16toh(retry->count)&0xff, le16toh(retry->count)); + count & 0xff, count); /* * Find the node to which the packet was sent and @@ -664,13 +665,12 @@ zyd_intr_read_callback(struct usb_xfer *xfer, usb_erro if (ni != NULL) { struct ieee80211_ratectl_tx_status *txs = &sc->sc_txs; - int retrycnt = - (int)(le16toh(retry->count) & 0xff); + int retrycnt = count & 0xff; txs->flags = IEEE80211_RATECTL_STATUS_LONG_RETRY; txs->long_retries = retrycnt; - if (le16toh(retry->count) & 0x100) { + if (count & 0x100) { txs->status = IEEE80211_RATECTL_TX_FAIL_LONG; } else { @@ -682,7 +682,7 @@ zyd_intr_read_callback(struct usb_xfer *xfer, usb_erro ieee80211_ratectl_tx_complete(ni, txs); ieee80211_free_node(ni); } - if (le16toh(retry->count) & 0x100) + if (count & 0x100) /* too many retries */ if_inc_counter(vap->iv_ifp, IFCOUNTER_OERRORS, 1); From owner-svn-src-all@freebsd.org Sun Jul 30 22:34:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44349DC3B0A; Sun, 30 Jul 2017 22:34:26 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 04D69831F4; Sun, 30 Jul 2017 22:34:25 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6UMYPOC082783; Sun, 30 Jul 2017 22:34:25 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6UMYOQW082775; Sun, 30 Jul 2017 22:34:24 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201707302234.v6UMYOQW082775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Sun, 30 Jul 2017 22:34:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321733 - 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: 321733 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.23 Precedence: list List-Id: "SVN commit messages 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, 30 Jul 2017 22:34:26 -0000 Author: scottl Date: Sun Jul 30 22:34:24 2017 New Revision: 321733 URL: https://svnweb.freebsd.org/changeset/base/321733 Log: Change from using underbar function names to normal function names for the informational print functions. Collapse the debug API a bit to be more generic and not require as much code duplication. While here, fix a bug in MPS that was already fixed in MPR. Modified: head/sys/dev/mpr/mpr.c head/sys/dev/mpr/mpr_sas_lsi.c head/sys/dev/mpr/mpr_table.c head/sys/dev/mpr/mpr_table.h head/sys/dev/mps/mps.c head/sys/dev/mps/mps_sas_lsi.c head/sys/dev/mps/mps_table.c head/sys/dev/mps/mps_table.h Modified: head/sys/dev/mpr/mpr.c ============================================================================== --- head/sys/dev/mpr/mpr.c Sun Jul 30 22:17:08 2017 (r321732) +++ head/sys/dev/mpr/mpr.c Sun Jul 30 22:34:24 2017 (r321733) @@ -381,7 +381,7 @@ mpr_iocfacts_allocate(struct mpr_softc *sc, uint8_t at } } - mpr_print_iocfacts(sc, sc->facts); + MPR_DPRINT_PAGE(sc, MPR_XINFO, iocfacts, sc->facts); snprintf(sc->fw_version, sizeof(sc->fw_version), "%02d.%02d.%02d.%02d", @@ -1772,7 +1772,7 @@ mpr_log_evt_handler(struct mpr_softc *sc, uintptr_t da { MPI2_EVENT_DATA_LOG_ENTRY_ADDED *entry; - mpr_print_event(sc, event); + MPR_DPRINT_EVENT(sc, generic, event); switch (event->Event) { case MPI2_EVENT_LOG_DATA: @@ -2187,7 +2187,7 @@ mpr_reregister_events_complete(struct mpr_softc *sc, s mpr_dprint(sc, MPR_TRACE, "%s\n", __func__); if (cm->cm_reply) - mpr_print_event(sc, + MPR_DPRINT_EVENT(sc, generic, (MPI2_EVENT_NOTIFICATION_REPLY *)cm->cm_reply); mpr_free_command(sc, cm); @@ -2270,7 +2270,7 @@ mpr_update_events(struct mpr_softc *sc, struct mpr_eve error = ENXIO; if (reply) - mpr_print_event(sc, reply); + MPR_DPRINT_EVENT(sc, generic, reply); mpr_dprint(sc, MPR_TRACE, "%s finished error %d\n", __func__, error); Modified: head/sys/dev/mpr/mpr_sas_lsi.c ============================================================================== --- head/sys/dev/mpr/mpr_sas_lsi.c Sun Jul 30 22:17:08 2017 (r321732) +++ head/sys/dev/mpr/mpr_sas_lsi.c Sun Jul 30 22:34:24 2017 (r321733) @@ -139,7 +139,7 @@ mprsas_evt_handler(struct mpr_softc *sc, uintptr_t dat u16 sz; mpr_dprint(sc, MPR_TRACE, "%s\n", __func__); - mpr_print_evt_sas(sc, event); + MPR_DPRINT_EVENT(sc, sas, event); mprsas_record_event(sc, event); fw_event = malloc(sizeof(struct mpr_fw_event_work), M_MPR, Modified: head/sys/dev/mpr/mpr_table.c ============================================================================== --- head/sys/dev/mpr/mpr_table.c Sun Jul 30 22:17:08 2017 (r321732) +++ head/sys/dev/mpr/mpr_table.c Sun Jul 30 22:34:24 2017 (r321733) @@ -219,7 +219,7 @@ mpr_describe_devinfo(uint32_t devinfo, char *string, i } void -_mpr_print_iocfacts(struct mpr_softc *sc, MPI2_IOC_FACTS_REPLY *facts) +mpr_print_iocfacts(struct mpr_softc *sc, MPI2_IOC_FACTS_REPLY *facts) { MPR_PRINTFIELD_START(sc, "IOCFacts"); MPR_PRINTFIELD(sc, facts, MsgVersion, 0x%x); @@ -259,7 +259,7 @@ _mpr_print_iocfacts(struct mpr_softc *sc, MPI2_IOC_FAC } void -_mpr_print_portfacts(struct mpr_softc *sc, MPI2_PORT_FACTS_REPLY *facts) +mpr_print_portfacts(struct mpr_softc *sc, MPI2_PORT_FACTS_REPLY *facts) { MPR_PRINTFIELD_START(sc, "PortFacts"); @@ -269,7 +269,7 @@ _mpr_print_portfacts(struct mpr_softc *sc, MPI2_PORT_F } void -_mpr_print_event(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event) +mpr_print_evt_generic(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event) { MPR_PRINTFIELD_START(sc, "EventReply"); @@ -281,7 +281,7 @@ _mpr_print_event(struct mpr_softc *sc, MPI2_EVENT_NOTI } void -_mpr_print_sasdev0(struct mpr_softc *sc, MPI2_CONFIG_PAGE_SAS_DEV_0 *buf) +mpr_print_sasdev0(struct mpr_softc *sc, MPI2_CONFIG_PAGE_SAS_DEV_0 *buf) { MPR_PRINTFIELD_START(sc, "SAS Device Page 0"); MPR_PRINTFIELD(sc, buf, Slot, %d); @@ -310,10 +310,10 @@ _mpr_print_sasdev0(struct mpr_softc *sc, MPI2_CONFIG_P } void -_mpr_print_evt_sas(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event) +mpr_print_evt_sas(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event) { - _mpr_print_event(sc, event); + mpr_print_evt_generic(sc, event); switch(event->Event) { case MPI2_EVENT_SAS_DISCOVERY: @@ -407,7 +407,7 @@ _mpr_print_evt_sas(struct mpr_softc *sc, MPI2_EVENT_NO } void -_mpr_print_expander1(struct mpr_softc *sc, MPI2_CONFIG_PAGE_EXPANDER_1 *buf) +mpr_print_expander1(struct mpr_softc *sc, MPI2_CONFIG_PAGE_EXPANDER_1 *buf) { MPR_PRINTFIELD_START(sc, "SAS Expander Page 1 #%d", buf->Phy); MPR_PRINTFIELD(sc, buf, PhysicalPort, %d); @@ -447,7 +447,7 @@ _mpr_print_expander1(struct mpr_softc *sc, MPI2_CONFIG } void -_mpr_print_sasphy0(struct mpr_softc *sc, MPI2_CONFIG_PAGE_SAS_PHY_0 *buf) +mpr_print_sasphy0(struct mpr_softc *sc, MPI2_CONFIG_PAGE_SAS_PHY_0 *buf) { MPR_PRINTFIELD_START(sc, "SAS PHY Page 0"); MPR_PRINTFIELD(sc, buf, OwnerDevHandle, 0x%04x); Modified: head/sys/dev/mpr/mpr_table.h ============================================================================== --- head/sys/dev/mpr/mpr_table.h Sun Jul 30 22:17:08 2017 (r321732) +++ head/sys/dev/mpr/mpr_table.h Sun Jul 30 22:34:24 2017 (r321733) @@ -42,63 +42,22 @@ extern struct mpr_table_lookup mpr_phystatus_names[]; extern struct mpr_table_lookup mpr_linkrate_names[]; extern struct mpr_table_lookup mpr_pcie_linkrate_names[]; -void _mpr_print_iocfacts(struct mpr_softc *, MPI2_IOC_FACTS_REPLY *); -void _mpr_print_portfacts(struct mpr_softc *, MPI2_PORT_FACTS_REPLY *); -void _mpr_print_event(struct mpr_softc *, MPI2_EVENT_NOTIFICATION_REPLY *); -void _mpr_print_sasdev0(struct mpr_softc *, MPI2_CONFIG_PAGE_SAS_DEV_0 *); -void _mpr_print_evt_sas(struct mpr_softc *, MPI2_EVENT_NOTIFICATION_REPLY *); -void _mpr_print_expander1(struct mpr_softc *, MPI2_CONFIG_PAGE_EXPANDER_1 *); -void _mpr_print_sasphy0(struct mpr_softc *, MPI2_CONFIG_PAGE_SAS_PHY_0 *); +void mpr_print_iocfacts(struct mpr_softc *, MPI2_IOC_FACTS_REPLY *); +void mpr_print_portfacts(struct mpr_softc *, MPI2_PORT_FACTS_REPLY *); +void mpr_print_evt_generic(struct mpr_softc *, MPI2_EVENT_NOTIFICATION_REPLY *); +void mpr_print_sasdev0(struct mpr_softc *, MPI2_CONFIG_PAGE_SAS_DEV_0 *); +void mpr_print_evt_sas(struct mpr_softc *, MPI2_EVENT_NOTIFICATION_REPLY *); +void mpr_print_expander1(struct mpr_softc *, MPI2_CONFIG_PAGE_EXPANDER_1 *); +void mpr_print_sasphy0(struct mpr_softc *, MPI2_CONFIG_PAGE_SAS_PHY_0 *); void mpr_print_sgl(struct mpr_softc *, struct mpr_command *, int); void mpr_print_scsiio_cmd(struct mpr_softc *, struct mpr_command *); -static __inline void -mpr_print_iocfacts(struct mpr_softc *sc, MPI2_IOC_FACTS_REPLY *facts) -{ - if (sc->mpr_debug & MPR_XINFO) - _mpr_print_iocfacts(sc, facts); -} +#define MPR_DPRINT_PAGE(sc, level, func, buf) \ +do { \ + if ((sc)->mpr_debug & level) \ + mpr_print_##func((sc), buf); \ +} while (0) -static __inline void -mpr_print_portfacts(struct mpr_softc *sc, MPI2_PORT_FACTS_REPLY *facts) -{ - if (sc->mpr_debug & MPR_XINFO) - _mpr_print_portfacts(sc, facts); -} - -static __inline void -mpr_print_event(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event) -{ - if (sc->mpr_debug & MPR_EVENT) - _mpr_print_event(sc, event); -} - -static __inline void -mpr_print_evt_sas(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event) -{ - if (sc->mpr_debug & MPR_EVENT) - _mpr_print_evt_sas(sc, event); -} - -static __inline void -mpr_print_sasdev0(struct mpr_softc *sc, MPI2_CONFIG_PAGE_SAS_DEV_0 *buf) -{ - if (sc->mpr_debug & MPR_XINFO) - _mpr_print_sasdev0(sc, buf); -} - -static __inline void -mpr_print_expander1(struct mpr_softc *sc, MPI2_CONFIG_PAGE_EXPANDER_1 *buf) -{ - if (sc->mpr_debug & MPR_XINFO) - _mpr_print_expander1(sc, buf); -} - -static __inline void -mpr_print_sasphy0(struct mpr_softc *sc, MPI2_CONFIG_PAGE_SAS_PHY_0 *buf) -{ - if (sc->mpr_debug & MPR_XINFO) - _mpr_print_sasphy0(sc, buf); -} - +#define MPR_DPRINT_EVENT(sc, func, buf) \ + MPR_DPRINT_PAGE(sc, MPR_EVENT, evt_##func, buf) #endif Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Sun Jul 30 22:17:08 2017 (r321732) +++ head/sys/dev/mps/mps.c Sun Jul 30 22:34:24 2017 (r321733) @@ -373,7 +373,7 @@ mps_iocfacts_allocate(struct mps_softc *sc, uint8_t at } } - mps_print_iocfacts(sc, sc->facts); + MPS_DPRINT_PAGE(sc, MPS_XINFO, iocfacts, sc->facts); snprintf(sc->fw_version, sizeof(sc->fw_version), "%02d.%02d.%02d.%02d", @@ -1623,7 +1623,7 @@ mps_log_evt_handler(struct mps_softc *sc, uintptr_t da { MPI2_EVENT_DATA_LOG_ENTRY_ADDED *entry; - mps_print_event(sc, event); + MPS_DPRINT_EVENT(sc, generic, event); switch (event->Event) { case MPI2_EVENT_LOG_DATA: @@ -2033,7 +2033,7 @@ mps_reregister_events_complete(struct mps_softc *sc, s mps_dprint(sc, MPS_TRACE, "%s\n", __func__); if (cm->cm_reply) - mps_print_event(sc, + MPS_DPRINT_EVENT(sc, generic, (MPI2_EVENT_NOTIFICATION_REPLY *)cm->cm_reply); mps_free_command(sc, cm); @@ -2118,7 +2118,10 @@ mps_update_events(struct mps_softc *sc, struct mps_eve if ((reply == NULL) || (reply->IOCStatus & MPI2_IOCSTATUS_MASK) != MPI2_IOCSTATUS_SUCCESS) error = ENXIO; - mps_print_event(sc, reply); + + if (reply) + MPS_DPRINT_EVENT(sc, generic, reply); + mps_dprint(sc, MPS_TRACE, "%s finished error %d\n", __func__, error); mps_free_command(sc, cm); Modified: head/sys/dev/mps/mps_sas_lsi.c ============================================================================== --- head/sys/dev/mps/mps_sas_lsi.c Sun Jul 30 22:17:08 2017 (r321732) +++ head/sys/dev/mps/mps_sas_lsi.c Sun Jul 30 22:34:24 2017 (r321733) @@ -136,7 +136,7 @@ mpssas_evt_handler(struct mps_softc *sc, uintptr_t dat u16 sz; mps_dprint(sc, MPS_TRACE, "%s\n", __func__); - mps_print_evt_sas(sc, event); + MPS_DPRINT_EVENT(sc, sas, event); mpssas_record_event(sc, event); fw_event = malloc(sizeof(struct mps_fw_event_work), M_MPT2, Modified: head/sys/dev/mps/mps_table.c ============================================================================== --- head/sys/dev/mps/mps_table.c Sun Jul 30 22:17:08 2017 (r321732) +++ head/sys/dev/mps/mps_table.c Sun Jul 30 22:34:24 2017 (r321733) @@ -196,7 +196,7 @@ mps_describe_devinfo(uint32_t devinfo, char *string, i } void -_mps_print_iocfacts(struct mps_softc *sc, MPI2_IOC_FACTS_REPLY *facts) +mps_print_iocfacts(struct mps_softc *sc, MPI2_IOC_FACTS_REPLY *facts) { MPS_PRINTFIELD_START(sc, "IOCFacts"); @@ -237,7 +237,7 @@ _mps_print_iocfacts(struct mps_softc *sc, MPI2_IOC_FAC } void -_mps_print_portfacts(struct mps_softc *sc, MPI2_PORT_FACTS_REPLY *facts) +mps_print_portfacts(struct mps_softc *sc, MPI2_PORT_FACTS_REPLY *facts) { MPS_PRINTFIELD_START(sc, "PortFacts"); @@ -247,7 +247,7 @@ _mps_print_portfacts(struct mps_softc *sc, MPI2_PORT_F } void -_mps_print_event(struct mps_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event) +mps_print_evt_generic(struct mps_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event) { MPS_PRINTFIELD_START(sc, "EventReply"); @@ -259,7 +259,7 @@ _mps_print_event(struct mps_softc *sc, MPI2_EVENT_NOTI } void -_mps_print_sasdev0(struct mps_softc *sc, MPI2_CONFIG_PAGE_SAS_DEV_0 *buf) +mps_print_sasdev0(struct mps_softc *sc, MPI2_CONFIG_PAGE_SAS_DEV_0 *buf) { MPS_PRINTFIELD_START(sc, "SAS Device Page 0"); MPS_PRINTFIELD(sc, buf, Slot, %d); @@ -288,10 +288,10 @@ _mps_print_sasdev0(struct mps_softc *sc, MPI2_CONFIG_P } void -_mps_print_evt_sas(struct mps_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event) +mps_print_evt_sas(struct mps_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event) { - _mps_print_event(sc, event); + mps_print_evt_generic(sc, event); switch(event->Event) { case MPI2_EVENT_SAS_DISCOVERY: @@ -384,7 +384,7 @@ _mps_print_evt_sas(struct mps_softc *sc, MPI2_EVENT_NO } void -_mps_print_expander1(struct mps_softc *sc, MPI2_CONFIG_PAGE_EXPANDER_1 *buf) +mps_print_expander1(struct mps_softc *sc, MPI2_CONFIG_PAGE_EXPANDER_1 *buf) { MPS_PRINTFIELD_START(sc, "SAS Expander Page 1 #%d", buf->Phy); MPS_PRINTFIELD(sc, buf, PhysicalPort, %d); @@ -424,7 +424,7 @@ _mps_print_expander1(struct mps_softc *sc, MPI2_CONFIG } void -_mps_print_sasphy0(struct mps_softc *sc, MPI2_CONFIG_PAGE_SAS_PHY_0 *buf) +mps_print_sasphy0(struct mps_softc *sc, MPI2_CONFIG_PAGE_SAS_PHY_0 *buf) { MPS_PRINTFIELD_START(sc, "SAS PHY Page 0"); MPS_PRINTFIELD(sc, buf, OwnerDevHandle, 0x%04x); Modified: head/sys/dev/mps/mps_table.h ============================================================================== --- head/sys/dev/mps/mps_table.h Sun Jul 30 22:17:08 2017 (r321732) +++ head/sys/dev/mps/mps_table.h Sun Jul 30 22:34:24 2017 (r321733) @@ -41,63 +41,23 @@ extern struct mps_table_lookup mps_event_names[]; extern struct mps_table_lookup mps_phystatus_names[]; extern struct mps_table_lookup mps_linkrate_names[]; -void _mps_print_iocfacts(struct mps_softc *, MPI2_IOC_FACTS_REPLY *); -void _mps_print_portfacts(struct mps_softc *, MPI2_PORT_FACTS_REPLY *); -void _mps_print_event(struct mps_softc *, MPI2_EVENT_NOTIFICATION_REPLY *); -void _mps_print_sasdev0(struct mps_softc *, MPI2_CONFIG_PAGE_SAS_DEV_0 *); -void _mps_print_evt_sas(struct mps_softc *, MPI2_EVENT_NOTIFICATION_REPLY *); -void _mps_print_expander1(struct mps_softc *, MPI2_CONFIG_PAGE_EXPANDER_1 *); -void _mps_print_sasphy0(struct mps_softc *, MPI2_CONFIG_PAGE_SAS_PHY_0 *); +void mps_print_iocfacts(struct mps_softc *, MPI2_IOC_FACTS_REPLY *); +void mps_print_portfacts(struct mps_softc *, MPI2_PORT_FACTS_REPLY *); +void mps_print_evt_generic(struct mps_softc *, MPI2_EVENT_NOTIFICATION_REPLY *); +void mps_print_sasdev0(struct mps_softc *, MPI2_CONFIG_PAGE_SAS_DEV_0 *); +void mps_print_evt_sas(struct mps_softc *, MPI2_EVENT_NOTIFICATION_REPLY *); +void mps_print_expander1(struct mps_softc *, MPI2_CONFIG_PAGE_EXPANDER_1 *); +void mps_print_sasphy0(struct mps_softc *, MPI2_CONFIG_PAGE_SAS_PHY_0 *); void mps_print_sgl(struct mps_softc *, struct mps_command *, int); void mps_print_scsiio_cmd(struct mps_softc *, struct mps_command *); -static __inline void -mps_print_iocfacts(struct mps_softc *sc, MPI2_IOC_FACTS_REPLY *facts) -{ - if (sc->mps_debug & MPS_XINFO) - _mps_print_iocfacts(sc, facts); -} +#define MPS_DPRINT_PAGE(sc, level, func, buf) \ +do { \ + if ((sc)->mps_debug & level) \ + mps_print_##func((sc), buf); \ +} while (0) -static __inline void -mps_print_portfacts(struct mps_softc *sc, MPI2_PORT_FACTS_REPLY *facts) -{ - if (sc->mps_debug & MPS_XINFO) - _mps_print_portfacts(sc, facts); -} - -static __inline void -mps_print_event(struct mps_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event) -{ - if (sc->mps_debug & MPS_EVENT) - _mps_print_event(sc, event); -} - -static __inline void -mps_print_sasdev0(struct mps_softc *sc, MPI2_CONFIG_PAGE_SAS_DEV_0 *buf) -{ - if (sc->mps_debug & MPS_XINFO) - _mps_print_sasdev0(sc, buf); -} - -static __inline void -mps_print_evt_sas(struct mps_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event) -{ - if (sc->mps_debug & MPS_EVENT) - _mps_print_evt_sas(sc, event); -} - -static __inline void -mps_print_expander1(struct mps_softc *sc, MPI2_CONFIG_PAGE_EXPANDER_1 *buf) -{ - if (sc->mps_debug & MPS_XINFO) - _mps_print_expander1(sc, buf); -} - -static __inline void -mps_print_sasphy0(struct mps_softc *sc, MPI2_CONFIG_PAGE_SAS_PHY_0 *buf) -{ - if (sc->mps_debug & MPS_XINFO) - _mps_print_sasphy0(sc, buf); -} +#define MPS_DPRINT_EVENT(sc, func, buf) \ + MPS_DPRINT_PAGE(sc, MPS_EVENT, evt_##func, buf) #endif From owner-svn-src-all@freebsd.org Sun Jul 30 23:15:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C269CDC449F; Sun, 30 Jul 2017 23:15:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F67E84196; Sun, 30 Jul 2017 23:15:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6UNFUWO099100; Sun, 30 Jul 2017 23:15:30 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6UNFUH4099099; Sun, 30 Jul 2017 23:15:30 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201707302315.v6UNFUH4099099@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 30 Jul 2017 23:15:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321734 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 321734 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.23 Precedence: list List-Id: "SVN commit messages 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, 30 Jul 2017 23:15:31 -0000 Author: emaste Date: Sun Jul 30 23:15:30 2017 New Revision: 321734 URL: https://svnweb.freebsd.org/changeset/base/321734 Log: bsdinstall: default to UEFI-only boot on arm64 Reviewed by: allanjude Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D11721 Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Sun Jul 30 22:34:24 2017 (r321733) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Sun Jul 30 23:15:30 2017 (r321734) @@ -1554,17 +1554,27 @@ f_dprintf "BSDINSTALL_TMPETC=[%s]" "$BSDINSTALL_TMPETC f_dprintf "FSTAB_FMT=[%s]" "$FSTAB_FMT" # -# If the system was booted with UEFI, set the default boot type to UEFI +# Determine default boot type # -bootmethod=$( sysctl -n machdep.bootmethod ) -f_dprintf "machdep.bootmethod=[%s]" "$bootmethod" -if [ "$bootmethod" = "UEFI" ]; then - : ${ZFSBOOT_BOOT_TYPE:=BIOS+UEFI} +case $(uname -m) in +arm64) + # We support only UEFI boot for arm64 + : ${ZFSBOOT_BOOT_TYPE:=UEFI} : ${ZFSBOOT_PARTITION_SCHEME:=GPT} -else - : ${ZFSBOOT_BOOT_TYPE:=BIOS} - : ${ZFSBOOT_PARTITION_SCHEME:=GPT} -fi + ;; +*) + # If the system was booted with UEFI, set the default boot type to UEFI + bootmethod=$( sysctl -n machdep.bootmethod ) + f_dprintf "machdep.bootmethod=[%s]" "$bootmethod" + if [ "$bootmethod" = "UEFI" ]; then + : ${ZFSBOOT_BOOT_TYPE:=BIOS+UEFI} + : ${ZFSBOOT_PARTITION_SCHEME:=GPT} + else + : ${ZFSBOOT_BOOT_TYPE:=BIOS} + : ${ZFSBOOT_PARTITION_SCHEME:=GPT} + fi + ;; +esac # # Loop over the main menu until we've accomplished what we came here to do From owner-svn-src-all@freebsd.org Sun Jul 30 23:35:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A668DC4B11; Sun, 30 Jul 2017 23:35:23 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D192C849F5; Sun, 30 Jul 2017 23:35:22 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6UNZLMX007416; Sun, 30 Jul 2017 23:35:21 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6UNZL7x007411; Sun, 30 Jul 2017 23:35:21 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201707302335.v6UNZL7x007411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 30 Jul 2017 23:35:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321735 - in head/sys/dev/rtwn: . usb X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in head/sys/dev/rtwn: . usb X-SVN-Commit-Revision: 321735 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.23 Precedence: list List-Id: "SVN commit messages 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, 30 Jul 2017 23:35:23 -0000 Author: avos Date: Sun Jul 30 23:35:21 2017 New Revision: 321735 URL: https://svnweb.freebsd.org/changeset/base/321735 Log: rtwn_usb: add support for fragmented Rx. Since device can pass multiple frames in a single payload temporary Rx buffer was big enough to hold all of them; now the driver can concatenate a single frame from multiple payloads. The Rx buffer size may be configured via tunable (dev.rtwn.%d.rx_buf_size). Tested with: - rtl8188cus, rtl8188eu and rtl8821au (STA mode). - (by kevlo) rtl8192cu and rtl8188eu. PR: 218527 Reviewed by: kevlo Differential Revision: https://reviews.freebsd.org/D11705 Modified: head/sys/dev/rtwn/if_rtwnreg.h head/sys/dev/rtwn/usb/rtwn_usb_attach.c head/sys/dev/rtwn/usb/rtwn_usb_ep.c head/sys/dev/rtwn/usb/rtwn_usb_rx.c head/sys/dev/rtwn/usb/rtwn_usb_var.h Modified: head/sys/dev/rtwn/if_rtwnreg.h ============================================================================== --- head/sys/dev/rtwn/if_rtwnreg.h Sun Jul 30 23:15:30 2017 (r321734) +++ head/sys/dev/rtwn/if_rtwnreg.h Sun Jul 30 23:35:21 2017 (r321735) @@ -18,6 +18,9 @@ * $FreeBSD$ */ +#ifndef IF_RTWNREG_H +#define IF_RTWNREG_H + #define R92C_MIN_TX_PWR 0x00 #define R92C_MAX_TX_PWR 0x3f @@ -165,3 +168,5 @@ rtwn_chan2centieee(const struct ieee80211_channel *c) return (chan); } + +#endif /* IF_RTWNREG_H */ Modified: head/sys/dev/rtwn/usb/rtwn_usb_attach.c ============================================================================== --- head/sys/dev/rtwn/usb/rtwn_usb_attach.c Sun Jul 30 23:15:30 2017 (r321734) +++ head/sys/dev/rtwn/usb/rtwn_usb_attach.c Sun Jul 30 23:35:21 2017 (r321735) @@ -77,12 +77,14 @@ static void rtwn_usb_reset_lists(struct rtwn_softc *, struct ieee80211vap *); static void rtwn_usb_reset_tx_list(struct rtwn_usb_softc *, rtwn_datahead *, struct ieee80211vap *); +static void rtwn_usb_reset_rx_list(struct rtwn_usb_softc *); static void rtwn_usb_start_xfers(struct rtwn_softc *); static void rtwn_usb_abort_xfers(struct rtwn_softc *); static int rtwn_usb_fw_write_block(struct rtwn_softc *, const uint8_t *, uint16_t, int); static void rtwn_usb_drop_incorrect_tx(struct rtwn_softc *); static void rtwn_usb_attach_methods(struct rtwn_softc *); +static void rtwn_usb_sysctlattach(struct rtwn_softc *); #define RTWN_CONFIG_INDEX 0 @@ -133,9 +135,8 @@ rtwn_usb_alloc_rx_list(struct rtwn_softc *sc) struct rtwn_usb_softc *uc = RTWN_USB_SOFTC(sc); int error, i; - /* XXX recheck */ error = rtwn_usb_alloc_list(sc, uc->uc_rx, RTWN_USB_RX_LIST_COUNT, - sc->rx_dma_size + 1024); + uc->uc_rx_buf_size * RTWN_USB_RXBUFSZ_UNIT); if (error != 0) return (error); @@ -199,6 +200,9 @@ rtwn_usb_free_rx_list(struct rtwn_softc *sc) rtwn_usb_free_list(sc, uc->uc_rx, RTWN_USB_RX_LIST_COUNT); + uc->uc_rx_stat_len = 0; + uc->uc_rx_off = 0; + STAILQ_INIT(&uc->uc_rx_active); STAILQ_INIT(&uc->uc_rx_inactive); } @@ -224,8 +228,10 @@ rtwn_usb_reset_lists(struct rtwn_softc *sc, struct iee rtwn_usb_reset_tx_list(uc, &uc->uc_tx_active, vap); rtwn_usb_reset_tx_list(uc, &uc->uc_tx_pending, vap); - if (vap == NULL) + if (vap == NULL) { + rtwn_usb_reset_rx_list(uc); sc->qfullmsk = 0; + } } static void @@ -259,6 +265,23 @@ rtwn_usb_reset_tx_list(struct rtwn_usb_softc *uc, } static void +rtwn_usb_reset_rx_list(struct rtwn_usb_softc *uc) +{ + int i; + + for (i = 0; i < RTWN_USB_RX_LIST_COUNT; i++) { + struct rtwn_data *dp = &uc->uc_rx[i]; + + if (dp->m != NULL) { + m_freem(dp->m); + dp->m = NULL; + } + } + uc->uc_rx_stat_len = 0; + uc->uc_rx_off = 0; +} + +static void rtwn_usb_start_xfers(struct rtwn_softc *sc) { struct rtwn_usb_softc *uc = RTWN_USB_SOFTC(sc); @@ -327,6 +350,31 @@ rtwn_usb_attach_methods(struct rtwn_softc *sc) sc->bcn_check_interval = 100; } +static void +rtwn_usb_sysctlattach(struct rtwn_softc *sc) +{ + struct rtwn_usb_softc *uc = RTWN_USB_SOFTC(sc); + struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(sc->sc_dev); + struct sysctl_oid *tree = device_get_sysctl_tree(sc->sc_dev); + char str[64]; + int ret; + + ret = snprintf(str, sizeof(str), + "Rx buffer size, 512-byte units [%d...%d]", + RTWN_USB_RXBUFSZ_MIN, RTWN_USB_RXBUFSZ_MAX); + KASSERT(ret > 0, ("ret (%d) <= 0!\n", ret)); + (void) ret; + + uc->uc_rx_buf_size = RTWN_USB_RXBUFSZ_DEF; + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "rx_buf_size", CTLFLAG_RDTUN, &uc->uc_rx_buf_size, + uc->uc_rx_buf_size, str); + if (uc->uc_rx_buf_size < RTWN_USB_RXBUFSZ_MIN) + uc->uc_rx_buf_size = RTWN_USB_RXBUFSZ_MIN; + if (uc->uc_rx_buf_size > RTWN_USB_RXBUFSZ_MAX) + uc->uc_rx_buf_size = RTWN_USB_RXBUFSZ_MAX; +} + static int rtwn_usb_attach(device_t self) { @@ -343,6 +391,7 @@ rtwn_usb_attach(device_t self) /* Need to be initialized early. */ rtwn_sysctlattach(sc); + rtwn_usb_sysctlattach(sc); mtx_init(&sc->sc_mtx, ic->ic_name, MTX_NETWORK_LOCK, MTX_DEF); rtwn_usb_attach_methods(sc); Modified: head/sys/dev/rtwn/usb/rtwn_usb_ep.c ============================================================================== --- head/sys/dev/rtwn/usb/rtwn_usb_ep.c Sun Jul 30 23:15:30 2017 (r321734) +++ head/sys/dev/rtwn/usb/rtwn_usb_ep.c Sun Jul 30 23:35:21 2017 (r321735) @@ -225,7 +225,8 @@ rtwn_usb_setup_endpoints(struct rtwn_usb_softc *uc) break; } - rtwn_config[RTWN_BULK_RX].bufsize = sc->rx_dma_size + 1024; + rtwn_config[RTWN_BULK_RX].bufsize = + uc->uc_rx_buf_size * RTWN_USB_RXBUFSZ_UNIT; error = usbd_transfer_setup(uc->uc_udev, &iface_index, uc->uc_xfer, rtwn_config, RTWN_N_TRANSFER, uc, &sc->sc_mtx); free(rtwn_config, M_TEMP); Modified: head/sys/dev/rtwn/usb/rtwn_usb_rx.c ============================================================================== --- head/sys/dev/rtwn/usb/rtwn_usb_rx.c Sun Jul 30 23:15:30 2017 (r321734) +++ head/sys/dev/rtwn/usb/rtwn_usb_rx.c Sun Jul 30 23:35:21 2017 (r321735) @@ -63,31 +63,24 @@ __FBSDID("$FreeBSD$"); #include #include +static struct mbuf * rtwn_rxeof(struct rtwn_softc *, struct rtwn_data *, + uint8_t *, int); -static struct mbuf * -rtwn_rx_copy_to_mbuf(struct rtwn_softc *sc, struct rtwn_rx_stat_common *stat, - int totlen) +static int +rtwn_rx_check_pre_alloc(struct rtwn_softc *sc, + struct rtwn_rx_stat_common *stat) { - struct ieee80211com *ic = &sc->sc_ic; - struct mbuf *m; uint32_t rxdw0; int pktlen; RTWN_ASSERT_LOCKED(sc); - /* Dump Rx descriptor. */ - RTWN_DPRINTF(sc, RTWN_DEBUG_RECV_DESC, - "%s: dw: 0 %08X, 1 %08X, 2 %08X, 3 %08X, 4 %08X, tsfl %08X\n", - __func__, le32toh(stat->rxdw0), le32toh(stat->rxdw1), - le32toh(stat->rxdw2), le32toh(stat->rxdw3), le32toh(stat->rxdw4), - le32toh(stat->tsf_low)); - /* * don't pass packets to the ieee80211 framework if the driver isn't * RUNNING. */ if (!(sc->sc_flags & RTWN_RUNNING)) - return (NULL); + return (-1); rxdw0 = le32toh(stat->rxdw0); if (__predict_false(rxdw0 & (RTWN_RXDW0_CRCERR | RTWN_RXDW0_ICVERR))) { @@ -98,7 +91,7 @@ rtwn_rx_copy_to_mbuf(struct rtwn_softc *sc, struct rtw RTWN_DPRINTF(sc, RTWN_DEBUG_RECV, "%s: RX flags error (%s)\n", __func__, rxdw0 & RTWN_RXDW0_CRCERR ? "CRC" : "ICV"); - goto fail; + return (-1); } pktlen = MS(rxdw0, RTWN_RXDW0_PKTLEN); @@ -108,9 +101,31 @@ rtwn_rx_copy_to_mbuf(struct rtwn_softc *sc, struct rtw */ RTWN_DPRINTF(sc, RTWN_DEBUG_RECV, "%s: frame is too short: %d\n", __func__, pktlen); - goto fail; + return (-1); } + return (0); +} + +static struct mbuf * +rtwn_rx_copy_to_mbuf(struct rtwn_softc *sc, struct rtwn_rx_stat_common *stat, + int totlen) +{ + struct ieee80211com *ic = &sc->sc_ic; + struct mbuf *m; + + RTWN_ASSERT_LOCKED(sc); + + /* Dump Rx descriptor. */ + RTWN_DPRINTF(sc, RTWN_DEBUG_RECV_DESC, + "%s: dw: 0 %08X, 1 %08X, 2 %08X, 3 %08X, 4 %08X, tsfl %08X\n", + __func__, le32toh(stat->rxdw0), le32toh(stat->rxdw1), + le32toh(stat->rxdw2), le32toh(stat->rxdw3), le32toh(stat->rxdw4), + le32toh(stat->tsf_low)); + + if (rtwn_rx_check_pre_alloc(sc, stat) != 0) + goto fail; + m = m_get2(totlen, M_NOWAIT, MT_DATA, M_PKTHDR); if (__predict_false(m == NULL)) { device_printf(sc->sc_dev, "%s: could not allocate RX mbuf\n", @@ -134,14 +149,108 @@ fail: } static struct mbuf * -rtwn_rxeof(struct rtwn_softc *sc, uint8_t *buf, int len) +rtwn_rxeof_fragmented(struct rtwn_usb_softc *uc, struct rtwn_data *data, + uint8_t *buf, int len) { + struct rtwn_softc *sc = &uc->uc_sc; + struct ieee80211com *ic = &sc->sc_ic; + struct rtwn_rx_stat_common *stat = &uc->uc_rx_stat; + uint32_t rxdw0; + int totlen, pktlen, infosz, min_len; + int orig_len = len; + int alloc_mbuf = 0; + + /* Check if Rx descriptor is not truncated. */ + if (uc->uc_rx_stat_len < sizeof(*stat)) { + min_len = min(sizeof(*stat) - uc->uc_rx_stat_len, len); + memcpy((uint8_t *)stat + uc->uc_rx_stat_len, buf, min_len); + + uc->uc_rx_stat_len += min_len; + buf += min_len; + len -= min_len; + + if (uc->uc_rx_stat_len < sizeof(*stat)) + goto end; + + KASSERT(data->m == NULL, ("%s: data->m != NULL!\n", __func__)); + alloc_mbuf = 1; + + /* Dump Rx descriptor. */ + RTWN_DPRINTF(sc, RTWN_DEBUG_RECV_DESC, + "%s: dw: 0 %08X, 1 %08X, 2 %08X, 3 %08X, 4 %08X, " + "tsfl %08X\n", __func__, le32toh(stat->rxdw0), + le32toh(stat->rxdw1), le32toh(stat->rxdw2), + le32toh(stat->rxdw3), le32toh(stat->rxdw4), + le32toh(stat->tsf_low)); + } + + rxdw0 = le32toh(stat->rxdw0); + pktlen = MS(rxdw0, RTWN_RXDW0_PKTLEN); + infosz = MS(rxdw0, RTWN_RXDW0_INFOSZ) * 8; + totlen = sizeof(*stat) + infosz + pktlen; + if (alloc_mbuf) { + if (rtwn_rx_check_pre_alloc(sc, stat) == 0) { + data->m = m_getm(NULL, totlen, M_NOWAIT, MT_DATA); + if (data->m != NULL) { + m_copyback(data->m, 0, uc->uc_rx_stat_len, + (caddr_t)stat); + + if (rtwn_check_frame(sc, data->m) != 0) { + m_freem(data->m); + data->m = NULL; + counter_u64_add(ic->ic_ierrors, 1); + } + } else + counter_u64_add(ic->ic_ierrors, 1); + } else + counter_u64_add(ic->ic_ierrors, 1); + + uc->uc_rx_off = sizeof(*stat); + } + + /* If mbuf allocation fails just discard the data. */ + min_len = min(totlen - uc->uc_rx_off, len); + if (data->m != NULL) + m_copyback(data->m, uc->uc_rx_off, min_len, buf); + + uc->uc_rx_off += min_len; + if (uc->uc_rx_off == totlen) { + /* Align next frame. */ + min_len = rtwn_usb_align_rx(uc, + orig_len - len + min_len, orig_len); + min_len -= (orig_len - len); + KASSERT(len >= min_len, ("%s: len (%d) < min_len (%d)!\n", + __func__, len, min_len)); + + /* Clear mbuf stats. */ + uc->uc_rx_stat_len = 0; + uc->uc_rx_off = 0; + } + len -= min_len; + buf += min_len; +end: + if (uc->uc_rx_stat_len == 0) + return (rtwn_rxeof(sc, data, buf, len)); + else + return (NULL); +} + +static struct mbuf * +rtwn_rxeof(struct rtwn_softc *sc, struct rtwn_data *data, uint8_t *buf, + int len) +{ struct rtwn_usb_softc *uc = RTWN_USB_SOFTC(sc); struct rtwn_rx_stat_common *stat; struct mbuf *m, *m0 = NULL; uint32_t rxdw0; int totlen, pktlen, infosz; + /* Prepend defragmented frame (if any). */ + if (data->m != NULL) { + m0 = m = data->m; + data->m = NULL; + } + /* Process packets. */ while (len >= sizeof(*stat)) { stat = (struct rtwn_rx_stat_common *)buf; @@ -156,8 +265,8 @@ rtwn_rxeof(struct rtwn_softc *sc, uint8_t *buf, int le /* Make sure everything fits in xfer. */ totlen = sizeof(*stat) + infosz + pktlen; if (totlen > len) { - device_printf(sc->sc_dev, - "%s: totlen (%d) > len (%d)!\n", + RTWN_DPRINTF(sc, RTWN_DEBUG_RECV, + "%s: frame is fragmented (totlen %d len %d)\n", __func__, totlen, len); break; } @@ -165,9 +274,9 @@ rtwn_rxeof(struct rtwn_softc *sc, uint8_t *buf, int le if (m0 == NULL) m0 = m = rtwn_rx_copy_to_mbuf(sc, stat, totlen); else { - m->m_next = rtwn_rx_copy_to_mbuf(sc, stat, totlen); - if (m->m_next != NULL) - m = m->m_next; + m->m_nextpkt = rtwn_rx_copy_to_mbuf(sc, stat, totlen); + if (m->m_nextpkt != NULL) + m = m->m_nextpkt; } /* Align next frame. */ @@ -176,6 +285,9 @@ rtwn_rxeof(struct rtwn_softc *sc, uint8_t *buf, int le len -= totlen; } + if (len > 0) + (void)rtwn_rxeof_fragmented(uc, data, buf, len); + return (m0); } @@ -190,15 +302,19 @@ rtwn_report_intr(struct rtwn_usb_softc *uc, struct usb usbd_xfer_status(xfer, &len, NULL, NULL, NULL); - if (__predict_false(len < sizeof(struct rtwn_rx_stat_common))) { + if (__predict_false(len < sizeof(struct rtwn_rx_stat_common) && + uc->uc_rx_stat_len == 0)) { counter_u64_add(ic->ic_ierrors, 1); return (NULL); } buf = data->buf; + if (uc->uc_rx_stat_len > 0) + return (rtwn_rxeof_fragmented(uc, data, data->buf, len)); + switch (rtwn_classify_intr(sc, buf, len)) { case RTWN_RX_DATA: - return (rtwn_rxeof(sc, buf, len)); + return (rtwn_rxeof(sc, data, buf, len)); case RTWN_RX_TX_REPORT: if (sc->sc_ratectl != RTWN_RATECTL_NET80211) { /* shouldn't happen */ @@ -284,8 +400,8 @@ tr_setup: * callback and safe to unlock. */ while (m != NULL) { - next = m->m_next; - m->m_next = NULL; + next = m->m_nextpkt; + m->m_nextpkt = NULL; ni = rtwn_rx_frame(sc, m); @@ -309,6 +425,8 @@ tr_setup: STAILQ_INSERT_TAIL(&uc->uc_rx_inactive, data, next); } if (error != USB_ERR_CANCELLED) { + /* XXX restart device if frame was fragmented? */ + usbd_xfer_set_stall(xfer); counter_u64_add(ic->ic_ierrors, 1); goto tr_setup; Modified: head/sys/dev/rtwn/usb/rtwn_usb_var.h ============================================================================== --- head/sys/dev/rtwn/usb/rtwn_usb_var.h Sun Jul 30 23:15:30 2017 (r321734) +++ head/sys/dev/rtwn/usb/rtwn_usb_var.h Sun Jul 30 23:35:21 2017 (r321735) @@ -21,6 +21,12 @@ #ifndef RTWN_USBVAR_H #define RTWN_USBVAR_H +#include /* for struct rtwn_rx_stat_common */ + +#define RTWN_USB_RXBUFSZ_UNIT (512) +#define RTWN_USB_RXBUFSZ_MIN ( 4) +#define RTWN_USB_RXBUFSZ_DEF (24) +#define RTWN_USB_RXBUFSZ_MAX (64) #define RTWN_USB_TXBUFSZ (16 * 1024) #define RTWN_IFACE_INDEX 0 @@ -58,6 +64,12 @@ struct rtwn_usb_softc { struct rtwn_data uc_rx[RTWN_USB_RX_LIST_COUNT]; rtwn_datahead uc_rx_active; rtwn_datahead uc_rx_inactive; + int uc_rx_buf_size; + + struct rtwn_rx_stat_common uc_rx_stat; + int uc_rx_stat_len; + int uc_rx_off; + struct rtwn_data uc_tx[RTWN_USB_TX_LIST_COUNT]; rtwn_datahead uc_tx_active; rtwn_datahead uc_tx_inactive; From owner-svn-src-all@freebsd.org Mon Jul 31 00:03:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 050DFDC554A; Mon, 31 Jul 2017 00:03:44 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C62B877B; Mon, 31 Jul 2017 00:03:43 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6V03gD2019540; Mon, 31 Jul 2017 00:03:42 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V03gNe019539; Mon, 31 Jul 2017 00:03:42 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201707310003.v6V03gNe019539@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 31 Jul 2017 00:03:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321736 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 321736 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 00:03:44 -0000 Author: avos Date: Mon Jul 31 00:03:42 2017 New Revision: 321736 URL: https://svnweb.freebsd.org/changeset/base/321736 Log: rtwn(4): refresh manpage - Remove 'if_rtwn_load="YES"' line from loader.conf; the module was renamed in r319733 + it will be loaded automatically as a dependency. - Move new sentence to new line. - Add short description for dev.rtwn.%d.rx_buf_size tunable. Modified: head/share/man/man4/rtwn.4 Modified: head/share/man/man4/rtwn.4 ============================================================================== --- head/share/man/man4/rtwn.4 Sun Jul 30 23:35:21 2017 (r321735) +++ head/share/man/man4/rtwn.4 Mon Jul 31 00:03:42 2017 (r321736) @@ -18,7 +18,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 24, 2017 +.Dd July 31, 2017 .Dt RTWN 4 .Os .Sh NAME @@ -44,7 +44,6 @@ Alternatively, to load the driver as a module at boot time, place following lines in .Xr loader.conf 5 : .Bd -literal -offset indent -if_rtwn_load="YES" if_rtwn_pci_load="YES" if_rtwn_usb_load="YES" .Ed @@ -53,7 +52,8 @@ The .Nm driver provides support for wireless network devices based on the Realtek RTL8192C, RTL8188E, RTL8192E, RTL8812A and RTL8821A -programming APIs. These APIs are used by a wide variety of chips; +programming APIs. +These APIs are used by a wide variety of chips; most chips with USB and some with PCI interface are supported. .Pp To enable use for PCI/PCIe systems, see the rtwn_pci(4) driver; @@ -175,6 +175,9 @@ algorithm in case if it is not implemented Currently selected algorithm is reported via .Em Va dev.rtwn.%d.ratectl_selected read-only OID. +.It Va dev.rtwn.%d.rx_buf_size +(USB only) Controls size of temporary Rx buffer; smaller buffer size +may increase number of interrupts. .El .Sh DIAGNOSTICS .Bl -diag From owner-svn-src-all@freebsd.org Mon Jul 31 00:05:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06D09DC56CE; Mon, 31 Jul 2017 00:05:51 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5961959; Mon, 31 Jul 2017 00:05:50 +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 v6V05ogO019658; Mon, 31 Jul 2017 00:05:50 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V05omg019657; Mon, 31 Jul 2017 00:05:50 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201707310005.v6V05omg019657@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Mon, 31 Jul 2017 00:05:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321737 - head/sys/dev/mpr X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: head/sys/dev/mpr X-SVN-Commit-Revision: 321737 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 00:05:51 -0000 Author: scottl Date: Mon Jul 31 00:05:49 2017 New Revision: 321737 URL: https://svnweb.freebsd.org/changeset/base/321737 Log: Don't re-parse PCI IDs in order to set card-specific flags, use the flags field in the PCIID table. Modified: head/sys/dev/mpr/mpr_pci.c Modified: head/sys/dev/mpr/mpr_pci.c ============================================================================== --- head/sys/dev/mpr/mpr_pci.c Mon Jul 31 00:03:42 2017 (r321736) +++ head/sys/dev/mpr/mpr_pci.c Mon Jul 31 00:05:49 2017 (r321737) @@ -125,23 +125,32 @@ struct mpr_ident { { MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_SAS3324_2, 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS3324_2" }, { MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_SAS3408, - 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS3408" }, + 0xffff, 0xffff, MPR_FLAGS_GEN35_IOC, + "Avago Technologies (LSI) SAS3408" }, { MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_SAS3416, - 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS3416" }, + 0xffff, 0xffff, MPR_FLAGS_GEN35_IOC, + "Avago Technologies (LSI) SAS3416" }, { MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_SAS3508, - 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS3508" }, + 0xffff, 0xffff, MPR_FLAGS_GEN35_IOC, + "Avago Technologies (LSI) SAS3508" }, { MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_SAS3508_1, - 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS3508_1" }, + 0xffff, 0xffff, MPR_FLAGS_GEN35_IOC, + "Avago Technologies (LSI) SAS3508_1" }, { MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_SAS3516, - 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS3516" }, + 0xffff, 0xffff, MPR_FLAGS_GEN35_IOC, + "Avago Technologies (LSI) SAS3516" }, { MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_SAS3516_1, - 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS3516_1" }, + 0xffff, 0xffff, MPR_FLAGS_GEN35_IOC, + "Avago Technologies (LSI) SAS3516_1" }, { MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_SAS3616, - 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS3616" }, + 0xffff, 0xffff, MPR_FLAGS_GEN35_IOC, + "Avago Technologies (LSI) SAS3616" }, { MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_SAS3708, - 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS3708" }, + 0xffff, 0xffff, MPR_FLAGS_GEN35_IOC, + "Avago Technologies (LSI) SAS3708" }, { MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_SAS3716, - 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS3716" }, + 0xffff, 0xffff, MPR_FLAGS_GEN35_IOC, + "Avago Technologies (LSI) SAS3716" }, { 0, 0, 0, 0, 0, NULL } }; @@ -196,19 +205,6 @@ mpr_pci_attach(device_t dev) /* Twiddle basic PCI config bits for a sanity check */ pci_enable_busmaster(dev); - - /* Set flag if this is a Gen3.5 IOC */ - if ((m->device == MPI26_MFGPAGE_DEVID_SAS3508) || - (m->device == MPI26_MFGPAGE_DEVID_SAS3508_1) || - (m->device == MPI26_MFGPAGE_DEVID_SAS3408) || - (m->device == MPI26_MFGPAGE_DEVID_SAS3516) || - (m->device == MPI26_MFGPAGE_DEVID_SAS3516_1) || - (m->device == MPI26_MFGPAGE_DEVID_SAS3416) || - (m->device == MPI26_MFGPAGE_DEVID_SAS3716) || - (m->device == MPI26_MFGPAGE_DEVID_SAS3616) || - (m->device == MPI26_MFGPAGE_DEVID_SAS3708)) { - sc->mpr_flags |= MPR_FLAGS_GEN35_IOC; - } for (i = 0; i < PCI_MAXMAPS_0; i++) { sc->mpr_regs_rid = PCIR_BAR(i); From owner-svn-src-all@freebsd.org Mon Jul 31 00:34:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91D9DDC5C5E; Mon, 31 Jul 2017 00:34:37 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 609491450; Mon, 31 Jul 2017 00:34:37 +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 v6V0YaZw031796; Mon, 31 Jul 2017 00:34:36 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V0Ya5u031795; Mon, 31 Jul 2017 00:34:36 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201707310034.v6V0Ya5u031795@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 31 Jul 2017 00:34:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321738 - stable/11/sbin/savecore X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sbin/savecore X-SVN-Commit-Revision: 321738 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 00:34:37 -0000 Author: markj Date: Mon Jul 31 00:34:36 2017 New Revision: 321738 URL: https://svnweb.freebsd.org/changeset/base/321738 Log: MFC r321437: Fix style and wrap lines to 80 columns in savecore.c. Modified: stable/11/sbin/savecore/savecore.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/savecore/savecore.c ============================================================================== --- stable/11/sbin/savecore/savecore.c Mon Jul 31 00:05:49 2017 (r321737) +++ stable/11/sbin/savecore/savecore.c Mon Jul 31 00:34:36 2017 (r321738) @@ -101,30 +101,39 @@ static sig_atomic_t got_siginfo; static void infohandler(int); static void -printheader(xo_handle_t *xo, const struct kerneldumpheader *h, const char *device, - int bounds, const int status) +printheader(xo_handle_t *xo, const struct kerneldumpheader *h, + const char *device, int bounds, const int status) { uint64_t dumplen; time_t t; const char *stat_str; xo_flush_h(xo); - xo_emit_h(xo, "{Lwc:Dump header from device}{:dump_device/%s}\n", device); - xo_emit_h(xo, "{P: }{Lwc:Architecture}{:architecture/%s}\n", h->architecture); - xo_emit_h(xo, "{P: }{Lwc:Architecture Version}{:architecture_version/%u}\n", dtoh32(h->architectureversion)); + xo_emit_h(xo, "{Lwc:Dump header from device}{:dump_device/%s}\n", + device); + xo_emit_h(xo, "{P: }{Lwc:Architecture}{:architecture/%s}\n", + h->architecture); + xo_emit_h(xo, + "{P: }{Lwc:Architecture Version}{:architecture_version/%u}\n", + dtoh32(h->architectureversion)); dumplen = dtoh64(h->dumplength); - xo_emit_h(xo, "{P: }{Lwc:Dump Length}{:dump_length_bytes/%lld}\n", (long long)dumplen); - xo_emit_h(xo, "{P: }{Lwc:Blocksize}{:blocksize/%d}\n", dtoh32(h->blocksize)); + xo_emit_h(xo, "{P: }{Lwc:Dump Length}{:dump_length_bytes/%lld}\n", + (long long)dumplen); + xo_emit_h(xo, "{P: }{Lwc:Blocksize}{:blocksize/%d}\n", + dtoh32(h->blocksize)); + t = dtoh64(h->dumptime); xo_emit_h(xo, "{P: }{Lwc:Dumptime}{:dumptime/%s}", ctime(&t)); xo_emit_h(xo, "{P: }{Lwc:Hostname}{:hostname/%s}\n", h->hostname); xo_emit_h(xo, "{P: }{Lwc:Magic}{:magic/%s}\n", h->magic); - xo_emit_h(xo, "{P: }{Lwc:Version String}{:version_string/%s}", h->versionstring); - xo_emit_h(xo, "{P: }{Lwc:Panic String}{:panic_string/%s}\n", h->panicstring); + xo_emit_h(xo, "{P: }{Lwc:Version String}{:version_string/%s}", + h->versionstring); + xo_emit_h(xo, "{P: }{Lwc:Panic String}{:panic_string/%s}\n", + h->panicstring); xo_emit_h(xo, "{P: }{Lwc:Dump Parity}{:dump_parity/%u}\n", h->parity); xo_emit_h(xo, "{P: }{Lwc:Bounds}{:bounds/%d}\n", bounds); - switch(status) { + switch (status) { case STATUS_BAD: stat_str = "bad"; break; @@ -133,13 +142,15 @@ printheader(xo_handle_t *xo, const struct kerneldumphe break; default: stat_str = "unknown"; + break; } xo_emit_h(xo, "{P: }{Lwc:Dump Status}{:dump_status/%s}\n", stat_str); xo_flush_h(xo); } static int -getbounds(void) { +getbounds(void) +{ FILE *fp; char buf[6]; int ret; @@ -170,7 +181,8 @@ getbounds(void) { } static void -writebounds(int bounds) { +writebounds(int bounds) +{ FILE *fp; if ((fp = fopen("bounds", "w")) == NULL) { @@ -372,8 +384,8 @@ DoRegularFile(int fd, off_t dumpsize, char *buf, const /* * At this point, we have a partial ordering: * nw <= hs <= he <= nr - * If hs > nw, buf[nw..hs] contains non-zero data. - * If he > hs, buf[hs..he] is all zeroes. + * If hs > nw, buf[nw..hs] contains non-zero + * data. If he > hs, buf[hs..he] is all zeroes. */ if (hs > nw) if (fwrite(buf + nw, hs - nw, 1, fp) @@ -675,7 +687,7 @@ DoFile(const char *savedir, const char *device) goto closefd; } - oumask = umask(S_IRWXG|S_IRWXO); /* Restrict access to the core file.*/ + oumask = umask(S_IRWXG|S_IRWXO); /* Restrict access to the core file. */ if (compress) { snprintf(corename, sizeof(corename), "%s.%d.gz", istextdump ? "textdump.tar" : "vmcore", bounds); @@ -889,7 +901,8 @@ main(int argc, char **argv) } else if (nsaved == 0) { if (nerr != 0) { if (verbose) - syslog(LOG_WARNING, "unsaved dumps found but not saved"); + syslog(LOG_WARNING, + "unsaved dumps found but not saved"); exit(1); } else if (verbose) syslog(LOG_WARNING, "no unsaved dumps found"); From owner-svn-src-all@freebsd.org Mon Jul 31 00:35:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76477DC5CC4; Mon, 31 Jul 2017 00:35:22 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 42F6C15C8; Mon, 31 Jul 2017 00:35:22 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6V0ZL6E031886; Mon, 31 Jul 2017 00:35:21 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V0ZLik031885; Mon, 31 Jul 2017 00:35:21 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201707310035.v6V0ZLik031885@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 31 Jul 2017 00:35:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321739 - stable/11/sys/dev/ksyms X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/dev/ksyms X-SVN-Commit-Revision: 321739 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 00:35:22 -0000 Author: markj Date: Mon Jul 31 00:35:21 2017 New Revision: 321739 URL: https://svnweb.freebsd.org/changeset/base/321739 Log: MFC r321639: Restrict permissions on /dev/ksyms to 0400. Modified: stable/11/sys/dev/ksyms/ksyms.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ksyms/ksyms.c ============================================================================== --- stable/11/sys/dev/ksyms/ksyms.c Mon Jul 31 00:34:36 2017 (r321738) +++ stable/11/sys/dev/ksyms/ksyms.c Mon Jul 31 00:35:21 2017 (r321739) @@ -592,7 +592,7 @@ ksyms_modevent(module_t mod __unused, int type, void * case MOD_LOAD: mtx_init(&ksyms_mtx, "KSyms mtx", NULL, MTX_DEF); ksyms_dev = make_dev(&ksyms_cdevsw, 0, UID_ROOT, GID_WHEEL, - 0444, KSYMS_DNAME); + 0400, KSYMS_DNAME); break; case MOD_UNLOAD: From owner-svn-src-all@freebsd.org Mon Jul 31 00:39:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27390DC5D46; Mon, 31 Jul 2017 00:39:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DAE53171D; Mon, 31 Jul 2017 00:39:23 +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 v6V0dNSA032071; Mon, 31 Jul 2017 00:39:23 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V0dN8J032070; Mon, 31 Jul 2017 00:39:23 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201707310039.v6V0dN8J032070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 31 Jul 2017 00:39:23 +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: r321740 - stable/10/sys/dev/ksyms X-SVN-Group: stable-10 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/10/sys/dev/ksyms X-SVN-Commit-Revision: 321740 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 00:39:24 -0000 Author: markj Date: Mon Jul 31 00:39:22 2017 New Revision: 321740 URL: https://svnweb.freebsd.org/changeset/base/321740 Log: MFC r321639: Restrict permissions on /dev/ksyms to 0400. Modified: stable/10/sys/dev/ksyms/ksyms.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ksyms/ksyms.c ============================================================================== --- stable/10/sys/dev/ksyms/ksyms.c Mon Jul 31 00:35:21 2017 (r321739) +++ stable/10/sys/dev/ksyms/ksyms.c Mon Jul 31 00:39:22 2017 (r321740) @@ -592,7 +592,7 @@ ksyms_modevent(module_t mod __unused, int type, void * case MOD_LOAD: mtx_init(&ksyms_mtx, "KSyms mtx", NULL, MTX_DEF); ksyms_dev = make_dev(&ksyms_cdevsw, 0, UID_ROOT, GID_WHEEL, - 0444, KSYMS_DNAME); + 0400, KSYMS_DNAME); break; case MOD_UNLOAD: From owner-svn-src-all@freebsd.org Mon Jul 31 00:40:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52EA8DC5DC5; Mon, 31 Jul 2017 00:40:15 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C1FD1883; Mon, 31 Jul 2017 00:40:15 +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 v6V0eEJI032182; Mon, 31 Jul 2017 00:40:14 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V0eEQV032181; Mon, 31 Jul 2017 00:40:14 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201707310040.v6V0eEQV032181@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 31 Jul 2017 00:40:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321741 - stable/11/sys/dev/ksyms X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/dev/ksyms X-SVN-Commit-Revision: 321741 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 00:40:15 -0000 Author: markj Date: Mon Jul 31 00:40:14 2017 New Revision: 321741 URL: https://svnweb.freebsd.org/changeset/base/321741 Log: MFC r321640: Fix style bugs in ksyms.c. Modified: stable/11/sys/dev/ksyms/ksyms.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ksyms/ksyms.c ============================================================================== --- stable/11/sys/dev/ksyms/ksyms.c Mon Jul 31 00:39:22 2017 (r321740) +++ stable/11/sys/dev/ksyms/ksyms.c Mon Jul 31 00:40:14 2017 (r321741) @@ -62,41 +62,40 @@ #define STR_SYMTAB ".symtab" #define STR_STRTAB ".strtab" -#define STR_SHSTRTAB ".shstrtab" +#define STR_SHSTRTAB ".shstrtab" #define KSYMS_DNAME "ksyms" -static d_open_t ksyms_open; -static d_read_t ksyms_read; -static d_close_t ksyms_close; -static d_ioctl_t ksyms_ioctl; -static d_mmap_t ksyms_mmap; +static d_open_t ksyms_open; +static d_read_t ksyms_read; +static d_close_t ksyms_close; +static d_ioctl_t ksyms_ioctl; +static d_mmap_t ksyms_mmap; static struct cdevsw ksyms_cdevsw = { - .d_version = D_VERSION, - .d_flags = D_TRACKCLOSE, - .d_open = ksyms_open, - .d_close = ksyms_close, - .d_read = ksyms_read, - .d_ioctl = ksyms_ioctl, - .d_mmap = ksyms_mmap, - .d_name = KSYMS_DNAME + .d_version = D_VERSION, + .d_flags = D_TRACKCLOSE, + .d_open = ksyms_open, + .d_close = ksyms_close, + .d_read = ksyms_read, + .d_ioctl = ksyms_ioctl, + .d_mmap = ksyms_mmap, + .d_name = KSYMS_DNAME }; struct ksyms_softc { LIST_ENTRY(ksyms_softc) sc_list; - vm_offset_t sc_uaddr; - size_t sc_usize; + vm_offset_t sc_uaddr; + size_t sc_usize; pmap_t sc_pmap; struct proc *sc_proc; }; -static struct mtx ksyms_mtx; -static struct cdev *ksyms_dev; -static LIST_HEAD(, ksyms_softc) ksyms_list = - LIST_HEAD_INITIALIZER(ksyms_list); +static struct mtx ksyms_mtx; +static struct cdev *ksyms_dev; +static LIST_HEAD(, ksyms_softc) ksyms_list = LIST_HEAD_INITIALIZER(ksyms_list); -static const char ksyms_shstrtab[] = +static const char ksyms_shstrtab[] = "\0" STR_SYMTAB "\0" STR_STRTAB "\0" STR_SHSTRTAB "\0"; struct ksyms_hdr { @@ -106,7 +105,7 @@ struct ksyms_hdr { Elf_Shdr kh_shdr[SHDR_NUM]; char kh_shstrtab[sizeof(ksyms_shstrtab)]; }; - + struct tsizes { size_t ts_symsz; size_t ts_strsz; @@ -123,7 +122,7 @@ static MALLOC_DEFINE(M_KSYMS, "KSYMS", "Kernel Symbol /* * Get the symbol and string table sizes for a kernel module. Add it to the - * running total. + * running total. */ static int ksyms_size_permod(linker_file_t lf, void *arg) @@ -132,35 +131,36 @@ ksyms_size_permod(linker_file_t lf, void *arg) const Elf_Sym *symtab; caddr_t strtab; long syms; - + ts = arg; - + syms = LINKER_SYMTAB_GET(lf, &symtab); ts->ts_symsz += syms * sizeof(Elf_Sym); ts->ts_strsz += LINKER_STRTAB_GET(lf, &strtab); - + return (0); } /* * For kernel module get the symbol and string table sizes, returning the - * totals in *ts. + * totals in *ts. */ -static void +static void ksyms_size_calc(struct tsizes *ts) { + ts->ts_symsz = 0; ts->ts_strsz = 0; - - (void) linker_file_foreach(ksyms_size_permod, ts); + + (void)linker_file_foreach(ksyms_size_permod, ts); } -#define KSYMS_EMIT(src, des, sz) do { \ - copyout(src, (void *)des, sz); \ - des += sz; \ - } while (0) +#define KSYMS_EMIT(src, des, sz) do { \ + copyout(src, (void *)des, sz); \ + des += sz; \ +} while (0) -#define SYMBLKSZ 256 * sizeof (Elf_Sym) +#define SYMBLKSZ (256 * sizeof(Elf_Sym)) /* * For a kernel module, add the symbol and string tables into the @@ -169,6 +169,7 @@ ksyms_size_calc(struct tsizes *ts) static int ksyms_add(linker_file_t lf, void *arg) { + char *buf; struct toffsets *to; const Elf_Sym *symtab; Elf_Sym *symp; @@ -176,43 +177,42 @@ ksyms_add(linker_file_t lf, void *arg) long symsz; size_t strsz, numsyms; linker_symval_t symval; - char *buf; int i, nsyms, len; - + to = arg; - + MOD_SLOCK; numsyms = LINKER_SYMTAB_GET(lf, &symtab); strsz = LINKER_STRTAB_GET(lf, &strtab); symsz = numsyms * sizeof(Elf_Sym); - + buf = malloc(SYMBLKSZ, M_KSYMS, M_WAITOK); - + while (symsz > 0) { len = min(SYMBLKSZ, symsz); bcopy(symtab, buf, len); - /* - * Fix up symbol table for kernel modules: - * string offsets need adjusted + /* + * Fix up symbol table for kernel modules: + * string offsets need adjusted * symbol values made absolute */ symp = (Elf_Sym *) buf; - nsyms = len / sizeof (Elf_Sym); + nsyms = len / sizeof(Elf_Sym); for (i = 0; i < nsyms; i++) { symp[i].st_name += to->to_stridx; - if (lf->id > 1 && LINKER_SYMBOL_VALUES(lf, - (c_linker_sym_t) &symtab[i], &symval) == 0) { - symp[i].st_value = (uintptr_t) symval.value; + if (lf->id > 1 && LINKER_SYMBOL_VALUES(lf, + (c_linker_sym_t)&symtab[i], &symval) == 0) { + symp[i].st_value = (uintptr_t)symval.value; } } - if (len > to->to_resid) { + if (len > to->to_resid) { MOD_SUNLOCK; free(buf, M_KSYMS); return (ENXIO); - } else - to->to_resid -= len; + } + to->to_resid -= len; KSYMS_EMIT(buf, to->to_symoff, len); symtab += nsyms; @@ -220,14 +220,13 @@ ksyms_add(linker_file_t lf, void *arg) } free(buf, M_KSYMS); MOD_SUNLOCK; - + if (strsz > to->to_resid) return (ENXIO); - else - to->to_resid -= strsz; + to->to_resid -= strsz; KSYMS_EMIT(strtab, to->to_stroff, strsz); to->to_stridx += strsz; - + return (0); } @@ -239,16 +238,14 @@ ksyms_add(linker_file_t lf, void *arg) static int ksyms_snapshot(struct tsizes *ts, vm_offset_t uaddr, size_t resid) { - struct ksyms_hdr *hdr; - struct toffsets to; + struct toffsets to; int error = 0; - /* Be kernel stack friendly */ - hdr = malloc(sizeof (*hdr), M_KSYMS, M_WAITOK|M_ZERO); + hdr = malloc(sizeof(*hdr), M_KSYMS, M_WAITOK | M_ZERO); - /* - * Create the ELF header. + /* + * Create the ELF header. */ hdr->kh_ehdr.e_ident[EI_PAD] = 0; hdr->kh_ehdr.e_ident[EI_MAG0] = ELFMAG0; @@ -269,32 +266,32 @@ ksyms_snapshot(struct tsizes *ts, vm_offset_t uaddr, s hdr->kh_ehdr.e_flags = 0; hdr->kh_ehdr.e_ehsize = sizeof(Elf_Ehdr); hdr->kh_ehdr.e_phentsize = sizeof(Elf_Phdr); - hdr->kh_ehdr.e_phnum = 2; /* Text and Data */ + hdr->kh_ehdr.e_phnum = 2; /* Text and Data */ hdr->kh_ehdr.e_shentsize = sizeof(Elf_Shdr); hdr->kh_ehdr.e_shnum = SHDR_NUM; hdr->kh_ehdr.e_shstrndx = SHDR_SHSTRTAB; - /* - * Add both the text and data Program headers. + /* + * Add both the text and data program headers. */ hdr->kh_txtphdr.p_type = PT_LOAD; /* XXX - is there a way to put the actual .text addr/size here? */ - hdr->kh_txtphdr.p_vaddr = 0; - hdr->kh_txtphdr.p_memsz = 0; + hdr->kh_txtphdr.p_vaddr = 0; + hdr->kh_txtphdr.p_memsz = 0; hdr->kh_txtphdr.p_flags = PF_R | PF_X; - + hdr->kh_datphdr.p_type = PT_LOAD; /* XXX - is there a way to put the actual .data addr/size here? */ - hdr->kh_datphdr.p_vaddr = 0; - hdr->kh_datphdr.p_memsz = 0; + hdr->kh_datphdr.p_vaddr = 0; + hdr->kh_datphdr.p_memsz = 0; hdr->kh_datphdr.p_flags = PF_R | PF_W | PF_X; - /* - * Add the Section headers: null, symtab, strtab, shstrtab, + /* + * Add the section headers: null, symtab, strtab, shstrtab. */ /* First section header - null */ - + /* Second section header - symtab */ hdr->kh_shdr[SHDR_SYMTAB].sh_name = 1; /* String offset (skip null) */ hdr->kh_shdr[SHDR_SYMTAB].sh_type = SHT_SYMTAB; @@ -302,31 +299,31 @@ ksyms_snapshot(struct tsizes *ts, vm_offset_t uaddr, s hdr->kh_shdr[SHDR_SYMTAB].sh_addr = 0; hdr->kh_shdr[SHDR_SYMTAB].sh_offset = sizeof(*hdr); hdr->kh_shdr[SHDR_SYMTAB].sh_size = ts->ts_symsz; - hdr->kh_shdr[SHDR_SYMTAB].sh_link = SHDR_STRTAB; - hdr->kh_shdr[SHDR_SYMTAB].sh_info = ts->ts_symsz / sizeof(Elf_Sym); + hdr->kh_shdr[SHDR_SYMTAB].sh_link = SHDR_STRTAB; + hdr->kh_shdr[SHDR_SYMTAB].sh_info = ts->ts_symsz / sizeof(Elf_Sym); hdr->kh_shdr[SHDR_SYMTAB].sh_addralign = sizeof(long); hdr->kh_shdr[SHDR_SYMTAB].sh_entsize = sizeof(Elf_Sym); /* Third section header - strtab */ - hdr->kh_shdr[SHDR_STRTAB].sh_name = 1 + sizeof(STR_SYMTAB); + hdr->kh_shdr[SHDR_STRTAB].sh_name = 1 + sizeof(STR_SYMTAB); hdr->kh_shdr[SHDR_STRTAB].sh_type = SHT_STRTAB; hdr->kh_shdr[SHDR_STRTAB].sh_flags = 0; hdr->kh_shdr[SHDR_STRTAB].sh_addr = 0; - hdr->kh_shdr[SHDR_STRTAB].sh_offset = - hdr->kh_shdr[SHDR_SYMTAB].sh_offset + ts->ts_symsz; + hdr->kh_shdr[SHDR_STRTAB].sh_offset = + hdr->kh_shdr[SHDR_SYMTAB].sh_offset + ts->ts_symsz; hdr->kh_shdr[SHDR_STRTAB].sh_size = ts->ts_strsz; hdr->kh_shdr[SHDR_STRTAB].sh_link = 0; hdr->kh_shdr[SHDR_STRTAB].sh_info = 0; hdr->kh_shdr[SHDR_STRTAB].sh_addralign = sizeof(char); hdr->kh_shdr[SHDR_STRTAB].sh_entsize = 0; - + /* Fourth section - shstrtab */ hdr->kh_shdr[SHDR_SHSTRTAB].sh_name = 1 + sizeof(STR_SYMTAB) + sizeof(STR_STRTAB); hdr->kh_shdr[SHDR_SHSTRTAB].sh_type = SHT_STRTAB; hdr->kh_shdr[SHDR_SHSTRTAB].sh_flags = 0; hdr->kh_shdr[SHDR_SHSTRTAB].sh_addr = 0; - hdr->kh_shdr[SHDR_SHSTRTAB].sh_offset = + hdr->kh_shdr[SHDR_SHSTRTAB].sh_offset = offsetof(struct ksyms_hdr, kh_shstrtab); hdr->kh_shdr[SHDR_SHSTRTAB].sh_size = sizeof(ksyms_shstrtab); hdr->kh_shdr[SHDR_SHSTRTAB].sh_link = 0; @@ -334,9 +331,9 @@ ksyms_snapshot(struct tsizes *ts, vm_offset_t uaddr, s hdr->kh_shdr[SHDR_SHSTRTAB].sh_addralign = 0 /* sizeof(char) */; hdr->kh_shdr[SHDR_SHSTRTAB].sh_entsize = 0; - /* Copy shstrtab into the header */ + /* Copy shstrtab into the header. */ bcopy(ksyms_shstrtab, hdr->kh_shstrtab, sizeof(ksyms_shstrtab)); - + to.to_symoff = uaddr + hdr->kh_shdr[SHDR_SYMTAB].sh_offset; to.to_stroff = uaddr + hdr->kh_shdr[SHDR_STRTAB].sh_offset; to.to_stridx = 0; @@ -346,13 +343,13 @@ ksyms_snapshot(struct tsizes *ts, vm_offset_t uaddr, s } to.to_resid = resid - sizeof(struct ksyms_hdr); - /* Emit Header */ + /* emit header */ copyout(hdr, (void *)uaddr, sizeof(struct ksyms_hdr)); - + free(hdr, M_KSYMS); - /* Add symbol and string tables for each kernelmodule */ - error = linker_file_foreach(ksyms_add, &to); + /* Add symbol and string tables for each kernel module. */ + error = linker_file_foreach(ksyms_add, &to); if (to.to_resid != 0) return (ENXIO); @@ -365,7 +362,7 @@ ksyms_cdevpriv_dtr(void *data) { struct ksyms_softc *sc; - sc = (struct ksyms_softc *)data; + sc = (struct ksyms_softc *)data; mtx_lock(&ksyms_mtx); LIST_REMOVE(sc, sc_list); @@ -373,19 +370,18 @@ ksyms_cdevpriv_dtr(void *data) free(sc, M_KSYMS); } -/* ARGSUSED */ static int ksyms_open(struct cdev *dev, int flags, int fmt __unused, struct thread *td) { struct tsizes ts; + struct ksyms_softc *sc; size_t total_elf_sz; int error, try; - struct ksyms_softc *sc; - - /* - * Limit one open() per process. The process must close() - * before open()'ing again. - */ + + /* + * Limit one open() per process. The process must close() + * before open()'ing again. + */ mtx_lock(&ksyms_mtx); LIST_FOREACH(sc, &ksyms_list, sc_list) { if (sc->sc_proc == td->td_proc) { @@ -394,9 +390,7 @@ ksyms_open(struct cdev *dev, int flags, int fmt __unus } } - sc = (struct ksyms_softc *) malloc(sizeof (*sc), M_KSYMS, - M_NOWAIT|M_ZERO); - + sc = malloc(sizeof(*sc), M_KSYMS, M_NOWAIT | M_ZERO); if (sc == NULL) { mtx_unlock(&ksyms_mtx); return (ENOMEM); @@ -407,41 +401,39 @@ ksyms_open(struct cdev *dev, int flags, int fmt __unus mtx_unlock(&ksyms_mtx); error = devfs_set_cdevpriv(sc, ksyms_cdevpriv_dtr); - if (error) + if (error != 0) goto failed; /* - * MOD_SLOCK doesn't work here (because of a lock reversal with - * KLD_SLOCK). Therefore, simply try upto 3 times to get a "clean" + * MOD_SLOCK doesn't work here (because of a lock reversal with + * KLD_SLOCK). Therefore, simply try up to 3 times to get a "clean" * snapshot of the kernel symbol table. This should work fine in the * rare case of a kernel module being loaded/unloaded at the same - * time. + * time. */ - for(try = 0; try < 3; try++) { + for (try = 0; try < 3; try++) { /* - * Map a buffer in the calling process memory space and - * create a snapshot of the kernel symbol table in it. - */ - + * Map a buffer in the calling process memory space and + * create a snapshot of the kernel symbol table in it. + */ + /* Compute the size of buffer needed. */ ksyms_size_calc(&ts); - total_elf_sz = sizeof(struct ksyms_hdr) + ts.ts_symsz + - ts.ts_strsz; + total_elf_sz = sizeof(struct ksyms_hdr) + ts.ts_symsz + + ts.ts_strsz; - error = copyout_map(td, &(sc->sc_uaddr), - (vm_size_t) total_elf_sz); - if (error) + error = copyout_map(td, &sc->sc_uaddr, (vm_size_t)total_elf_sz); + if (error != 0) break; - sc->sc_usize = total_elf_sz; + sc->sc_usize = total_elf_sz; - error = ksyms_snapshot(&ts, sc->sc_uaddr, total_elf_sz); - if (!error) { - /* Successful Snapshot */ - return (0); - } - - /* Snapshot failed, unmap the memory and try again */ - (void) copyout_unmap(td, sc->sc_uaddr, sc->sc_usize); + error = ksyms_snapshot(&ts, sc->sc_uaddr, total_elf_sz); + if (error == 0) + /* successful snapshot */ + return (0); + + /* Snapshot failed, unmap the memory and try again. */ + (void)copyout_unmap(td, sc->sc_uaddr, sc->sc_usize); } failed: @@ -449,30 +441,28 @@ failed: return (error); } -/* ARGSUSED */ static int ksyms_read(struct cdev *dev, struct uio *uio, int flags __unused) { - int error; - size_t len, sz; struct ksyms_softc *sc; - off_t off; char *buf; + off_t off; + size_t len, sz; vm_size_t ubase; - + int error; + error = devfs_get_cdevpriv((void **)&sc); - if (error) + if (error != 0) return (error); - + off = uio->uio_offset; - len = uio->uio_resid; - + len = uio->uio_resid; + if (off < 0 || off > sc->sc_usize) return (EFAULT); - if (len > (sc->sc_usize - off)) + if (len > sc->sc_usize - off) len = sc->sc_usize - off; - if (len == 0) return (0); @@ -485,16 +475,14 @@ ksyms_read(struct cdev *dev, struct uio *uio, int flag ubase = sc->sc_uaddr + off; while (len) { - sz = min(PAGE_SIZE, len); - if (copyin((void *)ubase, buf, sz)) - error = EFAULT; + if (copyin((void *)ubase, buf, sz) != 0) + error = EFAULT; else error = uiomove(buf, sz, uio); - - if (error) + if (error != 0) break; - + len -= sz; ubase += sz; } @@ -503,27 +491,25 @@ ksyms_read(struct cdev *dev, struct uio *uio, int flag return (error); } -/* ARGSUSED */ static int ksyms_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int32_t flag __unused, struct thread *td __unused) { - int error = 0; struct ksyms_softc *sc; + int error; error = devfs_get_cdevpriv((void **)&sc); - if (error) + if (error != 0) return (error); switch (cmd) { case KIOCGSIZE: - /* + /* * Return the size (in bytes) of the symbol table * snapshot. */ *(size_t *)data = sc->sc_usize; break; - case KIOCGADDR: /* * Return the address of the symbol table snapshot. @@ -531,7 +517,6 @@ ksyms_ioctl(struct cdev *dev, u_long cmd, caddr_t data */ *(void **)data = (void *)sc->sc_uaddr; break; - default: error = ENOTTY; break; @@ -540,71 +525,64 @@ ksyms_ioctl(struct cdev *dev, u_long cmd, caddr_t data return (error); } -/* ARGUSED */ static int ksyms_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, - int prot __unused, vm_memattr_t *memattr __unused) + int prot __unused, vm_memattr_t *memattr __unused) { - struct ksyms_softc *sc; + struct ksyms_softc *sc; int error; error = devfs_get_cdevpriv((void **)&sc); - if (error) + if (error != 0) return (error); /* * XXX mmap() will actually map the symbol table into the process * address space again. */ - if (offset > round_page(sc->sc_usize) || - (*paddr = pmap_extract(sc->sc_pmap, - (vm_offset_t)sc->sc_uaddr + offset)) == 0) + if (offset > round_page(sc->sc_usize) || + (*paddr = pmap_extract(sc->sc_pmap, + (vm_offset_t)sc->sc_uaddr + offset)) == 0) return (-1); return (0); } -/* ARGUSED */ static int ksyms_close(struct cdev *dev, int flags __unused, int fmt __unused, - struct thread *td) + struct thread *td) { - int error = 0; struct ksyms_softc *sc; + int error; error = devfs_get_cdevpriv((void **)&sc); - if (error) + if (error != 0) return (error); /* Unmap the buffer from the process address space. */ - error = copyout_unmap(td, sc->sc_uaddr, sc->sc_usize); - - return (error); + return (copyout_unmap(td, sc->sc_uaddr, sc->sc_usize)); } -/* ARGSUSED */ static int ksyms_modevent(module_t mod __unused, int type, void *data __unused) { - int error = 0; + int error; + error = 0; switch (type) { case MOD_LOAD: mtx_init(&ksyms_mtx, "KSyms mtx", NULL, MTX_DEF); ksyms_dev = make_dev(&ksyms_cdevsw, 0, UID_ROOT, GID_WHEEL, 0400, KSYMS_DNAME); break; - case MOD_UNLOAD: if (!LIST_EMPTY(&ksyms_list)) return (EBUSY); destroy_dev(ksyms_dev); mtx_destroy(&ksyms_mtx); break; - case MOD_SHUTDOWN: break; - default: error = EOPNOTSUPP; break; From owner-svn-src-all@freebsd.org Mon Jul 31 00:41:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 151F4DC5F58; Mon, 31 Jul 2017 00:41:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B83B21B2D; Mon, 31 Jul 2017 00:41:06 +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 v6V0f56M033658; Mon, 31 Jul 2017 00:41:05 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V0f50X033657; Mon, 31 Jul 2017 00:41:05 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201707310041.v6V0f50X033657@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 31 Jul 2017 00:41:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321742 - stable/10/sys/dev/ksyms X-SVN-Group: stable-10 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/10/sys/dev/ksyms X-SVN-Commit-Revision: 321742 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 00:41:07 -0000 Author: markj Date: Mon Jul 31 00:41:05 2017 New Revision: 321742 URL: https://svnweb.freebsd.org/changeset/base/321742 Log: MFC r321640: Fix style bugs in ksyms.c. Modified: stable/10/sys/dev/ksyms/ksyms.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ksyms/ksyms.c ============================================================================== --- stable/10/sys/dev/ksyms/ksyms.c Mon Jul 31 00:40:14 2017 (r321741) +++ stable/10/sys/dev/ksyms/ksyms.c Mon Jul 31 00:41:05 2017 (r321742) @@ -62,41 +62,40 @@ #define STR_SYMTAB ".symtab" #define STR_STRTAB ".strtab" -#define STR_SHSTRTAB ".shstrtab" +#define STR_SHSTRTAB ".shstrtab" #define KSYMS_DNAME "ksyms" -static d_open_t ksyms_open; -static d_read_t ksyms_read; -static d_close_t ksyms_close; -static d_ioctl_t ksyms_ioctl; -static d_mmap_t ksyms_mmap; +static d_open_t ksyms_open; +static d_read_t ksyms_read; +static d_close_t ksyms_close; +static d_ioctl_t ksyms_ioctl; +static d_mmap_t ksyms_mmap; static struct cdevsw ksyms_cdevsw = { - .d_version = D_VERSION, - .d_flags = D_TRACKCLOSE, - .d_open = ksyms_open, - .d_close = ksyms_close, - .d_read = ksyms_read, - .d_ioctl = ksyms_ioctl, - .d_mmap = ksyms_mmap, - .d_name = KSYMS_DNAME + .d_version = D_VERSION, + .d_flags = D_TRACKCLOSE, + .d_open = ksyms_open, + .d_close = ksyms_close, + .d_read = ksyms_read, + .d_ioctl = ksyms_ioctl, + .d_mmap = ksyms_mmap, + .d_name = KSYMS_DNAME }; struct ksyms_softc { LIST_ENTRY(ksyms_softc) sc_list; - vm_offset_t sc_uaddr; - size_t sc_usize; + vm_offset_t sc_uaddr; + size_t sc_usize; pmap_t sc_pmap; struct proc *sc_proc; }; -static struct mtx ksyms_mtx; -static struct cdev *ksyms_dev; -static LIST_HEAD(, ksyms_softc) ksyms_list = - LIST_HEAD_INITIALIZER(ksyms_list); +static struct mtx ksyms_mtx; +static struct cdev *ksyms_dev; +static LIST_HEAD(, ksyms_softc) ksyms_list = LIST_HEAD_INITIALIZER(ksyms_list); -static const char ksyms_shstrtab[] = +static const char ksyms_shstrtab[] = "\0" STR_SYMTAB "\0" STR_STRTAB "\0" STR_SHSTRTAB "\0"; struct ksyms_hdr { @@ -106,7 +105,7 @@ struct ksyms_hdr { Elf_Shdr kh_shdr[SHDR_NUM]; char kh_shstrtab[sizeof(ksyms_shstrtab)]; }; - + struct tsizes { size_t ts_symsz; size_t ts_strsz; @@ -123,7 +122,7 @@ static MALLOC_DEFINE(M_KSYMS, "KSYMS", "Kernel Symbol /* * Get the symbol and string table sizes for a kernel module. Add it to the - * running total. + * running total. */ static int ksyms_size_permod(linker_file_t lf, void *arg) @@ -132,35 +131,36 @@ ksyms_size_permod(linker_file_t lf, void *arg) const Elf_Sym *symtab; caddr_t strtab; long syms; - + ts = arg; - + syms = LINKER_SYMTAB_GET(lf, &symtab); ts->ts_symsz += syms * sizeof(Elf_Sym); ts->ts_strsz += LINKER_STRTAB_GET(lf, &strtab); - + return (0); } /* * For kernel module get the symbol and string table sizes, returning the - * totals in *ts. + * totals in *ts. */ -static void +static void ksyms_size_calc(struct tsizes *ts) { + ts->ts_symsz = 0; ts->ts_strsz = 0; - - (void) linker_file_foreach(ksyms_size_permod, ts); + + (void)linker_file_foreach(ksyms_size_permod, ts); } -#define KSYMS_EMIT(src, des, sz) do { \ - copyout(src, (void *)des, sz); \ - des += sz; \ - } while (0) +#define KSYMS_EMIT(src, des, sz) do { \ + copyout(src, (void *)des, sz); \ + des += sz; \ +} while (0) -#define SYMBLKSZ 256 * sizeof (Elf_Sym) +#define SYMBLKSZ (256 * sizeof(Elf_Sym)) /* * For a kernel module, add the symbol and string tables into the @@ -169,6 +169,7 @@ ksyms_size_calc(struct tsizes *ts) static int ksyms_add(linker_file_t lf, void *arg) { + char *buf; struct toffsets *to; const Elf_Sym *symtab; Elf_Sym *symp; @@ -176,43 +177,42 @@ ksyms_add(linker_file_t lf, void *arg) long symsz; size_t strsz, numsyms; linker_symval_t symval; - char *buf; int i, nsyms, len; - + to = arg; - + MOD_SLOCK; numsyms = LINKER_SYMTAB_GET(lf, &symtab); strsz = LINKER_STRTAB_GET(lf, &strtab); symsz = numsyms * sizeof(Elf_Sym); - + buf = malloc(SYMBLKSZ, M_KSYMS, M_WAITOK); - + while (symsz > 0) { len = min(SYMBLKSZ, symsz); bcopy(symtab, buf, len); - /* - * Fix up symbol table for kernel modules: - * string offsets need adjusted + /* + * Fix up symbol table for kernel modules: + * string offsets need adjusted * symbol values made absolute */ symp = (Elf_Sym *) buf; - nsyms = len / sizeof (Elf_Sym); + nsyms = len / sizeof(Elf_Sym); for (i = 0; i < nsyms; i++) { symp[i].st_name += to->to_stridx; - if (lf->id > 1 && LINKER_SYMBOL_VALUES(lf, - (c_linker_sym_t) &symtab[i], &symval) == 0) { - symp[i].st_value = (uintptr_t) symval.value; + if (lf->id > 1 && LINKER_SYMBOL_VALUES(lf, + (c_linker_sym_t)&symtab[i], &symval) == 0) { + symp[i].st_value = (uintptr_t)symval.value; } } - if (len > to->to_resid) { + if (len > to->to_resid) { MOD_SUNLOCK; free(buf, M_KSYMS); return (ENXIO); - } else - to->to_resid -= len; + } + to->to_resid -= len; KSYMS_EMIT(buf, to->to_symoff, len); symtab += nsyms; @@ -220,14 +220,13 @@ ksyms_add(linker_file_t lf, void *arg) } free(buf, M_KSYMS); MOD_SUNLOCK; - + if (strsz > to->to_resid) return (ENXIO); - else - to->to_resid -= strsz; + to->to_resid -= strsz; KSYMS_EMIT(strtab, to->to_stroff, strsz); to->to_stridx += strsz; - + return (0); } @@ -239,16 +238,14 @@ ksyms_add(linker_file_t lf, void *arg) static int ksyms_snapshot(struct tsizes *ts, vm_offset_t uaddr, size_t resid) { - struct ksyms_hdr *hdr; - struct toffsets to; + struct toffsets to; int error = 0; - /* Be kernel stack friendly */ - hdr = malloc(sizeof (*hdr), M_KSYMS, M_WAITOK|M_ZERO); + hdr = malloc(sizeof(*hdr), M_KSYMS, M_WAITOK | M_ZERO); - /* - * Create the ELF header. + /* + * Create the ELF header. */ hdr->kh_ehdr.e_ident[EI_PAD] = 0; hdr->kh_ehdr.e_ident[EI_MAG0] = ELFMAG0; @@ -269,32 +266,32 @@ ksyms_snapshot(struct tsizes *ts, vm_offset_t uaddr, s hdr->kh_ehdr.e_flags = 0; hdr->kh_ehdr.e_ehsize = sizeof(Elf_Ehdr); hdr->kh_ehdr.e_phentsize = sizeof(Elf_Phdr); - hdr->kh_ehdr.e_phnum = 2; /* Text and Data */ + hdr->kh_ehdr.e_phnum = 2; /* Text and Data */ hdr->kh_ehdr.e_shentsize = sizeof(Elf_Shdr); hdr->kh_ehdr.e_shnum = SHDR_NUM; hdr->kh_ehdr.e_shstrndx = SHDR_SHSTRTAB; - /* - * Add both the text and data Program headers. + /* + * Add both the text and data program headers. */ hdr->kh_txtphdr.p_type = PT_LOAD; /* XXX - is there a way to put the actual .text addr/size here? */ - hdr->kh_txtphdr.p_vaddr = 0; - hdr->kh_txtphdr.p_memsz = 0; + hdr->kh_txtphdr.p_vaddr = 0; + hdr->kh_txtphdr.p_memsz = 0; hdr->kh_txtphdr.p_flags = PF_R | PF_X; - + hdr->kh_datphdr.p_type = PT_LOAD; /* XXX - is there a way to put the actual .data addr/size here? */ - hdr->kh_datphdr.p_vaddr = 0; - hdr->kh_datphdr.p_memsz = 0; + hdr->kh_datphdr.p_vaddr = 0; + hdr->kh_datphdr.p_memsz = 0; hdr->kh_datphdr.p_flags = PF_R | PF_W | PF_X; - /* - * Add the Section headers: null, symtab, strtab, shstrtab, + /* + * Add the section headers: null, symtab, strtab, shstrtab. */ /* First section header - null */ - + /* Second section header - symtab */ hdr->kh_shdr[SHDR_SYMTAB].sh_name = 1; /* String offset (skip null) */ hdr->kh_shdr[SHDR_SYMTAB].sh_type = SHT_SYMTAB; @@ -302,31 +299,31 @@ ksyms_snapshot(struct tsizes *ts, vm_offset_t uaddr, s hdr->kh_shdr[SHDR_SYMTAB].sh_addr = 0; hdr->kh_shdr[SHDR_SYMTAB].sh_offset = sizeof(*hdr); hdr->kh_shdr[SHDR_SYMTAB].sh_size = ts->ts_symsz; - hdr->kh_shdr[SHDR_SYMTAB].sh_link = SHDR_STRTAB; - hdr->kh_shdr[SHDR_SYMTAB].sh_info = ts->ts_symsz / sizeof(Elf_Sym); + hdr->kh_shdr[SHDR_SYMTAB].sh_link = SHDR_STRTAB; + hdr->kh_shdr[SHDR_SYMTAB].sh_info = ts->ts_symsz / sizeof(Elf_Sym); hdr->kh_shdr[SHDR_SYMTAB].sh_addralign = sizeof(long); hdr->kh_shdr[SHDR_SYMTAB].sh_entsize = sizeof(Elf_Sym); /* Third section header - strtab */ - hdr->kh_shdr[SHDR_STRTAB].sh_name = 1 + sizeof(STR_SYMTAB); + hdr->kh_shdr[SHDR_STRTAB].sh_name = 1 + sizeof(STR_SYMTAB); hdr->kh_shdr[SHDR_STRTAB].sh_type = SHT_STRTAB; hdr->kh_shdr[SHDR_STRTAB].sh_flags = 0; hdr->kh_shdr[SHDR_STRTAB].sh_addr = 0; - hdr->kh_shdr[SHDR_STRTAB].sh_offset = - hdr->kh_shdr[SHDR_SYMTAB].sh_offset + ts->ts_symsz; + hdr->kh_shdr[SHDR_STRTAB].sh_offset = + hdr->kh_shdr[SHDR_SYMTAB].sh_offset + ts->ts_symsz; hdr->kh_shdr[SHDR_STRTAB].sh_size = ts->ts_strsz; hdr->kh_shdr[SHDR_STRTAB].sh_link = 0; hdr->kh_shdr[SHDR_STRTAB].sh_info = 0; hdr->kh_shdr[SHDR_STRTAB].sh_addralign = sizeof(char); hdr->kh_shdr[SHDR_STRTAB].sh_entsize = 0; - + /* Fourth section - shstrtab */ hdr->kh_shdr[SHDR_SHSTRTAB].sh_name = 1 + sizeof(STR_SYMTAB) + sizeof(STR_STRTAB); hdr->kh_shdr[SHDR_SHSTRTAB].sh_type = SHT_STRTAB; hdr->kh_shdr[SHDR_SHSTRTAB].sh_flags = 0; hdr->kh_shdr[SHDR_SHSTRTAB].sh_addr = 0; - hdr->kh_shdr[SHDR_SHSTRTAB].sh_offset = + hdr->kh_shdr[SHDR_SHSTRTAB].sh_offset = offsetof(struct ksyms_hdr, kh_shstrtab); hdr->kh_shdr[SHDR_SHSTRTAB].sh_size = sizeof(ksyms_shstrtab); hdr->kh_shdr[SHDR_SHSTRTAB].sh_link = 0; @@ -334,9 +331,9 @@ ksyms_snapshot(struct tsizes *ts, vm_offset_t uaddr, s hdr->kh_shdr[SHDR_SHSTRTAB].sh_addralign = 0 /* sizeof(char) */; hdr->kh_shdr[SHDR_SHSTRTAB].sh_entsize = 0; - /* Copy shstrtab into the header */ + /* Copy shstrtab into the header. */ bcopy(ksyms_shstrtab, hdr->kh_shstrtab, sizeof(ksyms_shstrtab)); - + to.to_symoff = uaddr + hdr->kh_shdr[SHDR_SYMTAB].sh_offset; to.to_stroff = uaddr + hdr->kh_shdr[SHDR_STRTAB].sh_offset; to.to_stridx = 0; @@ -346,13 +343,13 @@ ksyms_snapshot(struct tsizes *ts, vm_offset_t uaddr, s } to.to_resid = resid - sizeof(struct ksyms_hdr); - /* Emit Header */ + /* emit header */ copyout(hdr, (void *)uaddr, sizeof(struct ksyms_hdr)); - + free(hdr, M_KSYMS); - /* Add symbol and string tables for each kernelmodule */ - error = linker_file_foreach(ksyms_add, &to); + /* Add symbol and string tables for each kernel module. */ + error = linker_file_foreach(ksyms_add, &to); if (to.to_resid != 0) return (ENXIO); @@ -365,7 +362,7 @@ ksyms_cdevpriv_dtr(void *data) { struct ksyms_softc *sc; - sc = (struct ksyms_softc *)data; + sc = (struct ksyms_softc *)data; mtx_lock(&ksyms_mtx); LIST_REMOVE(sc, sc_list); @@ -373,19 +370,18 @@ ksyms_cdevpriv_dtr(void *data) free(sc, M_KSYMS); } -/* ARGSUSED */ static int ksyms_open(struct cdev *dev, int flags, int fmt __unused, struct thread *td) { struct tsizes ts; + struct ksyms_softc *sc; size_t total_elf_sz; int error, try; - struct ksyms_softc *sc; - - /* - * Limit one open() per process. The process must close() - * before open()'ing again. - */ + + /* + * Limit one open() per process. The process must close() + * before open()'ing again. + */ mtx_lock(&ksyms_mtx); LIST_FOREACH(sc, &ksyms_list, sc_list) { if (sc->sc_proc == td->td_proc) { @@ -394,9 +390,7 @@ ksyms_open(struct cdev *dev, int flags, int fmt __unus } } - sc = (struct ksyms_softc *) malloc(sizeof (*sc), M_KSYMS, - M_NOWAIT|M_ZERO); - + sc = malloc(sizeof(*sc), M_KSYMS, M_NOWAIT | M_ZERO); if (sc == NULL) { mtx_unlock(&ksyms_mtx); return (ENOMEM); @@ -407,41 +401,39 @@ ksyms_open(struct cdev *dev, int flags, int fmt __unus mtx_unlock(&ksyms_mtx); error = devfs_set_cdevpriv(sc, ksyms_cdevpriv_dtr); - if (error) + if (error != 0) goto failed; /* - * MOD_SLOCK doesn't work here (because of a lock reversal with - * KLD_SLOCK). Therefore, simply try upto 3 times to get a "clean" + * MOD_SLOCK doesn't work here (because of a lock reversal with + * KLD_SLOCK). Therefore, simply try up to 3 times to get a "clean" * snapshot of the kernel symbol table. This should work fine in the * rare case of a kernel module being loaded/unloaded at the same - * time. + * time. */ - for(try = 0; try < 3; try++) { + for (try = 0; try < 3; try++) { /* - * Map a buffer in the calling process memory space and - * create a snapshot of the kernel symbol table in it. - */ - + * Map a buffer in the calling process memory space and + * create a snapshot of the kernel symbol table in it. + */ + /* Compute the size of buffer needed. */ ksyms_size_calc(&ts); - total_elf_sz = sizeof(struct ksyms_hdr) + ts.ts_symsz + - ts.ts_strsz; + total_elf_sz = sizeof(struct ksyms_hdr) + ts.ts_symsz + + ts.ts_strsz; - error = copyout_map(td, &(sc->sc_uaddr), - (vm_size_t) total_elf_sz); - if (error) + error = copyout_map(td, &sc->sc_uaddr, (vm_size_t)total_elf_sz); + if (error != 0) break; - sc->sc_usize = total_elf_sz; + sc->sc_usize = total_elf_sz; - error = ksyms_snapshot(&ts, sc->sc_uaddr, total_elf_sz); - if (!error) { - /* Successful Snapshot */ - return (0); - } - - /* Snapshot failed, unmap the memory and try again */ - (void) copyout_unmap(td, sc->sc_uaddr, sc->sc_usize); + error = ksyms_snapshot(&ts, sc->sc_uaddr, total_elf_sz); + if (error == 0) + /* successful snapshot */ + return (0); + + /* Snapshot failed, unmap the memory and try again. */ + (void)copyout_unmap(td, sc->sc_uaddr, sc->sc_usize); } failed: @@ -449,30 +441,28 @@ failed: return (error); } -/* ARGSUSED */ static int ksyms_read(struct cdev *dev, struct uio *uio, int flags __unused) { - int error; - size_t len, sz; struct ksyms_softc *sc; - off_t off; char *buf; + off_t off; + size_t len, sz; vm_size_t ubase; - + int error; + error = devfs_get_cdevpriv((void **)&sc); - if (error) + if (error != 0) return (error); - + off = uio->uio_offset; - len = uio->uio_resid; - + len = uio->uio_resid; + if (off < 0 || off > sc->sc_usize) return (EFAULT); - if (len > (sc->sc_usize - off)) + if (len > sc->sc_usize - off) len = sc->sc_usize - off; - if (len == 0) return (0); @@ -485,16 +475,14 @@ ksyms_read(struct cdev *dev, struct uio *uio, int flag ubase = sc->sc_uaddr + off; while (len) { - sz = min(PAGE_SIZE, len); - if (copyin((void *)ubase, buf, sz)) - error = EFAULT; + if (copyin((void *)ubase, buf, sz) != 0) + error = EFAULT; else error = uiomove(buf, sz, uio); - - if (error) + if (error != 0) break; - + len -= sz; ubase += sz; } @@ -503,27 +491,25 @@ ksyms_read(struct cdev *dev, struct uio *uio, int flag return (error); } -/* ARGSUSED */ static int ksyms_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int32_t flag __unused, struct thread *td __unused) { - int error = 0; struct ksyms_softc *sc; + int error; error = devfs_get_cdevpriv((void **)&sc); - if (error) + if (error != 0) return (error); switch (cmd) { case KIOCGSIZE: - /* + /* * Return the size (in bytes) of the symbol table * snapshot. */ *(size_t *)data = sc->sc_usize; break; - case KIOCGADDR: /* * Return the address of the symbol table snapshot. @@ -531,7 +517,6 @@ ksyms_ioctl(struct cdev *dev, u_long cmd, caddr_t data */ *(void **)data = (void *)sc->sc_uaddr; break; - default: error = ENOTTY; break; @@ -540,71 +525,64 @@ ksyms_ioctl(struct cdev *dev, u_long cmd, caddr_t data return (error); } -/* ARGUSED */ static int ksyms_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, - int prot __unused, vm_memattr_t *memattr __unused) + int prot __unused, vm_memattr_t *memattr __unused) { - struct ksyms_softc *sc; + struct ksyms_softc *sc; int error; error = devfs_get_cdevpriv((void **)&sc); - if (error) + if (error != 0) return (error); /* * XXX mmap() will actually map the symbol table into the process * address space again. */ - if (offset > round_page(sc->sc_usize) || - (*paddr = pmap_extract(sc->sc_pmap, - (vm_offset_t)sc->sc_uaddr + offset)) == 0) + if (offset > round_page(sc->sc_usize) || + (*paddr = pmap_extract(sc->sc_pmap, + (vm_offset_t)sc->sc_uaddr + offset)) == 0) return (-1); return (0); } -/* ARGUSED */ static int ksyms_close(struct cdev *dev, int flags __unused, int fmt __unused, - struct thread *td) + struct thread *td) { - int error = 0; struct ksyms_softc *sc; + int error; error = devfs_get_cdevpriv((void **)&sc); - if (error) + if (error != 0) return (error); /* Unmap the buffer from the process address space. */ - error = copyout_unmap(td, sc->sc_uaddr, sc->sc_usize); - - return (error); + return (copyout_unmap(td, sc->sc_uaddr, sc->sc_usize)); } -/* ARGSUSED */ static int ksyms_modevent(module_t mod __unused, int type, void *data __unused) { - int error = 0; + int error; + error = 0; switch (type) { case MOD_LOAD: mtx_init(&ksyms_mtx, "KSyms mtx", NULL, MTX_DEF); ksyms_dev = make_dev(&ksyms_cdevsw, 0, UID_ROOT, GID_WHEEL, 0400, KSYMS_DNAME); break; - case MOD_UNLOAD: if (!LIST_EMPTY(&ksyms_list)) return (EBUSY); destroy_dev(ksyms_dev); mtx_destroy(&ksyms_mtx); break; - case MOD_SHUTDOWN: break; - default: error = EOPNOTSUPP; break; From owner-svn-src-all@freebsd.org Mon Jul 31 00:54:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A570FDC611C; Mon, 31 Jul 2017 00:54:51 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66ADE208D; Mon, 31 Jul 2017 00:54:51 +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 v6V0soM4039813; Mon, 31 Jul 2017 00:54:50 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V0soGn039810; Mon, 31 Jul 2017 00:54:50 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201707310054.v6V0soGn039810@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 31 Jul 2017 00:54:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321743 - in head: share/man/man9 sys/kern sys/sys X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head: share/man/man9 sys/kern sys/sys X-SVN-Commit-Revision: 321743 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 00:54:51 -0000 Author: ian Date: Mon Jul 31 00:54:50 2017 New Revision: 321743 URL: https://svnweb.freebsd.org/changeset/base/321743 Log: Add taskqueue_enqueue_timeout_sbt(), because sometimes you want more control over the scheduling precision than 'ticks' can offer, and because sometimes you're already working with sbintime_t units and it's dumb to convert them to ticks just so they can get converted back to sbintime_t under the hood. Modified: head/share/man/man9/taskqueue.9 head/sys/kern/subr_taskqueue.c head/sys/sys/taskqueue.h Modified: head/share/man/man9/taskqueue.9 ============================================================================== --- head/share/man/man9/taskqueue.9 Mon Jul 31 00:41:05 2017 (r321742) +++ head/share/man/man9/taskqueue.9 Mon Jul 31 00:54:50 2017 (r321743) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 1, 2016 +.Dd July 30, 2017 .Dt TASKQUEUE 9 .Os .Sh NAME @@ -82,6 +82,8 @@ struct timeout_task; .Ft int .Fn taskqueue_enqueue_timeout "struct taskqueue *queue" "struct timeout_task *timeout_task" "int ticks" .Ft int +.Fn taskqueue_enqueue_timeout_sbt "struct taskqueue *queue" "struct timeout_task *timeout_task" "sbintime_t sbt" "sbintime_t pr" "int flags" +.Ft int .Fn taskqueue_cancel "struct taskqueue *queue" "struct task *task" "u_int *pendp" .Ft int .Fn taskqueue_cancel_timeout "struct taskqueue *queue" "struct timeout_task *timeout_task" "u_int *pendp" @@ -211,8 +213,17 @@ is called on the task pointer passed to .Pp The .Fn taskqueue_enqueue_timeout -is used to schedule the enqueue after the specified amount of +function is used to schedule the enqueue after the specified number of .Va ticks . +The +.Fn taskqueue_enqueue_timeout_sbt +function provides finer control over the scheduling based on +.Va sbt , +.Va pr , +and +.Va flags , +as detailed in +.Xr timeout 9 . Only non-fast task queues can be used for .Va timeout_task scheduling. @@ -483,6 +494,7 @@ be created with a dedicated processing thread. .Xr ithread 9 , .Xr kthread 9 , .Xr swi 9 +.Xr timeout 9 .Sh HISTORY This interface first appeared in .Fx 5.0 . Modified: head/sys/kern/subr_taskqueue.c ============================================================================== --- head/sys/kern/subr_taskqueue.c Mon Jul 31 00:41:05 2017 (r321742) +++ head/sys/kern/subr_taskqueue.c Mon Jul 31 00:54:50 2017 (r321743) @@ -289,8 +289,8 @@ taskqueue_timeout_func(void *arg) } int -taskqueue_enqueue_timeout(struct taskqueue *queue, - struct timeout_task *timeout_task, int ticks) +taskqueue_enqueue_timeout_sbt(struct taskqueue *queue, + struct timeout_task *timeout_task, sbintime_t sbt, sbintime_t pr, int flags) { int res; @@ -304,7 +304,7 @@ taskqueue_enqueue_timeout(struct taskqueue *queue, /* Do nothing */ TQ_UNLOCK(queue); res = -1; - } else if (ticks == 0) { + } else if (sbt == 0) { taskqueue_enqueue_locked(queue, &timeout_task->t); /* The lock is released inside. */ } else { @@ -313,16 +313,25 @@ taskqueue_enqueue_timeout(struct taskqueue *queue, } else { queue->tq_callouts++; timeout_task->f |= DT_CALLOUT_ARMED; - if (ticks < 0) - ticks = -ticks; /* Ignore overflow. */ + if (sbt < 0) + sbt = -sbt; /* Ignore overflow. */ } - if (ticks > 0) { - callout_reset(&timeout_task->c, ticks, - taskqueue_timeout_func, timeout_task); + if (sbt > 0) { + callout_reset_sbt(&timeout_task->c, sbt, pr, + taskqueue_timeout_func, timeout_task, flags); } TQ_UNLOCK(queue); } return (res); +} + +int +taskqueue_enqueue_timeout(struct taskqueue *queue, + struct timeout_task *ttask, int ticks) +{ + + return (taskqueue_enqueue_timeout_sbt(queue, ttask, ticks * tick_sbt, + 0, 0)); } static void Modified: head/sys/sys/taskqueue.h ============================================================================== --- head/sys/sys/taskqueue.h Mon Jul 31 00:41:05 2017 (r321742) +++ head/sys/sys/taskqueue.h Mon Jul 31 00:54:50 2017 (r321743) @@ -79,6 +79,9 @@ int taskqueue_start_threads_cpuset(struct taskqueue ** int taskqueue_enqueue(struct taskqueue *queue, struct task *task); int taskqueue_enqueue_timeout(struct taskqueue *queue, struct timeout_task *timeout_task, int ticks); +int taskqueue_enqueue_timeout_sbt(struct taskqueue *queue, + struct timeout_task *timeout_task, sbintime_t sbt, sbintime_t pr, + int flags); int taskqueue_poll_is_busy(struct taskqueue *queue, struct task *task); int taskqueue_cancel(struct taskqueue *queue, struct task *task, u_int *pendp); From owner-svn-src-all@freebsd.org Mon Jul 31 00:59:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9D4DDC61B1; Mon, 31 Jul 2017 00:59:29 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5BC702241; Mon, 31 Jul 2017 00:59:29 +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 v6V0xSWl040028; Mon, 31 Jul 2017 00:59:28 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V0xSU1040027; Mon, 31 Jul 2017 00:59:28 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201707310059.v6V0xSU1040027@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 31 Jul 2017 00:59:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321744 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 321744 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 00:59:29 -0000 Author: markj Date: Mon Jul 31 00:59:28 2017 New Revision: 321744 URL: https://svnweb.freebsd.org/changeset/base/321744 Log: Correct the predicates on which lockstat:::{thread,spin}-spin fire. In particular, they should fire only if the lock was owned by another thread when we first attempted to acquire that lock. MFC after: 1 week Modified: head/sys/kern/kern_mutex.c Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Mon Jul 31 00:54:50 2017 (r321743) +++ head/sys/kern/kern_mutex.c Mon Jul 31 00:59:28 2017 (r321744) @@ -766,7 +766,7 @@ _mtx_lock_spin_cookie(volatile uintptr_t *c, uintptr_t LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(spin__acquire, m, contested, waittime, file, line); #ifdef KDTRACE_HOOKS - if (spin_time != 0) + if (lda.spin_cnt != 0) LOCKSTAT_RECORD1(spin__spin, m, spin_time); #endif } @@ -879,7 +879,7 @@ retry: LOCKSTAT_PROFILE_OBTAIN_LOCK_SUCCESS(spin__acquire, m, contested, waittime, file, line); #ifdef KDTRACE_HOOKS - if (spin_time != 0) + if (lda.spin_cnt != 0) LOCKSTAT_RECORD1(thread__spin, m, spin_time); #endif } From owner-svn-src-all@freebsd.org Mon Jul 31 01:18:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF05ADC6761; Mon, 31 Jul 2017 01:18:22 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC0E42C76; Mon, 31 Jul 2017 01:18:22 +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 v6V1ILop048525; Mon, 31 Jul 2017 01:18:21 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V1ILjF048523; Mon, 31 Jul 2017 01:18:21 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201707310118.v6V1ILjF048523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 31 Jul 2017 01:18:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321745 - 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: 321745 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 01:18:23 -0000 Author: ian Date: Mon Jul 31 01:18:21 2017 New Revision: 321745 URL: https://svnweb.freebsd.org/changeset/base/321745 Log: Add clock_schedule(), a feature that allows realtime clock drivers to request that their clock_settime() methods be called at a given offset from top-of-second. This adds a timeout_task to the rtc_instance so that each clock can be separately added to taskqueue_thread with the scheduling it prefers, instead of looping through all the clocks at once with a single task on taskqueue_thread. If a driver doesn't call clock_schedule() the default is the old behavior: clock_settime() is queued immediately. The motivation behind this is that I was on the path of adding identical code to a third RTC driver to figure out a delta to top-of-second and sleep for that amount of time because writing the the RTC registers resets the hardware's concept of top-of-second. (Sometimes it's not top-of-second, some RTC clocks tick over a half second after you set their time registers.) Worst-case would be to sleep for almost a full second, which is a rude thing to do on a shared task queue thread. Modified: head/sys/kern/subr_rtc.c head/sys/sys/clock.h Modified: head/sys/kern/subr_rtc.c ============================================================================== --- head/sys/kern/subr_rtc.c Mon Jul 31 00:59:28 2017 (r321744) +++ head/sys/kern/subr_rtc.c Mon Jul 31 01:18:21 2017 (r321745) @@ -95,7 +95,10 @@ struct rtc_instance { device_t clockdev; int resolution; int flags; + u_int schedns; struct timespec resadj; + struct timeout_task + stask; LIST_ENTRY(rtc_instance) rtc_entries; }; @@ -104,7 +107,6 @@ struct rtc_instance { * Clocks are updated using a task running on taskqueue_thread. */ static void settime_task_func(void *arg, int pending); -static struct task settime_task = TASK_INITIALIZER(0, settime_task_func, NULL); /* * Registered clocks are kept in a list which is sorted by resolution; the more @@ -116,9 +118,9 @@ static struct sx rtc_list_lock; SX_SYSINIT(rtc_list_lock_init, &rtc_list_lock, "rtc list"); /* - * On the task thread, invoke the clock_settime() method of each registered - * clock. Do so holding only an sxlock, so that clock drivers are free to do - * whatever kind of locking or sleeping they need to. + * On the task thread, invoke the clock_settime() method of the clock. Do so + * holding no locks, so that clock drivers are free to do whatever kind of + * locking or sleeping they need to. */ static void settime_task_func(void *arg, int pending) @@ -126,21 +128,18 @@ settime_task_func(void *arg, int pending) struct timespec ts; struct rtc_instance *rtc; - sx_xlock(&rtc_list_lock); - LIST_FOREACH(rtc, &rtc_list, rtc_entries) { - if (!(rtc->flags & CLOCKF_SETTIME_NO_TS)) { - getnanotime(&ts); - if (!(rtc->flags & CLOCKF_SETTIME_NO_ADJ)) { - ts.tv_sec -= utc_offset(); - timespecadd(&ts, &rtc->resadj); - } - } else { - ts.tv_sec = 0; - ts.tv_nsec = 0; + rtc = arg; + if (!(rtc->flags & CLOCKF_SETTIME_NO_TS)) { + getnanotime(&ts); + if (!(rtc->flags & CLOCKF_SETTIME_NO_ADJ)) { + ts.tv_sec -= utc_offset(); + timespecadd(&ts, &rtc->resadj); } - CLOCK_SETTIME(rtc->clockdev, &ts); + } else { + ts.tv_sec = 0; + ts.tv_nsec = 0; } - sx_xunlock(&rtc_list_lock); + CLOCK_SETTIME(rtc->clockdev, &ts); } void @@ -152,8 +151,11 @@ clock_register_flags(device_t clockdev, long resolutio newrtc->clockdev = clockdev; newrtc->resolution = (int)resolution; newrtc->flags = flags; + newrtc->schedns = 0; newrtc->resadj.tv_sec = newrtc->resolution / 2 / 1000000; newrtc->resadj.tv_nsec = newrtc->resolution / 2 % 1000000 * 1000; + TIMEOUT_TASK_INIT(taskqueue_thread, &newrtc->stask, 0, + settime_task_func, newrtc); sx_xlock(&rtc_list_lock); if (LIST_EMPTY(&rtc_list)) { @@ -192,12 +194,32 @@ clock_unregister(device_t clockdev) LIST_FOREACH_SAFE(rtc, &rtc_list, rtc_entries, tmp) { if (rtc->clockdev == clockdev) { LIST_REMOVE(rtc, rtc_entries); - free(rtc, M_DEVBUF); + break; } } sx_xunlock(&rtc_list_lock); + if (rtc != NULL) { + taskqueue_cancel_timeout(taskqueue_thread, &rtc->stask, NULL); + taskqueue_drain_timeout(taskqueue_thread, &rtc->stask); + free(rtc, M_DEVBUF); + } } +void +clock_schedule(device_t clockdev, u_int offsetns) +{ + struct rtc_instance *rtc; + + sx_xlock(&rtc_list_lock); + LIST_FOREACH(rtc, &rtc_list, rtc_entries) { + if (rtc->clockdev == clockdev) { + rtc->schedns = offsetns; + break; + } + } + sx_xunlock(&rtc_list_lock); +} + /* * Initialize the system time. Must be called from a context which does not * restrict any locking or sleeping that clock drivers may need to do. @@ -275,9 +297,26 @@ inittodr(time_t base) void resettodr(void) { + struct timespec now; + struct rtc_instance *rtc; + sbintime_t sbt; + long waitns; if (disable_rtc_set) return; - taskqueue_enqueue(taskqueue_thread, &settime_task); + sx_xlock(&rtc_list_lock); + LIST_FOREACH(rtc, &rtc_list, rtc_entries) { + if (rtc->schedns != 0) { + getnanotime(&now); + waitns = rtc->schedns - now.tv_nsec; + if (waitns < 0) + waitns += 1000000000; + sbt = nstosbt(waitns); + } else + sbt = 0; + taskqueue_enqueue_timeout_sbt(taskqueue_thread, + &rtc->stask, -sbt, 0, C_PREL(31)); + } + sx_xunlock(&rtc_list_lock); } Modified: head/sys/sys/clock.h ============================================================================== --- head/sys/sys/clock.h Mon Jul 31 00:59:28 2017 (r321744) +++ head/sys/sys/clock.h Mon Jul 31 01:18:21 2017 (r321745) @@ -77,10 +77,17 @@ int clock_ct_to_ts(struct clocktime *, struct timespec void clock_ts_to_ct(struct timespec *, struct clocktime *); /* - * Time-of-day clock register/unregister functions, and associated flags. These - * functions can sleep. Upon return from unregister, the clock's methods are - * not running and will not be called again. + * Time-of-day clock functions and flags. These functions might sleep. * + * clock_register and clock_unregister() do what they say. Upon return from + * unregister, the clock's methods are not running and will not be called again. + * + * clock_schedule() requests that a registered clock's clock_settime() calls + * happen at the given offset into the second. The default is 0, meaning no + * specific scheduling. To schedule the call as soon after top-of-second as + * possible, specify 1. Each clock has its own schedule, but taskqueue_thread + * is shared by many tasks; the timing of the call is not guaranteed. + * * Flags: * * CLOCKF_SETTIME_NO_TS @@ -102,6 +109,7 @@ void clock_ts_to_ct(struct timespec *, struct clocktim void clock_register(device_t _clockdev, long _resolution_us); void clock_register_flags(device_t _clockdev, long _resolution_us, int _flags); +void clock_schedule(device_t clockdev, u_int _offsetns); void clock_unregister(device_t _clockdev); /* From owner-svn-src-all@freebsd.org Mon Jul 31 01:36:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DCDDDC6CA2; Mon, 31 Jul 2017 01:36:52 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1EFAE3503; Mon, 31 Jul 2017 01:36:52 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6V1ap8x056372; Mon, 31 Jul 2017 01:36:51 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V1apth056370; Mon, 31 Jul 2017 01:36:51 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201707310136.v6V1apth056370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 31 Jul 2017 01:36:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321746 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 321746 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 01:36:52 -0000 Author: ian Date: Mon Jul 31 01:36:51 2017 New Revision: 321746 URL: https://svnweb.freebsd.org/changeset/base/321746 Log: Use the new clock_schedule() to arrange for clock_settime() to be called at the right time to keep the RTC hardware time in sync, instead of using pause_sbt() to sleep until the right time. Modified: head/sys/dev/iicbus/ds1307.c head/sys/dev/iicbus/nxprtc.c Modified: head/sys/dev/iicbus/ds1307.c ============================================================================== --- head/sys/dev/iicbus/ds1307.c Mon Jul 31 01:18:21 2017 (r321745) +++ head/sys/dev/iicbus/ds1307.c Mon Jul 31 01:36:51 2017 (r321746) @@ -295,8 +295,13 @@ ds1307_start(void *xdev) CTLFLAG_RW | CTLTYPE_UINT | CTLFLAG_MPSAFE, sc, 0, ds1307_sqw_out_sysctl, "IU", "DS1307 square-wave output state"); - /* Register as a clock with 1 second resolution. */ + /* + * Register as a clock with 1 second resolution. Schedule the + * clock_settime() method to be called just after top-of-second; + * resetting the time resets top-of-second in the hardware. + */ clock_register_flags(dev, 1000000, CLOCKF_SETTIME_NO_TS); + clock_schedule(dev, 1); } static int @@ -351,19 +356,6 @@ ds1307_settime(device_t dev, struct timespec *ts) uint8_t pmflags; sc = device_get_softc(dev); - - /* Sleep until 1ms into the second, to align RTC's second to ours. */ - getnanotime(ts); - waitns = 1000000 - ts->tv_nsec; - if (waitns < 0) - waitns += 1000000000; - pause_sbt("set1307", nstosbt(waitns), 0, C_PREL(31)); - - /* Grab a fresh post-sleep idea of the time. */ - getnanotime(ts); - ts->tv_sec -= utc_offset(); - ts->tv_nsec = 0; - clock_ts_to_ct(ts, &ct); /* If the chip is in AM/PM mode, adjust hour and set flags as needed. */ if (sc->sc_use_ampm) { Modified: head/sys/dev/iicbus/nxprtc.c ============================================================================== --- head/sys/dev/iicbus/nxprtc.c Mon Jul 31 01:18:21 2017 (r321745) +++ head/sys/dev/iicbus/nxprtc.c Mon Jul 31 01:36:51 2017 (r321746) @@ -513,10 +513,15 @@ nxprtc_start(void *dev) * we're using the timer to count fractional seconds, our resolution is * 1e6/64, about 15.6ms. Without the timer we still align the RTC clock * when setting it so our error is an average .5s when reading it. + * Schedule our clock_settime() method to be called at a .495ms offset + * into the second, because the clock hardware resets the divider chain + * to the mid-second point when you set the time and it takes about 5ms + * of i2c bus activity to set the clock. */ resolution = sc->use_timer ? 1000000 / TMR_TICKS_SEC : 1000000 / 2; clockflags = CLOCKF_GETTIME_NO_ADJ | CLOCKF_SETTIME_NO_TS; clock_register_flags(sc->dev, resolution, clockflags); + clock_schedule(sc->dev, 495000000); } static int @@ -599,7 +604,6 @@ nxprtc_settime(device_t dev, struct timespec *ts) struct clocktime ct; struct time_regs tregs; struct nxprtc_softc *sc; - long waitns; int err; uint8_t cflag, cs1, pmflag; @@ -608,16 +612,9 @@ nxprtc_settime(device_t dev, struct timespec *ts) /* * We stop the clock, set the time, then restart the clock. Half a * second after restarting the clock it ticks over to the next second. - * So to align the RTC, sleep until system time is halfway through the - * current second (shoot for .495 to allow time for i2c operations). - */ - getnanotime(ts); - waitns = 495000000 - ts->tv_nsec; - if (waitns < 0) - waitns += 1000000000; - pause_sbt("nxpset", nstosbt(waitns), 0, C_PREL(31)); - - /* + * So to align the RTC, we schedule this function to be called when + * system time is roughly halfway (.495) through the current second. + * * Reserve use of the i2c bus and stop the RTC clock. Note that if * anything goes wrong from this point on, we leave the clock stopped, * because we don't really know what state it's in. From owner-svn-src-all@freebsd.org Mon Jul 31 02:33:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65530DC786C; Mon, 31 Jul 2017 02:33:51 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3425263BD4; Mon, 31 Jul 2017 02:33:51 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6V2Xo5P080718; Mon, 31 Jul 2017 02:33:50 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V2Xoqd080716; Mon, 31 Jul 2017 02:33:50 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201707310233.v6V2Xoqd080716@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 31 Jul 2017 02:33:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321747 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 321747 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 02:33:51 -0000 Author: sephe Date: Mon Jul 31 02:33:49 2017 New Revision: 321747 URL: https://svnweb.freebsd.org/changeset/base/321747 Log: MFC 321406 ethernet: Add ethernet interface attached event and devctl notification. ifnet_arrival_event may not be adequate under certain situation; e.g. when the LLADDR is needed. So the ethernet ifattach event is announced after all necessary bits are setup. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D11617 Modified: stable/11/sys/net/ethernet.h stable/11/sys/net/if_ethersubr.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/ethernet.h ============================================================================== --- stable/11/sys/net/ethernet.h Mon Jul 31 01:36:51 2017 (r321746) +++ stable/11/sys/net/ethernet.h Mon Jul 31 02:33:49 2017 (r321747) @@ -403,6 +403,12 @@ void ether_vlan_mtap(struct bpf_if *, struct mbuf *, void *, u_int); struct mbuf *ether_vlanencap(struct mbuf *, uint16_t); +#ifdef _SYS_EVENTHANDLER_H_ +/* new ethernet interface attached event */ +typedef void (*ether_ifattach_event_handler_t)(void *, struct ifnet *); +EVENTHANDLER_DECLARE(ether_ifattach_event, ether_ifattach_event_handler_t); +#endif + #else /* _KERNEL */ #include Modified: stable/11/sys/net/if_ethersubr.c ============================================================================== --- stable/11/sys/net/if_ethersubr.c Mon Jul 31 01:36:51 2017 (r321746) +++ stable/11/sys/net/if_ethersubr.c Mon Jul 31 02:33:49 2017 (r321747) @@ -38,6 +38,8 @@ #include #include +#include +#include #include #include #include @@ -933,6 +935,11 @@ ether_ifattach(struct ifnet *ifp, const u_int8_t *lla) if_printf(ifp, "Ethernet address: %6D\n", lla, ":"); uuid_ether_add(LLADDR(sdl)); + + /* Add necessary bits are setup; announce it now. */ + EVENTHANDLER_INVOKE(ether_ifattach_event, ifp); + if (IS_DEFAULT_VNET(curvnet)) + devctl_notify("ETHERNET", ifp->if_xname, "IFATTACH", NULL); } /* From owner-svn-src-all@freebsd.org Mon Jul 31 02:48:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72F5CDC7D41; Mon, 31 Jul 2017 02:48:20 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 147E1642E2; Mon, 31 Jul 2017 02:48:20 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6V2mJgY085135; Mon, 31 Jul 2017 02:48:19 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V2mIFr085133; Mon, 31 Jul 2017 02:48:18 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201707310248.v6V2mIFr085133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 31 Jul 2017 02:48:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321748 - stable/11/sys/dev/hyperv/netvsc X-SVN-Group: stable-11 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: stable/11/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 321748 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 02:48:20 -0000 Author: sephe Date: Mon Jul 31 02:48:18 2017 New Revision: 321748 URL: https://svnweb.freebsd.org/changeset/base/321748 Log: MFC 321407 hyperv/hn: Export VF list and VF-HN mapping The VF-HN map will be used later on to implement "transparent VF". Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D11618 Modified: stable/11/sys/dev/hyperv/netvsc/if_hn.c stable/11/sys/dev/hyperv/netvsc/if_hnvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/11/sys/dev/hyperv/netvsc/if_hn.c Mon Jul 31 02:33:49 2017 (r321747) +++ stable/11/sys/dev/hyperv/netvsc/if_hn.c Mon Jul 31 02:48:18 2017 (r321748) @@ -69,6 +69,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include @@ -119,6 +121,8 @@ __FBSDID("$FreeBSD$"); #define HN_RING_CNT_DEF_MAX 8 +#define HN_VFMAP_SIZE_DEF 8 + /* YYY should get it from the underlying channel */ #define HN_TX_DESC_CNT 512 @@ -255,6 +259,11 @@ static int hn_ifmedia_upd(struct ifnet *); static void hn_ifmedia_sts(struct ifnet *, struct ifmediareq *); +static void hn_ifnet_event(void *, struct ifnet *, int); +static void hn_ifaddr_event(void *, struct ifnet *); +static void hn_ifnet_attevent(void *, struct ifnet *); +static void hn_ifnet_detevent(void *, struct ifnet *); + static int hn_rndis_rxinfo(const void *, int, struct hn_rxinfo *); static void hn_rndis_rx_data(struct hn_rx_ring *, @@ -303,6 +312,9 @@ static int hn_txagg_pktmax_sysctl(SYSCTL_HANDLER_ARG static int hn_txagg_align_sysctl(SYSCTL_HANDLER_ARGS); static int hn_polling_sysctl(SYSCTL_HANDLER_ARGS); static int hn_vf_sysctl(SYSCTL_HANDLER_ARGS); +static int hn_rxvf_sysctl(SYSCTL_HANDLER_ARGS); +static int hn_vflist_sysctl(SYSCTL_HANDLER_ARGS); +static int hn_vfmap_sysctl(SYSCTL_HANDLER_ARGS); static void hn_stop(struct hn_softc *, bool); static void hn_init_locked(struct hn_softc *); @@ -502,9 +514,21 @@ static int hn_tx_agg_pkts = -1; SYSCTL_INT(_hw_hn, OID_AUTO, tx_agg_pkts, CTLFLAG_RDTUN, &hn_tx_agg_pkts, 0, "Packet transmission aggregation packet limit"); +/* VF list */ +SYSCTL_PROC(_hw_hn, OID_AUTO, vflist, CTLFLAG_RD | CTLTYPE_STRING, + 0, 0, hn_vflist_sysctl, "A", "VF list"); + +/* VF mapping */ +SYSCTL_PROC(_hw_hn, OID_AUTO, vfmap, CTLFLAG_RD | CTLTYPE_STRING, + 0, 0, hn_vfmap_sysctl, "A", "VF mapping"); + static u_int hn_cpu_index; /* next CPU for channel */ static struct taskqueue **hn_tx_taskque;/* shared TX taskqueues */ +static struct rmlock hn_vfmap_lock; +static int hn_vfmap_size; +static struct ifnet **hn_vfmap; + #ifndef RSS static const uint8_t hn_rss_key_default[NDIS_HASH_KEYSIZE_TOEPLITZ] = { @@ -971,7 +995,7 @@ hn_update_vf_task(void *arg, int pending __unused) { struct hn_update_vf *uv = arg; - uv->rxr->hn_vf = uv->vf; + uv->rxr->hn_rxvf_ifp = uv->vf; } static void @@ -994,37 +1018,50 @@ hn_update_vf(struct hn_softc *sc, struct ifnet *vf) uv.vf = vf; vmbus_chan_run_task(rxr->hn_chan, &task); } else { - rxr->hn_vf = vf; + rxr->hn_rxvf_ifp = vf; } } } -static void -hn_set_vf(struct hn_softc *sc, struct ifnet *ifp, bool vf) +static __inline bool +hn_ismyvf(const struct hn_softc *sc, const struct ifnet *ifp) { - struct ifnet *hn_ifp; + const struct ifnet *hn_ifp; - HN_LOCK(sc); - - if (!(sc->hn_flags & HN_FLAG_SYNTH_ATTACHED)) - goto out; - hn_ifp = sc->hn_ifp; if (ifp == hn_ifp) - goto out; + return (false); if (ifp->if_alloctype != IFT_ETHER) - goto out; + return (false); /* Ignore lagg/vlan interfaces */ if (strcmp(ifp->if_dname, "lagg") == 0 || strcmp(ifp->if_dname, "vlan") == 0) - goto out; + return (false); if (bcmp(IF_LLADDR(ifp), IF_LLADDR(hn_ifp), ETHER_ADDR_LEN) != 0) + return (false); + + return (true); +} + +static void +hn_set_vf(struct hn_softc *sc, struct ifnet *ifp, bool vf) +{ + struct ifnet *hn_ifp; + + HN_LOCK(sc); + + if (!(sc->hn_flags & HN_FLAG_SYNTH_ATTACHED)) goto out; + if (!hn_ismyvf(sc, ifp)) + goto out; + + hn_ifp = sc->hn_ifp; + /* Now we're sure 'ifp' is a real VF device. */ if (vf) { if (sc->hn_flags & HN_FLAG_VF) @@ -1037,7 +1074,7 @@ hn_set_vf(struct hn_softc *sc, struct ifnet *ifp, bool goto out; sc->hn_flags &= ~HN_FLAG_VF; - if (sc->hn_ifp->if_drv_flags & IFF_DRV_RUNNING) + if (hn_ifp->if_drv_flags & IFF_DRV_RUNNING) hn_rxfilter_config(sc); else hn_set_rxfilter(sc, NDIS_PACKET_TYPE_NONE); @@ -1052,7 +1089,7 @@ hn_set_vf(struct hn_softc *sc, struct ifnet *ifp, bool hn_suspend_mgmt(sc); sc->hn_link_flags &= ~(HN_LINK_FLAG_LINKUP | HN_LINK_FLAG_NETCHG); - if_link_state_change(sc->hn_ifp, LINK_STATE_DOWN); + if_link_state_change(hn_ifp, LINK_STATE_DOWN); } else { hn_resume_mgmt(sc); } @@ -1082,6 +1119,85 @@ hn_ifaddr_event(void *arg, struct ifnet *ifp) hn_set_vf(arg, ifp, ifp->if_flags & IFF_UP); } +static void +hn_ifnet_attevent(void *xsc, struct ifnet *ifp) +{ + struct hn_softc *sc = xsc; + + HN_LOCK(sc); + + if (!(sc->hn_flags & HN_FLAG_SYNTH_ATTACHED)) + goto done; + + if (!hn_ismyvf(sc, ifp)) + goto done; + + if (sc->hn_vf_ifp != NULL) { + if_printf(sc->hn_ifp, "%s was attached as VF\n", + sc->hn_vf_ifp->if_xname); + goto done; + } + + rm_wlock(&hn_vfmap_lock); + + if (ifp->if_index >= hn_vfmap_size) { + struct ifnet **newmap; + int newsize; + + newsize = ifp->if_index + HN_VFMAP_SIZE_DEF; + newmap = malloc(sizeof(struct ifnet *) * newsize, M_DEVBUF, + M_WAITOK | M_ZERO); + + memcpy(newmap, hn_vfmap, + sizeof(struct ifnet *) * hn_vfmap_size); + free(hn_vfmap, M_DEVBUF); + hn_vfmap = newmap; + hn_vfmap_size = newsize; + } + KASSERT(hn_vfmap[ifp->if_index] == NULL, + ("%s: ifindex %d was mapped to %s", + ifp->if_xname, ifp->if_index, hn_vfmap[ifp->if_index]->if_xname)); + hn_vfmap[ifp->if_index] = sc->hn_ifp; + + rm_wunlock(&hn_vfmap_lock); + + sc->hn_vf_ifp = ifp; +done: + HN_UNLOCK(sc); +} + +static void +hn_ifnet_detevent(void *xsc, struct ifnet *ifp) +{ + struct hn_softc *sc = xsc; + + HN_LOCK(sc); + + if (sc->hn_vf_ifp == NULL) + goto done; + + if (!hn_ismyvf(sc, ifp)) + goto done; + + sc->hn_vf_ifp = NULL; + + rm_wlock(&hn_vfmap_lock); + + KASSERT(ifp->if_index < hn_vfmap_size, + ("ifindex %d, vfmapsize %d", ifp->if_index, hn_vfmap_size)); + if (hn_vfmap[ifp->if_index] != NULL) { + KASSERT(hn_vfmap[ifp->if_index] == sc->hn_ifp, + ("%s: ifindex %d was mapped to %s", + ifp->if_xname, ifp->if_index, + hn_vfmap[ifp->if_index]->if_xname)); + hn_vfmap[ifp->if_index] = NULL; + } + + rm_wunlock(&hn_vfmap_lock); +done: + HN_UNLOCK(sc); +} + /* {F8615163-DF3E-46c5-913F-F2D2F965ED0E} */ static const struct hyperv_guid g_net_vsc_device_type = { .hv_guid = {0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46, @@ -1322,6 +1438,9 @@ hn_attach(device_t dev) SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "vf", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, hn_vf_sysctl, "A", "Virtual Function's name"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rxvf", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, + hn_rxvf_sysctl, "A", "activated Virtual Function's name"); /* * Setup the ifmedia, which has been initialized earlier. @@ -1412,10 +1531,14 @@ hn_attach(device_t dev) sc->hn_ifnet_evthand = EVENTHANDLER_REGISTER(ifnet_event, hn_ifnet_event, sc, EVENTHANDLER_PRI_ANY); - sc->hn_ifaddr_evthand = EVENTHANDLER_REGISTER(ifaddr_event, hn_ifaddr_event, sc, EVENTHANDLER_PRI_ANY); + sc->hn_ifnet_atthand = EVENTHANDLER_REGISTER(ether_ifattach_event, + hn_ifnet_attevent, sc, EVENTHANDLER_PRI_ANY); + sc->hn_ifnet_dethand = EVENTHANDLER_REGISTER(ifnet_departure_event, + hn_ifnet_detevent, sc, EVENTHANDLER_PRI_ANY); + return (0); failed: if (sc->hn_flags & HN_FLAG_SYNTH_ATTACHED) @@ -1428,13 +1551,26 @@ static int hn_detach(device_t dev) { struct hn_softc *sc = device_get_softc(dev); - struct ifnet *ifp = sc->hn_ifp; + struct ifnet *ifp = sc->hn_ifp, *vf_ifp; if (sc->hn_ifaddr_evthand != NULL) EVENTHANDLER_DEREGISTER(ifaddr_event, sc->hn_ifaddr_evthand); if (sc->hn_ifnet_evthand != NULL) EVENTHANDLER_DEREGISTER(ifnet_event, sc->hn_ifnet_evthand); + if (sc->hn_ifnet_atthand != NULL) { + EVENTHANDLER_DEREGISTER(ether_ifattach_event, + sc->hn_ifnet_atthand); + } + if (sc->hn_ifnet_dethand != NULL) { + EVENTHANDLER_DEREGISTER(ifnet_departure_event, + sc->hn_ifnet_dethand); + } + vf_ifp = sc->hn_vf_ifp; + __compiler_membar(); + if (vf_ifp != NULL) + hn_ifnet_detevent(sc, vf_ifp); + if (sc->hn_xact != NULL && vmbus_chan_is_revoked(sc->hn_prichan)) { /* * In case that the vmbus missed the orphan handler @@ -2326,7 +2462,7 @@ hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int int hash_type; /* If the VF is active, inject the packet through the VF */ - ifp = rxr->hn_vf ? rxr->hn_vf : rxr->hn_ifp; + ifp = rxr->hn_rxvf_ifp ? rxr->hn_rxvf_ifp : rxr->hn_ifp; if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { /* @@ -3301,12 +3437,12 @@ static int hn_vf_sysctl(SYSCTL_HANDLER_ARGS) { struct hn_softc *sc = arg1; - char vf_name[128]; + char vf_name[IFNAMSIZ + 1]; struct ifnet *vf; HN_LOCK(sc); vf_name[0] = '\0'; - vf = sc->hn_rx_ring[0].hn_vf; + vf = sc->hn_vf_ifp; if (vf != NULL) snprintf(vf_name, sizeof(vf_name), "%s", if_name(vf)); HN_UNLOCK(sc); @@ -3314,6 +3450,110 @@ hn_vf_sysctl(SYSCTL_HANDLER_ARGS) } static int +hn_rxvf_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct hn_softc *sc = arg1; + char vf_name[IFNAMSIZ + 1]; + struct ifnet *vf; + + HN_LOCK(sc); + vf_name[0] = '\0'; + vf = sc->hn_rx_ring[0].hn_rxvf_ifp; + if (vf != NULL) + snprintf(vf_name, sizeof(vf_name), "%s", if_name(vf)); + HN_UNLOCK(sc); + return sysctl_handle_string(oidp, vf_name, sizeof(vf_name), req); +} + +static int +hn_vflist_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct rm_priotracker pt; + struct sbuf *sb; + int error, i; + bool first; + + error = sysctl_wire_old_buffer(req, 0); + if (error != 0) + return (error); + + sb = sbuf_new_for_sysctl(NULL, NULL, 128, req); + if (sb == NULL) + return (ENOMEM); + + rm_rlock(&hn_vfmap_lock, &pt); + + first = true; + for (i = 0; i < hn_vfmap_size; ++i) { + struct ifnet *ifp; + + if (hn_vfmap[i] == NULL) + continue; + + ifp = ifnet_byindex(i); + if (ifp != NULL) { + if (first) + sbuf_printf(sb, "%s", ifp->if_xname); + else + sbuf_printf(sb, " %s", ifp->if_xname); + first = false; + } + } + + rm_runlock(&hn_vfmap_lock, &pt); + + error = sbuf_finish(sb); + sbuf_delete(sb); + return (error); +} + +static int +hn_vfmap_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct rm_priotracker pt; + struct sbuf *sb; + int error, i; + bool first; + + error = sysctl_wire_old_buffer(req, 0); + if (error != 0) + return (error); + + sb = sbuf_new_for_sysctl(NULL, NULL, 128, req); + if (sb == NULL) + return (ENOMEM); + + rm_rlock(&hn_vfmap_lock, &pt); + + first = true; + for (i = 0; i < hn_vfmap_size; ++i) { + struct ifnet *ifp, *hn_ifp; + + hn_ifp = hn_vfmap[i]; + if (hn_ifp == NULL) + continue; + + ifp = ifnet_byindex(i); + if (ifp != NULL) { + if (first) { + sbuf_printf(sb, "%s:%s", ifp->if_xname, + hn_ifp->if_xname); + } else { + sbuf_printf(sb, " %s:%s", ifp->if_xname, + hn_ifp->if_xname); + } + first = false; + } + } + + rm_runlock(&hn_vfmap_lock, &pt); + + error = sbuf_finish(sb); + sbuf_delete(sb); + return (error); +} + +static int hn_check_iplen(const struct mbuf *m, int hoff) { const struct ip *ip; @@ -5829,11 +6069,19 @@ hn_chan_callback(struct vmbus_channel *chan, void *xrx } static void -hn_tx_taskq_create(void *arg __unused) +hn_sysinit(void *arg __unused) { int i; /* + * Initialize VF map. + */ + rm_init_flags(&hn_vfmap_lock, "hn_vfmap", RM_SLEEPABLE); + hn_vfmap_size = HN_VFMAP_SIZE_DEF; + hn_vfmap = malloc(sizeof(struct ifnet *) * hn_vfmap_size, M_DEVBUF, + M_WAITOK | M_ZERO); + + /* * Fix the # of TX taskqueues. */ if (hn_tx_taskq_cnt <= 0) @@ -5869,11 +6117,10 @@ hn_tx_taskq_create(void *arg __unused) "hn tx%d", i); } } -SYSINIT(hn_txtq_create, SI_SUB_DRIVERS, SI_ORDER_SECOND, - hn_tx_taskq_create, NULL); +SYSINIT(hn_sysinit, SI_SUB_DRIVERS, SI_ORDER_SECOND, hn_sysinit, NULL); static void -hn_tx_taskq_destroy(void *arg __unused) +hn_sysuninit(void *arg __unused) { if (hn_tx_taskque != NULL) { @@ -5883,6 +6130,9 @@ hn_tx_taskq_destroy(void *arg __unused) taskqueue_free(hn_tx_taskque[i]); free(hn_tx_taskque, M_DEVBUF); } + + if (hn_vfmap != NULL) + free(hn_vfmap, M_DEVBUF); + rm_destroy(&hn_vfmap_lock); } -SYSUNINIT(hn_txtq_destroy, SI_SUB_DRIVERS, SI_ORDER_SECOND, - hn_tx_taskq_destroy, NULL); +SYSUNINIT(hn_sysuninit, SI_SUB_DRIVERS, SI_ORDER_SECOND, hn_sysuninit, NULL); Modified: stable/11/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- stable/11/sys/dev/hyperv/netvsc/if_hnvar.h Mon Jul 31 02:33:49 2017 (r321747) +++ stable/11/sys/dev/hyperv/netvsc/if_hnvar.h Mon Jul 31 02:48:18 2017 (r321748) @@ -59,7 +59,7 @@ struct hn_tx_ring; struct hn_rx_ring { struct ifnet *hn_ifp; - struct ifnet *hn_vf; /* SR-IOV VF */ + struct ifnet *hn_rxvf_ifp; /* SR-IOV VF for RX */ struct hn_tx_ring *hn_txr; void *hn_pktbuf; int hn_pktbuf_len; @@ -174,6 +174,7 @@ struct hn_tx_ring { */ struct hn_softc { struct ifnet *hn_ifp; + struct ifnet *hn_vf_ifp; /* SR-IOV VF */ struct ifmedia hn_media; device_t hn_dev; int hn_if_flags; @@ -238,6 +239,8 @@ struct hn_softc { eventhandler_tag hn_ifaddr_evthand; eventhandler_tag hn_ifnet_evthand; + eventhandler_tag hn_ifnet_atthand; + eventhandler_tag hn_ifnet_dethand; }; #define HN_FLAG_RXBUF_CONNECTED 0x0001 From owner-svn-src-all@freebsd.org Mon Jul 31 02:57:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBDD6DC7FF9; Mon, 31 Jul 2017 02:57:40 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F7E464726; Mon, 31 Jul 2017 02:57:40 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6V2vdsJ089049; Mon, 31 Jul 2017 02:57:39 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V2vd0C089048; Mon, 31 Jul 2017 02:57:39 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201707310257.v6V2vd0C089048@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 31 Jul 2017 02:57: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: r321749 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 321749 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 02:57:40 -0000 Author: sephe Date: Mon Jul 31 02:57:39 2017 New Revision: 321749 URL: https://svnweb.freebsd.org/changeset/base/321749 Log: MFC 321408 rndis: Add LINK_SPEED_CHANGE status Reviewed by: hselasky Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D11650 Modified: stable/11/sys/net/rndis.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/rndis.h ============================================================================== --- stable/11/sys/net/rndis.h Mon Jul 31 02:48:18 2017 (r321748) +++ stable/11/sys/net/rndis.h Mon Jul 31 02:57:39 2017 (r321749) @@ -31,6 +31,7 @@ #define RNDIS_STATUS_PENDING 0x00000103L #define RNDIS_STATUS_MEDIA_CONNECT 0x4001000BL #define RNDIS_STATUS_MEDIA_DISCONNECT 0x4001000CL +#define RNDIS_STATUS_LINK_SPEED_CHANGE 0x40010013L #define RNDIS_STATUS_NETWORK_CHANGE 0x40010018L #define RNDIS_STATUS_TASK_OFFLOAD_CURRENT_CONFIG 0x40020006L #define RNDIS_STATUS_BUFFER_OVERFLOW 0x80000005L From owner-svn-src-all@freebsd.org Mon Jul 31 03:04:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBE4DDC8211; Mon, 31 Jul 2017 03:04:40 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6FD7B64F6E; Mon, 31 Jul 2017 03:04:40 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6V34d8M093928; Mon, 31 Jul 2017 03:04:39 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V34doH093927; Mon, 31 Jul 2017 03:04:39 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201707310304.v6V34doH093927@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 31 Jul 2017 03: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: r321750 - stable/11/sys/dev/hyperv/netvsc X-SVN-Group: stable-11 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: stable/11/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 321750 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 03:04:40 -0000 Author: sephe Date: Mon Jul 31 03:04:39 2017 New Revision: 321750 URL: https://svnweb.freebsd.org/changeset/base/321750 Log: MFC 321409 hyperv/hn: Ignore LINK_SPEED_CHANGE status. This status will be reported if the backend NIC is wireless; it's not useful. Due to the high frequency of the reporting, this could be pretty annoying; ignore it. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D11651 Modified: stable/11/sys/dev/hyperv/netvsc/if_hn.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/11/sys/dev/hyperv/netvsc/if_hn.c Mon Jul 31 02:57:39 2017 (r321749) +++ stable/11/sys/dev/hyperv/netvsc/if_hn.c Mon Jul 31 03:04:39 2017 (r321750) @@ -5574,6 +5574,7 @@ hn_rndis_rx_status(struct hn_softc *sc, const void *da break; case RNDIS_STATUS_TASK_OFFLOAD_CURRENT_CONFIG: + case RNDIS_STATUS_LINK_SPEED_CHANGE: /* Not really useful; ignore. */ break; From owner-svn-src-all@freebsd.org Mon Jul 31 03:19:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2AFC9DC84B2; Mon, 31 Jul 2017 03:19:18 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E956F653B8; Mon, 31 Jul 2017 03:19:17 +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 v6V3JGHs098127; Mon, 31 Jul 2017 03:19:16 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V3JGvE098126; Mon, 31 Jul 2017 03:19:16 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201707310319.v6V3JGvE098126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 31 Jul 2017 03:19:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321751 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 321751 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 03:19:18 -0000 Author: ian Date: Mon Jul 31 03:19:16 2017 New Revision: 321751 URL: https://svnweb.freebsd.org/changeset/base/321751 Log: Remove now-unused variable. Modified: head/sys/dev/iicbus/ds1307.c Modified: head/sys/dev/iicbus/ds1307.c ============================================================================== --- head/sys/dev/iicbus/ds1307.c Mon Jul 31 03:04:39 2017 (r321750) +++ head/sys/dev/iicbus/ds1307.c Mon Jul 31 03:19:16 2017 (r321751) @@ -350,7 +350,6 @@ ds1307_settime(device_t dev, struct timespec *ts) { struct clocktime ct; struct ds1307_softc *sc; - long waitns; int error; uint8_t data[7]; uint8_t pmflags; From owner-svn-src-all@freebsd.org Mon Jul 31 03:25:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B62B5DC8696; Mon, 31 Jul 2017 03:25:22 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9AAD0657A4; Mon, 31 Jul 2017 03:25:22 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from Xins-MBP.ut.rhv.delphij.net (unknown [IPv6:2601:646:8882:37a:dd8a:e75a:9211:e42a]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id 21F5F16B47; Sun, 30 Jul 2017 20:25:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1501471522; x=1501485922; bh=nVWrdevmntQTfrx6lGfpHGjvTDTQ9VSns0VuPnCvnKc=; h=Cc:Subject:To:References:From:Date:In-Reply-To; b=5ID7QVHtb6qKqIBb2fxC2pw6UY7rgRn85dP4hjlX80g0cwPgzLLipqcqjQhqvJyh3 5rg/gKHr6YQV35biQ5E5ENXXO7yEVwY9Cu+wrgnUBxmgVSPw++5nX0qJm6VlPf3uDq e4UqfDfO56psX0tCC9jubkRWmADjAG1/m5arLh2o= Cc: d@delphij.net Subject: Re: svn commit: r321605 - head/contrib/ipfilter To: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201707270626.v6R6QFpx016943@repo.freebsd.org> From: Xin Li Message-ID: <59e80a44-d9de-5081-9eda-f068188b843f@delphij.net> Date: Sun, 30 Jul 2017 20:25:19 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <201707270626.v6R6QFpx016943@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="qkHf0G7WFcstcsFV7l4rWHvsuGQw2vRUe" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 03:25:22 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --qkHf0G7WFcstcsFV7l4rWHvsuGQw2vRUe Content-Type: multipart/mixed; boundary="Jr1WPDWc9v4DdGMW1MpMm9tsIXBjADiqo"; protected-headers="v1" From: Xin Li To: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Cc: d@delphij.net Message-ID: <59e80a44-d9de-5081-9eda-f068188b843f@delphij.net> Subject: Re: svn commit: r321605 - head/contrib/ipfilter References: <201707270626.v6R6QFpx016943@repo.freebsd.org> In-Reply-To: <201707270626.v6R6QFpx016943@repo.freebsd.org> --Jr1WPDWc9v4DdGMW1MpMm9tsIXBjADiqo Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 7/26/17 23:26, Cy Schubert wrote: > Author: cy > Date: Thu Jul 27 06:26:15 2017 > New Revision: 321605 > URL: https://svnweb.freebsd.org/changeset/base/321605 >=20 > Log: > As in r315225, discard 3072 bytes of RC4 bytestream instead of 1024. > =20 > PR: 217920 > Submitted by: codarren@hackers.mu > Reviewed by: emaste, cem > Approved by: so (implicit, in r315225) Why ipfilter is using its own pseudo random number generator? Please remove them altogether and use the system PRNG instead. Cheers, --Jr1WPDWc9v4DdGMW1MpMm9tsIXBjADiqo-- --qkHf0G7WFcstcsFV7l4rWHvsuGQw2vRUe Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJZfqMiAAoJEJW2GBstM+nsjK4P/161Peu4RfRmB8f0r+7CdWlG Dxcbrtr5pf+4TeKtPPIOv9QobeVPCxcCN2Ec3Pb/+LBjy3f/XrJYzzS0yAWz6gkr 2TB67Kuvp9wTCLZcyxu8fB10L4lT3cNOrwQ2Xr8FjJdJJXrPp6Dol3P5TGHdbpD4 K0F3wOw7ZNjWH6RmhKJXEFSkzX4VFtKONMItZlCtgqubObvWEbpUvsoC95hfs8er IIAlPNh48LxtTrEpyRDu2hqd/XTx52Rpcut1jfRo5rvaKAfZl2YGalnYX0NllFjo P1wpmI2ZJSMxfKaopeFLjwac9ri1IKicJaahGryU1r82YdMDrcDmoMJ7Bu8JsZoC NBzVc9mFmiv11MdyIUUbPsnVWXzhaDjkXedPuRSjWriODk2JzQf5t3NIS1kEyU8I lsCU16CWndH4+l7Kdg3G5BGFGCpM1/ubYobiJObUjrahwE2TGNrytu49ESm5eUdy LVbOwoq1NWg+M6nGLnPyZUEz0emorXbmebVzGFyl7NX6cIh31yNXoupvR+O9Gm/L jQmD9Mhfnb5Vi/N2KEl2Io4udVMOX84/vqALWN+09YgretG3MY4V1QywBbA8ZZJk 8bpEVsTrBJNFpZq8rF08t5O7jYs9AfzZ5qWEehBIus1AhpyVz/kSj+E9Bc7FbYRG lgFwudjhcxnLZqk+vBXh =B0Ry -----END PGP SIGNATURE----- --qkHf0G7WFcstcsFV7l4rWHvsuGQw2vRUe-- From owner-svn-src-all@freebsd.org Mon Jul 31 03:49:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD122DC89D8; Mon, 31 Jul 2017 03:49:09 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 793C065ED6; Mon, 31 Jul 2017 03:49:09 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6V3n8ec010308; Mon, 31 Jul 2017 03:49:08 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V3n82L010306; Mon, 31 Jul 2017 03:49:08 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201707310349.v6V3n82L010306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 31 Jul 2017 03:49:08 +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: r321752 - stable/10/sys/net X-SVN-Group: stable-10 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: stable/10/sys/net X-SVN-Commit-Revision: 321752 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 03:49:09 -0000 Author: sephe Date: Mon Jul 31 03:49:08 2017 New Revision: 321752 URL: https://svnweb.freebsd.org/changeset/base/321752 Log: MFC 321406 ethernet: Add ethernet interface attached event and devctl notification. ifnet_arrival_event may not be adequate under certain situation; e.g. when the LLADDR is needed. So the ethernet ifattach event is announced after all necessary bits are setup. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D11617 Modified: stable/10/sys/net/ethernet.h stable/10/sys/net/if_ethersubr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/ethernet.h ============================================================================== --- stable/10/sys/net/ethernet.h Mon Jul 31 03:19:16 2017 (r321751) +++ stable/10/sys/net/ethernet.h Mon Jul 31 03:49:08 2017 (r321752) @@ -384,6 +384,12 @@ void ether_vlan_mtap(struct bpf_if *, struct mbuf *, void *, u_int); struct mbuf *ether_vlanencap(struct mbuf *, uint16_t); +#ifdef SYS_EVENTHANDLER_H +/* new ethernet interface attached event */ +typedef void (*ether_ifattach_event_handler_t)(void *, struct ifnet *); +EVENTHANDLER_DECLARE(ether_ifattach_event, ether_ifattach_event_handler_t); +#endif + #else /* _KERNEL */ #include Modified: stable/10/sys/net/if_ethersubr.c ============================================================================== --- stable/10/sys/net/if_ethersubr.c Mon Jul 31 03:19:16 2017 (r321751) +++ stable/10/sys/net/if_ethersubr.c Mon Jul 31 03:49:08 2017 (r321752) @@ -39,6 +39,8 @@ #include #include +#include +#include #include #include #include @@ -933,6 +935,11 @@ ether_ifattach(struct ifnet *ifp, const u_int8_t *lla) if_printf(ifp, "Ethernet address: %6D\n", lla, ":"); uuid_ether_add(LLADDR(sdl)); + + /* Add necessary bits are setup; announce it now. */ + EVENTHANDLER_INVOKE(ether_ifattach_event, ifp); + if (IS_DEFAULT_VNET(curvnet)) + devctl_notify("ETHERNET", ifp->if_xname, "IFATTACH", NULL); } /* From owner-svn-src-all@freebsd.org Mon Jul 31 03:57:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4ABBCDC8FE6; Mon, 31 Jul 2017 03:57:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1346866351; Mon, 31 Jul 2017 03:57:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6V3vkFu014556; Mon, 31 Jul 2017 03:57:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V3vkRV014554; Mon, 31 Jul 2017 03:57:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707310357.v6V3vkRV014554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 31 Jul 2017 03:57:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321753 - in stable/10/share/examples/tests/tests: atf plain X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10/share/examples/tests/tests: atf plain X-SVN-Commit-Revision: 321753 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 03:57:47 -0000 Author: ngie Date: Mon Jul 31 03:57:45 2017 New Revision: 321753 URL: https://svnweb.freebsd.org/changeset/base/321753 Log: MFC Note: ${FILES} documentation change omitted since r299094 will not be MFCed to ^/stable/10 . MFC r320442: share/examples/tests/{atf,plain}/Makefile: tweak example Makefile snippets - Including bsd.own.mk isn't required since no MK_ knobs are being manipulated. - Update documentation to note that ${FILES} is installed via bsd.progs.mk, not bsd.prog.mk. Modified: stable/10/share/examples/tests/tests/atf/Makefile stable/10/share/examples/tests/tests/plain/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/share/examples/tests/tests/atf/Makefile ============================================================================== --- stable/10/share/examples/tests/tests/atf/Makefile Mon Jul 31 03:49:08 2017 (r321752) +++ stable/10/share/examples/tests/tests/atf/Makefile Mon Jul 31 03:57:45 2017 (r321753) @@ -1,7 +1,5 @@ # $FreeBSD$ -.include - # Directory into which the Kyuafile provided by this directory will be # installed. # Modified: stable/10/share/examples/tests/tests/plain/Makefile ============================================================================== --- stable/10/share/examples/tests/tests/plain/Makefile Mon Jul 31 03:49:08 2017 (r321752) +++ stable/10/share/examples/tests/tests/plain/Makefile Mon Jul 31 03:57:45 2017 (r321753) @@ -1,7 +1,5 @@ # $FreeBSD$ -.include - # Directory into which the Kyuafile provided by this directory will be # installed. # From owner-svn-src-all@freebsd.org Mon Jul 31 03:59:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D239DC9059; Mon, 31 Jul 2017 03:59:00 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDF5866484; Mon, 31 Jul 2017 03:58:59 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6V3wxNT014681; Mon, 31 Jul 2017 03:58:59 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V3wxNf014679; Mon, 31 Jul 2017 03:58:59 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707310358.v6V3wxNf014679@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 31 Jul 2017 03:58:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321754 - in stable/11: contrib/atf/atf-sh libexec/atf/atf-sh X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/11: contrib/atf/atf-sh libexec/atf/atf-sh X-SVN-Commit-Revision: 321754 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 03:59:00 -0000 Author: ngie Date: Mon Jul 31 03:58:58 2017 New Revision: 321754 URL: https://svnweb.freebsd.org/changeset/base/321754 Log: MFC r320491: atf-sh(3): document atf_init_test_cases(3) fully The function was missing from the NAME/SYNOPSIS sections. Add a manpage link to complete the documentation reference. Modified: stable/11/contrib/atf/atf-sh/atf-sh.3 stable/11/libexec/atf/atf-sh/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/atf/atf-sh/atf-sh.3 ============================================================================== --- stable/11/contrib/atf/atf-sh/atf-sh.3 Mon Jul 31 03:57:45 2017 (r321753) +++ stable/11/contrib/atf/atf-sh/atf-sh.3 Mon Jul 31 03:58:58 2017 (r321754) @@ -40,6 +40,7 @@ .Nm atf_fail , .Nm atf_get , .Nm atf_get_srcdir , +.Nm atf_init_test_cases , .Nm atf_pass , .Nm atf_require_prog , .Nm atf_set , @@ -82,6 +83,8 @@ .Nm atf_get .Qq var_name .Nm atf_get_srcdir +.Nm atf_init_test_cases +.Qq name .Nm atf_pass .Nm atf_require_prog .Qq prog_name Modified: stable/11/libexec/atf/atf-sh/Makefile ============================================================================== --- stable/11/libexec/atf/atf-sh/Makefile Mon Jul 31 03:57:45 2017 (r321753) +++ stable/11/libexec/atf/atf-sh/Makefile Mon Jul 31 03:58:58 2017 (r321754) @@ -52,6 +52,7 @@ MLINKS+= \ atf-sh.3 atf_fail.3 \ atf-sh.3 atf_get.3 \ atf-sh.3 atf_get_srcdir.3 \ + atf-sh.3 atf_init_test_cases.3 \ atf-sh.3 atf_pass.3 \ atf-sh.3 atf_require_prog.3 \ atf-sh.3 atf_set.3 \ From owner-svn-src-all@freebsd.org Mon Jul 31 03:59:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8332CDC9094; Mon, 31 Jul 2017 03:59:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BBC3664E9; Mon, 31 Jul 2017 03:59:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6V3x7dD014736; Mon, 31 Jul 2017 03:59:07 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V3x73f014734; Mon, 31 Jul 2017 03:59:07 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201707310359.v6V3x73f014734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 31 Jul 2017 03:59:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321755 - in stable/10: contrib/atf/atf-sh libexec/atf/atf-sh X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10: contrib/atf/atf-sh libexec/atf/atf-sh X-SVN-Commit-Revision: 321755 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 03:59:08 -0000 Author: ngie Date: Mon Jul 31 03:59:07 2017 New Revision: 321755 URL: https://svnweb.freebsd.org/changeset/base/321755 Log: MFC r320491: atf-sh(3): document atf_init_test_cases(3) fully The function was missing from the NAME/SYNOPSIS sections. Add a manpage link to complete the documentation reference. Modified: stable/10/contrib/atf/atf-sh/atf-sh.3 stable/10/libexec/atf/atf-sh/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/atf/atf-sh/atf-sh.3 ============================================================================== --- stable/10/contrib/atf/atf-sh/atf-sh.3 Mon Jul 31 03:58:58 2017 (r321754) +++ stable/10/contrib/atf/atf-sh/atf-sh.3 Mon Jul 31 03:59:07 2017 (r321755) @@ -40,6 +40,7 @@ .Nm atf_fail , .Nm atf_get , .Nm atf_get_srcdir , +.Nm atf_init_test_cases , .Nm atf_pass , .Nm atf_require_prog , .Nm atf_set , @@ -82,6 +83,8 @@ .Nm atf_get .Qq var_name .Nm atf_get_srcdir +.Nm atf_init_test_cases +.Qq name .Nm atf_pass .Nm atf_require_prog .Qq prog_name Modified: stable/10/libexec/atf/atf-sh/Makefile ============================================================================== --- stable/10/libexec/atf/atf-sh/Makefile Mon Jul 31 03:58:58 2017 (r321754) +++ stable/10/libexec/atf/atf-sh/Makefile Mon Jul 31 03:59:07 2017 (r321755) @@ -51,6 +51,7 @@ MLINKS+= \ atf-sh.3 atf_fail.3 \ atf-sh.3 atf_get.3 \ atf-sh.3 atf_get_srcdir.3 \ + atf-sh.3 atf_init_test_cases.3 \ atf-sh.3 atf_pass.3 \ atf-sh.3 atf_require_prog.3 \ atf-sh.3 atf_set.3 \ From owner-svn-src-all@freebsd.org Mon Jul 31 05:23:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E5ACDCA35A; Mon, 31 Jul 2017 05:23:26 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 224F7683A1; Mon, 31 Jul 2017 05:23:25 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id c3AhdiB1sMaqMc3AidJ8xw; Sun, 30 Jul 2017 23:23:19 -0600 X-Authority-Analysis: v=2.2 cv=Qc8WhoTv c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=G3gG6ho9WtcA:10 a=SWg00rOMAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=r2EcXQugN9ykcdfzfG0A:9 a=CjuIK1q_8ugA:10 a=nWvTgx2JuP7DHgfbJPXu:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 434FE3DF; Sun, 30 Jul 2017 22:23:15 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id v6V5Lxs6004242; Sun, 30 Jul 2017 22:21:59 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201707310521.v6V5Lxs6004242@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Xin Li cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, d@delphij.net Subject: Re: svn commit: r321605 - head/contrib/ipfilter In-Reply-To: Message from Xin Li of "Sun, 30 Jul 2017 20:25:19 -0700." <59e80a44-d9de-5081-9eda-f068188b843f@delphij.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 30 Jul 2017 22:21:59 -0700 X-CMAE-Envelope: MS4wfCNe+NdSOKEpMiS/Kbc5T7bdvTawLBc+gWGL2+kPTDEMQPy4wiXXvJxcqDjGWb2uwsz3HgMvyAaaHAC4RsimWNhzCQGKD5lh2YoQbkNAKBSAeQeOSClW osRFjtCWpeCwRUCMUCDYNnHmh+VCuImSfdiaZusQHsQLv8129wmsws4uBsPnMd2efLdLxmgVok3MLUjB2RCDFslrMMpENkkyylNOXA8xDVPSIVrRU+8Eajqw BWebfzV65c/a3KRpPQFr1+CFC0Xv9+i3hS2kVqL/VfqvvIiAmDPclfheNEThwT+/GRKbSH7wFb4g2AdOczIRd77rKeAMgVCFk6/0y9Fiy+w= X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 05:23:26 -0000 In message <59e80a44-d9de-5081-9eda-f068188b843f@delphij.net>, Xin Li writes: > On 7/26/17 23:26, Cy Schubert wrote: > > Author: cy > > Date: Thu Jul 27 06:26:15 2017 > > New Revision: 321605 > > URL: https://svnweb.freebsd.org/changeset/base/321605 > >=20 > > Log: > > As in r315225, discard 3072 bytes of RC4 bytestream instead of 1024. > > =20 > > PR: 217920 > > Submitted by: codarren@hackers.mu > > Reviewed by: emaste, cem > > Approved by: so (implicit, in r315225) > > Why ipfilter is using its own pseudo random number generator? Please > remove them altogether and use the system PRNG instead. It uses this code when it builds the kernel sources in a userland program called ipftest. ipftest is a userland application outside of the kernel in which users pass generated or captured packets into it to test arbitrary ipfilter rules, which are separate from those in the kernel. ipftest is a rule testing application. ipftest is currently broken (it segfaults) and in my queue for loving attention. I'll look into using the libkern version of arc4rand(9) in this userland utility. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Mon Jul 31 05:28:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A6EEDCA469; Mon, 31 Jul 2017 05:28:37 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id EAE446860E; Mon, 31 Jul 2017 05:28:36 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id c3FldiCCbMaqMc3FmdJ9QJ; Sun, 30 Jul 2017 23:28:30 -0600 X-Authority-Analysis: v=2.2 cv=Qc8WhoTv c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=G3gG6ho9WtcA:10 a=SWg00rOMAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=jfMoK7GJBfBctF8Pp8sA:9 a=CjuIK1q_8ugA:10 a=nWvTgx2JuP7DHgfbJPXu:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 03EB33F5; Sun, 30 Jul 2017 22:28:28 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id v6V5RDRJ004333; Sun, 30 Jul 2017 22:27:13 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201707310527.v6V5RDRJ004333@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Xin Li , Cy Schubert cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, d@delphij.net Subject: Re: svn commit: r321605 - head/contrib/ipfilter In-Reply-To: Message from Cy Schubert of "Sun, 30 Jul 2017 22:21:59 -0700." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 30 Jul 2017 22:27:13 -0700 X-CMAE-Envelope: MS4wfI0yYcNQFo3jw2BQXfLyntdqsYItq3Gzq6b2vKVJhcBpNgvmLXAAvXdDc7JwTZ/h3pQg4T5onpMhDtZDAcusCKGHDgiQfLTCDpauxnFzgXA2PO873cpa n0Dd4gTIGKH+kwZE8UbSLfq1BTLDhgt+P+1DiyoftgfbPV0wvGyQfCypeefdhFV7mBSvZQJaLJzDX5dVEifMaO3U65Sj0YcLLIJovJ2IP09OIJUHzR5VdNwI N3tT22n2Sl38L5bON//hC/mzpBkHtbbBaRpMXto/mXa+OHlBDKl0P/LWaoTPDwPcTYNo/11Xvsu5lrkmY+/ko9XvVolp77CnHjs+j745oS4= X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 05:28:37 -0000 Cy Schubert writes: > In message <59e80a44-d9de-5081-9eda-f068188b843f@delphij.net>, Xin Li > writes: > > On 7/26/17 23:26, Cy Schubert wrote: > > > Author: cy > > > Date: Thu Jul 27 06:26:15 2017 > > > New Revision: 321605 > > > URL: https://svnweb.freebsd.org/changeset/base/321605 > > >=20 > > > Log: > > > As in r315225, discard 3072 bytes of RC4 bytestream instead of 1024. > > > =20 > > > PR: 217920 > > > Submitted by: codarren@hackers.mu > > > Reviewed by: emaste, cem > > > Approved by: so (implicit, in r315225) > > > > Why ipfilter is using its own pseudo random number generator? Please > > remove them altogether and use the system PRNG instead. > > It uses this code when it builds the kernel sources in a userland program > called ipftest. ipftest is a userland application outside of the kernel in > which users pass generated or captured packets into it to test arbitrary > ipfilter rules, which are separate from those in the kernel. ipftest is a > rule testing application. ipftest is currently broken (it segfaults) and in > my queue for loving attention. I'll look into using the libkern version of > arc4rand(9) in this userland utility. This will take a little more surgery than initially thought. make: "/export/home/cy/freebsd/svn/current/share/mk/src.libnames.mk" line 563: /export/home/cy/freebsd/svn/current/sbin/ipf/ipftest: Invalid LIBADD used which may need to be added to src.libnames.mk: libkern Probably not a good idea anyway to reference libkern from a userland utility. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Mon Jul 31 06:17:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C704DCAC83; Mon, 31 Jul 2017 06:17:22 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 3396D6966D; Mon, 31 Jul 2017 06:17:21 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id c411diM2nMaqMc412dJDBY; Mon, 31 Jul 2017 00:17:20 -0600 X-Authority-Analysis: v=2.2 cv=Qc8WhoTv c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=G3gG6ho9WtcA:10 a=VxmjJ2MpAAAA:8 a=SWg00rOMAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=aQURqbsA0iTKZVjtE9oA:9 a=gvgE5aWGGUghFNBC:21 a=zhIP_C7Dr5RDXHsw:21 a=CjuIK1q_8ugA:10 a=7gXAzLPJhVmCkEl4_tsf:22 a=nWvTgx2JuP7DHgfbJPXu:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 1C4C540B; Sun, 30 Jul 2017 23:17:19 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id v6V6G36T052681; Sun, 30 Jul 2017 23:16:03 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201707310616.v6V6G36T052681@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Xin Li , Cy Schubert cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, d@delphij.net Subject: Re: svn commit: r321605 - head/contrib/ipfilter In-Reply-To: Message from Cy Schubert of "Sun, 30 Jul 2017 22:27:13 -0700." <201707310527.v6V5RDRJ004333@slippy.cwsent.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 30 Jul 2017 23:16:03 -0700 X-CMAE-Envelope: MS4wfC2/41cM6FHv14ZG9j1laIZn9h7v92Yqpc61RPF98kpyNX7B+zaAqpwj5gIWgOGiiBa4D8v48tnd8iBSFTKom6x0zKMtFtZvEiuFp9OzJ2NO/YWPu/ns lPE2mm7YwgX2+TELPfwd+GFasjnRKmRHpjNs14ogwyxNBG+u7lvzurkOWHVx27VkjbSZWra3B2PP97iSCPD0v54rT2tL8K9CPFj1U4W5bksodHaS2dcc+rgt HXSQTF+wgw+dh2sPF8JswH7BfUoBVzCfYWj9UVj364bkDlpU+sRwAIB2JAVUVQn0zkISN6wbmdzK0sBL1zzRma8Sk+0uWrBddsv00QG61ls= X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 06:17:22 -0000 In message <201707310527.v6V5RDRJ004333@slippy.cwsent.com>, Cy Schubert writes: > Cy Schubert writes: > > In message <59e80a44-d9de-5081-9eda-f068188b843f@delphij.net>, Xin Li > > writes: > > > On 7/26/17 23:26, Cy Schubert wrote: > > > > Author: cy > > > > Date: Thu Jul 27 06:26:15 2017 > > > > New Revision: 321605 > > > > URL: https://svnweb.freebsd.org/changeset/base/321605 > > > >=20 > > > > Log: > > > > As in r315225, discard 3072 bytes of RC4 bytestream instead of 1024. > > > > =20 > > > > PR: 217920 > > > > Submitted by: codarren@hackers.mu > > > > Reviewed by: emaste, cem > > > > Approved by: so (implicit, in r315225) > > > > > > Why ipfilter is using its own pseudo random number generator? Please > > > remove them altogether and use the system PRNG instead. > > > > It uses this code when it builds the kernel sources in a userland program > > called ipftest. ipftest is a userland application outside of the kernel in > > which users pass generated or captured packets into it to test arbitrary > > ipfilter rules, which are separate from those in the kernel. ipftest is a > > rule testing application. ipftest is currently broken (it segfaults) and in > > > my queue for loving attention. I'll look into using the libkern version of > > arc4rand(9) in this userland utility. > > This will take a little more surgery than initially thought. > > make: "/export/home/cy/freebsd/svn/current/share/mk/src.libnames.mk" line > 563: /export/home/cy/freebsd/svn/current/sbin/ipf/ipftest: Invalid LIBADD > used which may need to be added to src.libnames.mk: libkern > > Probably not a good idea anyway to reference libkern from a userland > utility. Late night moving furniture. Sorry, I should have worded this better. This is an approximation of the libkern arc4rand(9) used in the ipftest(1) userland arbitrary rule testing utility. IP Filter "duplicates" a number of kernel function calls, including this one, to facilitate ipftest's use of ipfilter's kernel sources in the userland utility. My previous email's wording was disrespectful and simply bad. My apologies. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Mon Jul 31 06:27:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD526DCAE7A; Mon, 31 Jul 2017 06:27:44 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7E69369AFF; Mon, 31 Jul 2017 06:27:44 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6V6RhGl074862; Mon, 31 Jul 2017 06:27:43 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V6RhHh074860; Mon, 31 Jul 2017 06:27:43 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201707310627.v6V6RhHh074860@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 31 Jul 2017 06:27: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: r321759 - stable/10/sys/dev/hyperv/netvsc X-SVN-Group: stable-10 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: stable/10/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 321759 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 06:27:44 -0000 Author: sephe Date: Mon Jul 31 06:27:43 2017 New Revision: 321759 URL: https://svnweb.freebsd.org/changeset/base/321759 Log: MFC 321407 hyperv/hn: Export VF list and VF-HN mapping The VF-HN map will be used later on to implement "transparent VF". Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D11618 Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c stable/10/sys/dev/hyperv/netvsc/if_hnvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hn.c Mon Jul 31 05:23:32 2017 (r321758) +++ stable/10/sys/dev/hyperv/netvsc/if_hn.c Mon Jul 31 06:27:43 2017 (r321759) @@ -69,6 +69,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include @@ -118,6 +120,8 @@ __FBSDID("$FreeBSD$"); #define HN_RING_CNT_DEF_MAX 8 +#define HN_VFMAP_SIZE_DEF 8 + /* YYY should get it from the underlying channel */ #define HN_TX_DESC_CNT 512 @@ -250,6 +254,11 @@ static int hn_ifmedia_upd(struct ifnet *); static void hn_ifmedia_sts(struct ifnet *, struct ifmediareq *); +static void hn_ifnet_event(void *, struct ifnet *, int); +static void hn_ifaddr_event(void *, struct ifnet *); +static void hn_ifnet_attevent(void *, struct ifnet *); +static void hn_ifnet_detevent(void *, struct ifnet *); + static int hn_rndis_rxinfo(const void *, int, struct hn_rxinfo *); static void hn_rndis_rx_data(struct hn_rx_ring *, @@ -296,6 +305,9 @@ static int hn_txagg_pktmax_sysctl(SYSCTL_HANDLER_ARG static int hn_txagg_align_sysctl(SYSCTL_HANDLER_ARGS); static int hn_polling_sysctl(SYSCTL_HANDLER_ARGS); static int hn_vf_sysctl(SYSCTL_HANDLER_ARGS); +static int hn_rxvf_sysctl(SYSCTL_HANDLER_ARGS); +static int hn_vflist_sysctl(SYSCTL_HANDLER_ARGS); +static int hn_vfmap_sysctl(SYSCTL_HANDLER_ARGS); static void hn_stop(struct hn_softc *, bool); static void hn_init_locked(struct hn_softc *); @@ -493,9 +505,21 @@ static int hn_tx_agg_pkts = -1; SYSCTL_INT(_hw_hn, OID_AUTO, tx_agg_pkts, CTLFLAG_RDTUN, &hn_tx_agg_pkts, 0, "Packet transmission aggregation packet limit"); +/* VF list */ +SYSCTL_PROC(_hw_hn, OID_AUTO, vflist, CTLFLAG_RD | CTLTYPE_STRING, + 0, 0, hn_vflist_sysctl, "A", "VF list"); + +/* VF mapping */ +SYSCTL_PROC(_hw_hn, OID_AUTO, vfmap, CTLFLAG_RD | CTLTYPE_STRING, + 0, 0, hn_vfmap_sysctl, "A", "VF mapping"); + static u_int hn_cpu_index; /* next CPU for channel */ static struct taskqueue **hn_tx_taskque;/* shared TX taskqueues */ +static struct rmlock hn_vfmap_lock; +static int hn_vfmap_size; +static struct ifnet **hn_vfmap; + static const uint8_t hn_rss_key_default[NDIS_HASH_KEYSIZE_TOEPLITZ] = { 0x6d, 0x5a, 0x56, 0xda, 0x25, 0x5b, 0x0e, 0xc2, @@ -958,7 +982,7 @@ hn_update_vf_task(void *arg, int pending __unused) { struct hn_update_vf *uv = arg; - uv->rxr->hn_vf = uv->vf; + uv->rxr->hn_rxvf_ifp = uv->vf; } static void @@ -981,37 +1005,50 @@ hn_update_vf(struct hn_softc *sc, struct ifnet *vf) uv.vf = vf; vmbus_chan_run_task(rxr->hn_chan, &task); } else { - rxr->hn_vf = vf; + rxr->hn_rxvf_ifp = vf; } } } -static void -hn_set_vf(struct hn_softc *sc, struct ifnet *ifp, bool vf) +static __inline bool +hn_ismyvf(const struct hn_softc *sc, const struct ifnet *ifp) { - struct ifnet *hn_ifp; + const struct ifnet *hn_ifp; - HN_LOCK(sc); - - if (!(sc->hn_flags & HN_FLAG_SYNTH_ATTACHED)) - goto out; - hn_ifp = sc->hn_ifp; if (ifp == hn_ifp) - goto out; + return (false); if (ifp->if_alloctype != IFT_ETHER) - goto out; + return (false); /* Ignore lagg/vlan interfaces */ if (strcmp(ifp->if_dname, "lagg") == 0 || strcmp(ifp->if_dname, "vlan") == 0) - goto out; + return (false); if (bcmp(IF_LLADDR(ifp), IF_LLADDR(hn_ifp), ETHER_ADDR_LEN) != 0) + return (false); + + return (true); +} + +static void +hn_set_vf(struct hn_softc *sc, struct ifnet *ifp, bool vf) +{ + struct ifnet *hn_ifp; + + HN_LOCK(sc); + + if (!(sc->hn_flags & HN_FLAG_SYNTH_ATTACHED)) goto out; + if (!hn_ismyvf(sc, ifp)) + goto out; + + hn_ifp = sc->hn_ifp; + /* Now we're sure 'ifp' is a real VF device. */ if (vf) { if (sc->hn_flags & HN_FLAG_VF) @@ -1024,7 +1061,7 @@ hn_set_vf(struct hn_softc *sc, struct ifnet *ifp, bool goto out; sc->hn_flags &= ~HN_FLAG_VF; - if (sc->hn_ifp->if_drv_flags & IFF_DRV_RUNNING) + if (hn_ifp->if_drv_flags & IFF_DRV_RUNNING) hn_rxfilter_config(sc); else hn_set_rxfilter(sc, NDIS_PACKET_TYPE_NONE); @@ -1039,7 +1076,7 @@ hn_set_vf(struct hn_softc *sc, struct ifnet *ifp, bool hn_suspend_mgmt(sc); sc->hn_link_flags &= ~(HN_LINK_FLAG_LINKUP | HN_LINK_FLAG_NETCHG); - if_link_state_change(sc->hn_ifp, LINK_STATE_DOWN); + if_link_state_change(hn_ifp, LINK_STATE_DOWN); } else { hn_resume_mgmt(sc); } @@ -1069,6 +1106,85 @@ hn_ifaddr_event(void *arg, struct ifnet *ifp) hn_set_vf(arg, ifp, ifp->if_flags & IFF_UP); } +static void +hn_ifnet_attevent(void *xsc, struct ifnet *ifp) +{ + struct hn_softc *sc = xsc; + + HN_LOCK(sc); + + if (!(sc->hn_flags & HN_FLAG_SYNTH_ATTACHED)) + goto done; + + if (!hn_ismyvf(sc, ifp)) + goto done; + + if (sc->hn_vf_ifp != NULL) { + if_printf(sc->hn_ifp, "%s was attached as VF\n", + sc->hn_vf_ifp->if_xname); + goto done; + } + + rm_wlock(&hn_vfmap_lock); + + if (ifp->if_index >= hn_vfmap_size) { + struct ifnet **newmap; + int newsize; + + newsize = ifp->if_index + HN_VFMAP_SIZE_DEF; + newmap = malloc(sizeof(struct ifnet *) * newsize, M_DEVBUF, + M_WAITOK | M_ZERO); + + memcpy(newmap, hn_vfmap, + sizeof(struct ifnet *) * hn_vfmap_size); + free(hn_vfmap, M_DEVBUF); + hn_vfmap = newmap; + hn_vfmap_size = newsize; + } + KASSERT(hn_vfmap[ifp->if_index] == NULL, + ("%s: ifindex %d was mapped to %s", + ifp->if_xname, ifp->if_index, hn_vfmap[ifp->if_index]->if_xname)); + hn_vfmap[ifp->if_index] = sc->hn_ifp; + + rm_wunlock(&hn_vfmap_lock); + + sc->hn_vf_ifp = ifp; +done: + HN_UNLOCK(sc); +} + +static void +hn_ifnet_detevent(void *xsc, struct ifnet *ifp) +{ + struct hn_softc *sc = xsc; + + HN_LOCK(sc); + + if (sc->hn_vf_ifp == NULL) + goto done; + + if (!hn_ismyvf(sc, ifp)) + goto done; + + sc->hn_vf_ifp = NULL; + + rm_wlock(&hn_vfmap_lock); + + KASSERT(ifp->if_index < hn_vfmap_size, + ("ifindex %d, vfmapsize %d", ifp->if_index, hn_vfmap_size)); + if (hn_vfmap[ifp->if_index] != NULL) { + KASSERT(hn_vfmap[ifp->if_index] == sc->hn_ifp, + ("%s: ifindex %d was mapped to %s", + ifp->if_xname, ifp->if_index, + hn_vfmap[ifp->if_index]->if_xname)); + hn_vfmap[ifp->if_index] = NULL; + } + + rm_wunlock(&hn_vfmap_lock); +done: + HN_UNLOCK(sc); +} + /* {F8615163-DF3E-46c5-913F-F2D2F965ED0E} */ static const struct hyperv_guid g_net_vsc_device_type = { .hv_guid = {0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46, @@ -1300,6 +1416,9 @@ hn_attach(device_t dev) SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "vf", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, hn_vf_sysctl, "A", "Virtual Function's name"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rxvf", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, + hn_rxvf_sysctl, "A", "activated Virtual Function's name"); /* * Setup the ifmedia, which has been initialized earlier. @@ -1395,10 +1514,14 @@ hn_attach(device_t dev) sc->hn_ifnet_evthand = EVENTHANDLER_REGISTER(ifnet_event, hn_ifnet_event, sc, EVENTHANDLER_PRI_ANY); - sc->hn_ifaddr_evthand = EVENTHANDLER_REGISTER(ifaddr_event, hn_ifaddr_event, sc, EVENTHANDLER_PRI_ANY); + sc->hn_ifnet_atthand = EVENTHANDLER_REGISTER(ether_ifattach_event, + hn_ifnet_attevent, sc, EVENTHANDLER_PRI_ANY); + sc->hn_ifnet_dethand = EVENTHANDLER_REGISTER(ifnet_departure_event, + hn_ifnet_detevent, sc, EVENTHANDLER_PRI_ANY); + return (0); failed: if (sc->hn_flags & HN_FLAG_SYNTH_ATTACHED) @@ -1411,13 +1534,26 @@ static int hn_detach(device_t dev) { struct hn_softc *sc = device_get_softc(dev); - struct ifnet *ifp = sc->hn_ifp; + struct ifnet *ifp = sc->hn_ifp, *vf_ifp; if (sc->hn_ifaddr_evthand != NULL) EVENTHANDLER_DEREGISTER(ifaddr_event, sc->hn_ifaddr_evthand); if (sc->hn_ifnet_evthand != NULL) EVENTHANDLER_DEREGISTER(ifnet_event, sc->hn_ifnet_evthand); + if (sc->hn_ifnet_atthand != NULL) { + EVENTHANDLER_DEREGISTER(ether_ifattach_event, + sc->hn_ifnet_atthand); + } + if (sc->hn_ifnet_dethand != NULL) { + EVENTHANDLER_DEREGISTER(ifnet_departure_event, + sc->hn_ifnet_dethand); + } + vf_ifp = sc->hn_vf_ifp; + __compiler_membar(); + if (vf_ifp != NULL) + hn_ifnet_detevent(sc, vf_ifp); + if (sc->hn_xact != NULL && vmbus_chan_is_revoked(sc->hn_prichan)) { /* * In case that the vmbus missed the orphan handler @@ -2315,7 +2451,7 @@ hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int int hash_type = M_HASHTYPE_OPAQUE; /* If the VF is active, inject the packet through the VF */ - ifp = rxr->hn_vf ? rxr->hn_vf : rxr->hn_ifp; + ifp = rxr->hn_rxvf_ifp ? rxr->hn_rxvf_ifp : rxr->hn_ifp; if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { /* @@ -3284,12 +3420,12 @@ static int hn_vf_sysctl(SYSCTL_HANDLER_ARGS) { struct hn_softc *sc = arg1; - char vf_name[128]; + char vf_name[IFNAMSIZ + 1]; struct ifnet *vf; HN_LOCK(sc); vf_name[0] = '\0'; - vf = sc->hn_rx_ring[0].hn_vf; + vf = sc->hn_vf_ifp; if (vf != NULL) snprintf(vf_name, sizeof(vf_name), "%s", if_name(vf)); HN_UNLOCK(sc); @@ -3297,6 +3433,110 @@ hn_vf_sysctl(SYSCTL_HANDLER_ARGS) } static int +hn_rxvf_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct hn_softc *sc = arg1; + char vf_name[IFNAMSIZ + 1]; + struct ifnet *vf; + + HN_LOCK(sc); + vf_name[0] = '\0'; + vf = sc->hn_rx_ring[0].hn_rxvf_ifp; + if (vf != NULL) + snprintf(vf_name, sizeof(vf_name), "%s", if_name(vf)); + HN_UNLOCK(sc); + return sysctl_handle_string(oidp, vf_name, sizeof(vf_name), req); +} + +static int +hn_vflist_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct rm_priotracker pt; + struct sbuf *sb; + int error, i; + bool first; + + error = sysctl_wire_old_buffer(req, 0); + if (error != 0) + return (error); + + sb = sbuf_new_for_sysctl(NULL, NULL, 128, req); + if (sb == NULL) + return (ENOMEM); + + rm_rlock(&hn_vfmap_lock, &pt); + + first = true; + for (i = 0; i < hn_vfmap_size; ++i) { + struct ifnet *ifp; + + if (hn_vfmap[i] == NULL) + continue; + + ifp = ifnet_byindex(i); + if (ifp != NULL) { + if (first) + sbuf_printf(sb, "%s", ifp->if_xname); + else + sbuf_printf(sb, " %s", ifp->if_xname); + first = false; + } + } + + rm_runlock(&hn_vfmap_lock, &pt); + + error = sbuf_finish(sb); + sbuf_delete(sb); + return (error); +} + +static int +hn_vfmap_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct rm_priotracker pt; + struct sbuf *sb; + int error, i; + bool first; + + error = sysctl_wire_old_buffer(req, 0); + if (error != 0) + return (error); + + sb = sbuf_new_for_sysctl(NULL, NULL, 128, req); + if (sb == NULL) + return (ENOMEM); + + rm_rlock(&hn_vfmap_lock, &pt); + + first = true; + for (i = 0; i < hn_vfmap_size; ++i) { + struct ifnet *ifp, *hn_ifp; + + hn_ifp = hn_vfmap[i]; + if (hn_ifp == NULL) + continue; + + ifp = ifnet_byindex(i); + if (ifp != NULL) { + if (first) { + sbuf_printf(sb, "%s:%s", ifp->if_xname, + hn_ifp->if_xname); + } else { + sbuf_printf(sb, " %s:%s", ifp->if_xname, + hn_ifp->if_xname); + } + first = false; + } + } + + rm_runlock(&hn_vfmap_lock, &pt); + + error = sbuf_finish(sb); + sbuf_delete(sb); + return (error); +} + +static int hn_check_iplen(const struct mbuf *m, int hoff) { const struct ip *ip; @@ -5781,11 +6021,19 @@ hn_chan_callback(struct vmbus_channel *chan, void *xrx } static void -hn_tx_taskq_create(void *arg __unused) +hn_sysinit(void *arg __unused) { int i; /* + * Initialize VF map. + */ + rm_init_flags(&hn_vfmap_lock, "hn_vfmap", RM_SLEEPABLE); + hn_vfmap_size = HN_VFMAP_SIZE_DEF; + hn_vfmap = malloc(sizeof(struct ifnet *) * hn_vfmap_size, M_DEVBUF, + M_WAITOK | M_ZERO); + + /* * Fix the # of TX taskqueues. */ if (hn_tx_taskq_cnt <= 0) @@ -5821,11 +6069,10 @@ hn_tx_taskq_create(void *arg __unused) "hn tx%d", i); } } -SYSINIT(hn_txtq_create, SI_SUB_DRIVERS, SI_ORDER_SECOND, - hn_tx_taskq_create, NULL); +SYSINIT(hn_sysinit, SI_SUB_DRIVERS, SI_ORDER_SECOND, hn_sysinit, NULL); static void -hn_tx_taskq_destroy(void *arg __unused) +hn_sysuninit(void *arg __unused) { if (hn_tx_taskque != NULL) { @@ -5835,6 +6082,9 @@ hn_tx_taskq_destroy(void *arg __unused) taskqueue_free(hn_tx_taskque[i]); free(hn_tx_taskque, M_DEVBUF); } + + if (hn_vfmap != NULL) + free(hn_vfmap, M_DEVBUF); + rm_destroy(&hn_vfmap_lock); } -SYSUNINIT(hn_txtq_destroy, SI_SUB_DRIVERS, SI_ORDER_SECOND, - hn_tx_taskq_destroy, NULL); +SYSUNINIT(hn_sysuninit, SI_SUB_DRIVERS, SI_ORDER_SECOND, hn_sysuninit, NULL); Modified: stable/10/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hnvar.h Mon Jul 31 05:23:32 2017 (r321758) +++ stable/10/sys/dev/hyperv/netvsc/if_hnvar.h Mon Jul 31 06:27:43 2017 (r321759) @@ -59,7 +59,7 @@ struct hn_tx_ring; struct hn_rx_ring { struct ifnet *hn_ifp; - struct ifnet *hn_vf; /* SR-IOV VF */ + struct ifnet *hn_rxvf_ifp; /* SR-IOV VF for RX */ struct hn_tx_ring *hn_txr; void *hn_pktbuf; int hn_pktbuf_len; @@ -175,6 +175,7 @@ struct hn_tx_ring { struct hn_softc { struct ifnet *hn_ifp; struct arpcom arpcom; + struct ifnet *hn_vf_ifp; /* SR-IOV VF */ struct ifmedia hn_media; device_t hn_dev; int hn_if_flags; @@ -239,6 +240,8 @@ struct hn_softc { eventhandler_tag hn_ifaddr_evthand; eventhandler_tag hn_ifnet_evthand; + eventhandler_tag hn_ifnet_atthand; + eventhandler_tag hn_ifnet_dethand; }; #define HN_FLAG_RXBUF_CONNECTED 0x0001 From owner-svn-src-all@freebsd.org Mon Jul 31 06:40:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DADB3DCB1E5; Mon, 31 Jul 2017 06:40:10 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A7A6169FE8; Mon, 31 Jul 2017 06:40:10 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6V6e9UG079299; Mon, 31 Jul 2017 06:40:09 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V6e976079298; Mon, 31 Jul 2017 06:40:09 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201707310640.v6V6e976079298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 31 Jul 2017 06:40:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321760 - stable/10/sys/net X-SVN-Group: stable-10 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: stable/10/sys/net X-SVN-Commit-Revision: 321760 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 06:40:11 -0000 Author: sephe Date: Mon Jul 31 06:40:09 2017 New Revision: 321760 URL: https://svnweb.freebsd.org/changeset/base/321760 Log: MFC 321408 rndis: Add LINK_SPEED_CHANGE status Reviewed by: hselasky Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D11650 Modified: stable/10/sys/net/rndis.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/rndis.h ============================================================================== --- stable/10/sys/net/rndis.h Mon Jul 31 06:27:43 2017 (r321759) +++ stable/10/sys/net/rndis.h Mon Jul 31 06:40:09 2017 (r321760) @@ -31,6 +31,7 @@ #define RNDIS_STATUS_PENDING 0x00000103L #define RNDIS_STATUS_MEDIA_CONNECT 0x4001000BL #define RNDIS_STATUS_MEDIA_DISCONNECT 0x4001000CL +#define RNDIS_STATUS_LINK_SPEED_CHANGE 0x40010013L #define RNDIS_STATUS_NETWORK_CHANGE 0x40010018L #define RNDIS_STATUS_TASK_OFFLOAD_CURRENT_CONFIG 0x40020006L #define RNDIS_STATUS_BUFFER_OVERFLOW 0x80000005L From owner-svn-src-all@freebsd.org Mon Jul 31 06:53:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 985D4DCB635; Mon, 31 Jul 2017 06:53:44 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 578C06A78C; Mon, 31 Jul 2017 06:53:44 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6V6rhNx086942; Mon, 31 Jul 2017 06:53:43 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V6rh1w086941; Mon, 31 Jul 2017 06:53:43 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201707310653.v6V6rh1w086941@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 31 Jul 2017 06:53: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: r321761 - stable/10/sys/dev/hyperv/netvsc X-SVN-Group: stable-10 X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: stable/10/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 321761 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 06:53:44 -0000 Author: sephe Date: Mon Jul 31 06:53:43 2017 New Revision: 321761 URL: https://svnweb.freebsd.org/changeset/base/321761 Log: MFC 321409 hyperv/hn: Ignore LINK_SPEED_CHANGE status. This status will be reported if the backend NIC is wireless; it's not useful. Due to the high frequency of the reporting, this could be pretty annoying; ignore it. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D11651 Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/10/sys/dev/hyperv/netvsc/if_hn.c Mon Jul 31 06:40:09 2017 (r321760) +++ stable/10/sys/dev/hyperv/netvsc/if_hn.c Mon Jul 31 06:53:43 2017 (r321761) @@ -5526,6 +5526,7 @@ hn_rndis_rx_status(struct hn_softc *sc, const void *da break; case RNDIS_STATUS_TASK_OFFLOAD_CURRENT_CONFIG: + case RNDIS_STATUS_LINK_SPEED_CHANGE: /* Not really useful; ignore. */ break; From owner-svn-src-all@freebsd.org Mon Jul 31 07:18:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6228DCBD7F; Mon, 31 Jul 2017 07:18:16 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A4796B22B; Mon, 31 Jul 2017 07:18:16 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6V7IFoT095307; Mon, 31 Jul 2017 07:18:15 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V7IFmv095303; Mon, 31 Jul 2017 07:18:15 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201707310718.v6V7IFmv095303@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 31 Jul 2017 07:18:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321762 - in head: contrib/hyperv/tools/scripts etc/devd libexec/hyperv X-SVN-Group: head X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: in head: contrib/hyperv/tools/scripts etc/devd libexec/hyperv X-SVN-Commit-Revision: 321762 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 07:18:16 -0000 Author: sephe Date: Mon Jul 31 07:18:15 2017 New Revision: 321762 URL: https://svnweb.freebsd.org/changeset/base/321762 Log: hyperv: Add VF bringup scripts and devd rules. How network VF works with hn(4) on Hyper-V in non-transparent mode: - Each network VF has a cooresponding hn(4). - The network VF and the it's cooresponding hn(4) have the same hardware address. - Once the network VF is up, e.g. ifconfig VF up: o All of the transmission should go through the network VF. o Most of the reception goes through the network VF. o Small amount of reception may go through the cooresponding hn(4). This reception will happen, even if the the cooresponding hn(4) is down. The cooresponding hn(4) will change the reception interface to the network VF, so that network layer and application layer will be tricked into thinking that these packets were received by the network VF. o The cooresponding hn(4) pretends the physical link is down. - Once the network VF is down or detached: o All of the transmission should go through the cooresponding hn(4). o All of the reception goes through the cooresponding hn(4). o The cooresponding hn(4) fallbacks to the original physical link detection logic. All these features are mainly used to help live migration, during which the network VF will be detached, while the network communication to the VM must not be cut off. In order to reach this level of live migration transparency, we use failover mode lagg(4) with the network VF and the cooresponding hn(4) attached to it. To ease user configuration for both network VF and non-network VF, the lagg(4) will be created by the following rules, and the configuration of the cooresponding hn(4) will be applied to the lagg(4) automatically. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D11635 Added: head/contrib/hyperv/tools/scripts/hyperv_vfattach head/contrib/hyperv/tools/scripts/hyperv_vfup Modified: head/etc/devd/hyperv.conf head/libexec/hyperv/Makefile Added: head/contrib/hyperv/tools/scripts/hyperv_vfattach ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/hyperv/tools/scripts/hyperv_vfattach Mon Jul 31 07:18:15 2017 (r321762) @@ -0,0 +1,79 @@ +#!/bin/sh + +# +# If transparent VF is enabled, don't do anything. +# + +sysctl -n hw.hn.vf_transparent > /dev/null 2>&1 +if [ $? -ne 0 ] +then + # Old kernel; no transparent VF. + vf_transparent=0 +else + vf_transparent=`sysctl -n hw.hn.vf_transparent` +fi + +if [ $vf_transparent -ne 0 ] +then + # Transparent VF; done! + exit 0 +fi + +iface=$1 +delay=$2 + +if [ $delay -gt 0 ] +then + # + # Delayed VF up. + # + sleep $delay + ifconfig $iface up + # Done! + exit $? +fi + +# +# Check to see whether $iface is a VF or not. +# If $iface is a VF, bring it up now. +# + +# for hyperv_vf_delay +. /etc/rc.conf + +sysctl -n hw.hn.vflist > /dev/null 2>&1 +if [ $? -ne 0 ] +then + # Old kernel; nothing could be done properly. + exit 0 +fi +vf_list=`sysctl -n hw.hn.vflist` + +for vf in $vf_list +do + if [ $vf = $iface ] + then + # + # Linger a little bit (at least 2 seconds) mainly to + # make sure that $iface is fully attached. + # + # NOTE: + # In Azure hyperv_vf_delay should be configured to a + # large value, e.g. 120 seconds, to avoid racing cloud + # agent goofs. + # + test $hyperv_vf_delay -ge 2 > /dev/null 2>&1 + if [ $? -ne 0 ] + then + hyperv_vf_delay=2 + fi + # + # NOTE: + # "(sleep ..; ifconfig .. up) > /dev/null 2>&1 &" + # does _not_ work. + # + daemon -f /usr/libexec/hyperv/hyperv_vfattach \ + $iface $hyperv_vf_delay + break + fi +done Added: head/contrib/hyperv/tools/scripts/hyperv_vfup ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/hyperv/tools/scripts/hyperv_vfup Mon Jul 31 07:18:15 2017 (r321762) @@ -0,0 +1,119 @@ +#!/bin/sh + +. /etc/rc.subr +. /etc/network.subr + +load_rc_config netif + +# +# Customized per-interface setup, e.g. hyperv_vfup.hn1 +# +# NOTE-CUSTOMIZE: +# Comment this out, if this script is used as template +# for the customized per-interface setup. +# +if [ -f /usr/libexec/hyperv/hyperv_vfup.$1 ] +then + /usr/libexec/hyperv/hyperv_vfup.$1 + exit $? +fi + +# NOTE-CUSTOMIZE: +#hn=${0##*.} +hn=$1 +hn_unit=`echo $hn | sed 's/[^0-9]*//g'` + +vf=`sysctl -n dev.hn.$hn_unit.vf` +if [ ! $vf ] +then + # Race happened; VF was removed, before we ran. + echo "$hn: VF was detached" + exit 0 +fi + +# +# Create laggX for hnX. +# Add VF and hnX to laggX. +# + +lagg=lagg$hn_unit + +ifconfig $lagg > /dev/null 2>&1 +if [ $? -ne 0 ] +then + # + # No laggX, create it now. + # + ifconfig $lagg create > /dev/null 2>&1 + if [ $? -ne 0 ] + then + echo "$lagg creation failed" + exit 1 + fi + + # + # Configure laggX (failover), add hnX and VF to it. + # + ifconfig $lagg laggproto failover laggport $hn laggport $vf + ifconfig $lagg inet6 no_dad + + # + # Stop dhclient on hnX, if any. + # + pidfile=/var/run/dhclient.$hn.pid + if [ -f $pidfile ] + then + kill -TERM `cat $pidfile` + fi + + # + # Remove all configured IPv4 addresses on hnX, e.g. + # configured by dhclient. laggX will take over the + # network operations. + # + while true + do + ifconfig $hn -alias > /dev/null 2>&1 + if [ $? -ne 0 ] + then + break + fi + done + + # TODO: Remove IPv6 addresses on hnX + + # + # Use hnX's configuration for laggX + # + # NOTE-CUSTOMIZE: + # If this script is used as template for the customized + # per-interface setup, replace this with whatever you + # want to do with the laggX. + # + if dhcpif $hn; + then + ifconfig $lagg up + if syncdhcpif $hn; + then + dhclient $lagg + else + dhclient -b $lagg + fi + else + ifconfig_args=`ifconfig_getargs $hn` + if [ -n "$ifconfig_args" ] + then + ifconfig $lagg $ifconfig_args + fi + fi +else + # + # laggX exists. Check whether VF was there or not. + # If VF was not added to laggX, add it now. + # + ifconfig $lagg | grep "laggport: $vf" > /dev/null 2>&1 + if [ $? -ne 0 ] + then + ifconfig $lagg laggport $vf + fi +fi Modified: head/etc/devd/hyperv.conf ============================================================================== --- head/etc/devd/hyperv.conf Mon Jul 31 06:53:43 2017 (r321761) +++ head/etc/devd/hyperv.conf Mon Jul 31 07:18:15 2017 (r321762) @@ -33,3 +33,76 @@ notify 11 { match "cdev" "hv_fsvss_dev"; action "pkill -x hv_vss_daemon"; }; + +# +# Rules for non-transparent network VF. +# +# How network VF works with hn(4) on Hyper-V in non-transparent mode: +# +# - Each network VF has a cooresponding hn(4). +# - The network VF and the it's cooresponding hn(4) have the same hardware +# address. +# - Once the network VF is up, e.g. ifconfig VF up: +# o All of the transmission should go through the network VF. +# o Most of the reception goes through the network VF. +# o Small amount of reception may go through the cooresponding hn(4). +# This reception will happen, even if the the cooresponding hn(4) is +# down. The cooresponding hn(4) will change the reception interface +# to the network VF, so that network layer and application layer will +# be tricked into thinking that these packets were received by the +# network VF. +# o The cooresponding hn(4) pretends the physical link is down. +# - Once the network VF is down or detached: +# o All of the transmission should go through the cooresponding hn(4). +# o All of the reception goes through the cooresponding hn(4). +# o The cooresponding hn(4) fallbacks to the original physical link +# detection logic. +# +# All these features are mainly used to help live migration, during which +# the network VF will be detached, while the network communication to the +# VM must not be cut off. In order to reach this level of live migration +# transparency, we use failover mode lagg(4) with the network VF and the +# cooresponding hn(4) attached to it. +# +# To ease user configuration for both network VF and non-network VF, the +# lagg(4) will be created by the following rules, and the configuration +# of the cooresponding hn(4) will be applied to the lagg(4) automatically. +# +# NOTE: +# If live migration is not needed at all, the following rules could be +# commented out, and the network VF interface could be used exclusively. +# Most often the cooresponding hn(4) could be completely ignored. +# +# +# Default workflow for the network VF bringup: +# 1) ETHERNET/IFATTACH -> VF interface up (delayed by rc.conf hyperv_vf_delay +# seconds). This operation will trigger HYPERV_NIC_VF/VF_UP. +# 2) HYPERV_NIC_VF/VF_UP: +# a) Create laggX coresponding to hnX. +# b) Add hnX and VF to laggX. +# c) Whack all previous network configuration on hnX, including stopping +# dhclient. +# d) Apply rc.conf ifconfig_hnX to laggX; i.e. including starting dhclient. +# +# NOTE: +# HYPERV_NIC_VF/VF_UP action script could be customized per-interface by +# adding /usr/libexec/hyperv/hyperv_vfup.hnX script. +# /usr/libexec/hyperv/hyperv_vfup could be used as the template for the +# customized per-interface script. +# +# NOTE: +# For transparent network VF, hyperv_vfattach does nothing and +# HYPERV_NIC_VF/VF_UP will not be triggered at all. +# + +notify 10 { + match "system" "HYPERV_NIC_VF"; + match "type" "VF_UP"; + action "/usr/libexec/hyperv/hyperv_vfup $subsystem"; +}; + +notify 10 { + match "system" "ETHERNET"; + match "type" "IFATTACH"; + action "/usr/libexec/hyperv/hyperv_vfattach $subsystem 0"; +}; Modified: head/libexec/hyperv/Makefile ============================================================================== --- head/libexec/hyperv/Makefile Mon Jul 31 06:53:43 2017 (r321761) +++ head/libexec/hyperv/Makefile Mon Jul 31 07:18:15 2017 (r321762) @@ -5,5 +5,6 @@ BINDIR= ${LIBEXECDIR}/hyperv SCRIPTS= hv_set_ifconfig hv_get_dns_info hv_get_dhcp_info +SCRIPTS+= hyperv_vfattach hyperv_vfup .include From owner-svn-src-all@freebsd.org Mon Jul 31 07:48:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C438DCC636; Mon, 31 Jul 2017 07:48:10 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9AF06C16A; Mon, 31 Jul 2017 07:48:09 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6V7m9NY007661; Mon, 31 Jul 2017 07:48:09 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V7m9VS007660; Mon, 31 Jul 2017 07:48:09 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201707310748.v6V7m9VS007660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 31 Jul 2017 07:48:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321763 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321763 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 07:48:10 -0000 Author: sephe Date: Mon Jul 31 07:48:08 2017 New Revision: 321763 URL: https://svnweb.freebsd.org/changeset/base/321763 Log: calendar: Add myself. Reminded by: mckusick Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 07:18:15 2017 (r321762) +++ head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 07:48:08 2017 (r321763) @@ -364,6 +364,7 @@ 11/21 Mark Johnston born in Toronto, Ontario, Canada, 1989 11/22 Frederic Culot born in Saint-Germain-En-Laye, France, 1976 11/23 Josef Lawrence Karthauser born in Pembury, Kent, United Kingdom, 1972 +11/23 Sepherosa Ziehau born in Shanghai, China, 1980 11/24 Andrey Zakhvatov born in Chelyabinsk, Russian Federation, 1974 11/24 Daniel Gerzo born in Bratislava, Slovakia, 1986 11/28 Nik Clayton born in Peterborough, United Kingdom, 1973 From owner-svn-src-all@freebsd.org Mon Jul 31 07:58:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 756B5DCC849; Mon, 31 Jul 2017 07:58:31 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3260F6C586; Mon, 31 Jul 2017 07:58:31 +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 v6V7wUwd011567; Mon, 31 Jul 2017 07:58:30 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V7wUZ4011566; Mon, 31 Jul 2017 07:58:30 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201707310758.v6V7wUZ4011566@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 31 Jul 2017 07:58:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321764 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321764 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 07:58:31 -0000 Author: manu Date: Mon Jul 31 07:58:29 2017 New Revision: 321764 URL: https://svnweb.freebsd.org/changeset/base/321764 Log: Add myself to calendar Reminded by: mckusick Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 07:48:08 2017 (r321763) +++ head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 07:58:29 2017 (r321764) @@ -384,6 +384,7 @@ 12/18 Muhammad Moinur Rahman born in Dhaka, Bangladesh, 1983 12/18 Semen Ustimenko born in Novosibirsk, Russian Federation, 1979 12/19 Stephen Hurd born in Estevan, Saskatchewan, Canada, 1975 +12/19 Emmanuel Vadot born in Decines-Charpieu, France, 1983 12/21 Rong-En Fan born in Taipei, Taiwan, Republic of China, 1982 12/22 Maxim Sobolev born in Dnepropetrovsk, Ukraine, 1976 12/23 Sean Chittenden born in Seattle, Washington, United States, 1979 From owner-svn-src-all@freebsd.org Mon Jul 31 08:10:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F31CDCCBB4; Mon, 31 Jul 2017 08:10:04 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD0916CABF; Mon, 31 Jul 2017 08:10:03 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6V8A2LR015718; Mon, 31 Jul 2017 08:10:02 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V8A2Ht015717; Mon, 31 Jul 2017 08:10:02 GMT (envelope-from br@FreeBSD.org) Message-Id: <201707310810.v6V8A2Ht015717@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Mon, 31 Jul 2017 08:10:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321766 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321766 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 08:10:04 -0000 Author: br Date: Mon Jul 31 08:10:02 2017 New Revision: 321766 URL: https://svnweb.freebsd.org/changeset/base/321766 Log: Add my birthday. Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 08:02:25 2017 (r321765) +++ head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 08:10:02 2017 (r321766) @@ -18,6 +18,7 @@ 01/10 Jean-Yves Lefort born in Charleroi, Belgium, 1980 01/12 Yen-Ming Lee born in Taipei, Taiwan, Republic of China, 1977 01/12 Ying-Chieh Liao born in Taipei, Taiwan, Republic of China, 1979 +01/13 Ruslan Bukin born in Dudinka, Russian Federation, 1985 01/14 Yi-Jheng Lin born in Taichung, Taiwan, Republic of China, 1985 01/16 Ariff Abdullah born in Kuala Lumpur, Malaysia, 1978 01/16 Dmitry Sivachenko born in Moscow, USSR, 1978 From owner-svn-src-all@freebsd.org Mon Jul 31 08:11:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86296DCCD30; Mon, 31 Jul 2017 08:11:06 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 536956CC66; Mon, 31 Jul 2017 08:11:06 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6V8B5aE017948; Mon, 31 Jul 2017 08:11:05 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V8B55p017947; Mon, 31 Jul 2017 08:11:05 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201707310811.v6V8B55p017947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Mon, 31 Jul 2017 08:11:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321767 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321767 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 08:11:06 -0000 Author: tsoome Date: Mon Jul 31 08:11:05 2017 New Revision: 321767 URL: https://svnweb.freebsd.org/changeset/base/321767 Log: Add myself to calendar Reminded by: mckusick Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 08:10:02 2017 (r321766) +++ head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 08:11:05 2017 (r321767) @@ -343,6 +343,7 @@ 10/25 Eric Melville born in Los Gatos, California, United States, 1980 10/25 Julien Laffaye born in Toulouse, France, 1988 10/25 Ashish SHUKLA born in Kanpur, India, 1985 +10/25 Toomas Soome born Estonia, 1971 10/26 Matthew Ahrens born in United States, 1979 10/26 Philip M. Gollucci born in Silver Spring, Maryland, United States, 1979 10/27 Takanori Watanabe born in Numazu, Shizuoka, Japan, 1972 From owner-svn-src-all@freebsd.org Mon Jul 31 08:11:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF7F0DCCDA2; Mon, 31 Jul 2017 08:11:59 +0000 (UTC) (envelope-from romain@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9CD846CF31; Mon, 31 Jul 2017 08:11:59 +0000 (UTC) (envelope-from romain@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6V8Bwbh019423; Mon, 31 Jul 2017 08:11:58 GMT (envelope-from romain@FreeBSD.org) Received: (from romain@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V8Bwre019422; Mon, 31 Jul 2017 08:11:58 GMT (envelope-from romain@FreeBSD.org) Message-Id: <201707310811.v6V8Bwre019422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: romain set sender to romain@FreeBSD.org using -f From: =?UTF-8?Q?Romain_Tarti=c3=a8re?= Date: Mon, 31 Jul 2017 08:11:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321768 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: romain X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321768 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 08:11:59 -0000 Author: romain (ports committer) Date: Mon Jul 31 08:11:58 2017 New Revision: 321768 URL: https://svnweb.freebsd.org/changeset/base/321768 Log: Add myself Reminded by: mckusick Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 08:11:05 2017 (r321767) +++ head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 08:11:58 2017 (r321768) @@ -340,6 +340,7 @@ 10/21 Ben Smithurst born in Sheffield, South Yorkshire, United Kingdom, 1981 10/22 Jean-Sebastien Pedron born in Redon, Ille-et-Vilaine, France, 1980 10/23 Mario Sergio Fujikawa Ferreira born in Brasilia, Distrito Federal, Brazil, 1976 +10/23 Romain Tartière born in Clermont-Ferrand, France, 1984 10/25 Eric Melville born in Los Gatos, California, United States, 1980 10/25 Julien Laffaye born in Toulouse, France, 1988 10/25 Ashish SHUKLA born in Kanpur, India, 1985 From owner-svn-src-all@freebsd.org Mon Jul 31 08:16:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 134E3DCCE2D; Mon, 31 Jul 2017 08:16:14 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C697C6D0F8; Mon, 31 Jul 2017 08:16:13 +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 v6V8GCLb019618; Mon, 31 Jul 2017 08:16:12 GMT (envelope-from n_hibma@FreeBSD.org) Received: (from n_hibma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V8GCa0019617; Mon, 31 Jul 2017 08:16:12 GMT (envelope-from n_hibma@FreeBSD.org) Message-Id: <201707310816.v6V8GCa0019617@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, 31 Jul 2017 08:16:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321769 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: n_hibma X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321769 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 08:16:14 -0000 Author: n_hibma Date: Mon Jul 31 08:16:12 2017 New Revision: 321769 URL: https://svnweb.freebsd.org/changeset/base/321769 Log: Add my birthday entry to the calendar file. Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 08:11:58 2017 (r321768) +++ head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 08:16:12 2017 (r321769) @@ -34,6 +34,7 @@ 01/23 Hideyuki KURASHINA born in Niigata, Japan, 1982 01/24 Fabien Thomas born in Avignon, France, 1971 01/24 Matteo Riondato born in Padova, Italy, 1986 +01/25 Nick Hibma born in Groningen, the Netherlands, 1972 01/25 Bernd Walter born in Moers, Nordrhein-Westfalen, Germany, 1974 01/26 Andrew Gallatin born in Buffalo, New York, United States, 1970 01/27 Nick Sayer born in San Diego, California, United States, 1968 From owner-svn-src-all@freebsd.org Mon Jul 31 08:19:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D913ADCCEF9; Mon, 31 Jul 2017 08:19:45 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5FDD6D2B2; Mon, 31 Jul 2017 08:19:45 +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 v6V8Jifh019790; Mon, 31 Jul 2017 08:19:44 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V8JiBc019789; Mon, 31 Jul 2017 08:19:44 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201707310819.v6V8JiBc019789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 31 Jul 2017 08:19: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: r321770 - stable/11/usr.bin/ar X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/usr.bin/ar X-SVN-Commit-Revision: 321770 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 08:19:46 -0000 Author: emaste Date: Mon Jul 31 08:19:44 2017 New Revision: 321770 URL: https://svnweb.freebsd.org/changeset/base/321770 Log: MFC r321436: ar: handle partial writes from archive_write_data libarchive may limit a single archive_write_data call to handling 0x7fffffff bytes. Add a loop to handle partial writes. Sponsored by: The FreeBSD Foundation Modified: stable/11/usr.bin/ar/write.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/ar/write.c ============================================================================== --- stable/11/usr.bin/ar/write.c Mon Jul 31 08:16:12 2017 (r321769) +++ stable/11/usr.bin/ar/write.c Mon Jul 31 08:19:44 2017 (r321770) @@ -586,10 +586,17 @@ prefault_buffer(const char *buf, size_t s) static void write_data(struct bsdar *bsdar, struct archive *a, const void *buf, size_t s) { + ssize_t written; + prefault_buffer(buf, s); - if (archive_write_data(a, buf, s) != (ssize_t)s) - bsdar_errc(bsdar, EX_SOFTWARE, 0, "%s", - archive_error_string(a)); + while (s > 0) { + written = archive_write_data(a, buf, s); + if (written < 0) + bsdar_errc(bsdar, EX_SOFTWARE, 0, "%s", + archive_error_string(a)); + buf = (const char *)buf + written; + s -= written; + } } /* From owner-svn-src-all@freebsd.org Mon Jul 31 09:13:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC934DCE3F4; Mon, 31 Jul 2017 09:13:19 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 895F96F230; Mon, 31 Jul 2017 09:13:19 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6V9DIdd044419; Mon, 31 Jul 2017 09:13:18 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V9DIp9044418; Mon, 31 Jul 2017 09:13:18 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201707310913.v6V9DIp9044418@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Mon, 31 Jul 2017 09:13:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321771 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321771 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 09:13:19 -0000 Author: kp Date: Mon Jul 31 09:13:18 2017 New Revision: 321771 URL: https://svnweb.freebsd.org/changeset/base/321771 Log: Add myself to calendar Reminded by: mckusick Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 08:19:44 2017 (r321770) +++ head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 09:13:18 2017 (r321771) @@ -18,6 +18,7 @@ 01/10 Jean-Yves Lefort born in Charleroi, Belgium, 1980 01/12 Yen-Ming Lee born in Taipei, Taiwan, Republic of China, 1977 01/12 Ying-Chieh Liao born in Taipei, Taiwan, Republic of China, 1979 +01/12 Kristof Provost born in Aalst, Belgium, 1983 01/13 Ruslan Bukin born in Dudinka, Russian Federation, 1985 01/14 Yi-Jheng Lin born in Taichung, Taiwan, Republic of China, 1985 01/16 Ariff Abdullah born in Kuala Lumpur, Malaysia, 1978 From owner-svn-src-all@freebsd.org Mon Jul 31 09:15:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D94BDCE49E; Mon, 31 Jul 2017 09:15:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 094236F395; Mon, 31 Jul 2017 09:15:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6V9FGj8044535; Mon, 31 Jul 2017 09:15:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V9FFRw044532; Mon, 31 Jul 2017 09:15:15 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201707310915.v6V9FFRw044532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 31 Jul 2017 09:15:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321772 - in head/sys/dev/mlx4: . mlx4_core mlx4_ib X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx4: . mlx4_core mlx4_ib X-SVN-Commit-Revision: 321772 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 09:15:17 -0000 Author: hselasky Date: Mon Jul 31 09:15:15 2017 New Revision: 321772 URL: https://svnweb.freebsd.org/changeset/base/321772 Log: Fix broken usage of the mlx4_read_clock() function: - return value has too small width - cycle_t is unsigned and cannot be less than zero Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx4/device.h head/sys/dev/mlx4/mlx4_core/mlx4_main.c head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c Modified: head/sys/dev/mlx4/device.h ============================================================================== --- head/sys/dev/mlx4/device.h Mon Jul 31 09:13:18 2017 (r321771) +++ head/sys/dev/mlx4/device.h Mon Jul 31 09:15:15 2017 (r321772) @@ -1337,7 +1337,7 @@ int mlx4_get_roce_gid_from_slave(struct mlx4_dev *dev, int mlx4_FLOW_STEERING_IB_UC_QP_RANGE(struct mlx4_dev *dev, u32 min_range_qpn, u32 max_range_qpn); -int mlx4_read_clock(struct mlx4_dev *dev); +s64 mlx4_read_clock(struct mlx4_dev *dev); int mlx4_get_internal_clock_params(struct mlx4_dev *dev, struct mlx4_clock_params *params); Modified: head/sys/dev/mlx4/mlx4_core/mlx4_main.c ============================================================================== --- head/sys/dev/mlx4/mlx4_core/mlx4_main.c Mon Jul 31 09:13:18 2017 (r321771) +++ head/sys/dev/mlx4/mlx4_core/mlx4_main.c Mon Jul 31 09:15:15 2017 (r321772) @@ -1793,10 +1793,10 @@ static void unmap_bf_area(struct mlx4_dev *dev) io_mapping_free(mlx4_priv(dev)->bf_mapping); } -int mlx4_read_clock(struct mlx4_dev *dev) +s64 mlx4_read_clock(struct mlx4_dev *dev) { u32 clockhi, clocklo, clockhi1; - cycle_t cycles; + s64 cycles; int i; struct mlx4_priv *priv = mlx4_priv(dev); @@ -1813,7 +1813,7 @@ int mlx4_read_clock(struct mlx4_dev *dev) cycles = (u64) clockhi << 32 | (u64) clocklo; - return cycles; + return cycles & CORE_CLOCK_MASK; } EXPORT_SYMBOL_GPL(mlx4_read_clock); Modified: head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c ============================================================================== --- head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c Mon Jul 31 09:13:18 2017 (r321771) +++ head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c Mon Jul 31 09:15:15 2017 (r321772) @@ -877,12 +877,12 @@ static int mlx4_ib_query_values(struct ib_device *devi struct ib_device_values *values) { struct mlx4_ib_dev *dev = to_mdev(device); - cycle_t cycles; + s64 cycles; values->values_mask = 0; if (q_values & IBV_VALUES_HW_CLOCK) { cycles = mlx4_read_clock(dev->dev); - if (cycles < 0) { + if (cycles >= 0) { values->hwclock = cycles & CORE_CLOCK_MASK; values->values_mask |= IBV_VALUES_HW_CLOCK; } From owner-svn-src-all@freebsd.org Mon Jul 31 09:17:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82F07DCE716; Mon, 31 Jul 2017 09:17:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5161D6F5FA; Mon, 31 Jul 2017 09:17:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6V9HseO044663; Mon, 31 Jul 2017 09:17:54 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V9HsjD044662; Mon, 31 Jul 2017 09:17:54 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201707310917.v6V9HsjD044662@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 31 Jul 2017 09:17:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321773 - 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: 321773 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 09:17:55 -0000 Author: hselasky Date: Mon Jul 31 09:17:54 2017 New Revision: 321773 URL: https://svnweb.freebsd.org/changeset/base/321773 Log: Remove cycle_t type from the LinuxKPI similar to Linux upstream. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/clocksource.h Modified: head/sys/compat/linuxkpi/common/include/linux/clocksource.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/clocksource.h Mon Jul 31 09:15:15 2017 (r321772) +++ head/sys/compat/linuxkpi/common/include/linux/clocksource.h Mon Jul 31 09:17:54 2017 (r321773) @@ -33,9 +33,6 @@ #include -#define CLOCKSOURCE_MASK(x) ((cycle_t)(-1ULL >> ((-(x)) & 63))) - -/* clocksource cycle base type */ -typedef u64 cycle_t; +#define CLOCKSOURCE_MASK(x) ((u64)(-1ULL >> ((-(x)) & 63))) #endif /* _LINUX_CLOCKSOURCE_H */ From owner-svn-src-all@freebsd.org Mon Jul 31 09:18:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FBE9DCE791; Mon, 31 Jul 2017 09:18:55 +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 mx1.freebsd.org (Postfix) with ESMTPS id 1EFCC6F741; Mon, 31 Jul 2017 09:18:55 +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 v6V9IseT044751; Mon, 31 Jul 2017 09:18:54 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V9IsB2044750; Mon, 31 Jul 2017 09:18:54 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201707310918.v6V9IsB2044750@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 31 Jul 2017 09:18:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321774 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321774 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 09:18:55 -0000 Author: eugen (ports committer) Date: Mon Jul 31 09:18:53 2017 New Revision: 321774 URL: https://svnweb.freebsd.org/changeset/base/321774 Log: Add myself. Reminded by: mckusick Approved by: vsevolod (mentor) Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 09:17:54 2017 (r321773) +++ head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 09:18:53 2017 (r321774) @@ -332,6 +332,7 @@ 10/09 Stefan Walter born in Werne, Nordrhein-Westfalen, Germany, 1978 10/12 Pawel Jakub Dawidek born in Radzyn Podlaski, Poland, 1980 10/15 Maxim Konovalov born in Khabarovsk, USSR, 1973 +10/15 Eugene Grosbein born in Novokuznetsk, Russian Republic, USSR, 1976 10/16 Remko Lodder born in Rotterdam, the Netherlands, 1983 10/17 Maho NAKATA born in Osaka, Japan, 1974 10/18 Sheldon Hearn born in Cape Town, Western Cape, South Africa, 1974 From owner-svn-src-all@freebsd.org Mon Jul 31 09:28:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C013DCE969; Mon, 31 Jul 2017 09:28:44 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 682ED6FC48; Mon, 31 Jul 2017 09:28:44 +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 v6V9Sh7x048773; Mon, 31 Jul 2017 09:28:43 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V9Sh8X048772; Mon, 31 Jul 2017 09:28:43 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201707310928.v6V9Sh8X048772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 31 Jul 2017 09:28: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: r321775 - stable/10/usr.bin/ar X-SVN-Group: stable-10 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/10/usr.bin/ar X-SVN-Commit-Revision: 321775 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 09:28:44 -0000 Author: emaste Date: Mon Jul 31 09:28:43 2017 New Revision: 321775 URL: https://svnweb.freebsd.org/changeset/base/321775 Log: MFC r321436: ar: handle partial writes from archive_write_data libarchive may limit a single archive_write_data call to handling 0x7fffffff bytes. Add a loop to handle partial writes. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.bin/ar/write.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/ar/write.c ============================================================================== --- stable/10/usr.bin/ar/write.c Mon Jul 31 09:18:53 2017 (r321774) +++ stable/10/usr.bin/ar/write.c Mon Jul 31 09:28:43 2017 (r321775) @@ -581,10 +581,17 @@ prefault_buffer(const char *buf, size_t s) static void write_data(struct bsdar *bsdar, struct archive *a, const void *buf, size_t s) { + ssize_t written; + prefault_buffer(buf, s); - if (archive_write_data(a, buf, s) != (ssize_t)s) - bsdar_errc(bsdar, EX_SOFTWARE, 0, "%s", - archive_error_string(a)); + while (s > 0) { + written = archive_write_data(a, buf, s); + if (written < 0) + bsdar_errc(bsdar, EX_SOFTWARE, 0, "%s", + archive_error_string(a)); + buf = (const char *)buf + written; + s -= written; + } } /* From owner-svn-src-all@freebsd.org Mon Jul 31 09:46:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD6D5DCEC6C; Mon, 31 Jul 2017 09:46:49 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F48C702C2; Mon, 31 Jul 2017 09:46:49 +0000 (UTC) (envelope-from sgalabov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6V9kmEk056875; Mon, 31 Jul 2017 09:46:48 GMT (envelope-from sgalabov@FreeBSD.org) Received: (from sgalabov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6V9kmkI056874; Mon, 31 Jul 2017 09:46:48 GMT (envelope-from sgalabov@FreeBSD.org) Message-Id: <201707310946.v6V9kmkI056874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sgalabov set sender to sgalabov@FreeBSD.org using -f From: Stanislav Galabov Date: Mon, 31 Jul 2017 09:46:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321776 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: sgalabov X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321776 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 09:46:50 -0000 Author: sgalabov Date: Mon Jul 31 09:46:48 2017 New Revision: 321776 URL: https://svnweb.freebsd.org/changeset/base/321776 Log: Add myself to calendar Reminded by: mckusick Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 09:28:43 2017 (r321775) +++ head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 09:46:48 2017 (r321776) @@ -207,6 +207,7 @@ 06/06 Alan Eldridge died in Denver, Colorado, 2003 06/07 Jimmy Olgeni born in Milano, Italy, 1976 06/07 Benjamin Close born in Adelaide, Australia, 1978 +06/09 Stanislav Galabov born in Sofia, Bulgaria 1978 06/11 Alonso Cardenas Marquez born in Arequipa, Peru, 1979 06/14 Josh Paetzel born in Minneapolis, Minnesota, United States, 1973 06/17 Tilman Linneweh born in Weinheim, Baden-Wuerttemberg, Germany, 1978 From owner-svn-src-all@freebsd.org Mon Jul 31 11:04:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 008E3DD0368; Mon, 31 Jul 2017 11:04:37 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D06BE72A4F; Mon, 31 Jul 2017 11:04:36 +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 v6VB4aFe089405; Mon, 31 Jul 2017 11:04:36 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VB4ZeM089400; Mon, 31 Jul 2017 11:04:35 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201707311104.v6VB4ZeM089400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 31 Jul 2017 11:04:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321779 - in head/sys: net netipsec X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in head/sys: net netipsec X-SVN-Commit-Revision: 321779 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 11:04:37 -0000 Author: ae Date: Mon Jul 31 11:04:35 2017 New Revision: 321779 URL: https://svnweb.freebsd.org/changeset/base/321779 Log: Add inpcb pointer to struct ipsec_ctx_data and pass it to the pfil hook from enc_hhook(). This should solve the problem when pf is used with if_enc(4) interface, and outbound packet with existing PCB checked by pf, and this leads to deadlock due to pf does its own PCB lookup and tries to take rlock when wlock is already held. Now we pass PCB pointer if it is known to the pfil hook, this helps to avoid extra PCB lookup and thus rlock acquiring is not needed. For inbound packets it is safe to pass NULL, because we do not held any PCB locks yet. PR: 220217 MFC after: 3 weeks Sponsored by: Yandex LLC Modified: head/sys/net/if_enc.c head/sys/net/if_enc.h head/sys/netipsec/ipsec.h head/sys/netipsec/ipsec_input.c head/sys/netipsec/ipsec_output.c Modified: head/sys/net/if_enc.c ============================================================================== --- head/sys/net/if_enc.c Mon Jul 31 09:54:04 2017 (r321778) +++ head/sys/net/if_enc.c Mon Jul 31 11:04:35 2017 (r321779) @@ -284,7 +284,7 @@ enc_hhook(int32_t hhook_type, int32_t hhook_id, void * /* Make a packet looks like it was received on enc(4) */ rcvif = (*ctx->mp)->m_pkthdr.rcvif; (*ctx->mp)->m_pkthdr.rcvif = ifp; - if (pfil_run_hooks(ph, ctx->mp, ifp, pdir, NULL) != 0 || + if (pfil_run_hooks(ph, ctx->mp, ifp, pdir, ctx->inp) != 0 || *ctx->mp == NULL) { *ctx->mp = NULL; /* consumed by filter */ return (EACCES); Modified: head/sys/net/if_enc.h ============================================================================== --- head/sys/net/if_enc.h Mon Jul 31 09:54:04 2017 (r321778) +++ head/sys/net/if_enc.h Mon Jul 31 11:04:35 2017 (r321779) @@ -33,6 +33,7 @@ struct ipsec_ctx_data { struct mbuf **mp; struct secasvar *sav; + struct inpcb *inp; uint8_t af; #define IPSEC_ENC_BEFORE 0x01 #define IPSEC_ENC_AFTER 0x02 Modified: head/sys/netipsec/ipsec.h ============================================================================== --- head/sys/netipsec/ipsec.h Mon Jul 31 09:54:04 2017 (r321778) +++ head/sys/netipsec/ipsec.h Mon Jul 31 11:04:35 2017 (r321779) @@ -253,8 +253,9 @@ struct ipsecstat { #include struct ipsec_ctx_data; -#define IPSEC_INIT_CTX(_ctx, _mp, _sav, _af, _enc) do { \ +#define IPSEC_INIT_CTX(_ctx, _mp, _inp, _sav, _af, _enc) do { \ (_ctx)->mp = (_mp); \ + (_ctx)->inp = (_inp); \ (_ctx)->sav = (_sav); \ (_ctx)->af = (_af); \ (_ctx)->enc = (_enc); \ Modified: head/sys/netipsec/ipsec_input.c ============================================================================== --- head/sys/netipsec/ipsec_input.c Mon Jul 31 09:54:04 2017 (r321778) +++ head/sys/netipsec/ipsec_input.c Mon Jul 31 11:04:35 2017 (r321779) @@ -325,7 +325,7 @@ ipsec4_common_input_cb(struct mbuf *m, struct secasvar (prot == IPPROTO_UDP || prot == IPPROTO_TCP)) udp_ipsec_adjust_cksum(m, sav, prot, skip); - IPSEC_INIT_CTX(&ctx, &m, sav, AF_INET, IPSEC_ENC_BEFORE); + IPSEC_INIT_CTX(&ctx, &m, NULL, sav, AF_INET, IPSEC_ENC_BEFORE); if ((error = ipsec_run_hhooks(&ctx, HHOOK_TYPE_IPSEC_IN)) != 0) goto bad; ip = mtod(m, struct ip *); /* update pointer */ @@ -416,7 +416,7 @@ ipsec4_common_input_cb(struct mbuf *m, struct secasvar goto bad; } - IPSEC_INIT_CTX(&ctx, &m, sav, af, IPSEC_ENC_AFTER); + IPSEC_INIT_CTX(&ctx, &m, NULL, sav, af, IPSEC_ENC_AFTER); if ((error = ipsec_run_hhooks(&ctx, HHOOK_TYPE_IPSEC_IN)) != 0) goto bad; @@ -522,7 +522,7 @@ ipsec6_common_input_cb(struct mbuf *m, struct secasvar goto bad; } - IPSEC_INIT_CTX(&ctx, &m, sav, af, IPSEC_ENC_BEFORE); + IPSEC_INIT_CTX(&ctx, &m, NULL, sav, af, IPSEC_ENC_BEFORE); if ((error = ipsec_run_hhooks(&ctx, HHOOK_TYPE_IPSEC_IN)) != 0) goto bad; @@ -593,7 +593,7 @@ ipsec6_common_input_cb(struct mbuf *m, struct secasvar else #endif af = AF_INET6; - IPSEC_INIT_CTX(&ctx, &m, sav, af, IPSEC_ENC_AFTER); + IPSEC_INIT_CTX(&ctx, &m, NULL, sav, af, IPSEC_ENC_AFTER); if ((error = ipsec_run_hhooks(&ctx, HHOOK_TYPE_IPSEC_IN)) != 0) goto bad; if (skip == 0) { Modified: head/sys/netipsec/ipsec_output.c ============================================================================== --- head/sys/netipsec/ipsec_output.c Mon Jul 31 09:54:04 2017 (r321778) +++ head/sys/netipsec/ipsec_output.c Mon Jul 31 11:04:35 2017 (r321779) @@ -181,7 +181,8 @@ next: * IPsec output logic for IPv4. */ static int -ipsec4_perform_request(struct mbuf *m, struct secpolicy *sp, u_int idx) +ipsec4_perform_request(struct mbuf *m, struct secpolicy *sp, + struct inpcb *inp, u_int idx) { struct ipsec_ctx_data ctx; union sockaddr_union *dst; @@ -211,7 +212,7 @@ ipsec4_perform_request(struct mbuf *m, struct secpolic /* * XXXAE: most likely ip_sum at this point is wrong. */ - IPSEC_INIT_CTX(&ctx, &m, sav, AF_INET, IPSEC_ENC_BEFORE); + IPSEC_INIT_CTX(&ctx, &m, inp, sav, AF_INET, IPSEC_ENC_BEFORE); if ((error = ipsec_run_hhooks(&ctx, HHOOK_TYPE_IPSEC_OUT)) != 0) goto bad; @@ -235,9 +236,10 @@ ipsec4_perform_request(struct mbuf *m, struct secpolic /* XXXAE: IPSEC_OSTAT_INC(tunnel); */ goto bad; } + inp = NULL; } - IPSEC_INIT_CTX(&ctx, &m, sav, dst->sa.sa_family, IPSEC_ENC_AFTER); + IPSEC_INIT_CTX(&ctx, &m, inp, sav, dst->sa.sa_family, IPSEC_ENC_AFTER); if ((error = ipsec_run_hhooks(&ctx, HHOOK_TYPE_IPSEC_OUT)) != 0) goto bad; @@ -285,7 +287,7 @@ ipsec4_process_packet(struct mbuf *m, struct secpolicy struct inpcb *inp) { - return (ipsec4_perform_request(m, sp, 0)); + return (ipsec4_perform_request(m, sp, inp, 0)); } static int @@ -491,7 +493,8 @@ next: * IPsec output logic for IPv6. */ static int -ipsec6_perform_request(struct mbuf *m, struct secpolicy *sp, u_int idx) +ipsec6_perform_request(struct mbuf *m, struct secpolicy *sp, + struct inpcb *inp, u_int idx) { struct ipsec_ctx_data ctx; union sockaddr_union *dst; @@ -514,7 +517,7 @@ ipsec6_perform_request(struct mbuf *m, struct secpolic ip6 = mtod(m, struct ip6_hdr *); ip6->ip6_plen = htons(m->m_pkthdr.len - sizeof(*ip6)); - IPSEC_INIT_CTX(&ctx, &m, sav, AF_INET6, IPSEC_ENC_BEFORE); + IPSEC_INIT_CTX(&ctx, &m, inp, sav, AF_INET6, IPSEC_ENC_BEFORE); if ((error = ipsec_run_hhooks(&ctx, HHOOK_TYPE_IPSEC_OUT)) != 0) goto bad; @@ -540,9 +543,10 @@ ipsec6_perform_request(struct mbuf *m, struct secpolic /* XXXAE: IPSEC_OSTAT_INC(tunnel); */ goto bad; } + inp = NULL; } - IPSEC_INIT_CTX(&ctx, &m, sav, dst->sa.sa_family, IPSEC_ENC_AFTER); + IPSEC_INIT_CTX(&ctx, &m, inp, sav, dst->sa.sa_family, IPSEC_ENC_AFTER); if ((error = ipsec_run_hhooks(&ctx, HHOOK_TYPE_IPSEC_OUT)) != 0) goto bad; @@ -585,7 +589,7 @@ ipsec6_process_packet(struct mbuf *m, struct secpolicy struct inpcb *inp) { - return (ipsec6_perform_request(m, sp, 0)); + return (ipsec6_perform_request(m, sp, inp, 0)); } static int @@ -750,14 +754,14 @@ ipsec_process_done(struct mbuf *m, struct secpolicy *s case AF_INET: key_freesav(&sav); IPSECSTAT_INC(ips_out_bundlesa); - return (ipsec4_perform_request(m, sp, idx)); + return (ipsec4_perform_request(m, sp, NULL, idx)); /* NOTREACHED */ #endif #ifdef INET6 case AF_INET6: key_freesav(&sav); IPSEC6STAT_INC(ips_out_bundlesa); - return (ipsec6_perform_request(m, sp, idx)); + return (ipsec6_perform_request(m, sp, NULL, idx)); /* NOTREACHED */ #endif /* INET6 */ default: From owner-svn-src-all@freebsd.org Mon Jul 31 12:03:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99F59DD1E02; Mon, 31 Jul 2017 12:03:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 68A5E746A4; Mon, 31 Jul 2017 12:03:46 +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 v6VC3jbS014105; Mon, 31 Jul 2017 12:03:45 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VC3jrX014104; Mon, 31 Jul 2017 12:03:45 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201707311203.v6VC3jrX014104@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 31 Jul 2017 12:03:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321780 - head/sys/dev/mlx4/mlx4_ib X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx4/mlx4_ib X-SVN-Commit-Revision: 321780 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 12:03:46 -0000 Author: hselasky Date: Mon Jul 31 12:03:45 2017 New Revision: 321780 URL: https://svnweb.freebsd.org/changeset/base/321780 Log: Make sure on-stack buffer is properly aligned. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx4/mlx4_ib/mlx4_ib_mad.c Modified: head/sys/dev/mlx4/mlx4_ib/mlx4_ib_mad.c ============================================================================== --- head/sys/dev/mlx4/mlx4_ib/mlx4_ib_mad.c Mon Jul 31 11:04:35 2017 (r321779) +++ head/sys/dev/mlx4/mlx4_ib/mlx4_ib_mad.c Mon Jul 31 12:03:45 2017 (r321780) @@ -983,7 +983,7 @@ static int iboe_process_mad(struct ib_device *ibdev, i int err; u32 counter_index = dev->counters[port_num - 1].counter_index & 0xffff; u8 mode; - char counter_buf[MLX4_IF_STAT_SZ(1)]; + char counter_buf[MLX4_IF_STAT_SZ(1)] __aligned(8); union mlx4_counter *counter = (union mlx4_counter *) counter_buf; From owner-svn-src-all@freebsd.org Mon Jul 31 12:09:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71BEADAB172; Mon, 31 Jul 2017 12:09:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 32DFD74989; Mon, 31 Jul 2017 12:09:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6VC9PFj014390; Mon, 31 Jul 2017 12:09:25 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VC9O01014385; Mon, 31 Jul 2017 12:09:24 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201707311209.v6VC9O01014385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 31 Jul 2017 12:09:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321782 - in head/sys/dev/mlx4: . mlx4_core mlx4_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx4: . mlx4_core mlx4_en X-SVN-Commit-Revision: 321782 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 12:09:26 -0000 Author: hselasky Date: Mon Jul 31 12:09:24 2017 New Revision: 321782 URL: https://svnweb.freebsd.org/changeset/base/321782 Log: Remove some dead statistics related code and a structure field from the mlx4en driver which is used by its Linux counterpart, but not under FreeBSD. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx4/device.h head/sys/dev/mlx4/mlx4_core/mlx4_port.c head/sys/dev/mlx4/mlx4_en/en.h head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c head/sys/dev/mlx4/stats.h Modified: head/sys/dev/mlx4/device.h ============================================================================== --- head/sys/dev/mlx4/device.h Mon Jul 31 12:08:44 2017 (r321781) +++ head/sys/dev/mlx4/device.h Mon Jul 31 12:09:24 2017 (r321782) @@ -1273,7 +1273,6 @@ int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, u64 mac); int mlx4_get_base_qpn(struct mlx4_dev *dev, u8 port); int __mlx4_replace_mac(struct mlx4_dev *dev, u8 port, int qpn, u64 new_mac); -void mlx4_set_stats_bitmap(struct mlx4_dev *dev, unsigned long *stats_bitmap); int mlx4_SET_PORT_general(struct mlx4_dev *dev, u8 port, int mtu, u8 pptx, u8 pfctx, u8 pprx, u8 pfcrx); int mlx4_SET_PORT_qpn_calc(struct mlx4_dev *dev, u8 port, u32 base_qpn, Modified: head/sys/dev/mlx4/mlx4_core/mlx4_port.c ============================================================================== --- head/sys/dev/mlx4/mlx4_core/mlx4_port.c Mon Jul 31 12:08:44 2017 (r321781) +++ head/sys/dev/mlx4/mlx4_core/mlx4_port.c Mon Jul 31 12:09:24 2017 (r321782) @@ -982,38 +982,6 @@ int mlx4_DUMP_ETH_STATS_wrapper(struct mlx4_dev *dev, return 0; } -void mlx4_set_stats_bitmap(struct mlx4_dev *dev, unsigned long *stats_bitmap) -{ - int last_i = 0; - - bitmap_zero(stats_bitmap, NUM_ALL_STATS); - - if (mlx4_is_slave(dev)) { - last_i = dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_FLOWSTATS_EN ? - NUM_PKT_STATS + NUM_FLOW_STATS : NUM_PKT_STATS; - } else { - bitmap_set(stats_bitmap, last_i, NUM_PKT_STATS); - last_i = NUM_PKT_STATS; - - if (dev->caps.flags2 & - MLX4_DEV_CAP_FLAG2_FLOWSTATS_EN) { - bitmap_set(stats_bitmap, last_i, NUM_FLOW_STATS); - last_i += NUM_FLOW_STATS; - } - } - - if (mlx4_is_slave(dev)) - bitmap_set(stats_bitmap, last_i, NUM_VF_STATS); - last_i += NUM_VF_STATS; - - if (mlx4_is_master(dev)) - bitmap_set(stats_bitmap, last_i, NUM_VPORT_STATS); - last_i += NUM_VPORT_STATS; - - bitmap_set(stats_bitmap, last_i, NUM_PORT_STATS); -} -EXPORT_SYMBOL(mlx4_set_stats_bitmap); - int mlx4_get_slave_from_roce_gid(struct mlx4_dev *dev, int port, u8 *gid, int *slave_id) { struct mlx4_priv *priv = mlx4_priv(dev); Modified: head/sys/dev/mlx4/mlx4_en/en.h ============================================================================== --- head/sys/dev/mlx4/mlx4_en/en.h Mon Jul 31 12:08:44 2017 (r321781) +++ head/sys/dev/mlx4/mlx4_en/en.h Mon Jul 31 12:09:24 2017 (r321782) @@ -572,7 +572,6 @@ struct mlx4_en_priv { struct mlx4_en_port_stats port_stats; struct mlx4_en_vport_stats vport_stats; struct mlx4_en_vf_stats vf_stats; - DECLARE_BITMAP(stats_bitmap, NUM_ALL_STATS); struct list_head mc_list; struct list_head curr_list; u64 broadcast_id; Modified: head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c ============================================================================== --- head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c Mon Jul 31 12:08:44 2017 (r321781) +++ head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c Mon Jul 31 12:09:24 2017 (r321782) @@ -1377,8 +1377,6 @@ int mlx4_en_start_port(struct net_device *dev) /* Schedule multicast task to populate multicast list */ queue_work(mdev->workqueue, &priv->rx_mode_task); - mlx4_set_stats_bitmap(mdev->dev, priv->stats_bitmap); - priv->port_up = true; /* Enable the queues. */ @@ -2731,28 +2729,6 @@ static void mlx4_en_sysctl_stat(struct mlx4_en_priv *p SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "rx_gt_1548_bytes_packets", CTLFLAG_RD, &priv->pkstats.rx_gt_1548_bytes_packets, "RX Greater Then 1548 bytes Packets"); - -struct mlx4_en_pkt_stats { - unsigned long tx_packets; - unsigned long tx_bytes; - unsigned long tx_multicast_packets; - unsigned long tx_broadcast_packets; - unsigned long tx_errors; - unsigned long tx_dropped; - unsigned long tx_lt_64_bytes_packets; - unsigned long tx_127_bytes_packets; - unsigned long tx_255_bytes_packets; - unsigned long tx_511_bytes_packets; - unsigned long tx_1023_bytes_packets; - unsigned long tx_1518_bytes_packets; - unsigned long tx_1522_bytes_packets; - unsigned long tx_1548_bytes_packets; - unsigned long tx_gt_1548_bytes_packets; - unsigned long rx_prio[NUM_PRIORITIES][NUM_PRIORITY_STATS]; - unsigned long tx_prio[NUM_PRIORITIES][NUM_PRIORITY_STATS]; -#define NUM_PKT_STATS 72 -}; - SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "tx_packets", CTLFLAG_RD, &priv->pkstats.tx_packets, "TX packets"); Modified: head/sys/dev/mlx4/stats.h ============================================================================== --- head/sys/dev/mlx4/stats.h Mon Jul 31 12:08:44 2017 (r321781) +++ head/sys/dev/mlx4/stats.h Mon Jul 31 12:09:24 2017 (r321782) @@ -82,7 +82,6 @@ struct mlx4_en_pkt_stats { unsigned long tx_gt_1548_bytes_packets; unsigned long rx_prio[NUM_PRIORITIES][NUM_PRIORITY_STATS]; unsigned long tx_prio[NUM_PRIORITIES][NUM_PRIORITY_STATS]; -#define NUM_PKT_STATS 72 }; struct mlx4_en_vf_stats { @@ -97,7 +96,6 @@ struct mlx4_en_vf_stats { unsigned long tx_multicast_packets; unsigned long tx_broadcast_packets; unsigned long tx_errors; -#define NUM_VF_STATS 11 }; struct mlx4_en_vport_stats { @@ -116,7 +114,6 @@ struct mlx4_en_vport_stats { unsigned long tx_broadcast_packets; unsigned long tx_broadcast_bytes; unsigned long tx_errors; -#define NUM_VPORT_STATS 15 }; struct mlx4_en_port_stats { @@ -129,7 +126,6 @@ struct mlx4_en_port_stats { unsigned long rx_chksum_good; unsigned long rx_chksum_none; unsigned long tx_chksum_offload; -#define NUM_PORT_STATS 8 }; struct mlx4_en_perf_stats { @@ -139,7 +135,6 @@ struct mlx4_en_perf_stats { u16 tx_coal_avg; u16 rx_coal_avg; u32 napi_quota; -#define NUM_PERF_COUNTERS 6 }; struct mlx4_en_flow_stats { @@ -151,8 +146,6 @@ struct mlx4_en_flow_stats { u64 tx_pause_transition; }; #define MLX4_NUM_PRIORITIES 8 -#define NUM_FLOW_PRIORITY_STATS 6 -#define NUM_FLOW_STATS (NUM_FLOW_PRIORITY_STATS*MLX4_NUM_PRIORITIES) struct mlx4_en_stat_out_flow_control_mbox { @@ -180,6 +173,4 @@ int mlx4_get_vport_ethtool_stats(struct mlx4_dev *dev, struct mlx4_en_vport_stats *vport_stats, int reset); -#define NUM_ALL_STATS (NUM_PKT_STATS + NUM_FLOW_STATS + NUM_VPORT_STATS + \ - NUM_VF_STATS + NUM_PORT_STATS + NUM_PERF_STATS) #endif From owner-svn-src-all@freebsd.org Mon Jul 31 13:08:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 341F1DAD6CA; Mon, 31 Jul 2017 13:08:49 +0000 (UTC) (envelope-from lifanov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F347776417; Mon, 31 Jul 2017 13:08:48 +0000 (UTC) (envelope-from lifanov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6VD8mCk038757; Mon, 31 Jul 2017 13:08:48 GMT (envelope-from lifanov@FreeBSD.org) Received: (from lifanov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VD8ma9038756; Mon, 31 Jul 2017 13:08:48 GMT (envelope-from lifanov@FreeBSD.org) Message-Id: <201707311308.v6VD8ma9038756@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lifanov set sender to lifanov@FreeBSD.org using -f From: Nikolai Lifanov Date: Mon, 31 Jul 2017 13:08:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321783 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: lifanov X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321783 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 13:08:49 -0000 Author: lifanov (ports committer) Date: Mon Jul 31 13:08:47 2017 New Revision: 321783 URL: https://svnweb.freebsd.org/changeset/base/321783 Log: add myself to calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 12:09:24 2017 (r321782) +++ head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 13:08:47 2017 (r321783) @@ -94,6 +94,7 @@ 03/07 Michael P. Pritchard born in Los Angeles, California, United States, 1964 03/07 Giorgos Keramidas born in Athens, Greece, 1976 03/10 Andreas Klemm born in Duesseldorf, Nordrhein-Westfalen, Germany, 1963 +03/10 Nikolai Lifanov born in Moscow, Russian Federation, 1989 03/11 Soeren Straarup born in Andst, Denmark, 1978 03/12 Greg Lewis born in Adelaide, South Australia, Australia, 1969 03/13 Alexander Leidinger born in Neunkirchen, Saarland, Germany, 1976 From owner-svn-src-all@freebsd.org Mon Jul 31 13:32:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 335F3DAE0F5; Mon, 31 Jul 2017 13:32:37 +0000 (UTC) (envelope-from wen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E4C897729B; Mon, 31 Jul 2017 13:32:36 +0000 (UTC) (envelope-from wen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6VDWa26050610; Mon, 31 Jul 2017 13:32:36 GMT (envelope-from wen@FreeBSD.org) Received: (from wen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VDWaVf050609; Mon, 31 Jul 2017 13:32:36 GMT (envelope-from wen@FreeBSD.org) Message-Id: <201707311332.v6VDWaVf050609@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wen set sender to wen@FreeBSD.org using -f From: Wen Heping Date: Mon, 31 Jul 2017 13:32:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321784 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: wen X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321784 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 13:32:37 -0000 Author: wen (ports committer) Date: Mon Jul 31 13:32:35 2017 New Revision: 321784 URL: https://svnweb.freebsd.org/changeset/base/321784 Log: add myself to calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 13:08:47 2017 (r321783) +++ head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 13:32:35 2017 (r321784) @@ -192,6 +192,7 @@ 05/27 Ollivier Robert born in Paris, France, 1967 05/29 Wilko Bulte born in Arnhem, the Netherlands, 1965 05/29 Seigo Tanimura born in Kitakyushu, Fukuoka, Japan, 1976 +05/30 Wen Heping born in Xiangxiang, Hunan, China, 1970 05/31 Ville Skytta born in Helsinki, Finland, 1974 06/02 Jean-Marc Zucconi born in Pontarlier, France, 1954 06/02 Alexander Botero-Lowry born in Austin, Texas, United States, 1986 From owner-svn-src-all@freebsd.org Mon Jul 31 14:16:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0437DAEAFB; Mon, 31 Jul 2017 14:16:36 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7E5DD7C451; Mon, 31 Jul 2017 14:16:36 +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 v6VEGZCR067064; Mon, 31 Jul 2017 14:16:35 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VEGZKE067063; Mon, 31 Jul 2017 14:16:35 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201707311416.v6VEGZKE067063@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 31 Jul 2017 14:16:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321785 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321785 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 14:16:36 -0000 Author: jhibbits Date: Mon Jul 31 14:16:35 2017 New Revision: 321785 URL: https://svnweb.freebsd.org/changeset/base/321785 Log: Add myself to the calendar Reminded by: mckusick Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 13:32:35 2017 (r321784) +++ head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 14:16:35 2017 (r321785) @@ -69,6 +69,7 @@ 02/14 Erwin Lansing born in 's-Hertogenbosch, the Netherlands, 1975 02/14 Martin Blapp born in Olten, Switzerland, 1976 02/15 Hiren Panchasara born in Ahmedabad, Gujarat, India, 1984 +02/16 Justin Hibbits born in Toledo, Ohio, United States, 1983 02/19 Murray Stokely born in Jacksonville, Florida, United States, 1979 02/20 Anders Nordby born in Oslo, Norway, 1976 02/21 Alexey Zelkin born in Simferopol, Ukraine, 1978 From owner-svn-src-all@freebsd.org Mon Jul 31 14:42:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D941BDAF4E2; Mon, 31 Jul 2017 14:42:39 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A837C7D13C; Mon, 31 Jul 2017 14:42:39 +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 v6VEgc4E078881; Mon, 31 Jul 2017 14:42:38 GMT (envelope-from rpokala@FreeBSD.org) Received: (from rpokala@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VEgcwn078880; Mon, 31 Jul 2017 14:42:38 GMT (envelope-from rpokala@FreeBSD.org) Message-Id: <201707311442.v6VEgcwn078880@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpokala set sender to rpokala@FreeBSD.org using -f From: Ravi Pokala Date: Mon, 31 Jul 2017 14:42:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321786 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: rpokala X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321786 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 14:42:40 -0000 Author: rpokala Date: Mon Jul 31 14:42:38 2017 New Revision: 321786 URL: https://svnweb.freebsd.org/changeset/base/321786 Log: Add my birthday to the FreeBSD calendar Requested by: mckusick Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 14:16:35 2017 (r321785) +++ head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 14:42:38 2017 (r321786) @@ -210,6 +210,7 @@ 06/06 Alan Eldridge died in Denver, Colorado, 2003 06/07 Jimmy Olgeni born in Milano, Italy, 1976 06/07 Benjamin Close born in Adelaide, Australia, 1978 +06/08 Ravi Pokala born in Royal Oak, Michigan, United States, 1980 06/09 Stanislav Galabov born in Sofia, Bulgaria 1978 06/11 Alonso Cardenas Marquez born in Arequipa, Peru, 1979 06/14 Josh Paetzel born in Minneapolis, Minnesota, United States, 1973 From owner-svn-src-all@freebsd.org Mon Jul 31 14:49:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 123EEDAF798; Mon, 31 Jul 2017 14:49:46 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D3FCC7D477; Mon, 31 Jul 2017 14:49:45 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6VEnjOc079230; Mon, 31 Jul 2017 14:49:45 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VEnj5X079229; Mon, 31 Jul 2017 14:49:45 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201707311449.v6VEnj5X079229@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Mon, 31 Jul 2017 14:49:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321787 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: mm X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321787 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 14:49:46 -0000 Author: mm Date: Mon Jul 31 14:49:44 2017 New Revision: 321787 URL: https://svnweb.freebsd.org/changeset/base/321787 Log: Add myself to the calendar Reminded by: mckusick Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 14:42:38 2017 (r321786) +++ head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 14:49:44 2017 (r321787) @@ -321,6 +321,7 @@ 09/20 Kevin Lo born in Taipei, Taiwan, Republic of China, 1972 09/21 Gleb Kurtsou born in Minsk, Belarus, 1984 09/22 Bryan Drewery born in San Diego, California, United States, 1984 +09/23 Martin Matuska born in Bratislava, Slovakia, 1979 09/24 Larry Rosenman born in Queens, New York, United States, 1957 09/27 Neil Blakey-Milner born in Port Elizabeth, South Africa, 1978 09/27 Renato Botelho born in Araras, Sao Paulo, Brazil, 1979 From owner-svn-src-all@freebsd.org Mon Jul 31 14:50:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 509FDDAF83A; Mon, 31 Jul 2017 14:50:44 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 14ED67D5FC; Mon, 31 Jul 2017 14:50:44 +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 v6VEoh40080301; Mon, 31 Jul 2017 14:50:43 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VEohvA080300; Mon, 31 Jul 2017 14:50:43 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201707311450.v6VEohvA080300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 31 Jul 2017 14:50:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321788 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321788 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 14:50:44 -0000 Author: asomers Date: Mon Jul 31 14:50:42 2017 New Revision: 321788 URL: https://svnweb.freebsd.org/changeset/base/321788 Log: Add myself to the calendar Reported by: mckusick Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 14:49:44 2017 (r321787) +++ head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 14:50:42 2017 (r321788) @@ -320,6 +320,7 @@ 09/18 Matthew Fleming born in Cleveland, Ohio, United States, 1975 09/20 Kevin Lo born in Taipei, Taiwan, Republic of China, 1972 09/21 Gleb Kurtsou born in Minsk, Belarus, 1984 +09/22 Alan Somers born in San Antonio, Texas, United States, 1982 09/22 Bryan Drewery born in San Diego, California, United States, 1984 09/23 Martin Matuska born in Bratislava, Slovakia, 1979 09/24 Larry Rosenman born in Queens, New York, United States, 1957 From owner-svn-src-all@freebsd.org Mon Jul 31 14:53:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBD6ADAFAC0; Mon, 31 Jul 2017 14:53:04 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8AEFA7DAEB; Mon, 31 Jul 2017 14:53:04 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6VEr3IH083431; Mon, 31 Jul 2017 14:53:03 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VEr3WS083430; Mon, 31 Jul 2017 14:53:03 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201707311453.v6VEr3WS083430@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Mon, 31 Jul 2017 14:53:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321789 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: nyan X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321789 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 14:53:04 -0000 Author: nyan Date: Mon Jul 31 14:53:03 2017 New Revision: 321789 URL: https://svnweb.freebsd.org/changeset/base/321789 Log: Add myself. Reminded by: mckusick Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 14:50:42 2017 (r321788) +++ head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 14:53:03 2017 (r321789) @@ -53,6 +53,7 @@ 02/02 Michael W Lucas born in Detroit, Michigan, United States, 1967 02/02 Dmitry Chagin born in Stalingrad, USSR, 1976 02/02 Yoichi Nakayama born in Tsu, Mie, Japan, 1976 +02/02 Yoshihiro Takahashi born in Yokohama, Kanagawa, Japan, 1976 02/03 Jason Helfman born in Royal Oak, Michigan, United States, 1972 02/04 Eitan Adler born in West Hempstead, New York, United States, 1991 02/05 Frank Laszlo born in Howell, Michigan, United States, 1983 From owner-svn-src-all@freebsd.org Mon Jul 31 14:56:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A555EDAFC65; Mon, 31 Jul 2017 14:56:36 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F34F7DD0D; Mon, 31 Jul 2017 14:56:36 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6VEuZkr083623; Mon, 31 Jul 2017 14:56:35 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VEuZvT083622; Mon, 31 Jul 2017 14:56:35 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <201707311456.v6VEuZvT083622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Mon, 31 Jul 2017 14:56:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321790 - head/sbin/sysctl X-SVN-Group: head X-SVN-Commit-Author: gallatin X-SVN-Commit-Paths: head/sbin/sysctl X-SVN-Commit-Revision: 321790 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 14:56:36 -0000 Author: gallatin Date: Mon Jul 31 14:56:35 2017 New Revision: 321790 URL: https://svnweb.freebsd.org/changeset/base/321790 Log: Don't request CTLTYPE_OPAQUE if we can't print them. The intent is to skip expensive opaque sysctls like tcp_pcblist unless they are explicitly requested. Sysctl nodes like this don't show up in sysctl -a, but they do generate output that winds up being dropped, unless the user specifically requested binary/hex output or opaques. This reduces the runtime of sysctl in many circumstances on a loaded system. It also reduces the likelihood that simply gathering diagnostics on a sick machine (stuck lock, etc) via sysctl -a might push it over the edge into a total lockup. Reviewed by: jtl Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D11461 Modified: head/sbin/sysctl/sysctl.c Modified: head/sbin/sysctl/sysctl.c ============================================================================== --- head/sbin/sysctl/sysctl.c Mon Jul 31 14:53:03 2017 (r321789) +++ head/sbin/sysctl/sysctl.c Mon Jul 31 14:56:35 2017 (r321790) @@ -925,6 +925,32 @@ show_var(int *oid, int nlen) printf("%s", buf); return (0); } + + /* don't fetch opaques that we don't know how to print */ + if (ctltype == CTLTYPE_OPAQUE) { + if (strcmp(fmt, "S,clockinfo") == 0) + func = S_clockinfo; + else if (strcmp(fmt, "S,timeval") == 0) + func = S_timeval; + else if (strcmp(fmt, "S,loadavg") == 0) + func = S_loadavg; + else if (strcmp(fmt, "S,vmtotal") == 0) + func = S_vmtotal; +#ifdef __amd64__ + else if (strcmp(fmt, "S,efi_map_header") == 0) + func = S_efi_map; +#endif +#if defined(__amd64__) || defined(__i386__) + else if (strcmp(fmt, "S,bios_smap_xattr") == 0) + func = S_bios_smap_xattr; +#endif + else { + func = NULL; + if (!bflag && !oflag && !xflag) + return (1); + } + } + /* find an estimate of how much we need for this var */ if (Bflag) j = Bflag; @@ -1045,24 +1071,6 @@ show_var(int *oid, int nlen) case CTLTYPE_OPAQUE: i = 0; - if (strcmp(fmt, "S,clockinfo") == 0) - func = S_clockinfo; - else if (strcmp(fmt, "S,timeval") == 0) - func = S_timeval; - else if (strcmp(fmt, "S,loadavg") == 0) - func = S_loadavg; - else if (strcmp(fmt, "S,vmtotal") == 0) - func = S_vmtotal; -#ifdef __amd64__ - else if (strcmp(fmt, "S,efi_map_header") == 0) - func = S_efi_map; -#endif -#if defined(__amd64__) || defined(__i386__) - else if (strcmp(fmt, "S,bios_smap_xattr") == 0) - func = S_bios_smap_xattr; -#endif - else - func = NULL; if (func) { if (!nflag) printf("%s%s", name, sep); From owner-svn-src-all@freebsd.org Mon Jul 31 14:57:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C13DDAFCE8; Mon, 31 Jul 2017 14:57:03 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 57C5E7DE59; Mon, 31 Jul 2017 14:57:03 +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 v6VEv2HU083685; Mon, 31 Jul 2017 14:57:02 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VEv2gM083684; Mon, 31 Jul 2017 14:57:02 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201707311457.v6VEv2gM083684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 31 Jul 2017 14:57:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321791 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 321791 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 14:57:03 -0000 Author: ian Date: Mon Jul 31 14:57:02 2017 New Revision: 321791 URL: https://svnweb.freebsd.org/changeset/base/321791 Log: Switch from using iic_transfer() to iicdev_readfrom/writeto(), mostly so that transfers will be done with proper ownership of the bus. No behavioral changes. Also add a detach() method. Modified: head/sys/dev/iicbus/ds3231.c Modified: head/sys/dev/iicbus/ds3231.c ============================================================================== --- head/sys/dev/iicbus/ds3231.c Mon Jul 31 14:56:35 2017 (r321790) +++ head/sys/dev/iicbus/ds3231.c Mon Jul 31 14:57:02 2017 (r321791) @@ -67,24 +67,17 @@ struct ds3231_softc { static void ds3231_start(void *); static int -ds3231_read(device_t dev, uint16_t addr, uint8_t reg, uint8_t *data, size_t len) +ds3231_read1(device_t dev, uint8_t reg, uint8_t *data) { - struct iic_msg msg[2] = { - { addr, IIC_M_WR | IIC_M_NOSTOP, 1, ® }, - { addr, IIC_M_RD, len, data }, - }; - return (iicbus_transfer(dev, msg, nitems(msg))); + return (iicdev_readfrom(dev, reg, data, 1, IIC_INTRWAIT)); } static int -ds3231_write(device_t dev, uint16_t addr, uint8_t *data, size_t len) +ds3231_write1(device_t dev, uint8_t reg, uint8_t data) { - struct iic_msg msg[1] = { - { addr, IIC_M_WR, len, data }, - }; - return (iicbus_transfer(dev, msg, nitems(msg))); + return (iicdev_writeto(dev, reg, &data, 1, IIC_INTRWAIT)); } static int @@ -92,14 +85,11 @@ ds3231_ctrl_read(struct ds3231_softc *sc) { int error; - sc->sc_ctrl = 0; - error = ds3231_read(sc->sc_dev, sc->sc_addr, DS3231_CONTROL, - &sc->sc_ctrl, sizeof(sc->sc_ctrl)); + error = ds3231_read1(sc->sc_dev, DS3231_CONTROL, &sc->sc_ctrl); if (error) { device_printf(sc->sc_dev, "cannot read from RTC.\n"); return (error); } - return (0); } @@ -107,12 +97,11 @@ static int ds3231_ctrl_write(struct ds3231_softc *sc) { int error; - uint8_t data[2]; + uint8_t data; - data[0] = DS3231_CONTROL; /* Always enable the oscillator. Always disable both alarms. */ - data[1] = sc->sc_ctrl & ~DS3231_CTRL_MASK; - error = ds3231_write(sc->sc_dev, sc->sc_addr, data, sizeof(data)); + data = sc->sc_ctrl & ~DS3231_CTRL_MASK; + error = ds3231_write1(sc->sc_dev, DS3231_CONTROL, data); if (error != 0) device_printf(sc->sc_dev, "cannot write to RTC.\n"); @@ -124,9 +113,7 @@ ds3231_status_read(struct ds3231_softc *sc) { int error; - sc->sc_status = 0; - error = ds3231_read(sc->sc_dev, sc->sc_addr, DS3231_STATUS, - &sc->sc_status, sizeof(sc->sc_status)); + error = ds3231_read1(sc->sc_dev, DS3231_STATUS, &sc->sc_status); if (error) { device_printf(sc->sc_dev, "cannot read from RTC.\n"); return (error); @@ -139,15 +126,14 @@ static int ds3231_status_write(struct ds3231_softc *sc, int clear_a1, int clear_a2) { int error; - uint8_t data[2]; + uint8_t data; - data[0] = DS3231_STATUS; - data[1] = sc->sc_status; + data = sc->sc_status; if (clear_a1 == 0) - data[1] |= DS3231_STATUS_A1F; + data |= DS3231_STATUS_A1F; if (clear_a2 == 0) - data[1] |= DS3231_STATUS_A2F; - error = ds3231_write(sc->sc_dev, sc->sc_addr, data, sizeof(data)); + data |= DS3231_STATUS_A2F; + error = ds3231_write1(sc->sc_dev, DS3231_STATUS, data); if (error != 0) device_printf(sc->sc_dev, "cannot write to RTC.\n"); @@ -158,18 +144,15 @@ static int ds3231_set_24hrs_mode(struct ds3231_softc *sc) { int error; - uint8_t data[2], hour; + uint8_t hour; - hour = 0; - error = ds3231_read(sc->sc_dev, sc->sc_addr, DS3231_HOUR, - &hour, sizeof(hour)); + error = ds3231_read1(sc->sc_dev, DS3231_HOUR, &hour); if (error) { device_printf(sc->sc_dev, "cannot read from RTC.\n"); return (error); } - data[0] = DS3231_HOUR; - data[1] = hour & ~DS3231_C_MASK; - error = ds3231_write(sc->sc_dev, sc->sc_addr, data, sizeof(data)); + hour &= ~DS3231_C_MASK; + error = ds3231_write1(sc->sc_dev, DS3231_HOUR, hour); if (error != 0) device_printf(sc->sc_dev, "cannot write to RTC.\n"); @@ -183,8 +166,8 @@ ds3231_temp_read(struct ds3231_softc *sc, int *temp) uint8_t buf8[2]; uint16_t buf; - error = ds3231_read(sc->sc_dev, sc->sc_addr, DS3231_TEMP, - buf8, sizeof(buf8)); + error = iicdev_readfrom(sc->sc_dev, DS3231_TEMP, buf8, sizeof(buf8), + IIC_INTRWAIT); if (error != 0) return (error); buf = (buf8[0] << 8) | (buf8[1] & 0xff); @@ -426,6 +409,14 @@ ds3231_attach(device_t dev) return (0); } +static int +ds3231_detach(device_t dev) +{ + + clock_unregister(dev); + return (0); +} + static void ds3231_start(void *xdev) { @@ -499,8 +490,8 @@ ds3231_gettime(device_t dev, struct timespec *ts) sc = device_get_softc(dev); memset(data, 0, sizeof(data)); - error = ds3231_read(sc->sc_dev, sc->sc_addr, DS3231_SECS, - data, sizeof(data)); + error = iicdev_readfrom(sc->sc_dev, DS3231_SECS, data, sizeof(data), + IIC_INTRWAIT); if (error != 0) { device_printf(dev, "cannot read from RTC.\n"); return (error); @@ -533,7 +524,7 @@ ds3231_settime(device_t dev, struct timespec *ts) int error; struct clocktime ct; struct ds3231_softc *sc; - uint8_t data[8]; + uint8_t data[7]; sc = device_get_softc(dev); /* Accuracy is only one second. */ @@ -542,18 +533,18 @@ ds3231_settime(device_t dev, struct timespec *ts) ts->tv_nsec = 0; clock_ts_to_ct(ts, &ct); memset(data, 0, sizeof(data)); - data[0] = DS3231_SECS; - data[DS3231_SECS + 1] = TOBCD(ct.sec); - data[DS3231_MINS + 1] = TOBCD(ct.min); - data[DS3231_HOUR + 1] = TOBCD(ct.hour); - data[DS3231_DATE + 1] = TOBCD(ct.day); - data[DS3231_WEEKDAY + 1] = ct.dow; - data[DS3231_MONTH + 1] = TOBCD(ct.mon); - data[DS3231_YEAR + 1] = TOBCD(ct.year % 100); + data[DS3231_SECS] = TOBCD(ct.sec); + data[DS3231_MINS] = TOBCD(ct.min); + data[DS3231_HOUR] = TOBCD(ct.hour); + data[DS3231_DATE] = TOBCD(ct.day); + data[DS3231_WEEKDAY] = ct.dow; + data[DS3231_MONTH] = TOBCD(ct.mon); + data[DS3231_YEAR] = TOBCD(ct.year % 100); if (sc->sc_last_c) data[DS3231_MONTH] |= DS3231_C_MASK; /* Write the time back to RTC. */ - error = ds3231_write(dev, sc->sc_addr, data, sizeof(data)); + error = iicdev_writeto(dev, DS3231_SECS, data, sizeof(data), + IIC_INTRWAIT); if (error != 0) device_printf(dev, "cannot write to RTC.\n"); @@ -563,6 +554,7 @@ ds3231_settime(device_t dev, struct timespec *ts) static device_method_t ds3231_methods[] = { DEVMETHOD(device_probe, ds3231_probe), DEVMETHOD(device_attach, ds3231_attach), + DEVMETHOD(device_detach, ds3231_detach), DEVMETHOD(clock_gettime, ds3231_gettime), DEVMETHOD(clock_settime, ds3231_settime), From owner-svn-src-all@freebsd.org Mon Jul 31 14:58:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7802DDAFDA7; Mon, 31 Jul 2017 14:58: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 mx1.freebsd.org (Postfix) with ESMTPS id 424B27DFA5; Mon, 31 Jul 2017 14:58: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 v6VEw14N083759; Mon, 31 Jul 2017 14:58:01 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VEw1nj083758; Mon, 31 Jul 2017 14:58:01 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201707311458.v6VEw1nj083758@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 31 Jul 2017 14:58:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321792 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 321792 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 14:58:02 -0000 Author: ian Date: Mon Jul 31 14:58:01 2017 New Revision: 321792 URL: https://svnweb.freebsd.org/changeset/base/321792 Log: Add a detach() method. Modified: head/sys/dev/iicbus/ds1307.c Modified: head/sys/dev/iicbus/ds1307.c ============================================================================== --- head/sys/dev/iicbus/ds1307.c Mon Jul 31 14:57:02 2017 (r321791) +++ head/sys/dev/iicbus/ds1307.c Mon Jul 31 14:58:01 2017 (r321792) @@ -78,14 +78,14 @@ static int ds1307_read1(device_t dev, uint8_t reg, uint8_t *data) { - return(iicdev_readfrom(dev, reg, data, 1, IIC_INTRWAIT)); + return (iicdev_readfrom(dev, reg, data, 1, IIC_INTRWAIT)); } static int ds1307_write1(device_t dev, uint8_t reg, uint8_t data) { - return(iicdev_writeto(dev, reg, &data, 1, IIC_INTRWAIT)); + return (iicdev_writeto(dev, reg, &data, 1, IIC_INTRWAIT)); } static int @@ -255,6 +255,14 @@ ds1307_attach(device_t dev) return (0); } +static int +ds1307_detach(device_t dev) +{ + + clock_unregister(dev); + return (0); +} + static void ds1307_start(void *xdev) { @@ -387,6 +395,7 @@ ds1307_settime(device_t dev, struct timespec *ts) static device_method_t ds1307_methods[] = { DEVMETHOD(device_probe, ds1307_probe), DEVMETHOD(device_attach, ds1307_attach), + DEVMETHOD(device_detach, ds1307_detach), DEVMETHOD(clock_gettime, ds1307_gettime), DEVMETHOD(clock_settime, ds1307_settime), From owner-svn-src-all@freebsd.org Mon Jul 31 15:21:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8E90DB0A17; Mon, 31 Jul 2017 15:21:27 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 945CD7EED4; Mon, 31 Jul 2017 15:21:27 +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 v6VFLQ2e095223; Mon, 31 Jul 2017 15:21:26 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VFLQJY095222; Mon, 31 Jul 2017 15:21:26 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201707311521.v6VFLQJY095222@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 31 Jul 2017 15:21:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321793 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321793 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 15:21:27 -0000 Author: asomers Date: Mon Jul 31 15:21:26 2017 New Revision: 321793 URL: https://svnweb.freebsd.org/changeset/base/321793 Log: spellcheck jhale's calendar entry Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 14:58:01 2017 (r321792) +++ head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 15:21:26 2017 (r321793) @@ -61,7 +61,7 @@ 02/10 David Greenman born in Portland, Oregon, United States, 1968 02/10 Paul Richards born in Ammanford, Carmarthenshire, United Kingdom, 1968 02/10 Simon Barner born in Rosenheim, Bayern, Germany, 1980 -02/10 Jason E. Hale born in Pittsburgh, Pennsylvania, Unites States, 1982 +02/10 Jason E. Hale born in Pittsburgh, Pennsylvania, United States, 1982 02/13 Jesper Skriver born in Aarhus, Denmark, 1975 02/13 Steve Wills born in Lynchburg, Virginia, United States, 1975 02/13 Andrey Slusar born in Odessa, USSR, 1979 From owner-svn-src-all@freebsd.org Mon Jul 31 15:23:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBFDBDB0ED1; Mon, 31 Jul 2017 15:23:20 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C86B67F1C4; Mon, 31 Jul 2017 15:23:20 +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 v6VFNJDm096225; Mon, 31 Jul 2017 15:23:19 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VFNJIV096222; Mon, 31 Jul 2017 15:23:19 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201707311523.v6VFNJIV096222@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 31 Jul 2017 15:23:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321794 - in head/sys: fs/nfsserver nfs X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head/sys: fs/nfsserver nfs X-SVN-Commit-Revision: 321794 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 15:23:21 -0000 Author: mav Date: Mon Jul 31 15:23:19 2017 New Revision: 321794 URL: https://svnweb.freebsd.org/changeset/base/321794 Log: Improve FHA locality control for NFS read/write requests. This change adds two new tunables, allowing to control serialization for read and write NFS requests separately. It does not change the default behavior since there are too many factors to consider, but gives additional space for further experiments and tuning. The main motivation for this change is very low write speed in case of ZFS with sync=always or when NFS clients requests sychronous operation, when every separate request has to be written/flushed to ZIL, and requests are processed one at a time. Setting vfs.nfsd.fha.write=0 in that case allows to increase ZIL throughput by several times by coalescing writes and cache flushes. There is a worry that doing it may increase data fragmentation on disks, but I suppose it should not happen for pool with SLOG. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/sys/fs/nfsserver/nfs_fha_new.c head/sys/nfs/nfs_fha.c head/sys/nfs/nfs_fha.h Modified: head/sys/fs/nfsserver/nfs_fha_new.c ============================================================================== --- head/sys/fs/nfsserver/nfs_fha_new.c Mon Jul 31 15:21:26 2017 (r321793) +++ head/sys/fs/nfsserver/nfs_fha_new.c Mon Jul 31 15:23:19 2017 (r321794) @@ -93,7 +93,7 @@ fhanew_init(void *foo) sysctl_ctx_init(&softc->sysctl_ctx); softc->sysctl_tree = SYSCTL_ADD_NODE(&softc->sysctl_ctx, SYSCTL_STATIC_CHILDREN(_vfs_nfsd), OID_AUTO, "fha", CTLFLAG_RD, - 0, "fha node"); + 0, "NFS File Handle Affinity (FHA)"); if (softc->sysctl_tree == NULL) { printf("%s: unable to allocate sysctl tree\n", __func__); return; Modified: head/sys/nfs/nfs_fha.c ============================================================================== --- head/sys/nfs/nfs_fha.c Mon Jul 31 15:21:26 2017 (r321793) +++ head/sys/nfs/nfs_fha.c Mon Jul 31 15:23:19 2017 (r321794) @@ -51,7 +51,6 @@ static MALLOC_DEFINE(M_NFS_FHA, "NFS FHA", "NFS FHA"); void fha_init(struct fha_params *softc) { - char tmpstr[128]; int i; for (i = 0; i < FHA_HASH_SIZE; i++) @@ -61,47 +60,38 @@ fha_init(struct fha_params *softc) * Set the default tuning parameters. */ softc->ctls.enable = FHA_DEF_ENABLE; + softc->ctls.read = FHA_DEF_READ; + softc->ctls.write = FHA_DEF_WRITE; softc->ctls.bin_shift = FHA_DEF_BIN_SHIFT; softc->ctls.max_nfsds_per_fh = FHA_DEF_MAX_NFSDS_PER_FH; softc->ctls.max_reqs_per_nfsd = FHA_DEF_MAX_REQS_PER_NFSD; /* - * Allow the user to override the defaults at boot time with - * tunables. + * Add sysctls so the user can change the tuning parameters. */ - snprintf(tmpstr, sizeof(tmpstr), "vfs.%s.fha.enable", - softc->server_name); - TUNABLE_INT_FETCH(tmpstr, &softc->ctls.enable); - snprintf(tmpstr, sizeof(tmpstr), "vfs.%s.fha.bin_shift", - softc->server_name); - TUNABLE_INT_FETCH(tmpstr, &softc->ctls.bin_shift); - snprintf(tmpstr, sizeof(tmpstr), "vfs.%s.fha.max_nfsds_per_fh", - softc->server_name); - TUNABLE_INT_FETCH(tmpstr, &softc->ctls.max_nfsds_per_fh); - snprintf(tmpstr, sizeof(tmpstr), "vfs.%s.fha.max_reqs_per_nfsd", - softc->server_name); - TUNABLE_INT_FETCH(tmpstr, &softc->ctls.max_reqs_per_nfsd); - - /* - * Add sysctls so the user can change the tuning parameters at - * runtime. - */ SYSCTL_ADD_UINT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), - OID_AUTO, "enable", CTLFLAG_RW, + OID_AUTO, "enable", CTLFLAG_RWTUN, &softc->ctls.enable, 0, "Enable NFS File Handle Affinity (FHA)"); SYSCTL_ADD_UINT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), - OID_AUTO, "bin_shift", CTLFLAG_RW, - &softc->ctls.bin_shift, 0, "For FHA reads, no two requests will " - "contend if they're 2^(bin_shift) bytes apart"); + OID_AUTO, "read", CTLFLAG_RWTUN, + &softc->ctls.read, 0, "Enable NFS FHA read locality"); SYSCTL_ADD_UINT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), - OID_AUTO, "max_nfsds_per_fh", CTLFLAG_RW, + OID_AUTO, "write", CTLFLAG_RWTUN, + &softc->ctls.write, 0, "Enable NFS FHA write locality"); + + SYSCTL_ADD_UINT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, "bin_shift", CTLFLAG_RWTUN, + &softc->ctls.bin_shift, 0, "Maximum locality distance 2^(bin_shift) bytes"); + + SYSCTL_ADD_UINT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, "max_nfsds_per_fh", CTLFLAG_RWTUN, &softc->ctls.max_nfsds_per_fh, 0, "Maximum nfsd threads that " "should be working on requests for the same file handle"); SYSCTL_ADD_UINT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), - OID_AUTO, "max_reqs_per_nfsd", CTLFLAG_RW, + OID_AUTO, "max_reqs_per_nfsd", CTLFLAG_RWTUN, &softc->ctls.max_reqs_per_nfsd, 0, "Maximum requests that " "single nfsd thread should be working on at any time"); @@ -144,6 +134,7 @@ fha_extract_info(struct svc_req *req, struct fha_info i->fh = ++random_fh; i->offset = 0; i->locktype = LK_EXCLUSIVE; + i->read = i->write = 0; /* * Extract the procnum and convert to v3 form if necessary, @@ -169,6 +160,9 @@ fha_extract_info(struct svc_req *req, struct fha_info if (cb->no_offset(procnum)) goto out; + i->read = cb->is_read(procnum); + i->write = cb->is_write(procnum); + error = cb->realign(&req->rq_args, M_NOWAIT); if (error) goto out; @@ -181,7 +175,7 @@ fha_extract_info(struct svc_req *req, struct fha_info goto out; /* Content ourselves with zero offset for all but reads. */ - if (cb->is_read(procnum) || cb->is_write(procnum)) + if (i->read || i->write) cb->get_offset(&md, &dpos, v3, i); out: @@ -311,8 +305,13 @@ fha_hash_entry_choose_thread(struct fha_params *softc, return (thread); } + /* Check whether we should consider locality. */ + if ((i->read && !softc->ctls.read) || + (i->write && !softc->ctls.write)) + goto noloc; + /* - * Check for read locality, making sure that we won't + * Check for locality, making sure that we won't * exceed our per-thread load limit in the process. */ offset1 = i->offset; @@ -332,6 +331,7 @@ fha_hash_entry_choose_thread(struct fha_params *softc, } } +noloc: /* * We don't have a locality match, so skip this thread, * but keep track of the most attractive thread in case Modified: head/sys/nfs/nfs_fha.h ============================================================================== --- head/sys/nfs/nfs_fha.h Mon Jul 31 15:21:26 2017 (r321793) +++ head/sys/nfs/nfs_fha.h Mon Jul 31 15:23:19 2017 (r321794) @@ -31,6 +31,8 @@ /* Sysctl defaults. */ #define FHA_DEF_ENABLE 1 +#define FHA_DEF_READ 1 +#define FHA_DEF_WRITE 1 #define FHA_DEF_BIN_SHIFT 22 /* 4MB */ #define FHA_DEF_MAX_NFSDS_PER_FH 8 #define FHA_DEF_MAX_REQS_PER_NFSD 0 /* Unlimited */ @@ -39,6 +41,8 @@ struct fha_ctls { int enable; + int read; + int write; uint32_t bin_shift; uint32_t max_nfsds_per_fh; uint32_t max_reqs_per_nfsd; @@ -79,6 +83,8 @@ struct fha_info { u_int64_t fh; off_t offset; int locktype; + int read; + int write; }; struct fha_callbacks { From owner-svn-src-all@freebsd.org Mon Jul 31 15:24:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07C99DB0FCC; Mon, 31 Jul 2017 15:24:42 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C67207F324; Mon, 31 Jul 2017 15:24:41 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6VFOenq096312; Mon, 31 Jul 2017 15:24:40 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VFOeDl096311; Mon, 31 Jul 2017 15:24:40 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201707311524.v6VFOeDl096311@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 31 Jul 2017 15:24:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321795 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 321795 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 15:24:42 -0000 Author: ian Date: Mon Jul 31 15:24:40 2017 New Revision: 321795 URL: https://svnweb.freebsd.org/changeset/base/321795 Log: Check the clock-halted flag every time the clock is read, not just once at startup. The flag stays set until the clock is loaded with good time, so we need to keep saying the time is invalid until that happens. Modified: head/sys/dev/iicbus/ds1307.c Modified: head/sys/dev/iicbus/ds1307.c ============================================================================== --- head/sys/dev/iicbus/ds1307.c Mon Jul 31 15:23:19 2017 (r321794) +++ head/sys/dev/iicbus/ds1307.c Mon Jul 31 15:24:40 2017 (r321795) @@ -328,6 +328,10 @@ ds1307_gettime(device_t dev, struct timespec *ts) return (error); } + /* If the clock halted, we don't have good data. */ + if (data[DS1307_SECS] & DS1307_SECS_CH) + return (EINVAL); + /* If chip is in AM/PM mode remember that. */ if (data[DS1307_HOUR] & DS1307_HOUR_USE_AMPM) { sc->sc_use_ampm = true; From owner-svn-src-all@freebsd.org Mon Jul 31 15:29:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5262DB127B; Mon, 31 Jul 2017 15:29:45 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92B907F553; Mon, 31 Jul 2017 15:29:45 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6VFTilT096539; Mon, 31 Jul 2017 15:29:44 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VFTiYA096538; Mon, 31 Jul 2017 15:29:44 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201707311529.v6VFTiYA096538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Mon, 31 Jul 2017 15:29:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321796 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: jamie X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321796 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 15:29:45 -0000 Author: jamie Date: Mon Jul 31 15:29:44 2017 New Revision: 321796 URL: https://svnweb.freebsd.org/changeset/base/321796 Log: Add myself to the birthday calendar. Reminded by: mckusick Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 15:24:40 2017 (r321795) +++ head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 15:29:44 2017 (r321796) @@ -180,6 +180,7 @@ 05/19 Sofian Brabez born in Toulouse, France, 1984 05/20 Dan Moschuk died in Burlington, Ontario, Canada, 2010 05/21 Kris Kennaway born in Winnipeg, Manitoba, Canada, 1978 +05/22 James Gritton born in San Francisco, California, United States, 1967 05/22 Clive Tong-I Lin born in Changhua, Taiwan, Republic of China, 1978 05/22 Michael Bushkov born in Rostov-on-Don, Russian Federation, 1985 05/22 Rui Paulo born in Evora, Portugal, 1986 From owner-svn-src-all@freebsd.org Mon Jul 31 15:50:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 547F6DB233D; Mon, 31 Jul 2017 15:50:59 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D4EE80989; Mon, 31 Jul 2017 15:50:59 +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 v6VFowkL008249; Mon, 31 Jul 2017 15:50:58 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VFownb008248; Mon, 31 Jul 2017 15:50:58 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201707311550.v6VFownb008248@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Mon, 31 Jul 2017 15:50:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321797 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321797 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 15:50:59 -0000 Author: scottl Date: Mon Jul 31 15:50:58 2017 New Revision: 321797 URL: https://svnweb.freebsd.org/changeset/base/321797 Log: Add an entry to the freebsd calendar for myself. Reported by: kirk Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 15:29:44 2017 (r321796) +++ head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 15:50:58 2017 (r321797) @@ -290,6 +290,7 @@ 08/24 Alexander Botero-Lowry died in San Francisco, California, United States, 2012 08/25 Beech Rintoul born in Oakland, California, United States, 1952 08/25 Jean Milanez Melo born in Divinopolis, Minas Gerais, Brazil, 1982 +08/26 Scott Long born in Chicago, Illinois, United States, 1974 08/26 Dima Ruban born in Nalchik, USSR, 1970 08/26 Marc Fonvieille born in Avignon, France, 1972 08/26 Herve Quiroz born in Aix-en-Provence, France, 1977 From owner-svn-src-all@freebsd.org Mon Jul 31 16:46:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28A0FDB4013; Mon, 31 Jul 2017 16:46:18 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6D2B83AF0; Mon, 31 Jul 2017 16:46:17 +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 v6VGkH5O032509; Mon, 31 Jul 2017 16:46:17 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VGkHif032508; Mon, 31 Jul 2017 16:46:17 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201707311646.v6VGkHif032508@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 31 Jul 2017 16:46:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321798 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 321798 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 16:46:18 -0000 Author: ian Date: Mon Jul 31 16:46:16 2017 New Revision: 321798 URL: https://svnweb.freebsd.org/changeset/base/321798 Log: Restore a few rather important lines of code that got fumbled in r321746. Modified: head/sys/dev/iicbus/ds1307.c Modified: head/sys/dev/iicbus/ds1307.c ============================================================================== --- head/sys/dev/iicbus/ds1307.c Mon Jul 31 15:50:58 2017 (r321797) +++ head/sys/dev/iicbus/ds1307.c Mon Jul 31 16:46:16 2017 (r321798) @@ -380,6 +380,10 @@ ds1307_settime(device_t dev, struct timespec *ts) } else pmflags = 0; + getnanotime(ts); + ts->tv_sec -= utc_offset(); + clock_ts_to_ct(ts, &ct); + data[DS1307_SECS] = TOBCD(ct.sec); data[DS1307_MINS] = TOBCD(ct.min); data[DS1307_HOUR] = TOBCD(ct.hour) | pmflags; From owner-svn-src-all@freebsd.org Mon Jul 31 16:55:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32930DB4213; Mon, 31 Jul 2017 16:55:58 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F381B83F53; Mon, 31 Jul 2017 16:55:57 +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 v6VGtuFE036442; Mon, 31 Jul 2017 16:55:56 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VGtuEC036440; Mon, 31 Jul 2017 16:55:56 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201707311655.v6VGtuEC036440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Mon, 31 Jul 2017 16:55:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321799 - 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: 321799 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 16:55:58 -0000 Author: scottl Date: Mon Jul 31 16:55:56 2017 New Revision: 321799 URL: https://svnweb.freebsd.org/changeset/base/321799 Log: Fix a logic bug in the split PCI interrupt code that slipped through Reported by: Harry Schmalzbauer Modified: head/sys/dev/mpr/mpr_pci.c head/sys/dev/mps/mps_pci.c Modified: head/sys/dev/mpr/mpr_pci.c ============================================================================== --- head/sys/dev/mpr/mpr_pci.c Mon Jul 31 16:46:16 2017 (r321798) +++ head/sys/dev/mpr/mpr_pci.c Mon Jul 31 16:55:56 2017 (r321799) @@ -260,6 +260,7 @@ mpr_pci_alloc_interrupts(struct mpr_softc *sc) dev = sc->mpr_dev; error = 0; + msgs = 0; if ((sc->disable_msix == 0) && ((msgs = pci_msix_count(dev)) >= MPR_MSI_COUNT)) @@ -267,7 +268,7 @@ mpr_pci_alloc_interrupts(struct mpr_softc *sc) if ((error != 0) && (sc->disable_msi == 0) && ((msgs = pci_msi_count(dev)) >= MPR_MSI_COUNT)) error = mpr_alloc_msi(sc, MPR_MSI_COUNT); - else + if (error != 0) msgs = 0; sc->msi_msgs = msgs; Modified: head/sys/dev/mps/mps_pci.c ============================================================================== --- head/sys/dev/mps/mps_pci.c Mon Jul 31 16:46:16 2017 (r321798) +++ head/sys/dev/mps/mps_pci.c Mon Jul 31 16:55:56 2017 (r321799) @@ -245,6 +245,7 @@ mps_pci_alloc_interrupts(struct mps_softc *sc) dev = sc->mps_dev; error = 0; + msgs = 0; if ((sc->disable_msix == 0) && ((msgs = pci_msix_count(dev)) >= MPS_MSI_COUNT)) @@ -252,7 +253,7 @@ mps_pci_alloc_interrupts(struct mps_softc *sc) if ((error != 0) && (sc->disable_msi == 0) && ((msgs = pci_msi_count(dev)) >= MPS_MSI_COUNT)) error = mps_alloc_msi(sc, MPS_MSI_COUNT); - else + if (error != 0) msgs = 0; sc->msi_msgs = msgs; From owner-svn-src-all@freebsd.org Mon Jul 31 17:33:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6707ADB5341; Mon, 31 Jul 2017 17:33:58 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4341B1A94; Mon, 31 Jul 2017 17:33:58 +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 v6VHXvwK052448; Mon, 31 Jul 2017 17:33:57 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VHXv7K052447; Mon, 31 Jul 2017 17:33:57 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201707311733.v6VHXv7K052447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 31 Jul 2017 17:33:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321800 - head/tools/tools/net80211/wlanwds X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/tools/tools/net80211/wlanwds X-SVN-Commit-Revision: 321800 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 17:33:58 -0000 Author: adrian Date: Mon Jul 31 17:33:57 2017 New Revision: 321800 URL: https://svnweb.freebsd.org/changeset/base/321800 Log: [wlanwds] allow for a DWDS AP VAP to be not be the first VAP on a NIC. The wlanwds code was just creating a clone VAP without specifying the MAC address to use for said clone VAP. This meant that if an interface was cloned from an AP interface that wasn't the first created VAP (which shares the same MAC as the parent physical interface by default) then the cloned interface would have the wrong MAC and traffic wouldn't work. Besides chip bugs (ha!) this isn't a requirement. So, teach wlanwds to: * look up the link layer address for a given interface (which really should be a library interface, and will likely quickly become one); * use this when creating a cloned interface for a DWDS peer; * (net80211 already has the infrastructure to do this, it just needed to be used); * add some extra logging to see what MAC addresses, parent interfaces, etc are being created. Whilst here, add a reminder that I should extend this to include monitoring a specific VAP for DWDS updates rather than just the parent interface. This is the first step in allowing for multiple DWDS hops, which is a pre-requisite for adrian's house having wifi in the single upstairs room. Tested: * AR9380, DWDS AP + AP mode - with DWDS AP being the second VAP created with a different MAC address; * AR9331 (Carambola2), AP + DWDS STA; * passing traffic TODO: * fix 802.11s so this DWDS stuff is no longer required! Modified: head/tools/tools/net80211/wlanwds/wlanwds.c Modified: head/tools/tools/net80211/wlanwds/wlanwds.c ============================================================================== --- head/tools/tools/net80211/wlanwds/wlanwds.c Mon Jul 31 16:55:56 2017 (r321799) +++ head/tools/tools/net80211/wlanwds/wlanwds.c Mon Jul 31 17:33:57 2017 (r321800) @@ -55,6 +55,9 @@ #include #include +#include +#include + #include #include #include @@ -90,7 +93,8 @@ static void wds_discovery(const char *ifname, const uint8_t bssid[IEEE80211_ADDR_LEN]); static void wds_destroy(const char *ifname); static void wds_leave(const uint8_t bssid[IEEE80211_ADDR_LEN]); -static int wds_vap_create(const char *ifname, struct wds *); +static int wds_vap_create(const char *ifname, uint8_t macaddr[ETHER_ADDR_LEN], + struct wds *); static int wds_vap_destroy(const char *ifname); static void @@ -201,6 +205,11 @@ getparent(const char *ifname, char parent[IFNAMSIZ+1]) * Check if the specified ifnet is one we're supposed to monitor. * The ifnet is assumed to be a vap; we find it's parent and check * it against the set of ifnet's specified on the command line. + * + * TODO: extend this to also optionally allow the specific DWDS + * VAP to be monitored, instead of assuming all VAPs on a parent + * physical interface are being monitored by this instance of + * wlanwds. */ static int checkifnet(const char *ifname, int complain) @@ -257,6 +266,70 @@ getbssid(int s, const char *ifname, uint8_t bssid[IEEE } /* + * Fetch the mac address configured for a given ifnet. + * (Note - the current link level address, NOT hwaddr.) + * + * This is currently, sigh, O(n) because there's no current kernel + * API that will do it for a single interface. + * + * Return 0 if successful, -1 if failure. + */ +static int +getlladdr(const char *ifname, uint8_t macaddr[ETHER_ADDR_LEN]) +{ + struct ifaddrs *ifap, *ifa; + struct sockaddr_dl *sdl; + + if (getifaddrs(&ifap) < 0) { + warn("%s: getifaddrs", __func__); + return (-1); + } + + /* Look for a matching interface */ + for (ifa = ifap; ifa != NULL; ifa++) { + if (strcmp(ifname, ifa->ifa_name) != 0) + continue; + + /* Found it - check if there's an ifa_addr */ + if (ifa->ifa_addr == NULL) { + syslog(LOG_CRIT, "%s: ifname %s; ifa_addr is NULL\n", + __func__, ifname); + goto err; + } + + /* Check address family */ + sdl = (struct sockaddr_dl *) ifa->ifa_addr; + if (sdl->sdl_type != IFT_ETHER) { + syslog(LOG_CRIT, "%s: %s: unknown aftype (%d)\n", + __func__, + ifname, + sdl->sdl_type); + goto err; + } + if (sdl->sdl_alen != ETHER_ADDR_LEN) { + syslog(LOG_CRIT, "%s: %s: aflen too short (%d)\n", + __func__, + ifname, + sdl->sdl_alen); + goto err; + } + + /* Ok, found it */ + memcpy(macaddr, (void *) LLADDR(sdl), ETHER_ADDR_LEN); + goto ok; + } + syslog(LOG_CRIT, "%s: couldn't find ifname %s\n", __func__, ifname); + /* FALLTHROUGH */ +err: + freeifaddrs(ifap); + return (-1); + +ok: + freeifaddrs(ifap); + return (0); +} + +/* * Scan the system for WDS vaps associated with the ifnet's we're * supposed to monitor. Any vaps are added to our internal table * so we can find them (and destroy them) on station leave. @@ -374,6 +447,7 @@ wds_discovery(const char *ifname, const uint8_t bssid[ struct wds *p; char parent[256]; char cmd[1024]; + uint8_t macaddr[ETHER_ADDR_LEN]; int status; for (p = wds; p != NULL; p = p->next) @@ -388,13 +462,19 @@ wds_discovery(const char *ifname, const uint8_t bssid[ return; } + if (getlladdr(ifname, macaddr) < 0) { + syslog(LOG_ERR, "%s: couldn't get lladdr for parent interface: %m", + ifname); + return; + } + p = malloc(sizeof(struct wds)); if (p == NULL) { syslog(LOG_ERR, "%s: malloc failed: %m", __func__); return; } IEEE80211_ADDR_COPY(p->bssid, bssid); - if (wds_vap_create(parent, p) < 0) { + if (wds_vap_create(parent, macaddr, p) < 0) { free(p); return; } @@ -403,8 +483,11 @@ wds_discovery(const char *ifname, const uint8_t bssid[ */ p->next = wds; wds = p; - syslog(LOG_INFO, "[%s] create wds vap %s", ether_sprintf(bssid), - p->ifname); + syslog(LOG_INFO, "[%s] create wds vap %s, parent %s (%s)", + ether_sprintf(bssid), + p->ifname, + ifname, + parent); if (script != NULL) { snprintf(cmd, sizeof(cmd), "%s %s", script, p->ifname); status = system(cmd); @@ -454,17 +537,35 @@ wds_leave(const uint8_t bssid[IEEE80211_ADDR_LEN]) } static int -wds_vap_create(const char *parent, struct wds *p) +wds_vap_create(const char *parent, uint8_t macaddr[ETHER_ADDR_LEN], + struct wds *p) { struct ieee80211_clone_params cp; struct ifreq ifr; int s, status; + char bssid_str[32], macaddr_str[32]; memset(&cp, 0, sizeof(cp)); + + /* Parent interface */ strncpy(cp.icp_parent, parent, IFNAMSIZ); + + /* WDS interface */ cp.icp_opmode = IEEE80211_M_WDS; + + /* BSSID for the current node */ IEEE80211_ADDR_COPY(cp.icp_bssid, p->bssid); + /* + * Set the MAC address to match the actual interface + * that we received the discovery event from. + * That way we can run WDS on any VAP rather than + * only the first VAP and then correctly set the + * MAC address. + */ + cp.icp_flags |= IEEE80211_CLONE_MACADDR; + IEEE80211_ADDR_COPY(cp.icp_macaddr, macaddr); + memset(&ifr, 0, sizeof(ifr)); strncpy(ifr.ifr_name, "wlan", IFNAMSIZ); ifr.ifr_data = (void *) &cp; @@ -477,9 +578,10 @@ wds_vap_create(const char *parent, struct wds *p) status = 0; } else { syslog(LOG_ERR, "SIOCIFCREATE2(" - "mode %u flags 0x%x parent %s bssid %s): %m", + "mode %u flags 0x%x parent %s bssid %s macaddr %s): %m", cp.icp_opmode, cp.icp_flags, parent, - ether_sprintf(cp.icp_bssid)); + ether_ntoa_r((void *) cp.icp_bssid, bssid_str), + ether_ntoa_r((void *) cp.icp_macaddr, macaddr_str)); } close(s); } else From owner-svn-src-all@freebsd.org Mon Jul 31 17:49:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5317DB56E9; Mon, 31 Jul 2017 17:49:48 +0000 (UTC) (envelope-from dru@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93E582267; Mon, 31 Jul 2017 17:49:48 +0000 (UTC) (envelope-from dru@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6VHnlub056942; Mon, 31 Jul 2017 17:49:47 GMT (envelope-from dru@FreeBSD.org) Received: (from dru@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VHnl5i056941; Mon, 31 Jul 2017 17:49:47 GMT (envelope-from dru@FreeBSD.org) Message-Id: <201707311749.v6VHnl5i056941@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dru set sender to dru@FreeBSD.org using -f From: Dru Lavigne Date: Mon, 31 Jul 2017 17:49:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321801 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: dru X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321801 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 17:49:48 -0000 Author: dru (doc committer) Date: Mon Jul 31 17:49:47 2017 New Revision: 321801 URL: https://svnweb.freebsd.org/changeset/base/321801 Log: Add myself to calendar. Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 17:33:57 2017 (r321800) +++ head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 17:49:47 2017 (r321801) @@ -254,6 +254,7 @@ 07/19 Masafumi NAKANE born in Okazaki, Aichi, Japan, 1972 07/19 Simon L. Nielsen born in Copenhagen, Denmark, 1980 07/19 Gleb Smirnoff born in Kharkov, USSR, 1981 +07/20 Dru Lavigne born in Kingston, Ontario, Canada, 1965 07/20 Andrey V. Elsukov born in Kotelnich, Russian Federation, 1981 07/22 James Housley born in Chicago, Illinois, United States, 1965 07/22 Jens Schweikhardt born in Waiblingen, Baden-Wuerttemberg, Germany, 1967 From owner-svn-src-all@freebsd.org Mon Jul 31 17:57:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E2C7DB5A24; Mon, 31 Jul 2017 17:57:45 +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 mx1.freebsd.org (Postfix) with ESMTPS id 3AD2928CD; Mon, 31 Jul 2017 17:57:45 +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 v6VHviv1061303; Mon, 31 Jul 2017 17:57:44 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VHviUY061302; Mon, 31 Jul 2017 17:57:44 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201707311757.v6VHviUY061302@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Mon, 31 Jul 2017 17:57:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321802 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321802 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 17:57:45 -0000 Author: erj Date: Mon Jul 31 17:57:44 2017 New Revision: 321802 URL: https://svnweb.freebsd.org/changeset/base/321802 Log: Add myself to calendar.freebsd Reported by: mckusick Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 17:49:47 2017 (r321801) +++ head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 17:57:44 2017 (r321802) @@ -309,6 +309,7 @@ 09/05 Mark Robert Vaughan Murray born in Harare, Mashonaland, Zimbabwe, 1961 09/05 Adrian Harold Chadd born in Perth, Western Australia, Australia, 1979 09/05 Rodrigo Osorio born in Montevideo, Uruguay, 1975 +09/06 Eric Joyner born in Fairfax, Virginia, United States, 1991 09/07 Tim Bishop born in Cornwall, United Kingdom, 1978 09/07 Chris Rees born in Kettering, United Kingdom, 1987 09/08 Boris Samorodov born in Krasnodar, Russian Federation, 1963 From owner-svn-src-all@freebsd.org Mon Jul 31 17:57:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E786DB5A6E; Mon, 31 Jul 2017 17:57:56 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 28355294F; Mon, 31 Jul 2017 17:57:56 +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 v6VHvteQ061353; Mon, 31 Jul 2017 17:57:55 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VHvtlP061352; Mon, 31 Jul 2017 17:57:55 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201707311757.v6VHvtlP061352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 31 Jul 2017 17:57:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321803 - head/sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/x86/x86 X-SVN-Commit-Revision: 321803 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 17:57:56 -0000 Author: markj Date: Mon Jul 31 17:57:54 2017 New Revision: 321803 URL: https://svnweb.freebsd.org/changeset/base/321803 Log: Don't trace running threads that have interrupts disabled. In this case we shouldn't assume that the thread has a valid frame pointer. Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D11787 Modified: head/sys/x86/x86/stack_machdep.c Modified: head/sys/x86/x86/stack_machdep.c ============================================================================== --- head/sys/x86/x86/stack_machdep.c Mon Jul 31 17:57:44 2017 (r321802) +++ head/sys/x86/x86/stack_machdep.c Mon Jul 31 17:57:54 2017 (r321803) @@ -49,12 +49,14 @@ __FBSDID("$FreeBSD$"); #ifdef __i386__ #define PCB_FP(pcb) ((pcb)->pcb_ebp) +#define TF_FLAGS(tf) ((tf)->tf_eflags) #define TF_FP(tf) ((tf)->tf_ebp) #define TF_PC(tf) ((tf)->tf_eip) typedef struct i386_frame *x86_frame_t; #else #define PCB_FP(pcb) ((pcb)->pcb_rbp) +#define TF_FLAGS(tf) ((tf)->tf_rflags) #define TF_FP(tf) ((tf)->tf_rbp) #define TF_PC(tf) ((tf)->tf_rip) @@ -104,10 +106,10 @@ stack_nmi_handler(struct trapframe *tf) if (nmi_stack == NULL || curthread != nmi_pending) return (0); - if (INKERNEL(TF_PC(tf))) + if (INKERNEL(TF_PC(tf)) && (TF_FLAGS(tf) & PSL_I) != 0) stack_capture(curthread, nmi_stack, TF_FP(tf)); else - /* We interrupted a thread in user mode. */ + /* We were running in usermode or had interrupts disabled. */ nmi_stack->depth = 0; atomic_store_rel_ptr((long *)&nmi_pending, (long)NULL); @@ -155,7 +157,6 @@ stack_save_td_running(struct stack *st, struct thread mtx_unlock_spin(&nmi_lock); if (st->depth == 0) - /* We interrupted a thread in user mode. */ return (EAGAIN); #else /* !SMP */ KASSERT(0, ("curthread isn't running")); From owner-svn-src-all@freebsd.org Mon Jul 31 18:10:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1D7ADB5E21; Mon, 31 Jul 2017 18:10:11 +0000 (UTC) (envelope-from mjoras@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7EE00306E; Mon, 31 Jul 2017 18:10:11 +0000 (UTC) (envelope-from mjoras@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6VIAAFF065495; Mon, 31 Jul 2017 18:10:10 GMT (envelope-from mjoras@FreeBSD.org) Received: (from mjoras@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VIAAjF065494; Mon, 31 Jul 2017 18:10:10 GMT (envelope-from mjoras@FreeBSD.org) Message-Id: <201707311810.v6VIAAjF065494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjoras set sender to mjoras@FreeBSD.org using -f From: Matt Joras Date: Mon, 31 Jul 2017 18:10:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321804 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: mjoras X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321804 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 18:10:11 -0000 Author: mjoras Date: Mon Jul 31 18:10:10 2017 New Revision: 321804 URL: https://svnweb.freebsd.org/changeset/base/321804 Log: Add myself to the calendar. Reported by: mckusick Approved by: rstone (mentor) Differential Revision: https://reviews.freebsd.org/D11797 Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 17:57:54 2017 (r321803) +++ head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 18:10:10 2017 (r321804) @@ -374,6 +374,7 @@ 11/15 Lars Engels born in Hilden, Nordrhein-Westfalen, Germany, 1980 11/15 Tijl Coosemans born in Duffel, Belgium, 1983 11/16 Jose Maria Alcaide Salinas born in Madrid, Spain, 1962 +11/16 Matt Joras born in Evanston, Illinois, United States, 1992 11/17 Ralf S. Engelschall born in Dachau, Bavaria, Germany, 1972 11/18 Thomas Quinot born in Paris, France, 1977 11/19 Konstantin Belousov born in Kiev, USSR, 1972 From owner-svn-src-all@freebsd.org Mon Jul 31 18:49:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3286DDB6A96; Mon, 31 Jul 2017 18:49:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E738B635D3; Mon, 31 Jul 2017 18:48:59 +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 v6VImxSX081722; Mon, 31 Jul 2017 18:48:59 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VImxpY081721; Mon, 31 Jul 2017 18:48:59 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201707311848.v6VImxpY081721@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 31 Jul 2017 18:48:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321805 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 321805 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 18:49:00 -0000 Author: markj Date: Mon Jul 31 18:48:58 2017 New Revision: 321805 URL: https://svnweb.freebsd.org/changeset/base/321805 Log: Batch v_wire_count decrements in vm_hold_free_pages(). Atomic updates to v_wire_count are a significant source of contention, so combine multiple updates into one in this easy case. Also remove an old printf that gets executed if the page is shared-busied, which is a case that will lead to a panic anyway. Reviewed by: alc, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D11791 Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Mon Jul 31 18:10:10 2017 (r321804) +++ head/sys/kern/vfs_bio.c Mon Jul 31 18:48:58 2017 (r321805) @@ -4532,13 +4532,10 @@ vm_hold_free_pages(struct buf *bp, int newbsize) for (index = newnpages; index < bp->b_npages; index++) { p = bp->b_pages[index]; bp->b_pages[index] = NULL; - if (vm_page_sbusied(p)) - printf("vm_hold_free_pages: blkno: %jd, lblkno: %jd\n", - (intmax_t)bp->b_blkno, (intmax_t)bp->b_lblkno); p->wire_count--; vm_page_free(p); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); } + atomic_subtract_int(&vm_cnt.v_wire_count, bp->b_npages - newnpages); bp->b_npages = newnpages; } From owner-svn-src-all@freebsd.org Mon Jul 31 19:07:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51D26DB6FAB; Mon, 31 Jul 2017 19:07:46 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C5C763F70; Mon, 31 Jul 2017 19:07:46 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6VJ7j9O089783; Mon, 31 Jul 2017 19:07:45 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VJ7j4s089782; Mon, 31 Jul 2017 19:07:45 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201707311907.v6VJ7j4s089782@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 31 Jul 2017 19:07:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321806 - head/lib/libtelnet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/lib/libtelnet X-SVN-Commit-Revision: 321806 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 19:07:46 -0000 Author: cy Date: Mon Jul 31 19:07:45 2017 New Revision: 321806 URL: https://svnweb.freebsd.org/changeset/base/321806 Log: Remove redundant include directories which expand to a noop, "-I/lib/krb5 -I -I". Reviewed by: ngie@, markm@ MFC after: 1 month Differential Revision: D11769 Modified: head/lib/libtelnet/Makefile Modified: head/lib/libtelnet/Makefile ============================================================================== --- head/lib/libtelnet/Makefile Mon Jul 31 18:48:58 2017 (r321805) +++ head/lib/libtelnet/Makefile Mon Jul 31 19:07:45 2017 (r321806) @@ -23,8 +23,7 @@ CFLAGS+= -DENCRYPTION -DAUTHENTICATION -DSRA .if ${MK_KERBEROS_SUPPORT} != "no" SRCS+= kerberos5.c -CFLAGS+= -DKRB5 -I${KRB5DIR}/lib/krb5 -I${KRB5OBJDIR} -I${ASN1OBJDIR} -CFLAGS+= -DFORWARD -Dnet_write=telnet_net_write +CFLAGS+= -DKRB5 -DFORWARD -Dnet_write=telnet_net_write .endif .include From owner-svn-src-all@freebsd.org Mon Jul 31 19:17:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8DECDB7396; Mon, 31 Jul 2017 19:17:56 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7E6EF64713; Mon, 31 Jul 2017 19:17:56 +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 v6VJHt4o094192; Mon, 31 Jul 2017 19:17:55 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VJHssV094176; Mon, 31 Jul 2017 19:17:54 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201707311917.v6VJHssV094176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 31 Jul 2017 19:17:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r321807 - vendor/mdocml/dist X-SVN-Group: vendor X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: vendor/mdocml/dist X-SVN-Commit-Revision: 321807 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 19:17:56 -0000 Author: bapt Date: Mon Jul 31 19:17:54 2017 New Revision: 321807 URL: https://svnweb.freebsd.org/changeset/base/321807 Log: Import mandoc 1.14.2 Added: vendor/mdocml/dist/compat_recallocarray.c (contents, props changed) vendor/mdocml/dist/mandoc_xr.c (contents, props changed) vendor/mdocml/dist/mandoc_xr.h (contents, props changed) vendor/mdocml/dist/test-recallocarray.c (contents, props changed) Modified: vendor/mdocml/dist/INSTALL vendor/mdocml/dist/LICENSE vendor/mdocml/dist/Makefile vendor/mdocml/dist/Makefile.depend vendor/mdocml/dist/NEWS vendor/mdocml/dist/TODO vendor/mdocml/dist/apropos.1 vendor/mdocml/dist/att.c vendor/mdocml/dist/cgi.c vendor/mdocml/dist/chars.c vendor/mdocml/dist/configure vendor/mdocml/dist/configure.local.example vendor/mdocml/dist/demandoc.c vendor/mdocml/dist/eqn.7 vendor/mdocml/dist/eqn.c vendor/mdocml/dist/eqn_html.c vendor/mdocml/dist/eqn_term.c vendor/mdocml/dist/gmdiff vendor/mdocml/dist/html.c vendor/mdocml/dist/html.h vendor/mdocml/dist/lib.c vendor/mdocml/dist/libmandoc.h vendor/mdocml/dist/libroff.h vendor/mdocml/dist/main.c vendor/mdocml/dist/man.7 vendor/mdocml/dist/man.c vendor/mdocml/dist/man.options.1 vendor/mdocml/dist/man_html.c vendor/mdocml/dist/man_macro.c vendor/mdocml/dist/man_term.c vendor/mdocml/dist/man_validate.c vendor/mdocml/dist/manconf.h vendor/mdocml/dist/mandoc.1 vendor/mdocml/dist/mandoc.3 vendor/mdocml/dist/mandoc.c vendor/mdocml/dist/mandoc.css vendor/mdocml/dist/mandoc.h vendor/mdocml/dist/mandoc_aux.c vendor/mdocml/dist/mandoc_aux.h vendor/mdocml/dist/mandoc_char.7 vendor/mdocml/dist/mandoc_escape.3 vendor/mdocml/dist/mandoc_headers.3 vendor/mdocml/dist/mandoc_html.3 vendor/mdocml/dist/mandocd.c vendor/mdocml/dist/mandocdb.c vendor/mdocml/dist/manpath.c vendor/mdocml/dist/mansearch.c vendor/mdocml/dist/mdoc.7 vendor/mdocml/dist/mdoc.c vendor/mdocml/dist/mdoc_html.c vendor/mdocml/dist/mdoc_man.c vendor/mdocml/dist/mdoc_markdown.c vendor/mdocml/dist/mdoc_term.c vendor/mdocml/dist/mdoc_validate.c vendor/mdocml/dist/msec.in vendor/mdocml/dist/out.c vendor/mdocml/dist/out.h vendor/mdocml/dist/read.c vendor/mdocml/dist/roff.7 vendor/mdocml/dist/roff.c vendor/mdocml/dist/roff.h vendor/mdocml/dist/roff_html.c vendor/mdocml/dist/roff_int.h vendor/mdocml/dist/roff_term.c vendor/mdocml/dist/roff_validate.c vendor/mdocml/dist/soelim.1 vendor/mdocml/dist/st.c vendor/mdocml/dist/st.in vendor/mdocml/dist/tbl.7 vendor/mdocml/dist/tbl.c vendor/mdocml/dist/tbl_data.c vendor/mdocml/dist/tbl_html.c vendor/mdocml/dist/tbl_layout.c vendor/mdocml/dist/tbl_term.c vendor/mdocml/dist/term.c vendor/mdocml/dist/term.h vendor/mdocml/dist/term_ascii.c vendor/mdocml/dist/term_tab.c vendor/mdocml/dist/tree.c Modified: vendor/mdocml/dist/INSTALL ============================================================================== --- vendor/mdocml/dist/INSTALL Mon Jul 31 19:07:45 2017 (r321806) +++ vendor/mdocml/dist/INSTALL Mon Jul 31 19:17:54 2017 (r321807) @@ -1,22 +1,24 @@ -$Id: INSTALL,v 1.18 2017/02/08 12:24:10 schwarze Exp $ +$Id: INSTALL,v 1.20 2017/07/28 14:57:56 schwarze Exp $ -About mdocml, the portable mandoc distribution ----------------------------------------------- -The mandoc manpage compiler toolset is a suite of tools compiling -mdoc(7), the roff(7) macro language of choice for BSD manual pages, -and man(7), the predominant historical language for UNIX manuals. +About the portable mandoc distribution +-------------------------------------- +The mandoc manpage compiler toolset (formerly called "mdocml") +is a suite of tools compiling mdoc(7), the roff(7) macro language +of choice for BSD manual pages, and man(7), the predominant +historical language for UNIX manuals. + It includes a man(1) manual viewer and additional tools. -For general information, see . +For general information, see . In case you have questions or want to provide feedback, read -. Consider subscribing to the +. Consider subscribing to the discuss@ mailing list mentioned on that page. If you intend to help with the development of mandoc, consider subscribing to the tech@ mailing list, too. Enjoy using the mandoc toolset! -Ingo Schwarze, Karlsruhe, February 2017 +Ingo Schwarze, Karlsruhe, July 2017 Installation @@ -25,7 +27,7 @@ Before manually installing mandoc on your system, plea whether the newest version of mandoc is already installed by default or available via a binary package or a ports system. A list of the latest bundled and ported versions of mandoc for various operating -systems is maintained at . +systems is maintained at . Regarding how packages and ports are maintained for your operating system, please consult your operating system documentation. @@ -35,7 +37,7 @@ To install mandoc manually, the following steps are ne run the command "echo BUILD_CGI=1 >> configure.local". Then run "cp cgi.h.example cgi.h" and edit cgi.h as desired. -2. If you also want to build the new catman(8) utility, run the +2. If you also want to build the catman(8) utility, run the command "echo BUILD_CATMAN=1 >> configure.local". Note that it is unlikely to be a drop-in replacement providing the same functionality as your system's "catman", if your operating @@ -75,7 +77,7 @@ command like "make DESTDIR=... install". Read the *-i in the "Makefile" to understand how DESTDIR is used. 9. Run the command "sudo makewhatis" to build mandoc.db(5) databases -in all the directory trees configured in step 6. Whenever installing +in all the directory trees configured in step 3. Whenever installing new manual pages, re-run makewhatis(8) to update the databases, or apropos(1) will not find the new pages. Modified: vendor/mdocml/dist/LICENSE ============================================================================== --- vendor/mdocml/dist/LICENSE Mon Jul 31 19:07:45 2017 (r321806) +++ vendor/mdocml/dist/LICENSE Mon Jul 31 19:17:54 2017 (r321807) @@ -1,7 +1,7 @@ -$Id: LICENSE,v 1.15 2017/02/21 00:37:03 schwarze Exp $ +$Id: LICENSE,v 1.17 2017/06/23 15:58:14 schwarze Exp $ With the exceptions noted below, all code and documentation -contained in the mdocml toolkit is protected by the Copyright +contained in the mandoc toolkit is protected by the Copyright of the following developers: Copyright (c) 2008-2012, 2014 Kristaps Dzonsons @@ -13,7 +13,7 @@ Copyright (c) 2016 Ed Maste Copyright (c) 2017 Michael Stapelberg Copyright (c) 1999, 2004 Marc Espie Copyright (c) 1998, 2004, 2010 Todd C. Miller -Copyright (c) 2008 Otto Moerbeek +Copyright (c) 2008, 2017 Otto Moerbeek Copyright (c) 2004 Ted Unangst Copyright (c) 1994 Christos Zoulas Copyright (c) 2003, 2007, 2008, 2014 Jason McIntyre @@ -22,7 +22,7 @@ See the individual source files for information about to which file during which years. -The mdocml distribution as a whole is distributed by its developers +The mandoc distribution as a whole is distributed by its developers under the following license: Permission to use, copy, modify, and distribute this software for any Modified: vendor/mdocml/dist/Makefile ============================================================================== --- vendor/mdocml/dist/Makefile Mon Jul 31 19:07:45 2017 (r321806) +++ vendor/mdocml/dist/Makefile Mon Jul 31 19:17:54 2017 (r321807) @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.512 2017/05/07 17:31:45 schwarze Exp $ +# $Id: Makefile,v 1.516 2017/07/20 16:24:53 schwarze Exp $ # # Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons # Copyright (c) 2011, 2013-2017 Ingo Schwarze @@ -15,7 +15,7 @@ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -VERSION = 1.14.1 +VERSION = 1.14.2 # === LIST OF FILES ==================================================== @@ -38,6 +38,7 @@ TESTSRCS = test-be32toh.c \ test-progname.c \ test-recvmsg.c \ test-reallocarray.c \ + test-recallocarray.c \ test-rewb-bsd.c \ test-rewb-sysv.c \ test-sandbox_init.c \ @@ -64,6 +65,7 @@ SRCS = att.c \ compat_ohash.c \ compat_progname.c \ compat_reallocarray.c \ + compat_recallocarray.c \ compat_strcasestr.c \ compat_stringlist.c \ compat_strlcat.c \ @@ -92,6 +94,7 @@ SRCS = att.c \ mandoc.c \ mandoc_aux.c \ mandoc_ohash.c \ + mandoc_xr.c \ mandocd.c \ mandocdb.c \ manpath.c \ @@ -178,6 +181,7 @@ DISTFILES = INSTALL \ mandoc_html.3 \ mandoc_malloc.3 \ mandoc_ohash.h \ + mandoc_xr.h \ mandocd.8 \ mansearch.3 \ mansearch.h \ @@ -227,6 +231,7 @@ LIBMANDOC_OBJS = $(LIBMAN_OBJS) \ mandoc.o \ mandoc_aux.o \ mandoc_ohash.o \ + mandoc_xr.o \ msec.o \ preconv.o \ read.o @@ -240,6 +245,7 @@ COMPAT_OBJS = compat_err.o \ compat_ohash.o \ compat_progname.o \ compat_reallocarray.o \ + compat_recallocarray.o \ compat_strcasestr.o \ compat_strlcat.o \ compat_strlcpy.o \ @@ -341,9 +347,6 @@ WWW_MANS = apropos.1.html \ mdoc.h.html \ roff.h.html -WWW_OBJS = mdocml.tar.gz \ - mdocml.sha256 - # === USER CONFIGURATION =============================================== include Makefile.local @@ -354,7 +357,7 @@ all: mandoc demandoc soelim $(BUILD_TARGETS) Makefile. install: base-install $(INSTALL_TARGETS) -www: $(WWW_OBJS) $(WWW_MANS) +www: $(WWW_MANS) $(WWW_MANS): mandoc @@ -372,10 +375,10 @@ clean: rm -f libmandoc.a $(LIBMANDOC_OBJS) $(COMPAT_OBJS) rm -f mandoc $(MAIN_OBJS) rm -f man.cgi $(CGI_OBJS) - rm -f mandocd catman $(MANDOCD_OBJS) + rm -f mandocd catman catman.o $(MANDOCD_OBJS) rm -f demandoc $(DEMANDOC_OBJS) rm -f soelim $(SOELIM_OBJS) - rm -f $(WWW_MANS) $(WWW_OBJS) + rm -f $(WWW_MANS) mandoc.tar.gz mandoc.sha256 rm -rf *.dSYM base-install: mandoc demandoc soelim @@ -509,13 +512,7 @@ soelim: $(SOELIM_OBJS) # --- maintainer targets --- www-install: www - mkdir -p $(HTDOCDIR)/snapshots $(INSTALL_DATA) $(WWW_MANS) mandoc.css $(HTDOCDIR) - $(INSTALL_DATA) $(WWW_OBJS) $(HTDOCDIR)/snapshots - $(INSTALL_DATA) mdocml.tar.gz \ - $(HTDOCDIR)/snapshots/mdocml-$(VERSION).tar.gz - $(INSTALL_DATA) mdocml.sha256 \ - $(HTDOCDIR)/snapshots/mdocml-$(VERSION).sha256 depend: config.h mkdep -f Makefile.depend $(CFLAGS) $(SRCS) @@ -542,24 +539,25 @@ regress-distcheck: ! -name '*.out_ascii' \ ! -name '*.out_utf8' \ ! -name '*.out_html' \ + ! -name '*.out_markdown' \ ! -name '*.out_lint' \ ! -path regress/regress.pl \ ! -path regress/regress.pl.1 -dist: mdocml.sha256 +dist: mandoc.sha256 -mdocml.sha256: mdocml.tar.gz - sha256 mdocml.tar.gz > $@ +mandoc.sha256: mandoc.tar.gz + sha256 mandoc.tar.gz > $@ -mdocml.tar.gz: $(DISTFILES) +mandoc.tar.gz: $(DISTFILES) ls regress/*/*/*.mandoc_* && exit 1 || true - mkdir -p .dist/mdocml-$(VERSION)/ - $(INSTALL) -m 0644 $(DISTFILES) .dist/mdocml-$(VERSION) - cp -pR regress .dist/mdocml-$(VERSION) - find .dist/mdocml-$(VERSION)/regress \ + mkdir -p .dist/mandoc-$(VERSION)/ + $(INSTALL) -m 0644 $(DISTFILES) .dist/mandoc-$(VERSION) + cp -pR regress .dist/mandoc-$(VERSION) + find .dist/mandoc-$(VERSION)/regress \ -type d -name CVS -print0 | xargs -0 rm -rf - chmod 755 .dist/mdocml-$(VERSION)/configure - ( cd .dist/ && tar zcf ../$@ mdocml-$(VERSION) ) + chmod 755 .dist/mandoc-$(VERSION)/configure + ( cd .dist/ && tar zcf ../$@ mandoc-$(VERSION) ) rm -rf .dist/ # === SUFFIX RULES ===================================================== Modified: vendor/mdocml/dist/Makefile.depend ============================================================================== --- vendor/mdocml/dist/Makefile.depend Mon Jul 31 19:07:45 2017 (r321806) +++ vendor/mdocml/dist/Makefile.depend Mon Jul 31 19:17:54 2017 (r321807) @@ -1,4 +1,4 @@ -att.o: att.c config.h roff.h mdoc.h libmdoc.h +att.o: att.c config.h mandoc.h roff.h mdoc.h libmdoc.h catman.o: catman.c config.h compat_fts.h cgi.o: cgi.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h man.h main.h manconf.h mansearch.h cgi.h chars.o: chars.c config.h mandoc.h mandoc_aux.h mandoc_ohash.h compat_ohash.h libmandoc.h @@ -11,6 +11,7 @@ compat_mkdtemp.o: compat_mkdtemp.c config.h compat_ohash.o: compat_ohash.c config.h compat_ohash.h compat_progname.o: compat_progname.c config.h compat_reallocarray.o: compat_reallocarray.c config.h +compat_recallocarray.o: compat_recallocarray.c config.h compat_strcasestr.o: compat_strcasestr.c config.h compat_stringlist.o: compat_stringlist.c config.h compat_stringlist.h compat_strlcat.o: compat_strlcat.c config.h @@ -24,44 +25,45 @@ dba_read.o: dba_read.c mandoc_aux.h mansearch.h dba_ar dba_write.o: dba_write.c config.h dba_write.h dbm.o: dbm.c config.h mansearch.h dbm_map.h dbm.h dbm_map.o: dbm_map.c config.h mansearch.h dbm_map.h dbm.h -demandoc.o: demandoc.c config.h roff.h man.h mdoc.h mandoc.h -eqn.o: eqn.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h +demandoc.o: demandoc.c config.h mandoc.h roff.h man.h mdoc.h +eqn.o: eqn.c config.h mandoc_aux.h mandoc.h roff.h libmandoc.h libroff.h eqn_html.o: eqn_html.c config.h mandoc.h out.h html.h eqn_term.o: eqn_term.c config.h mandoc.h out.h term.h html.o: html.c config.h mandoc_aux.h mandoc.h roff.h out.h html.h manconf.h main.h -lib.o: lib.c config.h roff.h mdoc.h libmdoc.h lib.in -main.o: main.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h man.h tag.h main.h manconf.h mansearch.h +lib.o: lib.c config.h mandoc.h roff.h mdoc.h libmdoc.h lib.in +main.o: main.c config.h mandoc_aux.h mandoc.h mandoc_xr.h roff.h mdoc.h man.h tag.h main.h manconf.h mansearch.h man.o: man.c config.h mandoc_aux.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h -man_html.o: man_html.c config.h mandoc_aux.h roff.h man.h out.h html.h main.h +man_html.o: man_html.c config.h mandoc_aux.h mandoc.h roff.h man.h out.h html.h main.h man_macro.o: man_macro.c config.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h man_term.o: man_term.c config.h mandoc_aux.h mandoc.h roff.h man.h out.h term.h main.h man_validate.o: man_validate.c config.h mandoc_aux.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h -mandoc.o: mandoc.c config.h mandoc.h mandoc_aux.h libmandoc.h +mandoc.o: mandoc.c config.h mandoc_aux.h mandoc.h roff.h libmandoc.h mandoc_aux.o: mandoc_aux.c config.h mandoc.h mandoc_aux.h mandoc_ohash.o: mandoc_ohash.c mandoc_aux.h mandoc_ohash.h compat_ohash.h +mandoc_xr.o: mandoc_xr.c mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc_xr.h mandocd.o: mandocd.c config.h mandoc.h roff.h mdoc.h man.h main.h manconf.h mandocdb.o: mandocdb.c config.h compat_fts.h mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc.h roff.h mdoc.h man.h manconf.h mansearch.h dba_array.h dba.h manpath.o: manpath.c config.h mandoc_aux.h manconf.h mansearch.o: mansearch.c config.h mandoc.h mandoc_aux.h mandoc_ohash.h compat_ohash.h manconf.h mansearch.h dbm.h mdoc.o: mdoc.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h mdoc_argv.o: mdoc_argv.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h -mdoc_html.o: mdoc_html.c config.h mandoc_aux.h roff.h mdoc.h out.h html.h main.h +mdoc_html.o: mdoc_html.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h out.h html.h main.h mdoc_macro.o: mdoc_macro.c config.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h mdoc_man.o: mdoc_man.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h man.h out.h main.h mdoc_markdown.o: mdoc_markdown.c mandoc_aux.h mandoc.h roff.h mdoc.h main.h mdoc_state.o: mdoc_state.c mandoc.h roff.h mdoc.h libmandoc.h libmdoc.h mdoc_term.o: mdoc_term.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h out.h term.h tag.h main.h -mdoc_validate.o: mdoc_validate.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h +mdoc_validate.o: mdoc_validate.c config.h mandoc_aux.h mandoc.h mandoc_xr.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h msec.o: msec.c config.h mandoc.h libmandoc.h msec.in out.o: out.c config.h mandoc_aux.h mandoc.h out.h preconv.o: preconv.c config.h mandoc.h libmandoc.h -read.o: read.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h man.h libmandoc.h roff_int.h +read.o: read.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h man.h libmandoc.h roff.o: roff.c config.h mandoc.h mandoc_aux.h mandoc_ohash.h compat_ohash.h roff.h libmandoc.h roff_int.h libroff.h predefs.in -roff_html.o: roff_html.c roff.h out.h html.h -roff_term.o: roff_term.c roff.h out.h term.h +roff_html.o: roff_html.c mandoc.h roff.h out.h html.h +roff_term.o: roff_term.c mandoc.h roff.h out.h term.h roff_validate.o: roff_validate.c mandoc.h roff.h libmandoc.h roff_int.h soelim.o: soelim.c config.h compat_stringlist.h -st.o: st.c config.h roff.h mdoc.h libmdoc.h st.in +st.o: st.c config.h mandoc.h roff.h mdoc.h libmdoc.h st.in tag.o: tag.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h tag.h tbl.o: tbl.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h tbl_data.o: tbl_data.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h Modified: vendor/mdocml/dist/NEWS ============================================================================== --- vendor/mdocml/dist/NEWS Mon Jul 31 19:07:45 2017 (r321806) +++ vendor/mdocml/dist/NEWS Mon Jul 31 19:17:54 2017 (r321807) @@ -1,7 +1,93 @@ -$Id: NEWS,v 1.21 2017/02/21 00:37:03 schwarze Exp $ +$Id: NEWS,v 1.26 2017/07/28 14:57:56 schwarze Exp $ -This file lists the most important changes in the mdocml.bsd.lv distribution. +This file lists the most important changes in the mandoc.bsd.lv distribution. +Changes in version 1.14.2, released on July 28, 2017 + + --- MAJOR NEW FEATURES --- + * New mdoc(7) -Tmarkdown output mode. + * For -Thtml, implement internal hyperlinks pointing to authoritative + definitions of various syntax elements, similar to the ctags(1)-like + less(1) :t internal searching in terminal mode. + * Provide a superset of the functionality of the former mdoclint(1) + utility and a new -Wstyle message level with several new messages, + including validity checking of .Xr cross references. + * tbl(7): Implement automatic line breaking inside individual table + cells, and several other formatting improvements. + * eqn(7): Complete rewrite of the lexer, resulting in several bugfixes. + * Continue parser unification, in particular allowing generation + of syntax tree nodes on the roff(7) level, allowing implementation + of many additional roff requests. + --- REMOVED FUNCTIONALITY --- + * Delete the manpage(1) utility. It was never enabled in any release. + * Delete the -Txhtml command line option. It has been an obsolete + alias for the -Thtml output mode for more than two years. + --- MINOR NEW FEATURES --- + * -Tlint now puts parser messages on stdout instead of stderr, + making commands like "man -l -Tlint *.1" useful. + * mdoc(7): Various .Lk formatting improvements. + * mdoc(7) -Thtml: Better CSS for .Bl lists. + * man(7): Implement the .MT/.ME block macro (mailto hyperlink). + * man(7): Implement the .DT macro (restore default tab positions). + * man(7): Improved support for manuals generated with reStructuredText + by partial support for the \n[an-margin] number register. + * man(7) -Thtml: Support deep linking to .SH and .SS headers. + * tbl(7): Implement the "allbox" table option. + * tbl(7): Implement the column spacing and the 'w' (minimum column + width) layout modifiers. + * tbl(7): Significant improvements of the manual page. + * eqn(7): Much improved font selection, including recognition of + well-known function names, and a few other formatting improvements. + * eqn(7) -Thtml: Use and in addition to . + * roff(7): Implement the .ce (centering), .mc (margin character), + .rj (right justify), .ta (define tab stops), .ti (temporary indent), + .als (macro alias), .ec and .eo (escape character control), + .po (page offset), and .rn (macro rename) requests. + * roff(7) .am: Implement appending to mdoc(7) and man(7) macros. + * roff(7): implement the \h (horizontol motion), \l (horizontal + line drawing), and \p (break output line) escape sequences, + and also several additional character escape sequences. + * roff(7): Implement the 'd' conditional (macro or string defined). + * man.cgi(8) now uses pledge(2), too. + * regress.pl(1): simpler user interface, better summary output, + simpler code, and no more recursion. + --- THANKS TO --- + * Anthony Bentley (OpenBSD) for the implementation of .MT/.ME, + reports of many bugs and missing features, and suggestions + for a number of feature and documentation improvements. + * Sebastien Marie (OpenBSD) for two source code patches and + for some useful discussions. + * Florian Obser (OpenBSD) for a bugfix patch and a bug report. + * Jonathan Gray (OpenBSD) for several bug reports from afl(1) + and several more from static analysis tools. + * Theo Buehler (OpenBSD) for several bug reports, most from afl(1). + * Jason McIntyre (OpenBSD) for many useful discussions about a + wide variety of topics, lots of continuous testing, a number of + bug reports, and some suggestions for messages and documentation. + * Thomas Klausner (NetBSD) for lots of help while migrating + mdoclint(1) functionality to mandoc -Tlint, for suggesting + several useful new messages, and for release testing. + * Reyk Floeter (OpenBSD) and Vsevolod Stakhov (FreeBSD) for + suggesting a markdown output mode. + * Thomas Guettler for suggesting -Thtml internal hyperlinks. + * Yuri Pankov (Illumos) for inspiring new warning messages and + for extensive release testing. + * Anton Lindqvist and TJ Townsend (both OpenBSD) and Jan Stary + for multiple bug reports. + * Leah Neukirchen (Void Linux) for bug reports and release testing. + * Michael Stapelberg (Debian) for suggesting feature improvements + and for release testing. + * Martin Natano and Theo de Raadt (both OpenBSD), Andreas Voegele, + Gabriel Guzman, Gonzalo Tornaria, Markus Waldeck, and Raf Czlonka + for bug reports. + * Antoine Jacoutot (OpenBSD) and Steffen Nurpmeso for suggesting + feature improvements. + * Dag-Erling Smoergrav (FreeBSD) for inspiring new warning messages. + * Ted Unangst and Marc Espie (OpenBSD) for providing useful ideas. + * Svyatoslav Mishyn (Crux Linux) for release testing. + * Carsten Kunze (Heirloom roff) for help keeping mandoc and groff + compatible and for committing some of my patches to groff. + Changes in version 1.14.1, released on February 21, 2017 --- MAJOR NEW FEATURES --- @@ -274,11 +360,11 @@ Changes in version 1.13.3, released on March 13, 2015 * New -Wunsupp message level. --- POTENTIONALLY SECURITY RELEVANT BUGFIXES --- * Fix a potential write buffer overrun on incomplete string conditionals. - http://mdocml.bsd.lv/cgi-bin/cvsweb/roff.c#rev1.241 + http://mandoc.bsd.lv/cgi-bin/cvsweb/roff.c#rev1.241 * Fix a potential write buffer overrun on backslash at EOF in a conditional. - http://mdocml.bsd.lv/cgi-bin/cvsweb/roff.c#rev1.247 + http://mandoc.bsd.lv/cgi-bin/cvsweb/roff.c#rev1.247 * Fix a use after free sometimes hit when validation deletes a block. - http://mdocml.bsd.lv/cgi-bin/cvsweb/mdoc_macro.c#rev1.180 + http://mandoc.bsd.lv/cgi-bin/cvsweb/mdoc_macro.c#rev1.180 --- MAJOR FUNCTIONALLY RELEVANT BUGFIXES --- * Let man(1) show manuals for the current architecture by default, and support the MACHINE environment variable. @@ -889,4 +975,4 @@ Changes in version 1.9.15, released on February 18, 20 * and column lengths handled correctly. For older releases, see the ChangeLog files -in http://mdocml.bsd.lv/snapshots/ . +in http://mandoc.bsd.lv/snapshots/ . Modified: vendor/mdocml/dist/TODO ============================================================================== --- vendor/mdocml/dist/TODO Mon Jul 31 19:07:45 2017 (r321806) +++ vendor/mdocml/dist/TODO Mon Jul 31 19:17:54 2017 (r321807) @@ -1,6 +1,6 @@ ************************************************************************ * Official mandoc TODO. -* $Id: TODO,v 1.237 2017/05/16 19:06:30 schwarze Exp $ +* $Id: TODO,v 1.246 2017/07/24 11:15:12 schwarze Exp $ ************************************************************************ Many issues are annotated for difficulty as follows: @@ -65,21 +65,10 @@ are mere guesses, and some may be wrong. found by jca@ in ratpoison(1) Sun, 30 Jun 2013 12:01:09 +0200 loc * exist ** algo ** size ** imp ** -- \h horizontal move - #2 most important issue naddy@ Mon, 16 Feb 2015 20:59:17 +0100 - found in cclive(1) nasm(1) bogofilter(1) asciidoc/DocBook output - bentley@ on discuss@ Sat, 21 Sep 2013 22:29:34 -0600 - naddy@ Thu, 4 Dec 2014 16:26:41 +0100 - loc ** exist ** algo ** size * imp *** (parser reorg helps a lot) - - \n+ and \n- numerical register increment and decrement found by bentley@ in sbcl(1) Mon, 9 Dec 2013 18:36:57 -0700 loc * exist * algo * size * imp ** -- \n(.$ macro argument count number register; ocserv(8) by autogen - found by sthen@ Thu, 19 Feb 2015 22:03:01 +0000 - loc * exist ** algo * size * imp ** - - \w'' improve width measurements would not be very useful without an expression parser, see below needed for Tcl_NewStringObj(3) via wiz@ Wed, 5 Mar 2014 22:27:43 +0100 @@ -183,22 +172,6 @@ are mere guesses, and some may be wrong. --- missing tbl features ----------------------------------------------- -- horizontal lines in the layout still consume data cells - and can be mixed with actual data on the same table line - synaptics(4) found by tedu@ Mon, 17 Aug 2015 21:17:42 -0400 - loc ** exist ** algo ** size ** imp *** - -- break long text into lines inside cells - net/lftp(1) from jirib via bentley@ Sep 13, 2016 - -- layout l1 for a column of max text width 3 reduces the following - inter-column spacing for groff, but not for mandoc - net/lftp(1) from jirib via bentley@ Sep 13, 2016 - -- the "w" layout option is ignored - synaptics(4) found by tedu@ Mon, 17 Aug 2015 21:17:42 -0400 - loc * exist * algo * size * imp ** - - the "s" layout column specifier is used for placement of data into columns, but ignored during column width calculations synaptics(4) found by tedu@ Mon, 17 Aug 2015 21:17:42 -0400 @@ -240,6 +213,16 @@ are mere guesses, and some may be wrong. see User's Guide (Second Edition) page 5 section 15. loc ** exist ** algo ** size ** imp ** +- GNU eqn converts some operators to special characters, for example, + input HYPHEN-MINUS becomes output \(mi, unless it is part of a + quoted word. mandoc(1) only does this when the operator is + surrounded by blanks, not when it is part of an unquoted word. + Also, check whether there are more such cases (e.g., +?). + reported by bentley@ 20 Jun 2017 02:04:29 -0600 + +- Primes, opprime, and ' + bentley@ Thu, 13 Jul 2017 23:14:20 -0600 + --- missing misc features ---------------------------------------------- - italic correction (\/) in PostScript mode @@ -359,6 +342,12 @@ are mere guesses, and some may be wrong. .Vt vs .Vt/.Va vs .Ft/.Va vs .Ft/.Fa ... from kristaps@ Tue, 08 Jun 2010 11:13:32 +0200 +- implicit whitespace around inline equations + example code: where '$times$' denotes matrix multiplication + must not have an HTML line break, nor a blank, before + partial solution: html.c {"math", HTML_NLINSIDE | HTML_INDENT}, + bentley@ Thu, 13 Jul 2017 19:00:59 -0600 + - in enclosures, mandoc sometimes fancies a bogus end of sentence reminded by jmc@ Thu, 23 Sep 2010 18:13:39 +0059 loc * exist ** algo *** size * imp *** @@ -421,9 +410,6 @@ are mere guesses, and some may be wrong. Steffen Nurpmeso Sat, 08 Nov 2014 13:34:59 +0100 loc * exist ** algo ** size * imp ** -- .Lk formatting for long links with line breaks - Franco Fichtner 8 Oct 2013 00:33:42 +0200 - - In .Bl -enum -width 0n, groff continues one the same line after the number, mandoc breaks the line. mail to kristaps@ Mon, 20 Jul 2009 02:21:39 +0200 @@ -450,16 +436,6 @@ are mere guesses, and some may be wrong. Probably, this should be fixed somewhere in termp_it_pre(), not sure. loc * exist ** algo ** size * imp ** -- .Nx 1.0a - should be "NetBSD 1.0A", not "NetBSD 1.0a", - see OpenBSD ccdconfig(8). - loc * exist * algo * size * imp ** - -- In .Bl -tag, if a tag exceeds the right margin and must be continued - on the next line, it must be indented by -width, not width+1; - see "rule block|pass" in OpenBSD ifconfig(8). - loc * exist *** algo ** size * imp ** - - When the -width string contains macros, the macros must be rendered before measuring the width, for example .Bl -tag -width ".Dv message" @@ -495,15 +471,24 @@ are mere guesses, and some may be wrong. * warning issues ************************************************************************ -- provide a way in mandoc(1) to warn about broken .Xr links; - probably cannot be on by default in -Tlint because it needs - to access the manpath and mandoc.db(3) after parsing. - asked for by jmc@ Fri, 4 Dec 2015 22:39:40 +0000 +- style message about macros inside .Bd -literal and .Dl, in particular + font changing macros like .Cm, .Ar, .Fa (from the mdoclint TODO) +- style message about mismatches between the section number in the + file name (if it is known) and the section number in .Dt + (from the mdoclint TODO) + +- style message about NULL without .Dv (from the mdoclint TODO) + +- style message about error constants without .Er (from the mdoclint TODO) + - warn when .Sh or .Ss contain other macros Steffen Nurpmeso, savannah.gnu.org/bugs/index.php?45034 loc * exist * algo * size * imp ** +- style message about violations of the convention + .An name Aq Mt localpart@domain in AUTHORS (from the mdoclint TODO) + - warn about attempts to call non-callable macros Steffen Nurpmeso Tue, 11 Nov 2014 22:55:16 +0100 Note that formatting is inconsistent in groff. @@ -512,25 +497,25 @@ are mere guesses, and some may be wrong. all over mdoc_macro.c and all subtly different. loc ** exist ** algo ** size ** imp ** +- style message about suspicious uses of - vs. \- vs. \(mi + e.g. -1 is likely wrong (from the mdoclint TODO) + +- warn about punctuation - e.g. ',' and ';' - at the beginning + of a text line, if it is likely intended to follow the preceding + output without intervening whitespace, in particular after a + macro line (from the mdoclint TODO) + - mandoc_special does not really check the escape sequence, but just the overall format loc ** exist ** algo *** size ** imp ** -- integrate mdoclint into mandoc ("end-of-line whitespace" thread) - from jmc@ Mon, 13 Jul 2009 17:12:09 +0100 - from kristaps@ Mon, 13 Jul 2009 18:34:53 +0200 - from jmc@ Mon, 13 Jul 2009 17:45:37 +0059 - from kristaps@ Mon, 13 Jul 2009 19:02:03 +0200 - (mostly done, check what remains) - -- -Tlint parser errors and warnings to stdout - to tech@mdocml, naddy@ Wed, 28 Sep 2011 11:21:46 +0200 - wait! kristaps@ Sun, 02 Oct 2011 17:12:52 +0200 - ************************************************************************ * documentation issues ************************************************************************ +- dashes, hyphens, and minus signs in manual pages + jmc@ Fri, 28 Mar 2014 07:19:27 +0000 + - mark macros as: page structure domain, manual domain, general text domain is this useful? @@ -543,11 +528,6 @@ are mere guesses, and some may be wrong. * performance issues ************************************************************************ -- Why are we using MAP_SHARED, not MAP_PRIVATE for mmap(2)? - from kristaps@ Sat, 09 Aug 2014 13:51:36 +0200 - -Several areas can be cleaned up to make mandoc even faster. These are - - the PDF file is HUGE: this can be reduced by using relative offsets ************************************************************************ @@ -565,13 +545,13 @@ Several areas can be cleaned up to make mandoc even fa same-line from different-line input. That plainly doesn't work with user-defined macros, leading to random breakage. +- Is it possible to further simplify ENDBODY_SPACE? + - Find better ways to prevent endless loops in roff(7) macro and string expansion. -- Finish cleanup of date handling. - Decide which formats should be recognized where. - Update both mdoc(7) and man(7) documentation. - Triggered by Tim van der Molen Tue, 22 Feb 2011 20:30:45 +0100 +- make buffers for parsing functions const + christos@ via wiz@ Fri, 18 Dec 2015 17:10:01 +0100 - struct mparse refactoring Steffen Nurpmeso Thu, 04 Sep 2014 12:50:00 +0200 Modified: vendor/mdocml/dist/apropos.1 ============================================================================== --- vendor/mdocml/dist/apropos.1 Mon Jul 31 19:07:45 2017 (r321806) +++ vendor/mdocml/dist/apropos.1 Mon Jul 31 19:17:54 2017 (r321807) @@ -1,4 +1,4 @@ -.\" $Id: apropos.1,v 1.45 2017/03/27 18:51:36 schwarze Exp $ +.\" $Id: apropos.1,v 1.46 2017/07/04 23:40:01 schwarze Exp $ .\" .\" Copyright (c) 2011, 2012 Kristaps Dzonsons .\" Copyright (c) 2011, 2012, 2014, 2017 Ingo Schwarze @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: March 27 2017 $ +.Dd $Mdocdate: July 4 2017 $ .Dt APROPOS 1 .Os .Sh NAME @@ -407,7 +407,7 @@ variables: .Dl $ apropos \-s 3 Va=optind \-a Va=optarg .Pp Do exactly the same as calling -.Xr whatis 1 +.Nm whatis with the argument .Qq ssh : .Pp Modified: vendor/mdocml/dist/att.c ============================================================================== --- vendor/mdocml/dist/att.c Mon Jul 31 19:07:45 2017 (r321806) +++ vendor/mdocml/dist/att.c Mon Jul 31 19:17:54 2017 (r321807) @@ -1,4 +1,4 @@ -/* $Id: att.c,v 1.15 2015/10/06 18:32:19 schwarze Exp $ */ +/* $Id: att.c,v 1.16 2017/06/24 14:38:32 schwarze Exp $ */ /* * Copyright (c) 2009 Kristaps Dzonsons * @@ -19,6 +19,7 @@ #include #include +#include "mandoc.h" #include "roff.h" #include "mdoc.h" #include "libmdoc.h" Modified: vendor/mdocml/dist/cgi.c ============================================================================== --- vendor/mdocml/dist/cgi.c Mon Jul 31 19:07:45 2017 (r321806) +++ vendor/mdocml/dist/cgi.c Mon Jul 31 19:17:54 2017 (r321807) @@ -1,4 +1,4 @@ -/* $Id: cgi.c,v 1.154 2017/04/19 01:00:03 schwarze Exp $ */ +/* $Id: cgi.c,v 1.156 2017/06/24 14:38:32 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze @@ -140,16 +140,16 @@ html_putchar(char c) { switch (c) { - case ('"'): + case '"': printf("""); break; - case ('&'): + case '&': printf("&"); break; - case ('>'): + case '>': printf(">"); break; - case ('<'): + case '<': printf("<"); break; default: @@ -832,7 +832,7 @@ resp_format(const struct req *req, const char *file) mchars_alloc(); mp = mparse_alloc(MPARSE_SO | MPARSE_UTF8 | MPARSE_LATIN1, - MANDOCLEVEL_BADARG, NULL, req->q.manpath); + MANDOCERR_MAX, NULL, MANDOC_OS_OTHER, req->q.manpath); mparse_readfd(mp, fd, file); close(fd); Modified: vendor/mdocml/dist/chars.c ============================================================================== --- vendor/mdocml/dist/chars.c Mon Jul 31 19:07:45 2017 (r321806) +++ vendor/mdocml/dist/chars.c Mon Jul 31 19:17:54 2017 (r321807) @@ -1,4 +1,4 @@ -/* $Id: chars.c,v 1.70 2017/06/02 12:43:52 schwarze Exp $ */ +/* $Id: chars.c,v 1.71 2017/06/14 20:57:07 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2011, 2014, 2015, 2017 Ingo Schwarze @@ -61,6 +61,7 @@ static struct ln lines[] = { { "ba", "|", 0x007c }, { "br", "|", 0x2502 }, { "ul", "_", 0x005f }, + { "ru", "_", 0x005f }, { "rn", "-", 0x203e }, { "bb", "|", 0x00a6 }, { "sl", "/", 0x002f }, Added: vendor/mdocml/dist/compat_recallocarray.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/mdocml/dist/compat_recallocarray.c Mon Jul 31 19:17:54 2017 (r321807) @@ -0,0 +1,108 @@ +#include "config.h" + +#if HAVE_RECALLOCARRAY + +int dummy; + +#else + +/* $Id: compat_recallocarray.c,v 1.1 2017/06/12 19:05:47 schwarze Exp $ */ +/* $OpenBSD: malloc.c,v 1.225 2017/05/13 07:11:29 otto Exp $ */ +/* + * Copyright (c) 2017 Otto Moerbeek + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +#include +#include +#include +#include + +/* + * This is sqrt(SIZE_MAX+1), as s1*s2 <= SIZE_MAX + * if both s1 < MUL_NO_OVERFLOW and s2 < MUL_NO_OVERFLOW + */ +#define MUL_NO_OVERFLOW ((size_t)1 << (sizeof(size_t) * 4)) + +/* + * Even though specified in POSIX, the PAGESIZE and PAGE_SIZE + * macros have very poor portability. Since we only use this + * to avoid free() overhead for small shrinking, simply pick + * an arbitrary number. + */ +#define MALLOC_PAGESIZE (1UL << 12) + + +void * +recallocarray(void *ptr, size_t oldnmemb, size_t newnmemb, size_t size) +{ + size_t oldsize, newsize; + void *newptr; + + if (ptr == NULL) + return calloc(newnmemb, size); + + if ((newnmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) && + newnmemb > 0 && SIZE_MAX / newnmemb < size) { + errno = ENOMEM; + return NULL; + } + newsize = newnmemb * size; + + if ((oldnmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) && + oldnmemb > 0 && SIZE_MAX / oldnmemb < size) { + errno = EINVAL; + return NULL; + } + oldsize = oldnmemb * size; + + /* + * Don't bother too much if we're shrinking just a bit, + * we do not shrink for series of small steps, oh well. + */ + if (newsize <= oldsize) { + size_t d = oldsize - newsize; + + if (d < oldsize / 2 && d < MALLOC_PAGESIZE) { + memset((char *)ptr + newsize, 0, d); + return ptr; + } + } + + newptr = malloc(newsize); + if (newptr == NULL) + return NULL; + + if (newsize > oldsize) { + memcpy(newptr, ptr, oldsize); + memset((char *)newptr + oldsize, 0, newsize - oldsize); + } else + memcpy(newptr, ptr, newsize); + + /* + * At this point, the OpenBSD implementation calls + * explicit_bzero() on the old memory before it is + * freed. Since explicit_bzero() is hard to implement + * portably and we don't handle confidential data in + * mandoc in the first place, simply free the memory + * without clearing it. + */ + + free(ptr); + + return newptr; +} + +#endif /* !HAVE_RECALLOCARRAY */ Modified: vendor/mdocml/dist/configure ============================================================================== --- vendor/mdocml/dist/configure Mon Jul 31 19:07:45 2017 (r321806) +++ vendor/mdocml/dist/configure Mon Jul 31 19:17:54 2017 (r321807) @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: configure,v 1.62 2017/03/04 16:36:29 schwarze Exp $ +# $Id: configure,v 1.64 2017/07/01 09:47:30 schwarze Exp $ # # Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze # @@ -35,6 +35,7 @@ echo "config.log: writing..." SOURCEDIR=`dirname "$0"` +MANPATH_BASE="/usr/share/man:/usr/X11R6/man" MANPATH_DEFAULT="/usr/share/man:/usr/X11R6/man:/usr/local/man" OSNAME= UTF8_LOCALE= @@ -73,6 +74,7 @@ HAVE_PATH_MAX= HAVE_PLEDGE= HAVE_PROGNAME= HAVE_REALLOCARRAY= +HAVE_RECALLOCARRAY= HAVE_RECVMSG= HAVE_REWB_BSD= HAVE_REWB_SYSV= @@ -229,6 +231,7 @@ runtest pledge PLEDGE || true runtest sandbox_init SANDBOX_INIT || true runtest progname PROGNAME || true runtest reallocarray REALLOCARRAY || true +runtest recallocarray RECALLOCARRAY || true runtest rewb-bsd REWB_BSD || true runtest rewb-sysv REWB_SYSV || true runtest strcasestr STRCASESTR || true @@ -348,7 +351,8 @@ cat << __HEREDOC__ __HEREDOC__ -[ ${HAVE_GETLINE} -eq 0 -o ${HAVE_REALLOCARRAY} -eq 0 -o \ +[ ${HAVE_GETLINE} -eq 0 -o \ + ${HAVE_REALLOCARRAY} -eq 0 -o ${HAVE_RECALLOCARRAY} -eq 0 -o \ ${HAVE_STRLCAT} -eq 0 -o ${HAVE_STRLCPY} -eq 0 ] \ && echo "#include " [ ${HAVE_VASPRINTF} -eq 0 ] && echo "#include " @@ -356,6 +360,7 @@ __HEREDOC__ echo echo "#define MAN_CONF_FILE \"/etc/${MANM_MANCONF}\"" +echo "#define MANPATH_BASE \"${MANPATH_BASE}\"" echo "#define MANPATH_DEFAULT \"${MANPATH_DEFAULT}\"" [ -n "${OSNAME}" ] && echo "#define OSNAME \"${OSNAME}\"" [ -n "${UTF8_LOCALE}" ] && echo "#define UTF8_LOCALE \"${UTF8_LOCALE}\"" @@ -383,6 +388,7 @@ cat << __HEREDOC__ #define HAVE_PLEDGE ${HAVE_PLEDGE} #define HAVE_PROGNAME ${HAVE_PROGNAME} #define HAVE_REALLOCARRAY ${HAVE_REALLOCARRAY} +#define HAVE_RECALLOCARRAY ${HAVE_RECALLOCARRAY} #define HAVE_REWB_BSD ${HAVE_REWB_BSD} #define HAVE_REWB_SYSV ${HAVE_REWB_SYSV} #define HAVE_SANDBOX_INIT ${HAVE_SANDBOX_INIT} @@ -433,6 +439,9 @@ fi [ ${HAVE_REALLOCARRAY} -eq 0 ] && \ echo "extern void *reallocarray(void *, size_t, size_t);" + +[ ${HAVE_RECALLOCARRAY} -eq 0 ] && \ + echo "extern void *recallocarray(void *, size_t, size_t, size_t);" [ ${HAVE_STRCASESTR} -eq 0 ] && \ echo "extern char *strcasestr(const char *, const char *);" Modified: vendor/mdocml/dist/configure.local.example ============================================================================== --- vendor/mdocml/dist/configure.local.example Mon Jul 31 19:07:45 2017 (r321806) +++ vendor/mdocml/dist/configure.local.example Mon Jul 31 19:17:54 2017 (r321807) @@ -1,4 +1,4 @@ -# $Id: configure.local.example,v 1.30 2017/03/04 16:36:29 schwarze Exp $ +# $Id: configure.local.example,v 1.33 2017/07/20 16:24:53 schwarze Exp $ # # Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze # @@ -20,7 +20,7 @@ # and put any of these settings into it if ./configure autodetection # fails or if you want to make different choices for other reasons. -# If autodetection fails, please tell . +# If autodetection fails, please tell . # We recommend that you write ./configure.local from scratch and # only put the lines there you need. This file contains examples. @@ -62,6 +62,11 @@ UTF8_LOCALE=en_US.UTF-8 MANPATH_DEFAULT="/usr/share/man:/usr/X11R6/man:/usr/local/man" +# Validation of cross references with mandoc -Tlint only looks +# for manual pages in the following directories: + +MANPATH_BASE="/usr/share/man:/usr/X11R6/man" + # In manual pages written in the mdoc(7) language, the operating system # version is displayed in the page footer line. If an operating system # is specified as an argument to the .Os macro, that is always used. @@ -292,6 +297,7 @@ HAVE_PATH_MAX=0 HAVE_PLEDGE=0 HAVE_PROGNAME=0 HAVE_REALLOCARRAY=0 +HAVE_RECALLOCARRAY=0 HAVE_REWB_BSD=0 HAVE_REWB_SYSV=0 HAVE_STRCASESTR=0 Modified: vendor/mdocml/dist/demandoc.c ============================================================================== --- vendor/mdocml/dist/demandoc.c Mon Jul 31 19:07:45 2017 (r321806) +++ vendor/mdocml/dist/demandoc.c Mon Jul 31 19:17:54 2017 (r321807) @@ -1,4 +1,4 @@ -/* $Id: demandoc.c,v 1.28 2017/01/10 13:47:00 schwarze Exp $ */ +/* $Id: demandoc.c,v 1.29 2017/06/24 14:38:32 schwarze Exp $ */ /* * Copyright (c) 2011 Kristaps Dzonsons * @@ -25,10 +25,10 @@ #include #include +#include "mandoc.h" #include "roff.h" #include "man.h" #include "mdoc.h" -#include "mandoc.h" static void pline(int, int *, int *, int); static void pman(const struct roff_node *, int *, int *, int); @@ -78,7 +78,8 @@ main(int argc, char *argv[]) argv += optind; mchars_alloc(); - mp = mparse_alloc(MPARSE_SO, MANDOCLEVEL_BADARG, NULL, NULL); + mp = mparse_alloc(MPARSE_SO, MANDOCERR_MAX, NULL, + MANDOC_OS_OTHER, NULL); assert(mp); if (argc < 1) Modified: vendor/mdocml/dist/eqn.7 ============================================================================== --- vendor/mdocml/dist/eqn.7 Mon Jul 31 19:07:45 2017 (r321806) +++ vendor/mdocml/dist/eqn.7 Mon Jul 31 19:17:54 2017 (r321807) @@ -1,4 +1,4 @@ -.\" $Id: eqn.7,v 1.35 2015/03/30 16:06:14 schwarze Exp $ +.\" $Id: eqn.7,v 1.36 2017/07/20 11:07:27 schwarze Exp $ .\" .\" Copyright (c) 2011 Kristaps Dzonsons .\" Copyright (c) 2014 Ingo Schwarze @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: March 30 2015 $ +.Dd $Mdocdate: July 20 2017 $ .Dt EQN 7 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Jul 31 19:18:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC27ADB7407; Mon, 31 Jul 2017 19:18:49 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6F4864854; Mon, 31 Jul 2017 19:18:49 +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 v6VJInqL094279; Mon, 31 Jul 2017 19:18:49 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VJImm0094273; Mon, 31 Jul 2017 19:18:48 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201707311918.v6VJImm0094273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 31 Jul 2017 19:18:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r321808 - vendor/mdocml/1.14.2 X-SVN-Group: vendor X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: vendor/mdocml/1.14.2 X-SVN-Commit-Revision: 321808 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 19:18:50 -0000 Author: bapt Date: Mon Jul 31 19:18:48 2017 New Revision: 321808 URL: https://svnweb.freebsd.org/changeset/base/321808 Log: Tag import of mandoc 1.14.2 Added: vendor/mdocml/1.14.2/ - copied from r321806, vendor/mdocml/dist/ vendor/mdocml/1.14.2/compat_recallocarray.c - copied unchanged from r321807, vendor/mdocml/dist/compat_recallocarray.c vendor/mdocml/1.14.2/mandoc_xr.c - copied unchanged from r321807, vendor/mdocml/dist/mandoc_xr.c vendor/mdocml/1.14.2/mandoc_xr.h - copied unchanged from r321807, vendor/mdocml/dist/mandoc_xr.h vendor/mdocml/1.14.2/test-recallocarray.c - copied unchanged from r321807, vendor/mdocml/dist/test-recallocarray.c Replaced: vendor/mdocml/1.14.2/INSTALL - copied unchanged from r321807, vendor/mdocml/dist/INSTALL vendor/mdocml/1.14.2/LICENSE - copied unchanged from r321807, vendor/mdocml/dist/LICENSE vendor/mdocml/1.14.2/Makefile - copied unchanged from r321807, vendor/mdocml/dist/Makefile vendor/mdocml/1.14.2/Makefile.depend - copied unchanged from r321807, vendor/mdocml/dist/Makefile.depend vendor/mdocml/1.14.2/NEWS - copied unchanged from r321807, vendor/mdocml/dist/NEWS vendor/mdocml/1.14.2/TODO - copied unchanged from r321807, vendor/mdocml/dist/TODO vendor/mdocml/1.14.2/apropos.1 - copied unchanged from r321807, vendor/mdocml/dist/apropos.1 vendor/mdocml/1.14.2/att.c - copied unchanged from r321807, vendor/mdocml/dist/att.c vendor/mdocml/1.14.2/cgi.c - copied unchanged from r321807, vendor/mdocml/dist/cgi.c vendor/mdocml/1.14.2/chars.c - copied unchanged from r321807, vendor/mdocml/dist/chars.c vendor/mdocml/1.14.2/configure - copied unchanged from r321807, vendor/mdocml/dist/configure vendor/mdocml/1.14.2/configure.local.example - copied unchanged from r321807, vendor/mdocml/dist/configure.local.example vendor/mdocml/1.14.2/demandoc.c - copied unchanged from r321807, vendor/mdocml/dist/demandoc.c vendor/mdocml/1.14.2/eqn.7 - copied unchanged from r321807, vendor/mdocml/dist/eqn.7 vendor/mdocml/1.14.2/eqn.c - copied unchanged from r321807, vendor/mdocml/dist/eqn.c vendor/mdocml/1.14.2/eqn_html.c - copied unchanged from r321807, vendor/mdocml/dist/eqn_html.c vendor/mdocml/1.14.2/eqn_term.c - copied unchanged from r321807, vendor/mdocml/dist/eqn_term.c vendor/mdocml/1.14.2/gmdiff - copied unchanged from r321807, vendor/mdocml/dist/gmdiff vendor/mdocml/1.14.2/html.c - copied unchanged from r321807, vendor/mdocml/dist/html.c vendor/mdocml/1.14.2/html.h - copied unchanged from r321807, vendor/mdocml/dist/html.h vendor/mdocml/1.14.2/lib.c - copied unchanged from r321807, vendor/mdocml/dist/lib.c vendor/mdocml/1.14.2/libmandoc.h - copied unchanged from r321807, vendor/mdocml/dist/libmandoc.h vendor/mdocml/1.14.2/libroff.h - copied unchanged from r321807, vendor/mdocml/dist/libroff.h vendor/mdocml/1.14.2/main.c - copied unchanged from r321807, vendor/mdocml/dist/main.c vendor/mdocml/1.14.2/man.7 - copied unchanged from r321807, vendor/mdocml/dist/man.7 vendor/mdocml/1.14.2/man.c - copied unchanged from r321807, vendor/mdocml/dist/man.c vendor/mdocml/1.14.2/man.options.1 - copied unchanged from r321807, vendor/mdocml/dist/man.options.1 vendor/mdocml/1.14.2/man_html.c - copied unchanged from r321807, vendor/mdocml/dist/man_html.c vendor/mdocml/1.14.2/man_macro.c - copied unchanged from r321807, vendor/mdocml/dist/man_macro.c vendor/mdocml/1.14.2/man_term.c - copied unchanged from r321807, vendor/mdocml/dist/man_term.c vendor/mdocml/1.14.2/man_validate.c - copied unchanged from r321807, vendor/mdocml/dist/man_validate.c vendor/mdocml/1.14.2/manconf.h - copied unchanged from r321807, vendor/mdocml/dist/manconf.h vendor/mdocml/1.14.2/mandoc.1 - copied unchanged from r321807, vendor/mdocml/dist/mandoc.1 vendor/mdocml/1.14.2/mandoc.3 - copied unchanged from r321807, vendor/mdocml/dist/mandoc.3 vendor/mdocml/1.14.2/mandoc.c - copied unchanged from r321807, vendor/mdocml/dist/mandoc.c vendor/mdocml/1.14.2/mandoc.css - copied unchanged from r321807, vendor/mdocml/dist/mandoc.css vendor/mdocml/1.14.2/mandoc.h - copied unchanged from r321807, vendor/mdocml/dist/mandoc.h vendor/mdocml/1.14.2/mandoc_aux.c - copied unchanged from r321807, vendor/mdocml/dist/mandoc_aux.c vendor/mdocml/1.14.2/mandoc_aux.h - copied unchanged from r321807, vendor/mdocml/dist/mandoc_aux.h vendor/mdocml/1.14.2/mandoc_char.7 - copied unchanged from r321807, vendor/mdocml/dist/mandoc_char.7 vendor/mdocml/1.14.2/mandoc_escape.3 - copied unchanged from r321807, vendor/mdocml/dist/mandoc_escape.3 vendor/mdocml/1.14.2/mandoc_headers.3 - copied unchanged from r321807, vendor/mdocml/dist/mandoc_headers.3 vendor/mdocml/1.14.2/mandoc_html.3 - copied unchanged from r321807, vendor/mdocml/dist/mandoc_html.3 vendor/mdocml/1.14.2/mandocd.c - copied unchanged from r321807, vendor/mdocml/dist/mandocd.c vendor/mdocml/1.14.2/mandocdb.c - copied unchanged from r321807, vendor/mdocml/dist/mandocdb.c vendor/mdocml/1.14.2/manpath.c - copied unchanged from r321807, vendor/mdocml/dist/manpath.c vendor/mdocml/1.14.2/mansearch.c - copied unchanged from r321807, vendor/mdocml/dist/mansearch.c vendor/mdocml/1.14.2/mdoc.7 - copied unchanged from r321807, vendor/mdocml/dist/mdoc.7 vendor/mdocml/1.14.2/mdoc.c - copied unchanged from r321807, vendor/mdocml/dist/mdoc.c vendor/mdocml/1.14.2/mdoc_html.c - copied unchanged from r321807, vendor/mdocml/dist/mdoc_html.c vendor/mdocml/1.14.2/mdoc_man.c - copied unchanged from r321807, vendor/mdocml/dist/mdoc_man.c vendor/mdocml/1.14.2/mdoc_markdown.c - copied unchanged from r321807, vendor/mdocml/dist/mdoc_markdown.c vendor/mdocml/1.14.2/mdoc_term.c - copied unchanged from r321807, vendor/mdocml/dist/mdoc_term.c vendor/mdocml/1.14.2/mdoc_validate.c - copied unchanged from r321807, vendor/mdocml/dist/mdoc_validate.c vendor/mdocml/1.14.2/msec.in - copied unchanged from r321807, vendor/mdocml/dist/msec.in vendor/mdocml/1.14.2/out.c - copied unchanged from r321807, vendor/mdocml/dist/out.c vendor/mdocml/1.14.2/out.h - copied unchanged from r321807, vendor/mdocml/dist/out.h vendor/mdocml/1.14.2/read.c - copied unchanged from r321807, vendor/mdocml/dist/read.c vendor/mdocml/1.14.2/roff.7 - copied unchanged from r321807, vendor/mdocml/dist/roff.7 vendor/mdocml/1.14.2/roff.c - copied unchanged from r321807, vendor/mdocml/dist/roff.c vendor/mdocml/1.14.2/roff.h - copied unchanged from r321807, vendor/mdocml/dist/roff.h vendor/mdocml/1.14.2/roff_html.c - copied unchanged from r321807, vendor/mdocml/dist/roff_html.c vendor/mdocml/1.14.2/roff_int.h - copied unchanged from r321807, vendor/mdocml/dist/roff_int.h vendor/mdocml/1.14.2/roff_term.c - copied unchanged from r321807, vendor/mdocml/dist/roff_term.c vendor/mdocml/1.14.2/roff_validate.c - copied unchanged from r321807, vendor/mdocml/dist/roff_validate.c vendor/mdocml/1.14.2/soelim.1 - copied unchanged from r321807, vendor/mdocml/dist/soelim.1 vendor/mdocml/1.14.2/st.c - copied unchanged from r321807, vendor/mdocml/dist/st.c vendor/mdocml/1.14.2/st.in - copied unchanged from r321807, vendor/mdocml/dist/st.in vendor/mdocml/1.14.2/tbl.7 - copied unchanged from r321807, vendor/mdocml/dist/tbl.7 vendor/mdocml/1.14.2/tbl.c - copied unchanged from r321807, vendor/mdocml/dist/tbl.c vendor/mdocml/1.14.2/tbl_data.c - copied unchanged from r321807, vendor/mdocml/dist/tbl_data.c vendor/mdocml/1.14.2/tbl_html.c - copied unchanged from r321807, vendor/mdocml/dist/tbl_html.c vendor/mdocml/1.14.2/tbl_layout.c - copied unchanged from r321807, vendor/mdocml/dist/tbl_layout.c vendor/mdocml/1.14.2/tbl_term.c - copied unchanged from r321807, vendor/mdocml/dist/tbl_term.c vendor/mdocml/1.14.2/term.c - copied unchanged from r321807, vendor/mdocml/dist/term.c vendor/mdocml/1.14.2/term.h - copied unchanged from r321807, vendor/mdocml/dist/term.h vendor/mdocml/1.14.2/term_ascii.c - copied unchanged from r321807, vendor/mdocml/dist/term_ascii.c vendor/mdocml/1.14.2/term_tab.c - copied unchanged from r321807, vendor/mdocml/dist/term_tab.c vendor/mdocml/1.14.2/tree.c - copied unchanged from r321807, vendor/mdocml/dist/tree.c Copied: vendor/mdocml/1.14.2/INSTALL (from r321807, vendor/mdocml/dist/INSTALL) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/mdocml/1.14.2/INSTALL Mon Jul 31 19:18:48 2017 (r321808, copy of r321807, vendor/mdocml/dist/INSTALL) @@ -0,0 +1,159 @@ +$Id: INSTALL,v 1.20 2017/07/28 14:57:56 schwarze Exp $ + +About the portable mandoc distribution +-------------------------------------- +The mandoc manpage compiler toolset (formerly called "mdocml") +is a suite of tools compiling mdoc(7), the roff(7) macro language +of choice for BSD manual pages, and man(7), the predominant +historical language for UNIX manuals. + +It includes a man(1) manual viewer and additional tools. +For general information, see . + +In case you have questions or want to provide feedback, read +. Consider subscribing to the +discuss@ mailing list mentioned on that page. If you intend to +help with the development of mandoc, consider subscribing to the +tech@ mailing list, too. + +Enjoy using the mandoc toolset! + +Ingo Schwarze, Karlsruhe, July 2017 + + +Installation +------------ +Before manually installing mandoc on your system, please check +whether the newest version of mandoc is already installed by default +or available via a binary package or a ports system. A list of the +latest bundled and ported versions of mandoc for various operating +systems is maintained at . + +Regarding how packages and ports are maintained for your operating +system, please consult your operating system documentation. +To install mandoc manually, the following steps are needed: + +1. If you want to build the CGI program, man.cgi(8), too, +run the command "echo BUILD_CGI=1 >> configure.local". +Then run "cp cgi.h.example cgi.h" and edit cgi.h as desired. + +2. If you also want to build the catman(8) utility, run the +command "echo BUILD_CATMAN=1 >> configure.local". Note that it +is unlikely to be a drop-in replacement providing the same +functionality as your system's "catman", if your operating +system contains one. + +3. Define MANPATH_DEFAULT in configure.local +if /usr/share/man:/usr/X11R6/man:/usr/local/man is not appropriate +for your operating system. + +4. Run "./configure". +This script attempts autoconfiguration of mandoc for your system. +Read both its standard output and the file "Makefile.local" it +generates. If anything looks wrong or different from what you +wish, read the file "configure.local.example", create and edit +a file "configure.local", and re-run "./configure" until the +result seems right to you. +On Solaris 10 and earlier, you may have to run "ksh ./configure" +because the native /bin/sh lacks some POSIX features. + +5. Run "make". +Any POSIX-compatible make, in particular both BSD make and GNU make, +should work. If the build fails, look at "configure.local.example" +and go back to step 2. + +6. Run "make -n install" and check whether everything will be +installed to the intended places. Otherwise, put some *DIR or *NM* +variables into "configure.local" and go back to step 4. + +7. Optionally run the regression suite. +Basically, that amounts to "cd regress && ./regress.pl". +But you should probably look at "./mandoc -l regress/regress.pl.1" +first. + +8. Run "sudo make install". If you intend to build a binary +package using some kind of fake root mechanism, you may need a +command like "make DESTDIR=... install". Read the *-install targets +in the "Makefile" to understand how DESTDIR is used. + +9. Run the command "sudo makewhatis" to build mandoc.db(5) databases +in all the directory trees configured in step 3. Whenever installing +new manual pages, re-run makewhatis(8) to update the databases, or +apropos(1) will not find the new pages. + +10. To set up a man.cgi(8) server, read its manual page. + +Note that some man(7) pages may contain low-level roff(7) markup +that mandoc does not yet understand. On some BSD systems using +mandoc, third-party software is vetted on whether it may be formatted +with mandoc. If not, groff(1) is pulled in as a dependency and +used to install a pre-formatted "catpage" instead of directly as +manual page source. + + +Understanding mandoc dependencies +--------------------------------- +The following libraries are required: + +1. zlib for decompressing gzipped manual pages. + +2. The fts(3) directory traversion functions. +If your system does not have them, the bundled compatibility version +will be used, so you need not worry in that case. But be careful: old +glibc versions of fts(3) were known to be broken on 32bit platforms, +see . +That was presumably fixed in glibc-2.23. +If you run into that problem, set "HAVE_FTS=0" in configure.local. + +3. Marc Espie's ohash(3) library. +If your system does not have it, the bundled compatibility version +will be used, so you probably need not worry about it. + +One of the chief design goals of the mandoc toolbox is to make +sure that nothing related to documentation requires C++. +Consequently, linking mandoc against any kind of C++ program +would defeat the purpose and is not supported. + + +Checking autoconfiguration quality +---------------------------------- +If you want to check whether automatic configuration works well +on your platform, consider the following: + +The mandoc package intentionally does not use GNU autoconf because +we consider that toolset a blatant example of overengineering that +is obsolete nowadays, since all modern operating systems are now +reasonably close to POSIX and do not need arcane shell magic any +longer. If your system does need such magic, consider upgrading +to reasonably modern POSIX-compliant tools rather than asking for +autoconf-style workarounds. + +As far as mandoc is using any features not mandated by ANSI X3.159-1989 +("ANSI C") or IEEE Std 1003.1-2008 ("POSIX") that some modern systems +do not have, we intend to provide autoconfiguration tests and +compat_*.c implementations. Please report any that turn out to be +missing. Note that while we do strive to produce portable code, +we do not slavishly restrict ourselves to POSIX-only interfaces. +For improved security and readability, we do use well-designed, +modern interfaces like reallocarray(3) even if they are still rather +uncommon, of course bundling compat_*.c implementations as needed. + +Where mandoc is using ANSI C or POSIX features that some systems +still lack and that compat_*.c implementations can be provided for +without too much hassle, we will consider adding them, too, so +please report whatever is missing on your platform. + +The following steps can be used to manually check the automatic +configuration on your platform: + +1. Run "make distclean". + +2. Run "./configure" + +3. Read the file "config.log". It shows the compiler commands used +to test the libraries installed on your system and the standard +output and standard error output these commands produce. Watch out +for unexpected failures. Those are most likely to happen if headers +or libraries are installed in unusual places or interfaces defined +in unusual headers. You can also look at the file "config.h" and +check that no "#define HAVE_*" differ from your expectations. Copied: vendor/mdocml/1.14.2/LICENSE (from r321807, vendor/mdocml/dist/LICENSE) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/mdocml/1.14.2/LICENSE Mon Jul 31 19:18:48 2017 (r321808, copy of r321807, vendor/mdocml/dist/LICENSE) @@ -0,0 +1,54 @@ +$Id: LICENSE,v 1.17 2017/06/23 15:58:14 schwarze Exp $ + +With the exceptions noted below, all code and documentation +contained in the mandoc toolkit is protected by the Copyright +of the following developers: + +Copyright (c) 2008-2012, 2014 Kristaps Dzonsons +Copyright (c) 2010-2017 Ingo Schwarze +Copyright (c) 2009, 2010, 2011, 2012 Joerg Sonnenberger +Copyright (c) 2013 Franco Fichtner +Copyright (c) 2014 Baptiste Daroussin +Copyright (c) 2016 Ed Maste +Copyright (c) 2017 Michael Stapelberg +Copyright (c) 1999, 2004 Marc Espie +Copyright (c) 1998, 2004, 2010 Todd C. Miller +Copyright (c) 2008, 2017 Otto Moerbeek +Copyright (c) 2004 Ted Unangst +Copyright (c) 1994 Christos Zoulas +Copyright (c) 2003, 2007, 2008, 2014 Jason McIntyre + +See the individual source files for information about who contributed +to which file during which years. + + +The mandoc distribution as a whole is distributed by its developers +under the following license: + +Permission to use, copy, modify, and distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + +The following files included from outside sources are protected by +other people's Copyright and are distributed under various 2-clause +and 3-clause BSD licenses; see these individual files for details. + +soelim.c, soelim.1: +Copyright (c) 2014 Baptiste Daroussin + +compat_err.c, compat_fts.c, compat_fts.h, +compat_getsubopt.c, compat_strcasestr.c, compat_strsep.c, +man.1: +Copyright (c) 1989,1990,1993,1994 The Regents of the University of California + +compat_stringlist.c, compat_stringlist.h: +Copyright (c) 1994 Christos Zoulas Copied: vendor/mdocml/1.14.2/Makefile (from r321807, vendor/mdocml/dist/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/mdocml/1.14.2/Makefile Mon Jul 31 19:18:48 2017 (r321808, copy of r321807, vendor/mdocml/dist/Makefile) @@ -0,0 +1,573 @@ +# $Id: Makefile,v 1.516 2017/07/20 16:24:53 schwarze Exp $ +# +# Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons +# Copyright (c) 2011, 2013-2017 Ingo Schwarze +# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +VERSION = 1.14.2 + +# === LIST OF FILES ==================================================== + +TESTSRCS = test-be32toh.c \ + test-cmsg.c \ + test-dirent-namlen.c \ + test-EFTYPE.c \ + test-err.c \ + test-fts.c \ + test-getline.c \ + test-getsubopt.c \ + test-isblank.c \ + test-mkdtemp.c \ + test-nanosleep.c \ + test-ntohl.c \ + test-O_DIRECTORY.c \ + test-ohash.c \ + test-PATH_MAX.c \ + test-pledge.c \ + test-progname.c \ + test-recvmsg.c \ + test-reallocarray.c \ + test-recallocarray.c \ + test-rewb-bsd.c \ + test-rewb-sysv.c \ + test-sandbox_init.c \ + test-strcasestr.c \ + test-stringlist.c \ + test-strlcat.c \ + test-strlcpy.c \ + test-strptime.c \ + test-strsep.c \ + test-strtonum.c \ + test-vasprintf.c \ + test-wchar.c + +SRCS = att.c \ + catman.c \ + cgi.c \ + chars.c \ + compat_err.c \ + compat_fts.c \ + compat_getline.c \ + compat_getsubopt.c \ + compat_isblank.c \ + compat_mkdtemp.c \ + compat_ohash.c \ + compat_progname.c \ + compat_reallocarray.c \ + compat_recallocarray.c \ + compat_strcasestr.c \ + compat_stringlist.c \ + compat_strlcat.c \ + compat_strlcpy.c \ + compat_strsep.c \ + compat_strtonum.c \ + compat_vasprintf.c \ + dba.c \ + dba_array.c \ + dba_read.c \ + dba_write.c \ + dbm.c \ + dbm_map.c \ + demandoc.c \ + eqn.c \ + eqn_html.c \ + eqn_term.c \ + html.c \ + lib.c \ + main.c \ + man.c \ + man_html.c \ + man_macro.c \ + man_term.c \ + man_validate.c \ + mandoc.c \ + mandoc_aux.c \ + mandoc_ohash.c \ + mandoc_xr.c \ + mandocd.c \ + mandocdb.c \ + manpath.c \ + mansearch.c \ + mdoc.c \ + mdoc_argv.c \ + mdoc_html.c \ + mdoc_macro.c \ + mdoc_man.c \ + mdoc_markdown.c \ + mdoc_state.c \ + mdoc_term.c \ + mdoc_validate.c \ + msec.c \ + out.c \ + preconv.c \ + read.c \ + roff.c \ + roff_html.c \ + roff_term.c \ + roff_validate.c \ + soelim.c \ + st.c \ + tag.c \ + tbl.c \ + tbl_data.c \ + tbl_html.c \ + tbl_layout.c \ + tbl_opts.c \ + tbl_term.c \ + term.c \ + term_ascii.c \ + term_ps.c \ + term_tab.c \ + tree.c + +DISTFILES = INSTALL \ + LICENSE \ + Makefile \ + Makefile.depend \ + NEWS \ + TODO \ + apropos.1 \ + catman.8 \ + cgi.h.example \ + compat_fts.h \ + compat_ohash.h \ + compat_stringlist.h \ + configure \ + configure.local.example \ + dba.h \ + dba_array.h \ + dba_write.h \ + dbm.h \ + dbm_map.h \ + demandoc.1 \ + eqn.7 \ + gmdiff \ + html.h \ + lib.in \ + libman.h \ + libmandoc.h \ + libmdoc.h \ + libroff.h \ + main.h \ + makewhatis.8 \ + man.1 \ + man.7 \ + man.cgi.3 \ + man.cgi.8 \ + man.conf.5 \ + man.h \ + man.options.1 \ + manconf.h \ + mandoc.1 \ + mandoc.3 \ + mandoc.css \ + mandoc.db.5 \ + mandoc.h \ + mandoc_aux.h \ + mandoc_char.7 \ + mandoc_escape.3 \ + mandoc_headers.3 \ + mandoc_html.3 \ + mandoc_malloc.3 \ + mandoc_ohash.h \ + mandoc_xr.h \ + mandocd.8 \ + mansearch.3 \ + mansearch.h \ + mchars_alloc.3 \ + mdoc.7 \ + mdoc.h \ + msec.in \ + out.h \ + predefs.in \ + roff.7 \ + roff.h \ + roff_int.h \ + soelim.1 \ + st.in \ + tag.h \ + tbl.3 \ + tbl.7 \ + term.h \ + $(SRCS) \ + $(TESTSRCS) + +LIBMAN_OBJS = man.o \ + man_macro.o \ + man_validate.o + +LIBMDOC_OBJS = att.o \ + lib.o \ + mdoc.o \ + mdoc_argv.o \ + mdoc_macro.o \ + mdoc_state.o \ + mdoc_validate.o \ + st.o + +LIBROFF_OBJS = eqn.o \ + roff.o \ + roff_validate.o \ + tbl.o \ + tbl_data.o \ + tbl_layout.o \ + tbl_opts.o + +LIBMANDOC_OBJS = $(LIBMAN_OBJS) \ + $(LIBMDOC_OBJS) \ + $(LIBROFF_OBJS) \ + chars.o \ + mandoc.o \ + mandoc_aux.o \ + mandoc_ohash.o \ + mandoc_xr.o \ + msec.o \ + preconv.o \ + read.o + +COMPAT_OBJS = compat_err.o \ + compat_fts.o \ + compat_getline.o \ + compat_getsubopt.o \ + compat_isblank.o \ + compat_mkdtemp.o \ + compat_ohash.o \ + compat_progname.o \ + compat_reallocarray.o \ + compat_recallocarray.o \ + compat_strcasestr.o \ + compat_strlcat.o \ + compat_strlcpy.o \ + compat_strsep.o \ + compat_strtonum.o \ + compat_vasprintf.o + +MANDOC_HTML_OBJS = eqn_html.o \ + html.o \ + man_html.o \ + mdoc_html.o \ + roff_html.o \ + tbl_html.o + +MANDOC_TERM_OBJS = eqn_term.o \ + man_term.o \ + mdoc_term.o \ + roff_term.o \ + term.o \ + term_ascii.o \ + term_ps.o \ + term_tab.o \ + tbl_term.o + +DBM_OBJS = dbm.o \ + dbm_map.o \ + mansearch.o + +DBA_OBJS = dba.o \ + dba_array.o \ + dba_read.o \ + dba_write.o \ + mandocdb.o + +MAIN_OBJS = $(MANDOC_HTML_OBJS) \ + $(MANDOC_MAN_OBJS) \ + $(MANDOC_TERM_OBJS) \ + $(DBM_OBJS) \ + $(DBA_OBJS) \ + main.o \ + manpath.o \ + mdoc_man.o \ + mdoc_markdown.o \ + out.o \ + tag.o \ + tree.o + +CGI_OBJS = $(MANDOC_HTML_OBJS) \ + $(DBM_OBJS) \ + cgi.o \ + out.o + +MANDOCD_OBJS = $(MANDOC_HTML_OBJS) \ + $(MANDOC_TERM_OBJS) \ + mandocd.o \ + out.o \ + tag.o + +DEMANDOC_OBJS = demandoc.o + +SOELIM_OBJS = soelim.o \ + compat_err.o \ + compat_getline.o \ + compat_progname.o \ + compat_reallocarray.o \ + compat_stringlist.o + +WWW_MANS = apropos.1.html \ + demandoc.1.html \ + man.1.html \ + mandoc.1.html \ + soelim.1.html \ + man.cgi.3.html \ + mandoc.3.html \ + mandoc_escape.3.html \ + mandoc_headers.3.html \ + mandoc_html.3.html \ + mandoc_malloc.3.html \ + mansearch.3.html \ + mchars_alloc.3.html \ + tbl.3.html \ + man.conf.5.html \ + mandoc.db.5.html \ + eqn.7.html \ + man.7.html \ + mandoc_char.7.html \ + mandocd.8.html \ + mdoc.7.html \ + roff.7.html \ + tbl.7.html \ + catman.8.html \ + makewhatis.8.html \ + man.cgi.8.html \ + man.h.html \ + manconf.h.html \ + mandoc.h.html \ + mandoc_aux.h.html \ + mansearch.h.html \ + mdoc.h.html \ + roff.h.html + +# === USER CONFIGURATION =============================================== + +include Makefile.local + +# === DEPENDENCY HANDLING ============================================== + +all: mandoc demandoc soelim $(BUILD_TARGETS) Makefile.local + +install: base-install $(INSTALL_TARGETS) + +www: $(WWW_MANS) + +$(WWW_MANS): mandoc + +.PHONY: base-install cgi-install install www-install +.PHONY: clean distclean depend + +include Makefile.depend + +# === TARGETS CONTAINING SHELL COMMANDS ================================ + +distclean: clean + rm -f Makefile.local config.h config.h.old config.log config.log.old + +clean: + rm -f libmandoc.a $(LIBMANDOC_OBJS) $(COMPAT_OBJS) + rm -f mandoc $(MAIN_OBJS) + rm -f man.cgi $(CGI_OBJS) + rm -f mandocd catman catman.o $(MANDOCD_OBJS) + rm -f demandoc $(DEMANDOC_OBJS) + rm -f soelim $(SOELIM_OBJS) + rm -f $(WWW_MANS) mandoc.tar.gz mandoc.sha256 + rm -rf *.dSYM + +base-install: mandoc demandoc soelim + mkdir -p $(DESTDIR)$(BINDIR) + mkdir -p $(DESTDIR)$(SBINDIR) + mkdir -p $(DESTDIR)$(MANDIR)/man1 + mkdir -p $(DESTDIR)$(MANDIR)/man5 + mkdir -p $(DESTDIR)$(MANDIR)/man7 + mkdir -p $(DESTDIR)$(MANDIR)/man8 + $(INSTALL_PROGRAM) mandoc demandoc $(DESTDIR)$(BINDIR) + $(INSTALL_PROGRAM) soelim $(DESTDIR)$(BINDIR)/$(BINM_SOELIM) + cd $(DESTDIR)$(BINDIR) && $(LN) mandoc $(BINM_MAN) + cd $(DESTDIR)$(BINDIR) && $(LN) mandoc $(BINM_APROPOS) + cd $(DESTDIR)$(BINDIR) && $(LN) mandoc $(BINM_WHATIS) + cd $(DESTDIR)$(SBINDIR) && \ + $(LN) ${BIN_FROM_SBIN}/mandoc $(BINM_MAKEWHATIS) + $(INSTALL_MAN) mandoc.1 demandoc.1 $(DESTDIR)$(MANDIR)/man1 + $(INSTALL_MAN) soelim.1 $(DESTDIR)$(MANDIR)/man1/$(BINM_SOELIM).1 + $(INSTALL_MAN) man.1 $(DESTDIR)$(MANDIR)/man1/$(BINM_MAN).1 + $(INSTALL_MAN) apropos.1 $(DESTDIR)$(MANDIR)/man1/$(BINM_APROPOS).1 + cd $(DESTDIR)$(MANDIR)/man1 && $(LN) $(BINM_APROPOS).1 $(BINM_WHATIS).1 + $(INSTALL_MAN) man.conf.5 $(DESTDIR)$(MANDIR)/man5/$(MANM_MANCONF).5 + $(INSTALL_MAN) mandoc.db.5 $(DESTDIR)$(MANDIR)/man5 + $(INSTALL_MAN) man.7 $(DESTDIR)$(MANDIR)/man7/$(MANM_MAN).7 + $(INSTALL_MAN) mdoc.7 $(DESTDIR)$(MANDIR)/man7/$(MANM_MDOC).7 + $(INSTALL_MAN) roff.7 $(DESTDIR)$(MANDIR)/man7/$(MANM_ROFF).7 + $(INSTALL_MAN) eqn.7 $(DESTDIR)$(MANDIR)/man7/$(MANM_EQN).7 + $(INSTALL_MAN) tbl.7 $(DESTDIR)$(MANDIR)/man7/$(MANM_TBL).7 + $(INSTALL_MAN) mandoc_char.7 $(DESTDIR)$(MANDIR)/man7 + $(INSTALL_MAN) makewhatis.8 \ + $(DESTDIR)$(MANDIR)/man8/$(BINM_MAKEWHATIS).8 + +lib-install: libmandoc.a + mkdir -p $(DESTDIR)$(LIBDIR) + mkdir -p $(DESTDIR)$(INCLUDEDIR) + mkdir -p $(DESTDIR)$(MANDIR)/man3 + $(INSTALL_LIB) libmandoc.a $(DESTDIR)$(LIBDIR) + $(INSTALL_LIB) man.h mandoc.h mandoc_aux.h mdoc.h roff.h \ + $(DESTDIR)$(INCLUDEDIR) + $(INSTALL_MAN) mandoc.3 mandoc_escape.3 mandoc_malloc.3 \ + mansearch.3 mchars_alloc.3 tbl.3 $(DESTDIR)$(MANDIR)/man3 + +cgi-install: man.cgi + mkdir -p $(DESTDIR)$(CGIBINDIR) + mkdir -p $(DESTDIR)$(HTDOCDIR) + $(INSTALL_PROGRAM) man.cgi $(DESTDIR)$(CGIBINDIR) + $(INSTALL_DATA) mandoc.css $(DESTDIR)$(HTDOCDIR) + +catman-install: mandocd catman + mkdir -p $(DESTDIR)$(SBINDIR) + mkdir -p $(DESTDIR)$(MANDIR)/man8 + $(INSTALL_PROGRAM) mandocd $(DESTDIR)$(SBINDIR) + $(INSTALL_PROGRAM) catman $(DESTDIR)$(SBINDIR)/$(BINM_CATMAN) + $(INSTALL_MAN) mandocd.8 $(DESTDIR)$(MANDIR)/man8 + $(INSTALL_MAN) catman.8 $(DESTDIR)$(MANDIR)/man8/$(BINM_CATMAN).8 + +uninstall: + rm -f $(DESTDIR)$(BINDIR)/mandoc + rm -f $(DESTDIR)$(BINDIR)/demandoc + rm -f $(DESTDIR)$(BINDIR)/$(BINM_SOELIM) + rm -f $(DESTDIR)$(BINDIR)/$(BINM_MAN) + rm -f $(DESTDIR)$(BINDIR)/$(BINM_APROPOS) + rm -f $(DESTDIR)$(BINDIR)/$(BINM_WHATIS) + rm -f $(DESTDIR)$(SBINDIR)/$(BINM_MAKEWHATIS) + rm -f $(DESTDIR)$(MANDIR)/man1/mandoc.1 + rm -f $(DESTDIR)$(MANDIR)/man1/demandoc.1 + rm -f $(DESTDIR)$(MANDIR)/man1/$(BINM_SOELIM).1 + rm -f $(DESTDIR)$(MANDIR)/man1/$(BINM_MAN).1 + rm -f $(DESTDIR)$(MANDIR)/man1/$(BINM_APROPOS).1 + rm -f $(DESTDIR)$(MANDIR)/man1/$(BINM_WHATIS).1 + rm -f $(DESTDIR)$(MANDIR)/man5/$(MANM_MANCONF).5 + rm -f $(DESTDIR)$(MANDIR)/man5/mandoc.db.5 + rm -f $(DESTDIR)$(MANDIR)/man7/$(MANM_MAN).7 + rm -f $(DESTDIR)$(MANDIR)/man7/$(MANM_MDOC).7 + rm -f $(DESTDIR)$(MANDIR)/man7/$(MANM_ROFF).7 + rm -f $(DESTDIR)$(MANDIR)/man7/$(MANM_EQN).7 + rm -f $(DESTDIR)$(MANDIR)/man7/$(MANM_TBL).7 + rm -f $(DESTDIR)$(MANDIR)/man7/mandoc_char.7 + rm -f $(DESTDIR)$(MANDIR)/man8/$(BINM_MAKEWHATIS).8 + rm -f $(DESTDIR)$(CGIBINDIR)/man.cgi + rm -f $(DESTDIR)$(HTDOCDIR)/mandoc.css + rm -f $(DESTDIR)$(SBINDIR)/mandocd + rm -f $(DESTDIR)$(SBINDIR)/$(BINM_CATMAN) + rm -f $(DESTDIR)$(MANDIR)/man8/mandocd.8 + rm -f $(DESTDIR)$(MANDIR)/man8/$(BINM_CATMAN).8 + rm -f $(DESTDIR)$(LIBDIR)/libmandoc.a + rm -f $(DESTDIR)$(MANDIR)/man3/mandoc.3 + rm -f $(DESTDIR)$(MANDIR)/man3/mandoc_escape.3 + rm -f $(DESTDIR)$(MANDIR)/man3/mandoc_malloc.3 + rm -f $(DESTDIR)$(MANDIR)/man3/mansearch.3 + rm -f $(DESTDIR)$(MANDIR)/man3/mchars_alloc.3 + rm -f $(DESTDIR)$(MANDIR)/man3/tbl.3 + rm -f $(DESTDIR)$(INCLUDEDIR)/man.h + rm -f $(DESTDIR)$(INCLUDEDIR)/mandoc.h + rm -f $(DESTDIR)$(INCLUDEDIR)/mandoc_aux.h + rm -f $(DESTDIR)$(INCLUDEDIR)/mdoc.h + rm -f $(DESTDIR)$(INCLUDEDIR)/roff.h + [ ! -e $(DESTDIR)$(INCLUDEDIR) ] || rmdir $(DESTDIR)$(INCLUDEDIR) + +regress: all + cd regress && ./regress.pl + +regress-clean: + cd regress && ./regress.pl . clean + +Makefile.local config.h: configure $(TESTSRCS) + @echo "$@ is out of date; please run ./configure" + @exit 1 + +libmandoc.a: $(COMPAT_OBJS) $(LIBMANDOC_OBJS) + ar rs $@ $(COMPAT_OBJS) $(LIBMANDOC_OBJS) + +mandoc: $(MAIN_OBJS) libmandoc.a + $(CC) -o $@ $(LDFLAGS) $(MAIN_OBJS) libmandoc.a $(LDADD) + +man.cgi: $(CGI_OBJS) libmandoc.a + $(CC) $(STATIC) -o $@ $(LDFLAGS) $(CGI_OBJS) libmandoc.a $(LDADD) + +mandocd: $(MANDOCD_OBJS) libmandoc.a + $(CC) -o $@ $(LDFLAGS) $(MANDOCD_OBJS) libmandoc.a $(LDADD) + +catman: catman.o libmandoc.a + $(CC) -o $@ $(LDFLAGS) catman.o libmandoc.a $(LDADD) + +demandoc: $(DEMANDOC_OBJS) libmandoc.a + $(CC) -o $@ $(LDFLAGS) $(DEMANDOC_OBJS) libmandoc.a $(LDADD) + +soelim: $(SOELIM_OBJS) + $(CC) -o $@ $(LDFLAGS) $(SOELIM_OBJS) + +# --- maintainer targets --- + +www-install: www + $(INSTALL_DATA) $(WWW_MANS) mandoc.css $(HTDOCDIR) + +depend: config.h + mkdep -f Makefile.depend $(CFLAGS) $(SRCS) + perl -e 'undef $$/; $$_ = <>; s|/usr/include/\S+||g; \ + s|\\\n||g; s| +| |g; s| $$||mg; print;' \ + Makefile.depend > Makefile.tmp + mv Makefile.tmp Makefile.depend + +regress-distclean: + @find regress \ + -name '.#*' -o \ + -name '*.orig' -o \ + -name '*.rej' -o \ + -name '*.core' \ + -exec rm -i {} \; + +regress-distcheck: + @find regress ! -type d ! -type f + @find regress -type f \ + ! -path '*/CVS/*' \ + ! -name Makefile \ + ! -name Makefile.inc \ + ! -name '*.in' \ + ! -name '*.out_ascii' \ + ! -name '*.out_utf8' \ + ! -name '*.out_html' \ + ! -name '*.out_markdown' \ + ! -name '*.out_lint' \ + ! -path regress/regress.pl \ + ! -path regress/regress.pl.1 + +dist: mandoc.sha256 + +mandoc.sha256: mandoc.tar.gz + sha256 mandoc.tar.gz > $@ + +mandoc.tar.gz: $(DISTFILES) + ls regress/*/*/*.mandoc_* && exit 1 || true + mkdir -p .dist/mandoc-$(VERSION)/ + $(INSTALL) -m 0644 $(DISTFILES) .dist/mandoc-$(VERSION) + cp -pR regress .dist/mandoc-$(VERSION) + find .dist/mandoc-$(VERSION)/regress \ + -type d -name CVS -print0 | xargs -0 rm -rf + chmod 755 .dist/mandoc-$(VERSION)/configure + ( cd .dist/ && tar zcf ../$@ mandoc-$(VERSION) ) + rm -rf .dist/ + +# === SUFFIX RULES ===================================================== + +.SUFFIXES: .1 .3 .5 .7 .8 .h +.SUFFIXES: .1.html .3.html .5.html .7.html .8.html .h.html + +.h.h.html: + highlight -I $< > $@ + +.1.1.html .3.3.html .5.5.html .7.7.html .8.8.html: mandoc + ./mandoc -Thtml -Wall,stop \ + -Ostyle=mandoc.css,man=%N.%S.html,includes=%I.html $< > $@ Copied: vendor/mdocml/1.14.2/Makefile.depend (from r321807, vendor/mdocml/dist/Makefile.depend) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/mdocml/1.14.2/Makefile.depend Mon Jul 31 19:18:48 2017 (r321808, copy of r321807, vendor/mdocml/dist/Makefile.depend) @@ -0,0 +1,78 @@ +att.o: att.c config.h mandoc.h roff.h mdoc.h libmdoc.h +catman.o: catman.c config.h compat_fts.h +cgi.o: cgi.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h man.h main.h manconf.h mansearch.h cgi.h +chars.o: chars.c config.h mandoc.h mandoc_aux.h mandoc_ohash.h compat_ohash.h libmandoc.h +compat_err.o: compat_err.c config.h +compat_fts.o: compat_fts.c config.h compat_fts.h +compat_getline.o: compat_getline.c config.h +compat_getsubopt.o: compat_getsubopt.c config.h +compat_isblank.o: compat_isblank.c config.h +compat_mkdtemp.o: compat_mkdtemp.c config.h +compat_ohash.o: compat_ohash.c config.h compat_ohash.h +compat_progname.o: compat_progname.c config.h +compat_reallocarray.o: compat_reallocarray.c config.h +compat_recallocarray.o: compat_recallocarray.c config.h +compat_strcasestr.o: compat_strcasestr.c config.h +compat_stringlist.o: compat_stringlist.c config.h compat_stringlist.h +compat_strlcat.o: compat_strlcat.c config.h +compat_strlcpy.o: compat_strlcpy.c config.h +compat_strsep.o: compat_strsep.c config.h +compat_strtonum.o: compat_strtonum.c config.h +compat_vasprintf.o: compat_vasprintf.c config.h +dba.o: dba.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h mansearch.h dba_write.h dba_array.h dba.h +dba_array.o: dba_array.c mandoc_aux.h dba_write.h dba_array.h +dba_read.o: dba_read.c mandoc_aux.h mansearch.h dba_array.h dba.h dbm.h +dba_write.o: dba_write.c config.h dba_write.h +dbm.o: dbm.c config.h mansearch.h dbm_map.h dbm.h +dbm_map.o: dbm_map.c config.h mansearch.h dbm_map.h dbm.h +demandoc.o: demandoc.c config.h mandoc.h roff.h man.h mdoc.h +eqn.o: eqn.c config.h mandoc_aux.h mandoc.h roff.h libmandoc.h libroff.h +eqn_html.o: eqn_html.c config.h mandoc.h out.h html.h +eqn_term.o: eqn_term.c config.h mandoc.h out.h term.h +html.o: html.c config.h mandoc_aux.h mandoc.h roff.h out.h html.h manconf.h main.h +lib.o: lib.c config.h mandoc.h roff.h mdoc.h libmdoc.h lib.in +main.o: main.c config.h mandoc_aux.h mandoc.h mandoc_xr.h roff.h mdoc.h man.h tag.h main.h manconf.h mansearch.h +man.o: man.c config.h mandoc_aux.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h +man_html.o: man_html.c config.h mandoc_aux.h mandoc.h roff.h man.h out.h html.h main.h +man_macro.o: man_macro.c config.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h +man_term.o: man_term.c config.h mandoc_aux.h mandoc.h roff.h man.h out.h term.h main.h +man_validate.o: man_validate.c config.h mandoc_aux.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h +mandoc.o: mandoc.c config.h mandoc_aux.h mandoc.h roff.h libmandoc.h +mandoc_aux.o: mandoc_aux.c config.h mandoc.h mandoc_aux.h +mandoc_ohash.o: mandoc_ohash.c mandoc_aux.h mandoc_ohash.h compat_ohash.h +mandoc_xr.o: mandoc_xr.c mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc_xr.h +mandocd.o: mandocd.c config.h mandoc.h roff.h mdoc.h man.h main.h manconf.h +mandocdb.o: mandocdb.c config.h compat_fts.h mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc.h roff.h mdoc.h man.h manconf.h mansearch.h dba_array.h dba.h +manpath.o: manpath.c config.h mandoc_aux.h manconf.h +mansearch.o: mansearch.c config.h mandoc.h mandoc_aux.h mandoc_ohash.h compat_ohash.h manconf.h mansearch.h dbm.h +mdoc.o: mdoc.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h +mdoc_argv.o: mdoc_argv.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h +mdoc_html.o: mdoc_html.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h out.h html.h main.h +mdoc_macro.o: mdoc_macro.c config.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h +mdoc_man.o: mdoc_man.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h man.h out.h main.h +mdoc_markdown.o: mdoc_markdown.c mandoc_aux.h mandoc.h roff.h mdoc.h main.h +mdoc_state.o: mdoc_state.c mandoc.h roff.h mdoc.h libmandoc.h libmdoc.h +mdoc_term.o: mdoc_term.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h out.h term.h tag.h main.h +mdoc_validate.o: mdoc_validate.c config.h mandoc_aux.h mandoc.h mandoc_xr.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h +msec.o: msec.c config.h mandoc.h libmandoc.h msec.in +out.o: out.c config.h mandoc_aux.h mandoc.h out.h +preconv.o: preconv.c config.h mandoc.h libmandoc.h +read.o: read.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h man.h libmandoc.h +roff.o: roff.c config.h mandoc.h mandoc_aux.h mandoc_ohash.h compat_ohash.h roff.h libmandoc.h roff_int.h libroff.h predefs.in +roff_html.o: roff_html.c mandoc.h roff.h out.h html.h +roff_term.o: roff_term.c mandoc.h roff.h out.h term.h +roff_validate.o: roff_validate.c mandoc.h roff.h libmandoc.h roff_int.h +soelim.o: soelim.c config.h compat_stringlist.h +st.o: st.c config.h mandoc.h roff.h mdoc.h libmdoc.h st.in +tag.o: tag.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h tag.h +tbl.o: tbl.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h +tbl_data.o: tbl_data.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h +tbl_html.o: tbl_html.c config.h mandoc.h out.h html.h +tbl_layout.o: tbl_layout.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h +tbl_opts.o: tbl_opts.c config.h mandoc.h libmandoc.h libroff.h +tbl_term.o: tbl_term.c config.h mandoc.h out.h term.h +term.o: term.c config.h mandoc.h mandoc_aux.h out.h term.h main.h +term_ascii.o: term_ascii.c config.h mandoc.h mandoc_aux.h out.h term.h manconf.h main.h +term_ps.o: term_ps.c config.h mandoc_aux.h out.h term.h manconf.h main.h +term_tab.o: term_tab.c mandoc_aux.h out.h term.h +tree.o: tree.c config.h mandoc.h roff.h mdoc.h man.h main.h Copied: vendor/mdocml/1.14.2/NEWS (from r321807, vendor/mdocml/dist/NEWS) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/mdocml/1.14.2/NEWS Mon Jul 31 19:18:48 2017 (r321808, copy of r321807, vendor/mdocml/dist/NEWS) @@ -0,0 +1,978 @@ +$Id: NEWS,v 1.26 2017/07/28 14:57:56 schwarze Exp $ + +This file lists the most important changes in the mandoc.bsd.lv distribution. + +Changes in version 1.14.2, released on July 28, 2017 + + --- MAJOR NEW FEATURES --- + * New mdoc(7) -Tmarkdown output mode. + * For -Thtml, implement internal hyperlinks pointing to authoritative + definitions of various syntax elements, similar to the ctags(1)-like + less(1) :t internal searching in terminal mode. + * Provide a superset of the functionality of the former mdoclint(1) + utility and a new -Wstyle message level with several new messages, + including validity checking of .Xr cross references. + * tbl(7): Implement automatic line breaking inside individual table + cells, and several other formatting improvements. + * eqn(7): Complete rewrite of the lexer, resulting in several bugfixes. + * Continue parser unification, in particular allowing generation + of syntax tree nodes on the roff(7) level, allowing implementation + of many additional roff requests. + --- REMOVED FUNCTIONALITY --- + * Delete the manpage(1) utility. It was never enabled in any release. + * Delete the -Txhtml command line option. It has been an obsolete + alias for the -Thtml output mode for more than two years. + --- MINOR NEW FEATURES --- + * -Tlint now puts parser messages on stdout instead of stderr, + making commands like "man -l -Tlint *.1" useful. + * mdoc(7): Various .Lk formatting improvements. + * mdoc(7) -Thtml: Better CSS for .Bl lists. + * man(7): Implement the .MT/.ME block macro (mailto hyperlink). + * man(7): Implement the .DT macro (restore default tab positions). + * man(7): Improved support for manuals generated with reStructuredText + by partial support for the \n[an-margin] number register. + * man(7) -Thtml: Support deep linking to .SH and .SS headers. + * tbl(7): Implement the "allbox" table option. + * tbl(7): Implement the column spacing and the 'w' (minimum column + width) layout modifiers. + * tbl(7): Significant improvements of the manual page. + * eqn(7): Much improved font selection, including recognition of + well-known function names, and a few other formatting improvements. + * eqn(7) -Thtml: Use and in addition to . + * roff(7): Implement the .ce (centering), .mc (margin character), + .rj (right justify), .ta (define tab stops), .ti (temporary indent), + .als (macro alias), .ec and .eo (escape character control), + .po (page offset), and .rn (macro rename) requests. + * roff(7) .am: Implement appending to mdoc(7) and man(7) macros. + * roff(7): implement the \h (horizontol motion), \l (horizontal + line drawing), and \p (break output line) escape sequences, + and also several additional character escape sequences. + * roff(7): Implement the 'd' conditional (macro or string defined). + * man.cgi(8) now uses pledge(2), too. + * regress.pl(1): simpler user interface, better summary output, + simpler code, and no more recursion. + --- THANKS TO --- + * Anthony Bentley (OpenBSD) for the implementation of .MT/.ME, + reports of many bugs and missing features, and suggestions + for a number of feature and documentation improvements. + * Sebastien Marie (OpenBSD) for two source code patches and + for some useful discussions. + * Florian Obser (OpenBSD) for a bugfix patch and a bug report. + * Jonathan Gray (OpenBSD) for several bug reports from afl(1) + and several more from static analysis tools. + * Theo Buehler (OpenBSD) for several bug reports, most from afl(1). + * Jason McIntyre (OpenBSD) for many useful discussions about a + wide variety of topics, lots of continuous testing, a number of + bug reports, and some suggestions for messages and documentation. + * Thomas Klausner (NetBSD) for lots of help while migrating + mdoclint(1) functionality to mandoc -Tlint, for suggesting + several useful new messages, and for release testing. + * Reyk Floeter (OpenBSD) and Vsevolod Stakhov (FreeBSD) for + suggesting a markdown output mode. + * Thomas Guettler for suggesting -Thtml internal hyperlinks. + * Yuri Pankov (Illumos) for inspiring new warning messages and + for extensive release testing. + * Anton Lindqvist and TJ Townsend (both OpenBSD) and Jan Stary + for multiple bug reports. + * Leah Neukirchen (Void Linux) for bug reports and release testing. + * Michael Stapelberg (Debian) for suggesting feature improvements + and for release testing. + * Martin Natano and Theo de Raadt (both OpenBSD), Andreas Voegele, + Gabriel Guzman, Gonzalo Tornaria, Markus Waldeck, and Raf Czlonka + for bug reports. + * Antoine Jacoutot (OpenBSD) and Steffen Nurpmeso for suggesting + feature improvements. + * Dag-Erling Smoergrav (FreeBSD) for inspiring new warning messages. + * Ted Unangst and Marc Espie (OpenBSD) for providing useful ideas. + * Svyatoslav Mishyn (Crux Linux) for release testing. + * Carsten Kunze (Heirloom roff) for help keeping mandoc and groff + compatible and for committing some of my patches to groff. + +Changes in version 1.14.1, released on February 21, 2017 + + --- MAJOR NEW FEATURES --- + * apropos(1): Reimplement complete semantic search functionality + without the dependency on SQLite3, using only POSIX APIs. + This comes with a completely new mandoc.db(5) file format. + * man(1): Support more than one tag entry for the same search term, + plus some minor improvements to the less(1) :t support. + * -Thtml: Use real macro names for CSS classes. + Systematic cleanup of and many improvements to mandoc.css. + * -Thtml: Produce human readable HTML code by using indentation + and better line breaks. Improve various HTML elements, + and trim several useless ones. + * New catman(8) utility, still somewhat experimental. + * Now includes a portable version of the OpenBSD mandoc regression + suite, see regress/regress.pl.1 for details. + --- REMOVED FUNCTIONALITY --- + * Operating systems that don't provide mmap(3) are no longer supported. + * Drop support for manpath(1). Even if your system has manpath(1), + it is simpler to use MANPATH_DEFAULT in configure.local for + operating system defaults, man.conf(5) for machine-specific + modifications, and ${MANPATH}, -m, and -M for user preferences + than to bother with the complexity of manpath(1). + * makewhatis(8) -p: No longer warn about missing MLINKS since these + are no longer needed for anything. + --- MINOR NEW FEATURES --- + * mdoc(7): Warn about invalid punctuation and content below NAME. + * mdoc(7): Warn about .Xr lacking the second argument (section). + * mdoc(7): Warn about violations of the rule "new sentence, new line". + * roff(7): Warn about trailing whitespace at the end of comments. + * mdoc(7): Improve rendering of double quotes. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Jul 31 19:34:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA446DB7B91; Mon, 31 Jul 2017 19:34:40 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A2A36528A; Mon, 31 Jul 2017 19:34:40 +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 v6VJYdTS002484; Mon, 31 Jul 2017 19:34:39 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VJYcMx002466; Mon, 31 Jul 2017 19:34:38 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201707311934.v6VJYcMx002466@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 31 Jul 2017 19:34:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321810 - in head: contrib/mdocml usr.bin/mandoc X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in head: contrib/mdocml usr.bin/mandoc X-SVN-Commit-Revision: 321810 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 19:34:40 -0000 Author: bapt Date: Mon Jul 31 19:34:38 2017 New Revision: 321810 URL: https://svnweb.freebsd.org/changeset/base/321810 Log: Update mandoc to 1.14.2 Added: head/contrib/mdocml/compat_recallocarray.c - copied unchanged from r321808, vendor/mdocml/dist/compat_recallocarray.c head/contrib/mdocml/mandoc_xr.c - copied unchanged from r321808, vendor/mdocml/dist/mandoc_xr.c head/contrib/mdocml/mandoc_xr.h - copied unchanged from r321808, vendor/mdocml/dist/mandoc_xr.h head/contrib/mdocml/test-recallocarray.c - copied unchanged from r321808, vendor/mdocml/dist/test-recallocarray.c Modified: head/contrib/mdocml/INSTALL head/contrib/mdocml/LICENSE head/contrib/mdocml/Makefile head/contrib/mdocml/Makefile.depend head/contrib/mdocml/NEWS head/contrib/mdocml/TODO head/contrib/mdocml/apropos.1 head/contrib/mdocml/att.c head/contrib/mdocml/cgi.c head/contrib/mdocml/chars.c head/contrib/mdocml/config.h head/contrib/mdocml/configure head/contrib/mdocml/configure.local.example head/contrib/mdocml/demandoc.c head/contrib/mdocml/eqn.7 head/contrib/mdocml/eqn.c head/contrib/mdocml/eqn_html.c head/contrib/mdocml/eqn_term.c head/contrib/mdocml/gmdiff head/contrib/mdocml/html.c head/contrib/mdocml/html.h head/contrib/mdocml/lib.c head/contrib/mdocml/libmandoc.h head/contrib/mdocml/libroff.h head/contrib/mdocml/main.c head/contrib/mdocml/man.7 head/contrib/mdocml/man.c head/contrib/mdocml/man.options.1 head/contrib/mdocml/man_html.c head/contrib/mdocml/man_macro.c head/contrib/mdocml/man_term.c head/contrib/mdocml/man_validate.c head/contrib/mdocml/manconf.h head/contrib/mdocml/mandoc.1 head/contrib/mdocml/mandoc.3 head/contrib/mdocml/mandoc.c head/contrib/mdocml/mandoc.css head/contrib/mdocml/mandoc.h head/contrib/mdocml/mandoc_aux.c head/contrib/mdocml/mandoc_aux.h head/contrib/mdocml/mandoc_char.7 head/contrib/mdocml/mandoc_escape.3 head/contrib/mdocml/mandoc_headers.3 head/contrib/mdocml/mandoc_html.3 head/contrib/mdocml/mandocd.c head/contrib/mdocml/mandocdb.c head/contrib/mdocml/manpath.c head/contrib/mdocml/mansearch.c head/contrib/mdocml/mdoc.7 head/contrib/mdocml/mdoc.c head/contrib/mdocml/mdoc_html.c head/contrib/mdocml/mdoc_man.c head/contrib/mdocml/mdoc_markdown.c head/contrib/mdocml/mdoc_term.c head/contrib/mdocml/mdoc_validate.c head/contrib/mdocml/msec.in head/contrib/mdocml/out.c head/contrib/mdocml/out.h head/contrib/mdocml/read.c head/contrib/mdocml/roff.7 head/contrib/mdocml/roff.c head/contrib/mdocml/roff.h head/contrib/mdocml/roff_html.c head/contrib/mdocml/roff_int.h head/contrib/mdocml/roff_term.c head/contrib/mdocml/roff_validate.c head/contrib/mdocml/soelim.1 head/contrib/mdocml/st.c head/contrib/mdocml/st.in head/contrib/mdocml/tbl.7 head/contrib/mdocml/tbl.c head/contrib/mdocml/tbl_data.c head/contrib/mdocml/tbl_html.c head/contrib/mdocml/tbl_layout.c head/contrib/mdocml/tbl_term.c head/contrib/mdocml/term.c head/contrib/mdocml/term.h head/contrib/mdocml/term_ascii.c head/contrib/mdocml/term_tab.c head/contrib/mdocml/tree.c head/usr.bin/mandoc/Makefile Directory Properties: head/contrib/mdocml/ (props changed) Modified: head/contrib/mdocml/INSTALL ============================================================================== --- head/contrib/mdocml/INSTALL Mon Jul 31 19:30:23 2017 (r321809) +++ head/contrib/mdocml/INSTALL Mon Jul 31 19:34:38 2017 (r321810) @@ -1,22 +1,24 @@ -$Id: INSTALL,v 1.18 2017/02/08 12:24:10 schwarze Exp $ +$Id: INSTALL,v 1.20 2017/07/28 14:57:56 schwarze Exp $ -About mdocml, the portable mandoc distribution ----------------------------------------------- -The mandoc manpage compiler toolset is a suite of tools compiling -mdoc(7), the roff(7) macro language of choice for BSD manual pages, -and man(7), the predominant historical language for UNIX manuals. +About the portable mandoc distribution +-------------------------------------- +The mandoc manpage compiler toolset (formerly called "mdocml") +is a suite of tools compiling mdoc(7), the roff(7) macro language +of choice for BSD manual pages, and man(7), the predominant +historical language for UNIX manuals. + It includes a man(1) manual viewer and additional tools. -For general information, see . +For general information, see . In case you have questions or want to provide feedback, read -. Consider subscribing to the +. Consider subscribing to the discuss@ mailing list mentioned on that page. If you intend to help with the development of mandoc, consider subscribing to the tech@ mailing list, too. Enjoy using the mandoc toolset! -Ingo Schwarze, Karlsruhe, February 2017 +Ingo Schwarze, Karlsruhe, July 2017 Installation @@ -25,7 +27,7 @@ Before manually installing mandoc on your system, plea whether the newest version of mandoc is already installed by default or available via a binary package or a ports system. A list of the latest bundled and ported versions of mandoc for various operating -systems is maintained at . +systems is maintained at . Regarding how packages and ports are maintained for your operating system, please consult your operating system documentation. @@ -35,7 +37,7 @@ To install mandoc manually, the following steps are ne run the command "echo BUILD_CGI=1 >> configure.local". Then run "cp cgi.h.example cgi.h" and edit cgi.h as desired. -2. If you also want to build the new catman(8) utility, run the +2. If you also want to build the catman(8) utility, run the command "echo BUILD_CATMAN=1 >> configure.local". Note that it is unlikely to be a drop-in replacement providing the same functionality as your system's "catman", if your operating @@ -75,7 +77,7 @@ command like "make DESTDIR=... install". Read the *-i in the "Makefile" to understand how DESTDIR is used. 9. Run the command "sudo makewhatis" to build mandoc.db(5) databases -in all the directory trees configured in step 6. Whenever installing +in all the directory trees configured in step 3. Whenever installing new manual pages, re-run makewhatis(8) to update the databases, or apropos(1) will not find the new pages. Modified: head/contrib/mdocml/LICENSE ============================================================================== --- head/contrib/mdocml/LICENSE Mon Jul 31 19:30:23 2017 (r321809) +++ head/contrib/mdocml/LICENSE Mon Jul 31 19:34:38 2017 (r321810) @@ -1,7 +1,7 @@ -$Id: LICENSE,v 1.15 2017/02/21 00:37:03 schwarze Exp $ +$Id: LICENSE,v 1.17 2017/06/23 15:58:14 schwarze Exp $ With the exceptions noted below, all code and documentation -contained in the mdocml toolkit is protected by the Copyright +contained in the mandoc toolkit is protected by the Copyright of the following developers: Copyright (c) 2008-2012, 2014 Kristaps Dzonsons @@ -13,7 +13,7 @@ Copyright (c) 2016 Ed Maste Copyright (c) 2017 Michael Stapelberg Copyright (c) 1999, 2004 Marc Espie Copyright (c) 1998, 2004, 2010 Todd C. Miller -Copyright (c) 2008 Otto Moerbeek +Copyright (c) 2008, 2017 Otto Moerbeek Copyright (c) 2004 Ted Unangst Copyright (c) 1994 Christos Zoulas Copyright (c) 2003, 2007, 2008, 2014 Jason McIntyre @@ -22,7 +22,7 @@ See the individual source files for information about to which file during which years. -The mdocml distribution as a whole is distributed by its developers +The mandoc distribution as a whole is distributed by its developers under the following license: Permission to use, copy, modify, and distribute this software for any Modified: head/contrib/mdocml/Makefile ============================================================================== --- head/contrib/mdocml/Makefile Mon Jul 31 19:30:23 2017 (r321809) +++ head/contrib/mdocml/Makefile Mon Jul 31 19:34:38 2017 (r321810) @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.512 2017/05/07 17:31:45 schwarze Exp $ +# $Id: Makefile,v 1.516 2017/07/20 16:24:53 schwarze Exp $ # # Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons # Copyright (c) 2011, 2013-2017 Ingo Schwarze @@ -15,7 +15,7 @@ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -VERSION = 1.14.1 +VERSION = 1.14.2 # === LIST OF FILES ==================================================== @@ -38,6 +38,7 @@ TESTSRCS = test-be32toh.c \ test-progname.c \ test-recvmsg.c \ test-reallocarray.c \ + test-recallocarray.c \ test-rewb-bsd.c \ test-rewb-sysv.c \ test-sandbox_init.c \ @@ -64,6 +65,7 @@ SRCS = att.c \ compat_ohash.c \ compat_progname.c \ compat_reallocarray.c \ + compat_recallocarray.c \ compat_strcasestr.c \ compat_stringlist.c \ compat_strlcat.c \ @@ -92,6 +94,7 @@ SRCS = att.c \ mandoc.c \ mandoc_aux.c \ mandoc_ohash.c \ + mandoc_xr.c \ mandocd.c \ mandocdb.c \ manpath.c \ @@ -178,6 +181,7 @@ DISTFILES = INSTALL \ mandoc_html.3 \ mandoc_malloc.3 \ mandoc_ohash.h \ + mandoc_xr.h \ mandocd.8 \ mansearch.3 \ mansearch.h \ @@ -227,6 +231,7 @@ LIBMANDOC_OBJS = $(LIBMAN_OBJS) \ mandoc.o \ mandoc_aux.o \ mandoc_ohash.o \ + mandoc_xr.o \ msec.o \ preconv.o \ read.o @@ -240,6 +245,7 @@ COMPAT_OBJS = compat_err.o \ compat_ohash.o \ compat_progname.o \ compat_reallocarray.o \ + compat_recallocarray.o \ compat_strcasestr.o \ compat_strlcat.o \ compat_strlcpy.o \ @@ -341,9 +347,6 @@ WWW_MANS = apropos.1.html \ mdoc.h.html \ roff.h.html -WWW_OBJS = mdocml.tar.gz \ - mdocml.sha256 - # === USER CONFIGURATION =============================================== include Makefile.local @@ -354,7 +357,7 @@ all: mandoc demandoc soelim $(BUILD_TARGETS) Makefile. install: base-install $(INSTALL_TARGETS) -www: $(WWW_OBJS) $(WWW_MANS) +www: $(WWW_MANS) $(WWW_MANS): mandoc @@ -372,10 +375,10 @@ clean: rm -f libmandoc.a $(LIBMANDOC_OBJS) $(COMPAT_OBJS) rm -f mandoc $(MAIN_OBJS) rm -f man.cgi $(CGI_OBJS) - rm -f mandocd catman $(MANDOCD_OBJS) + rm -f mandocd catman catman.o $(MANDOCD_OBJS) rm -f demandoc $(DEMANDOC_OBJS) rm -f soelim $(SOELIM_OBJS) - rm -f $(WWW_MANS) $(WWW_OBJS) + rm -f $(WWW_MANS) mandoc.tar.gz mandoc.sha256 rm -rf *.dSYM base-install: mandoc demandoc soelim @@ -509,13 +512,7 @@ soelim: $(SOELIM_OBJS) # --- maintainer targets --- www-install: www - mkdir -p $(HTDOCDIR)/snapshots $(INSTALL_DATA) $(WWW_MANS) mandoc.css $(HTDOCDIR) - $(INSTALL_DATA) $(WWW_OBJS) $(HTDOCDIR)/snapshots - $(INSTALL_DATA) mdocml.tar.gz \ - $(HTDOCDIR)/snapshots/mdocml-$(VERSION).tar.gz - $(INSTALL_DATA) mdocml.sha256 \ - $(HTDOCDIR)/snapshots/mdocml-$(VERSION).sha256 depend: config.h mkdep -f Makefile.depend $(CFLAGS) $(SRCS) @@ -542,24 +539,25 @@ regress-distcheck: ! -name '*.out_ascii' \ ! -name '*.out_utf8' \ ! -name '*.out_html' \ + ! -name '*.out_markdown' \ ! -name '*.out_lint' \ ! -path regress/regress.pl \ ! -path regress/regress.pl.1 -dist: mdocml.sha256 +dist: mandoc.sha256 -mdocml.sha256: mdocml.tar.gz - sha256 mdocml.tar.gz > $@ +mandoc.sha256: mandoc.tar.gz + sha256 mandoc.tar.gz > $@ -mdocml.tar.gz: $(DISTFILES) +mandoc.tar.gz: $(DISTFILES) ls regress/*/*/*.mandoc_* && exit 1 || true - mkdir -p .dist/mdocml-$(VERSION)/ - $(INSTALL) -m 0644 $(DISTFILES) .dist/mdocml-$(VERSION) - cp -pR regress .dist/mdocml-$(VERSION) - find .dist/mdocml-$(VERSION)/regress \ + mkdir -p .dist/mandoc-$(VERSION)/ + $(INSTALL) -m 0644 $(DISTFILES) .dist/mandoc-$(VERSION) + cp -pR regress .dist/mandoc-$(VERSION) + find .dist/mandoc-$(VERSION)/regress \ -type d -name CVS -print0 | xargs -0 rm -rf - chmod 755 .dist/mdocml-$(VERSION)/configure - ( cd .dist/ && tar zcf ../$@ mdocml-$(VERSION) ) + chmod 755 .dist/mandoc-$(VERSION)/configure + ( cd .dist/ && tar zcf ../$@ mandoc-$(VERSION) ) rm -rf .dist/ # === SUFFIX RULES ===================================================== Modified: head/contrib/mdocml/Makefile.depend ============================================================================== --- head/contrib/mdocml/Makefile.depend Mon Jul 31 19:30:23 2017 (r321809) +++ head/contrib/mdocml/Makefile.depend Mon Jul 31 19:34:38 2017 (r321810) @@ -1,4 +1,4 @@ -att.o: att.c config.h roff.h mdoc.h libmdoc.h +att.o: att.c config.h mandoc.h roff.h mdoc.h libmdoc.h catman.o: catman.c config.h compat_fts.h cgi.o: cgi.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h man.h main.h manconf.h mansearch.h cgi.h chars.o: chars.c config.h mandoc.h mandoc_aux.h mandoc_ohash.h compat_ohash.h libmandoc.h @@ -11,6 +11,7 @@ compat_mkdtemp.o: compat_mkdtemp.c config.h compat_ohash.o: compat_ohash.c config.h compat_ohash.h compat_progname.o: compat_progname.c config.h compat_reallocarray.o: compat_reallocarray.c config.h +compat_recallocarray.o: compat_recallocarray.c config.h compat_strcasestr.o: compat_strcasestr.c config.h compat_stringlist.o: compat_stringlist.c config.h compat_stringlist.h compat_strlcat.o: compat_strlcat.c config.h @@ -24,44 +25,45 @@ dba_read.o: dba_read.c mandoc_aux.h mansearch.h dba_ar dba_write.o: dba_write.c config.h dba_write.h dbm.o: dbm.c config.h mansearch.h dbm_map.h dbm.h dbm_map.o: dbm_map.c config.h mansearch.h dbm_map.h dbm.h -demandoc.o: demandoc.c config.h roff.h man.h mdoc.h mandoc.h -eqn.o: eqn.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h +demandoc.o: demandoc.c config.h mandoc.h roff.h man.h mdoc.h +eqn.o: eqn.c config.h mandoc_aux.h mandoc.h roff.h libmandoc.h libroff.h eqn_html.o: eqn_html.c config.h mandoc.h out.h html.h eqn_term.o: eqn_term.c config.h mandoc.h out.h term.h html.o: html.c config.h mandoc_aux.h mandoc.h roff.h out.h html.h manconf.h main.h -lib.o: lib.c config.h roff.h mdoc.h libmdoc.h lib.in -main.o: main.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h man.h tag.h main.h manconf.h mansearch.h +lib.o: lib.c config.h mandoc.h roff.h mdoc.h libmdoc.h lib.in +main.o: main.c config.h mandoc_aux.h mandoc.h mandoc_xr.h roff.h mdoc.h man.h tag.h main.h manconf.h mansearch.h man.o: man.c config.h mandoc_aux.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h -man_html.o: man_html.c config.h mandoc_aux.h roff.h man.h out.h html.h main.h +man_html.o: man_html.c config.h mandoc_aux.h mandoc.h roff.h man.h out.h html.h main.h man_macro.o: man_macro.c config.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h man_term.o: man_term.c config.h mandoc_aux.h mandoc.h roff.h man.h out.h term.h main.h man_validate.o: man_validate.c config.h mandoc_aux.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h -mandoc.o: mandoc.c config.h mandoc.h mandoc_aux.h libmandoc.h +mandoc.o: mandoc.c config.h mandoc_aux.h mandoc.h roff.h libmandoc.h mandoc_aux.o: mandoc_aux.c config.h mandoc.h mandoc_aux.h mandoc_ohash.o: mandoc_ohash.c mandoc_aux.h mandoc_ohash.h compat_ohash.h +mandoc_xr.o: mandoc_xr.c mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc_xr.h mandocd.o: mandocd.c config.h mandoc.h roff.h mdoc.h man.h main.h manconf.h mandocdb.o: mandocdb.c config.h compat_fts.h mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc.h roff.h mdoc.h man.h manconf.h mansearch.h dba_array.h dba.h manpath.o: manpath.c config.h mandoc_aux.h manconf.h mansearch.o: mansearch.c config.h mandoc.h mandoc_aux.h mandoc_ohash.h compat_ohash.h manconf.h mansearch.h dbm.h mdoc.o: mdoc.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h mdoc_argv.o: mdoc_argv.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h -mdoc_html.o: mdoc_html.c config.h mandoc_aux.h roff.h mdoc.h out.h html.h main.h +mdoc_html.o: mdoc_html.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h out.h html.h main.h mdoc_macro.o: mdoc_macro.c config.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h mdoc_man.o: mdoc_man.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h man.h out.h main.h mdoc_markdown.o: mdoc_markdown.c mandoc_aux.h mandoc.h roff.h mdoc.h main.h mdoc_state.o: mdoc_state.c mandoc.h roff.h mdoc.h libmandoc.h libmdoc.h mdoc_term.o: mdoc_term.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h out.h term.h tag.h main.h -mdoc_validate.o: mdoc_validate.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h +mdoc_validate.o: mdoc_validate.c config.h mandoc_aux.h mandoc.h mandoc_xr.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h msec.o: msec.c config.h mandoc.h libmandoc.h msec.in out.o: out.c config.h mandoc_aux.h mandoc.h out.h preconv.o: preconv.c config.h mandoc.h libmandoc.h -read.o: read.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h man.h libmandoc.h roff_int.h +read.o: read.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h man.h libmandoc.h roff.o: roff.c config.h mandoc.h mandoc_aux.h mandoc_ohash.h compat_ohash.h roff.h libmandoc.h roff_int.h libroff.h predefs.in -roff_html.o: roff_html.c roff.h out.h html.h -roff_term.o: roff_term.c roff.h out.h term.h +roff_html.o: roff_html.c mandoc.h roff.h out.h html.h +roff_term.o: roff_term.c mandoc.h roff.h out.h term.h roff_validate.o: roff_validate.c mandoc.h roff.h libmandoc.h roff_int.h soelim.o: soelim.c config.h compat_stringlist.h -st.o: st.c config.h roff.h mdoc.h libmdoc.h st.in +st.o: st.c config.h mandoc.h roff.h mdoc.h libmdoc.h st.in tag.o: tag.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h tag.h tbl.o: tbl.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h tbl_data.o: tbl_data.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h Modified: head/contrib/mdocml/NEWS ============================================================================== --- head/contrib/mdocml/NEWS Mon Jul 31 19:30:23 2017 (r321809) +++ head/contrib/mdocml/NEWS Mon Jul 31 19:34:38 2017 (r321810) @@ -1,7 +1,93 @@ -$Id: NEWS,v 1.21 2017/02/21 00:37:03 schwarze Exp $ +$Id: NEWS,v 1.26 2017/07/28 14:57:56 schwarze Exp $ -This file lists the most important changes in the mdocml.bsd.lv distribution. +This file lists the most important changes in the mandoc.bsd.lv distribution. +Changes in version 1.14.2, released on July 28, 2017 + + --- MAJOR NEW FEATURES --- + * New mdoc(7) -Tmarkdown output mode. + * For -Thtml, implement internal hyperlinks pointing to authoritative + definitions of various syntax elements, similar to the ctags(1)-like + less(1) :t internal searching in terminal mode. + * Provide a superset of the functionality of the former mdoclint(1) + utility and a new -Wstyle message level with several new messages, + including validity checking of .Xr cross references. + * tbl(7): Implement automatic line breaking inside individual table + cells, and several other formatting improvements. + * eqn(7): Complete rewrite of the lexer, resulting in several bugfixes. + * Continue parser unification, in particular allowing generation + of syntax tree nodes on the roff(7) level, allowing implementation + of many additional roff requests. + --- REMOVED FUNCTIONALITY --- + * Delete the manpage(1) utility. It was never enabled in any release. + * Delete the -Txhtml command line option. It has been an obsolete + alias for the -Thtml output mode for more than two years. + --- MINOR NEW FEATURES --- + * -Tlint now puts parser messages on stdout instead of stderr, + making commands like "man -l -Tlint *.1" useful. + * mdoc(7): Various .Lk formatting improvements. + * mdoc(7) -Thtml: Better CSS for .Bl lists. + * man(7): Implement the .MT/.ME block macro (mailto hyperlink). + * man(7): Implement the .DT macro (restore default tab positions). + * man(7): Improved support for manuals generated with reStructuredText + by partial support for the \n[an-margin] number register. + * man(7) -Thtml: Support deep linking to .SH and .SS headers. + * tbl(7): Implement the "allbox" table option. + * tbl(7): Implement the column spacing and the 'w' (minimum column + width) layout modifiers. + * tbl(7): Significant improvements of the manual page. + * eqn(7): Much improved font selection, including recognition of + well-known function names, and a few other formatting improvements. + * eqn(7) -Thtml: Use and in addition to . + * roff(7): Implement the .ce (centering), .mc (margin character), + .rj (right justify), .ta (define tab stops), .ti (temporary indent), + .als (macro alias), .ec and .eo (escape character control), + .po (page offset), and .rn (macro rename) requests. + * roff(7) .am: Implement appending to mdoc(7) and man(7) macros. + * roff(7): implement the \h (horizontol motion), \l (horizontal + line drawing), and \p (break output line) escape sequences, + and also several additional character escape sequences. + * roff(7): Implement the 'd' conditional (macro or string defined). + * man.cgi(8) now uses pledge(2), too. + * regress.pl(1): simpler user interface, better summary output, + simpler code, and no more recursion. + --- THANKS TO --- + * Anthony Bentley (OpenBSD) for the implementation of .MT/.ME, + reports of many bugs and missing features, and suggestions + for a number of feature and documentation improvements. + * Sebastien Marie (OpenBSD) for two source code patches and + for some useful discussions. + * Florian Obser (OpenBSD) for a bugfix patch and a bug report. + * Jonathan Gray (OpenBSD) for several bug reports from afl(1) + and several more from static analysis tools. + * Theo Buehler (OpenBSD) for several bug reports, most from afl(1). + * Jason McIntyre (OpenBSD) for many useful discussions about a + wide variety of topics, lots of continuous testing, a number of + bug reports, and some suggestions for messages and documentation. + * Thomas Klausner (NetBSD) for lots of help while migrating + mdoclint(1) functionality to mandoc -Tlint, for suggesting + several useful new messages, and for release testing. + * Reyk Floeter (OpenBSD) and Vsevolod Stakhov (FreeBSD) for + suggesting a markdown output mode. + * Thomas Guettler for suggesting -Thtml internal hyperlinks. + * Yuri Pankov (Illumos) for inspiring new warning messages and + for extensive release testing. + * Anton Lindqvist and TJ Townsend (both OpenBSD) and Jan Stary + for multiple bug reports. + * Leah Neukirchen (Void Linux) for bug reports and release testing. + * Michael Stapelberg (Debian) for suggesting feature improvements + and for release testing. + * Martin Natano and Theo de Raadt (both OpenBSD), Andreas Voegele, + Gabriel Guzman, Gonzalo Tornaria, Markus Waldeck, and Raf Czlonka + for bug reports. + * Antoine Jacoutot (OpenBSD) and Steffen Nurpmeso for suggesting + feature improvements. + * Dag-Erling Smoergrav (FreeBSD) for inspiring new warning messages. + * Ted Unangst and Marc Espie (OpenBSD) for providing useful ideas. + * Svyatoslav Mishyn (Crux Linux) for release testing. + * Carsten Kunze (Heirloom roff) for help keeping mandoc and groff + compatible and for committing some of my patches to groff. + Changes in version 1.14.1, released on February 21, 2017 --- MAJOR NEW FEATURES --- @@ -274,11 +360,11 @@ Changes in version 1.13.3, released on March 13, 2015 * New -Wunsupp message level. --- POTENTIONALLY SECURITY RELEVANT BUGFIXES --- * Fix a potential write buffer overrun on incomplete string conditionals. - http://mdocml.bsd.lv/cgi-bin/cvsweb/roff.c#rev1.241 + http://mandoc.bsd.lv/cgi-bin/cvsweb/roff.c#rev1.241 * Fix a potential write buffer overrun on backslash at EOF in a conditional. - http://mdocml.bsd.lv/cgi-bin/cvsweb/roff.c#rev1.247 + http://mandoc.bsd.lv/cgi-bin/cvsweb/roff.c#rev1.247 * Fix a use after free sometimes hit when validation deletes a block. - http://mdocml.bsd.lv/cgi-bin/cvsweb/mdoc_macro.c#rev1.180 + http://mandoc.bsd.lv/cgi-bin/cvsweb/mdoc_macro.c#rev1.180 --- MAJOR FUNCTIONALLY RELEVANT BUGFIXES --- * Let man(1) show manuals for the current architecture by default, and support the MACHINE environment variable. @@ -889,4 +975,4 @@ Changes in version 1.9.15, released on February 18, 20 * and column lengths handled correctly. For older releases, see the ChangeLog files -in http://mdocml.bsd.lv/snapshots/ . +in http://mandoc.bsd.lv/snapshots/ . Modified: head/contrib/mdocml/TODO ============================================================================== --- head/contrib/mdocml/TODO Mon Jul 31 19:30:23 2017 (r321809) +++ head/contrib/mdocml/TODO Mon Jul 31 19:34:38 2017 (r321810) @@ -1,6 +1,6 @@ ************************************************************************ * Official mandoc TODO. -* $Id: TODO,v 1.237 2017/05/16 19:06:30 schwarze Exp $ +* $Id: TODO,v 1.246 2017/07/24 11:15:12 schwarze Exp $ ************************************************************************ Many issues are annotated for difficulty as follows: @@ -65,21 +65,10 @@ are mere guesses, and some may be wrong. found by jca@ in ratpoison(1) Sun, 30 Jun 2013 12:01:09 +0200 loc * exist ** algo ** size ** imp ** -- \h horizontal move - #2 most important issue naddy@ Mon, 16 Feb 2015 20:59:17 +0100 - found in cclive(1) nasm(1) bogofilter(1) asciidoc/DocBook output - bentley@ on discuss@ Sat, 21 Sep 2013 22:29:34 -0600 - naddy@ Thu, 4 Dec 2014 16:26:41 +0100 - loc ** exist ** algo ** size * imp *** (parser reorg helps a lot) - - \n+ and \n- numerical register increment and decrement found by bentley@ in sbcl(1) Mon, 9 Dec 2013 18:36:57 -0700 loc * exist * algo * size * imp ** -- \n(.$ macro argument count number register; ocserv(8) by autogen - found by sthen@ Thu, 19 Feb 2015 22:03:01 +0000 - loc * exist ** algo * size * imp ** - - \w'' improve width measurements would not be very useful without an expression parser, see below needed for Tcl_NewStringObj(3) via wiz@ Wed, 5 Mar 2014 22:27:43 +0100 @@ -183,22 +172,6 @@ are mere guesses, and some may be wrong. --- missing tbl features ----------------------------------------------- -- horizontal lines in the layout still consume data cells - and can be mixed with actual data on the same table line - synaptics(4) found by tedu@ Mon, 17 Aug 2015 21:17:42 -0400 - loc ** exist ** algo ** size ** imp *** - -- break long text into lines inside cells - net/lftp(1) from jirib via bentley@ Sep 13, 2016 - -- layout l1 for a column of max text width 3 reduces the following - inter-column spacing for groff, but not for mandoc - net/lftp(1) from jirib via bentley@ Sep 13, 2016 - -- the "w" layout option is ignored - synaptics(4) found by tedu@ Mon, 17 Aug 2015 21:17:42 -0400 - loc * exist * algo * size * imp ** - - the "s" layout column specifier is used for placement of data into columns, but ignored during column width calculations synaptics(4) found by tedu@ Mon, 17 Aug 2015 21:17:42 -0400 @@ -240,6 +213,16 @@ are mere guesses, and some may be wrong. see User's Guide (Second Edition) page 5 section 15. loc ** exist ** algo ** size ** imp ** +- GNU eqn converts some operators to special characters, for example, + input HYPHEN-MINUS becomes output \(mi, unless it is part of a + quoted word. mandoc(1) only does this when the operator is + surrounded by blanks, not when it is part of an unquoted word. + Also, check whether there are more such cases (e.g., +?). + reported by bentley@ 20 Jun 2017 02:04:29 -0600 + +- Primes, opprime, and ' + bentley@ Thu, 13 Jul 2017 23:14:20 -0600 + --- missing misc features ---------------------------------------------- - italic correction (\/) in PostScript mode @@ -359,6 +342,12 @@ are mere guesses, and some may be wrong. .Vt vs .Vt/.Va vs .Ft/.Va vs .Ft/.Fa ... from kristaps@ Tue, 08 Jun 2010 11:13:32 +0200 +- implicit whitespace around inline equations + example code: where '$times$' denotes matrix multiplication + must not have an HTML line break, nor a blank, before + partial solution: html.c {"math", HTML_NLINSIDE | HTML_INDENT}, + bentley@ Thu, 13 Jul 2017 19:00:59 -0600 + - in enclosures, mandoc sometimes fancies a bogus end of sentence reminded by jmc@ Thu, 23 Sep 2010 18:13:39 +0059 loc * exist ** algo *** size * imp *** @@ -421,9 +410,6 @@ are mere guesses, and some may be wrong. Steffen Nurpmeso Sat, 08 Nov 2014 13:34:59 +0100 loc * exist ** algo ** size * imp ** -- .Lk formatting for long links with line breaks - Franco Fichtner 8 Oct 2013 00:33:42 +0200 - - In .Bl -enum -width 0n, groff continues one the same line after the number, mandoc breaks the line. mail to kristaps@ Mon, 20 Jul 2009 02:21:39 +0200 @@ -450,16 +436,6 @@ are mere guesses, and some may be wrong. Probably, this should be fixed somewhere in termp_it_pre(), not sure. loc * exist ** algo ** size * imp ** -- .Nx 1.0a - should be "NetBSD 1.0A", not "NetBSD 1.0a", - see OpenBSD ccdconfig(8). - loc * exist * algo * size * imp ** - -- In .Bl -tag, if a tag exceeds the right margin and must be continued - on the next line, it must be indented by -width, not width+1; - see "rule block|pass" in OpenBSD ifconfig(8). - loc * exist *** algo ** size * imp ** - - When the -width string contains macros, the macros must be rendered before measuring the width, for example .Bl -tag -width ".Dv message" @@ -495,15 +471,24 @@ are mere guesses, and some may be wrong. * warning issues ************************************************************************ -- provide a way in mandoc(1) to warn about broken .Xr links; - probably cannot be on by default in -Tlint because it needs - to access the manpath and mandoc.db(3) after parsing. - asked for by jmc@ Fri, 4 Dec 2015 22:39:40 +0000 +- style message about macros inside .Bd -literal and .Dl, in particular + font changing macros like .Cm, .Ar, .Fa (from the mdoclint TODO) +- style message about mismatches between the section number in the + file name (if it is known) and the section number in .Dt + (from the mdoclint TODO) + +- style message about NULL without .Dv (from the mdoclint TODO) + +- style message about error constants without .Er (from the mdoclint TODO) + - warn when .Sh or .Ss contain other macros Steffen Nurpmeso, savannah.gnu.org/bugs/index.php?45034 loc * exist * algo * size * imp ** +- style message about violations of the convention + .An name Aq Mt localpart@domain in AUTHORS (from the mdoclint TODO) + - warn about attempts to call non-callable macros Steffen Nurpmeso Tue, 11 Nov 2014 22:55:16 +0100 Note that formatting is inconsistent in groff. @@ -512,25 +497,25 @@ are mere guesses, and some may be wrong. all over mdoc_macro.c and all subtly different. loc ** exist ** algo ** size ** imp ** +- style message about suspicious uses of - vs. \- vs. \(mi + e.g. -1 is likely wrong (from the mdoclint TODO) + +- warn about punctuation - e.g. ',' and ';' - at the beginning + of a text line, if it is likely intended to follow the preceding + output without intervening whitespace, in particular after a + macro line (from the mdoclint TODO) + - mandoc_special does not really check the escape sequence, but just the overall format loc ** exist ** algo *** size ** imp ** -- integrate mdoclint into mandoc ("end-of-line whitespace" thread) - from jmc@ Mon, 13 Jul 2009 17:12:09 +0100 - from kristaps@ Mon, 13 Jul 2009 18:34:53 +0200 - from jmc@ Mon, 13 Jul 2009 17:45:37 +0059 - from kristaps@ Mon, 13 Jul 2009 19:02:03 +0200 - (mostly done, check what remains) - -- -Tlint parser errors and warnings to stdout - to tech@mdocml, naddy@ Wed, 28 Sep 2011 11:21:46 +0200 - wait! kristaps@ Sun, 02 Oct 2011 17:12:52 +0200 - ************************************************************************ * documentation issues ************************************************************************ +- dashes, hyphens, and minus signs in manual pages + jmc@ Fri, 28 Mar 2014 07:19:27 +0000 + - mark macros as: page structure domain, manual domain, general text domain is this useful? @@ -543,11 +528,6 @@ are mere guesses, and some may be wrong. * performance issues ************************************************************************ -- Why are we using MAP_SHARED, not MAP_PRIVATE for mmap(2)? - from kristaps@ Sat, 09 Aug 2014 13:51:36 +0200 - -Several areas can be cleaned up to make mandoc even faster. These are - - the PDF file is HUGE: this can be reduced by using relative offsets ************************************************************************ @@ -565,13 +545,13 @@ Several areas can be cleaned up to make mandoc even fa same-line from different-line input. That plainly doesn't work with user-defined macros, leading to random breakage. +- Is it possible to further simplify ENDBODY_SPACE? + - Find better ways to prevent endless loops in roff(7) macro and string expansion. -- Finish cleanup of date handling. - Decide which formats should be recognized where. - Update both mdoc(7) and man(7) documentation. - Triggered by Tim van der Molen Tue, 22 Feb 2011 20:30:45 +0100 +- make buffers for parsing functions const + christos@ via wiz@ Fri, 18 Dec 2015 17:10:01 +0100 - struct mparse refactoring Steffen Nurpmeso Thu, 04 Sep 2014 12:50:00 +0200 Modified: head/contrib/mdocml/apropos.1 ============================================================================== --- head/contrib/mdocml/apropos.1 Mon Jul 31 19:30:23 2017 (r321809) +++ head/contrib/mdocml/apropos.1 Mon Jul 31 19:34:38 2017 (r321810) @@ -1,4 +1,4 @@ -.\" $Id: apropos.1,v 1.45 2017/03/27 18:51:36 schwarze Exp $ +.\" $Id: apropos.1,v 1.46 2017/07/04 23:40:01 schwarze Exp $ .\" .\" Copyright (c) 2011, 2012 Kristaps Dzonsons .\" Copyright (c) 2011, 2012, 2014, 2017 Ingo Schwarze @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: March 27 2017 $ +.Dd $Mdocdate: July 4 2017 $ .Dt APROPOS 1 .Os .Sh NAME @@ -407,7 +407,7 @@ variables: .Dl $ apropos \-s 3 Va=optind \-a Va=optarg .Pp Do exactly the same as calling -.Xr whatis 1 +.Nm whatis with the argument .Qq ssh : .Pp Modified: head/contrib/mdocml/att.c ============================================================================== --- head/contrib/mdocml/att.c Mon Jul 31 19:30:23 2017 (r321809) +++ head/contrib/mdocml/att.c Mon Jul 31 19:34:38 2017 (r321810) @@ -1,4 +1,4 @@ -/* $Id: att.c,v 1.15 2015/10/06 18:32:19 schwarze Exp $ */ +/* $Id: att.c,v 1.16 2017/06/24 14:38:32 schwarze Exp $ */ /* * Copyright (c) 2009 Kristaps Dzonsons * @@ -19,6 +19,7 @@ #include #include +#include "mandoc.h" #include "roff.h" #include "mdoc.h" #include "libmdoc.h" Modified: head/contrib/mdocml/cgi.c ============================================================================== --- head/contrib/mdocml/cgi.c Mon Jul 31 19:30:23 2017 (r321809) +++ head/contrib/mdocml/cgi.c Mon Jul 31 19:34:38 2017 (r321810) @@ -1,4 +1,4 @@ -/* $Id: cgi.c,v 1.154 2017/04/19 01:00:03 schwarze Exp $ */ +/* $Id: cgi.c,v 1.156 2017/06/24 14:38:32 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze @@ -140,16 +140,16 @@ html_putchar(char c) { switch (c) { - case ('"'): + case '"': printf("""); break; - case ('&'): + case '&': printf("&"); break; - case ('>'): + case '>': printf(">"); break; - case ('<'): + case '<': printf("<"); break; default: @@ -832,7 +832,7 @@ resp_format(const struct req *req, const char *file) mchars_alloc(); mp = mparse_alloc(MPARSE_SO | MPARSE_UTF8 | MPARSE_LATIN1, - MANDOCLEVEL_BADARG, NULL, req->q.manpath); + MANDOCERR_MAX, NULL, MANDOC_OS_OTHER, req->q.manpath); mparse_readfd(mp, fd, file); close(fd); Modified: head/contrib/mdocml/chars.c ============================================================================== --- head/contrib/mdocml/chars.c Mon Jul 31 19:30:23 2017 (r321809) +++ head/contrib/mdocml/chars.c Mon Jul 31 19:34:38 2017 (r321810) @@ -1,4 +1,4 @@ -/* $Id: chars.c,v 1.70 2017/06/02 12:43:52 schwarze Exp $ */ +/* $Id: chars.c,v 1.71 2017/06/14 20:57:07 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2011, 2014, 2015, 2017 Ingo Schwarze @@ -61,6 +61,7 @@ static struct ln lines[] = { { "ba", "|", 0x007c }, { "br", "|", 0x2502 }, { "ul", "_", 0x005f }, + { "ru", "_", 0x005f }, { "rn", "-", 0x203e }, { "bb", "|", 0x00a6 }, { "sl", "/", 0x002f }, Copied: head/contrib/mdocml/compat_recallocarray.c (from r321808, vendor/mdocml/dist/compat_recallocarray.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/mdocml/compat_recallocarray.c Mon Jul 31 19:34:38 2017 (r321810, copy of r321808, vendor/mdocml/dist/compat_recallocarray.c) @@ -0,0 +1,108 @@ +#include "config.h" + +#if HAVE_RECALLOCARRAY + +int dummy; + +#else + +/* $Id: compat_recallocarray.c,v 1.1 2017/06/12 19:05:47 schwarze Exp $ */ +/* $OpenBSD: malloc.c,v 1.225 2017/05/13 07:11:29 otto Exp $ */ +/* + * Copyright (c) 2017 Otto Moerbeek + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +#include +#include +#include +#include + +/* + * This is sqrt(SIZE_MAX+1), as s1*s2 <= SIZE_MAX + * if both s1 < MUL_NO_OVERFLOW and s2 < MUL_NO_OVERFLOW + */ +#define MUL_NO_OVERFLOW ((size_t)1 << (sizeof(size_t) * 4)) + +/* + * Even though specified in POSIX, the PAGESIZE and PAGE_SIZE + * macros have very poor portability. Since we only use this + * to avoid free() overhead for small shrinking, simply pick + * an arbitrary number. + */ +#define MALLOC_PAGESIZE (1UL << 12) + + +void * +recallocarray(void *ptr, size_t oldnmemb, size_t newnmemb, size_t size) +{ + size_t oldsize, newsize; + void *newptr; + + if (ptr == NULL) + return calloc(newnmemb, size); + + if ((newnmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) && + newnmemb > 0 && SIZE_MAX / newnmemb < size) { + errno = ENOMEM; + return NULL; + } + newsize = newnmemb * size; + + if ((oldnmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) && + oldnmemb > 0 && SIZE_MAX / oldnmemb < size) { + errno = EINVAL; + return NULL; + } + oldsize = oldnmemb * size; + + /* + * Don't bother too much if we're shrinking just a bit, + * we do not shrink for series of small steps, oh well. + */ + if (newsize <= oldsize) { + size_t d = oldsize - newsize; + + if (d < oldsize / 2 && d < MALLOC_PAGESIZE) { + memset((char *)ptr + newsize, 0, d); + return ptr; + } + } + + newptr = malloc(newsize); + if (newptr == NULL) + return NULL; + + if (newsize > oldsize) { + memcpy(newptr, ptr, oldsize); + memset((char *)newptr + oldsize, 0, newsize - oldsize); + } else + memcpy(newptr, ptr, newsize); + + /* + * At this point, the OpenBSD implementation calls + * explicit_bzero() on the old memory before it is + * freed. Since explicit_bzero() is hard to implement + * portably and we don't handle confidential data in + * mandoc in the first place, simply free the memory + * without clearing it. + */ + + free(ptr); + + return newptr; +} + +#endif /* !HAVE_RECALLOCARRAY */ Modified: head/contrib/mdocml/config.h ============================================================================== --- head/contrib/mdocml/config.h Mon Jul 31 19:30:23 2017 (r321809) +++ head/contrib/mdocml/config.h Mon Jul 31 19:34:38 2017 (r321810) @@ -10,14 +10,18 @@ #define _GNU_SOURCE /* See test-*.c what needs this. */ #endif +#include #define MAN_CONF_FILE "/etc/man.conf" +#define MANPATH_BASE "/usr/share/man" #define MANPATH_DEFAULT "/usr/share/man:/usr/local/man" #define UTF8_LOCALE "en_US.UTF-8" +#define HAVE_CMSG_XPG42 0 #define HAVE_DIRENT_NAMLEN 1 #define HAVE_ENDIAN 0 #define HAVE_ERR 1 #define HAVE_FTS 1 +#define HAVE_FTS_COMPARE_CONST 1 #define HAVE_GETLINE 1 #define HAVE_GETSUBOPT 1 #define HAVE_ISBLANK 1 @@ -26,6 +30,7 @@ #define HAVE_PLEDGE 0 #define HAVE_PROGNAME 1 #define HAVE_REALLOCARRAY 1 +#define HAVE_RECALLOCARRAY 0 #define HAVE_REWB_BSD 1 #define HAVE_REWB_SYSV 1 #define HAVE_SANDBOX_INIT 0 @@ -40,10 +45,11 @@ #define HAVE_VASPRINTF 1 #define HAVE_WCHAR 1 #define HAVE_OHASH 1 -#define HAVE_FTS_COMPARE_CONST 1 #define BINM_APROPOS "apropos" #define BINM_MAKEWHATIS "makewhatis" #define BINM_MAN "man" #define BINM_SOELIM "soelim" #define BINM_WHATIS "whatis" + +extern void *recallocarray(void *, size_t, size_t, size_t); Modified: head/contrib/mdocml/configure ============================================================================== --- head/contrib/mdocml/configure Mon Jul 31 19:30:23 2017 (r321809) +++ head/contrib/mdocml/configure Mon Jul 31 19:34:38 2017 (r321810) @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: configure,v 1.62 2017/03/04 16:36:29 schwarze Exp $ +# $Id: configure,v 1.64 2017/07/01 09:47:30 schwarze Exp $ # # Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze # @@ -35,6 +35,7 @@ echo "config.log: writing..." SOURCEDIR=`dirname "$0"` +MANPATH_BASE="/usr/share/man:/usr/X11R6/man" MANPATH_DEFAULT="/usr/share/man:/usr/X11R6/man:/usr/local/man" OSNAME= UTF8_LOCALE= @@ -73,6 +74,7 @@ HAVE_PATH_MAX= HAVE_PLEDGE= HAVE_PROGNAME= HAVE_REALLOCARRAY= +HAVE_RECALLOCARRAY= HAVE_RECVMSG= HAVE_REWB_BSD= HAVE_REWB_SYSV= @@ -229,6 +231,7 @@ runtest pledge PLEDGE || true runtest sandbox_init SANDBOX_INIT || true runtest progname PROGNAME || true runtest reallocarray REALLOCARRAY || true +runtest recallocarray RECALLOCARRAY || true runtest rewb-bsd REWB_BSD || true runtest rewb-sysv REWB_SYSV || true runtest strcasestr STRCASESTR || true @@ -348,7 +351,8 @@ cat << __HEREDOC__ __HEREDOC__ -[ ${HAVE_GETLINE} -eq 0 -o ${HAVE_REALLOCARRAY} -eq 0 -o \ +[ ${HAVE_GETLINE} -eq 0 -o \ + ${HAVE_REALLOCARRAY} -eq 0 -o ${HAVE_RECALLOCARRAY} -eq 0 -o \ ${HAVE_STRLCAT} -eq 0 -o ${HAVE_STRLCPY} -eq 0 ] \ && echo "#include " [ ${HAVE_VASPRINTF} -eq 0 ] && echo "#include " @@ -356,6 +360,7 @@ __HEREDOC__ echo echo "#define MAN_CONF_FILE \"/etc/${MANM_MANCONF}\"" +echo "#define MANPATH_BASE \"${MANPATH_BASE}\"" echo "#define MANPATH_DEFAULT \"${MANPATH_DEFAULT}\"" [ -n "${OSNAME}" ] && echo "#define OSNAME \"${OSNAME}\"" [ -n "${UTF8_LOCALE}" ] && echo "#define UTF8_LOCALE \"${UTF8_LOCALE}\"" @@ -383,6 +388,7 @@ cat << __HEREDOC__ #define HAVE_PLEDGE ${HAVE_PLEDGE} #define HAVE_PROGNAME ${HAVE_PROGNAME} #define HAVE_REALLOCARRAY ${HAVE_REALLOCARRAY} +#define HAVE_RECALLOCARRAY ${HAVE_RECALLOCARRAY} #define HAVE_REWB_BSD ${HAVE_REWB_BSD} #define HAVE_REWB_SYSV ${HAVE_REWB_SYSV} #define HAVE_SANDBOX_INIT ${HAVE_SANDBOX_INIT} @@ -433,6 +439,9 @@ fi [ ${HAVE_REALLOCARRAY} -eq 0 ] && \ echo "extern void *reallocarray(void *, size_t, size_t);" + +[ ${HAVE_RECALLOCARRAY} -eq 0 ] && \ + echo "extern void *recallocarray(void *, size_t, size_t, size_t);" [ ${HAVE_STRCASESTR} -eq 0 ] && \ echo "extern char *strcasestr(const char *, const char *);" Modified: head/contrib/mdocml/configure.local.example ============================================================================== --- head/contrib/mdocml/configure.local.example Mon Jul 31 19:30:23 2017 (r321809) +++ head/contrib/mdocml/configure.local.example Mon Jul 31 19:34:38 2017 (r321810) @@ -1,4 +1,4 @@ -# $Id: configure.local.example,v 1.30 2017/03/04 16:36:29 schwarze Exp $ +# $Id: configure.local.example,v 1.33 2017/07/20 16:24:53 schwarze Exp $ # # Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze # @@ -20,7 +20,7 @@ # and put any of these settings into it if ./configure autodetection # fails or if you want to make different choices for other reasons. -# If autodetection fails, please tell . +# If autodetection fails, please tell . # We recommend that you write ./configure.local from scratch and # only put the lines there you need. This file contains examples. @@ -62,6 +62,11 @@ UTF8_LOCALE=en_US.UTF-8 MANPATH_DEFAULT="/usr/share/man:/usr/X11R6/man:/usr/local/man" +# Validation of cross references with mandoc -Tlint only looks +# for manual pages in the following directories: + +MANPATH_BASE="/usr/share/man:/usr/X11R6/man" + # In manual pages written in the mdoc(7) language, the operating system # version is displayed in the page footer line. If an operating system # is specified as an argument to the .Os macro, that is always used. @@ -292,6 +297,7 @@ HAVE_PATH_MAX=0 HAVE_PLEDGE=0 HAVE_PROGNAME=0 HAVE_REALLOCARRAY=0 +HAVE_RECALLOCARRAY=0 HAVE_REWB_BSD=0 HAVE_REWB_SYSV=0 HAVE_STRCASESTR=0 Modified: head/contrib/mdocml/demandoc.c ============================================================================== --- head/contrib/mdocml/demandoc.c Mon Jul 31 19:30:23 2017 (r321809) +++ head/contrib/mdocml/demandoc.c Mon Jul 31 19:34:38 2017 (r321810) @@ -1,4 +1,4 @@ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Jul 31 19:48:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77743DBC11C; Mon, 31 Jul 2017 19:48:30 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4645065C30; Mon, 31 Jul 2017 19:48:30 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6VJmTZe007059; Mon, 31 Jul 2017 19:48:29 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VJmT8V007058; Mon, 31 Jul 2017 19:48:29 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201707311948.v6VJmT8V007058@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Mon, 31 Jul 2017 19:48:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321811 - stable/11/sys/netpfil/ipfw X-SVN-Group: stable-11 X-SVN-Commit-Author: philip X-SVN-Commit-Paths: stable/11/sys/netpfil/ipfw X-SVN-Commit-Revision: 321811 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 19:48:30 -0000 Author: philip Date: Mon Jul 31 19:48:29 2017 New Revision: 321811 URL: https://svnweb.freebsd.org/changeset/base/321811 Log: MFC r320941: Fix GRE over IPv6 tunnels with IPFW Previously, GRE packets in IPv6 tunnels would be dropped by IPFW (unless net.inet6.ip6.fw.deny_unknown_exthdrs was unset). PR: 220640 Submitted by: Kun Xie 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 Mon Jul 31 19:34:38 2017 (r321810) +++ stable/11/sys/netpfil/ipfw/ip_fw2.c Mon Jul 31 19:48:29 2017 (r321811) @@ -92,6 +92,8 @@ __FBSDID("$FreeBSD$"); #include #endif +#include /* for struct grehdr */ + #include #include /* XXX for in_cksum */ @@ -1160,6 +1162,11 @@ do { \ case IPPROTO_PIM: /* XXX PIM header check? */ PULLUP_TO(hlen, ulp, struct pim); + break; + + case IPPROTO_GRE: /* RFC 1701 */ + /* XXX GRE header check? */ + PULLUP_TO(hlen, ulp, struct grehdr); break; case IPPROTO_CARP: From owner-svn-src-all@freebsd.org Mon Jul 31 19:51:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF82EDBC2FB; Mon, 31 Jul 2017 19:51:37 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 970F165F4F; Mon, 31 Jul 2017 19:51:37 +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 v6VJpaIg010745; Mon, 31 Jul 2017 19:51:36 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VJpawW010744; Mon, 31 Jul 2017 19:51:36 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201707311951.v6VJpawW010744@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 31 Jul 2017 19:51:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321812 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 321812 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 19:51:37 -0000 Author: bapt Date: Mon Jul 31 19:51:36 2017 New Revision: 321812 URL: https://svnweb.freebsd.org/changeset/base/321812 Log: Update pci_vendors to 2017.07.27 MFC after: 2 days Modified: head/share/misc/pci_vendors Modified: head/share/misc/pci_vendors ============================================================================== --- head/share/misc/pci_vendors Mon Jul 31 19:48:29 2017 (r321811) +++ head/share/misc/pci_vendors Mon Jul 31 19:51:36 2017 (r321812) @@ -3,8 +3,8 @@ # # List of PCI ID's # -# Version: 2017.07.13 -# Date: 2017-07-13 03:15:01 +# Version: 2017.07.27 +# Date: 2017-07-27 03:15:02 # # Maintained by Albert Pool, Martin Mares, and other volunteers from # the PCI ID Project at http://pci-ids.ucw.cz/. @@ -2436,7 +2436,7 @@ 144d c0c7 Radeon HD 7550M 6842 Thames LE [Radeon HD 7000M Series] 6843 Thames [Radeon HD 7670M] - 6863 Vega 10 [Radeon Vega Frontier Edition] + 6863 Vega 10 XTX [Radeon Vega Frontier Edition] 687f Vega [Radeon RX Vega] 6888 Cypress XT [FirePro V8800] 6889 Cypress PRO [FirePro V7800] @@ -2952,6 +2952,8 @@ 6987 Polaris12 6995 Lexa XT [Radeon PRO WX 2100] 699f Lexa PRO [Radeon RX 550] + 148c 2380 Lexa XL [Radeon RX 550] + 1da2 e367 Lexa PRO [Radeon RX 550] 700f RS100 AGP Bridge 7010 RS200/RS250 AGP Bridge 7100 R520 [Radeon X1800 XT] @@ -6026,11 +6028,12 @@ 1077 e4f4 FastLinQ QL45411H 40GbE Adapter 1644 FastLinQ QL45000 Series 100GbE Controller 1077 e4f8 FastLinQ QL45611H 100GbE Adapter + 1654 FastLinQ QL45000 Series 50GbE Controller + 1590 0223 Synergy 6810C 25/50Gb Ethernet Adapter 1656 FastLinQ QL45000 Series 25GbE Controller 1077 02a7 QL45212-DE 25GbE Adapter 1077 e4f6 FastLinQ QL45211H 25GbE Adapter 1077 e4f7 FastLinQ QL45212H 25GbE Adapter - 1590 0223 Synergy 6810C 25/50Gb Ethernet Adapter 165c FastLinQ QL45000 Series 40GbE Controller (FCoE) 1077 e4f1 FastLinQ QL45462H 40GbE FCoE Adapter 1077 e4f2 FastLinQ QL45461H 40GbE FCoE Adapter @@ -16128,6 +16131,8 @@ 50a0 T540-50A0 Unified Wire Ethernet Controller 50a1 T540-50A1 Unified Wire Ethernet Controller 50a2 T580-50A2 Unified Wire Ethernet Controller + 50a3 T580-50A3 Unified Wire Ethernet Controller + 50a4 T540-50A4 Unified Wire Ethernet Controller 5401 T520-CR Unified Wire Ethernet Controller 5402 T522-CR Unified Wire Ethernet Controller 5403 T540-CR Unified Wire Ethernet Controller @@ -16181,6 +16186,8 @@ 54a0 T540-50A0 Unified Wire Ethernet Controller 54a1 T540-50A1 Unified Wire Ethernet Controller 54a2 T580-50A2 Unified Wire Ethernet Controller + 54a3 T580-50A3 Unified Wire Ethernet Controller + 54a4 T540-50A4 Unified Wire Ethernet Controller 5501 T520-CR Unified Wire Storage Controller 5502 T522-CR Unified Wire Storage Controller 5503 T540-CR Unified Wire Storage Controller @@ -16234,6 +16241,8 @@ 55a0 T540-50A0 Unified Wire Storage Controller 55a1 T540-50A1 Unified Wire Storage Controller 55a2 T580-50A2 Unified Wire Storage Controller + 55a3 T580-50A3 Unified Wire Storage Controller + 55a4 T540-50A4 Unified Wire Storage Controller 5601 T520-CR Unified Wire Storage Controller 5602 T522-CR Unified Wire Storage Controller 5603 T540-CR Unified Wire Storage Controller @@ -16287,6 +16296,8 @@ 56a0 T540-50A0 Unified Wire Storage Controller 56a1 T540-50A1 Unified Wire Storage Controller 56a2 T580-50A2 Unified Wire Storage Controller + 56a3 T580-50A3 Unified Wire Storage Controller + 56a4 T540-50A4 Unified Wire Storage Controller 5701 T520-CR Unified Wire Ethernet Controller 5702 T522-CR Unified Wire Ethernet Controller 5703 T540-CR Unified Wire Ethernet Controller @@ -16379,6 +16390,8 @@ 58a0 T540-50A0 Unified Wire Ethernet Controller [VF] 58a1 T540-50A1 Unified Wire Ethernet Controller [VF] 58a2 T580-50A2 Unified Wire Ethernet Controller [VF] + 58a3 T580-50A3 Unified Wire Ethernet Controller [VF] + 58a4 T540-50A4 Unified Wire Ethernet Controller [VF] 6001 T6225-CR Unified Wire Ethernet Controller 6002 T6225-SO-CR Unified Wire Ethernet Controller 6003 T6425-CR Unified Wire Ethernet Controller @@ -16594,6 +16607,7 @@ e836 M115S Hybrid Analog/DVB PAL/SECAM/NTSC Tuner f436 AVerTV Hybrid+FM 1462 Micro-Star International Co., Ltd. [MSI] + aaf0 Radeon RX 580 Gaming X 8G 1463 Fast Corporation 1464 Interactive Circuits & Systems Ltd 1465 GN NETTEST Telecom DIV. @@ -19273,6 +19287,7 @@ 17d3 1880 ARC-1880 8/12/16/24 Port PCIe 2.0 to SAS/SATA 6Gb RAID Controller 17d3 1882 ARC-1882 8/12/16/24 Port PCIe 3.0 to SAS/SATA 6Gb RAID Controller 17d3 1883 ARC-1883 8/12/16/24 Port PCIe 3.0 to SAS/SATA 12Gb RAID Controller + 1884 ARC-1884 series PCIe 3.0 to SAS/SATA 12/6Gb RAID Controller # nee Neterion Inc., previously S2io Inc. 17d5 Exar Corp. 5731 Xframe 10-Gigabit Ethernet PCI-X @@ -19348,12 +19363,15 @@ 17e4 Sectra AB 0001 KK671 Cardbus encryption board 0002 KK672 Cardbus encryption board -17e6 Entropic Communications Inc. +# nee Entropic Communications Inc. +17e6 MaxLinear 0010 EN2010 [c.Link] MoCA Network Controller (Coax, PCI interface) 0011 EN2010 [c.Link] MoCA Network Controller (Coax, MPEG interface) 0021 EN2210 [c.Link] MoCA Network Controller (Coax) 0025 EN2510 [c.Link] MoCA Network Controller (Coax, PCIe interface) 0027 EN2710 [c.Link] MoCA 2.0 Network Controller (Coax, PCIe interface) + 3706 MoCA 2.0 Network Controller (Coax, PCIe interface) + 3711 MoCA 2.5 Network Controller (Coax, PCIe interface) 17ee Connect Components Ltd 17f2 Albatron Corp. 17f3 RDC Semiconductor, Inc. @@ -24631,6 +24649,7 @@ 24f3 Wireless 8260 # Snow Field Peak AC 8086 0010 Dual Band Wireless-AC 8260 + 8086 1010 Dual Band Wireless-AC 8260 24f4 Wireless 8260 # Snow Field Peak AC 8086 0030 Dual Band Wireless-AC 8260 From owner-svn-src-all@freebsd.org Mon Jul 31 20:15:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 260EFDBCA24; Mon, 31 Jul 2017 20:15:13 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E96DD66CC6; Mon, 31 Jul 2017 20:15:12 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6VKFC65019159; Mon, 31 Jul 2017 20:15:12 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VKFCUM019158; Mon, 31 Jul 2017 20:15:12 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201707312015.v6VKFCUM019158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 31 Jul 2017 20:15:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321814 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321814 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 20:15:13 -0000 Author: mjg Date: Mon Jul 31 20:15:11 2017 New Revision: 321814 URL: https://svnweb.freebsd.org/changeset/base/321814 Log: Add myself to the calendar. Prodded by: invisible peer pressure Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 19:58:49 2017 (r321813) +++ head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 20:15:11 2017 (r321814) @@ -233,6 +233,7 @@ 06/30 Guido van Rooij born in Best, Noord-Brabant, the Netherlands, 1965 06/30 Second quarter status reports are due on 07/15 07/01 Matthew Dillon born in San Francisco, California, United States, 1966 +07/01 Mateusz Guzik born in Nowy Targ, Poland, 1986 07/02 Mark Christopher Ovens born in Preston, Lancashire, United Kingdom, 1958 07/02 Vasil Venelinov Dimov born in Shumen, Bulgaria, 1982 07/04 Motoyuki Konno born in Musashino, Tokyo, Japan, 1969 From owner-svn-src-all@freebsd.org Mon Jul 31 20:35:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB6A1DBD1C9; Mon, 31 Jul 2017 20:35:46 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B8B89678D2; Mon, 31 Jul 2017 20:35:46 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 19A9A10AB01; Mon, 31 Jul 2017 16:35:39 -0400 (EDT) From: John Baldwin To: Andrew Gallatin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r321790 - head/sbin/sysctl Date: Mon, 31 Jul 2017 10:20:50 -0700 Message-ID: <2175723.Ple0o0TTz8@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201707311456.v6VEuZvT083622@repo.freebsd.org> References: <201707311456.v6VEuZvT083622@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); Mon, 31 Jul 2017 16:35:39 -0400 (EDT) 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 20:35:47 -0000 On Monday, July 31, 2017 02:56:35 PM Andrew Gallatin wrote: > Author: gallatin > Date: Mon Jul 31 14:56:35 2017 > New Revision: 321790 > URL: https://svnweb.freebsd.org/changeset/base/321790 > > Log: > Don't request CTLTYPE_OPAQUE if we can't print them. > > The intent is to skip expensive opaque sysctls like tcp_pcblist unless > they are explicitly requested. Sysctl nodes like this don't show up in > sysctl -a, but they do generate output that winds up being dropped, > unless the user specifically requested binary/hex output or opaques. > > This reduces the runtime of sysctl in many circumstances on a loaded > system. It also reduces the likelihood that simply gathering > diagnostics on a sick machine (stuck lock, etc) via sysctl -a might > push it over the edge into a total lockup. > > Reviewed by: jtl > Sponsored by: Netflix > Differential Revision: https://reviews.freebsd.org/D11461 > > Modified: > head/sbin/sysctl/sysctl.c > > Modified: head/sbin/sysctl/sysctl.c > ============================================================================== > --- head/sbin/sysctl/sysctl.c Mon Jul 31 14:53:03 2017 (r321789) > +++ head/sbin/sysctl/sysctl.c Mon Jul 31 14:56:35 2017 (r321790) > @@ -925,6 +925,32 @@ show_var(int *oid, int nlen) > printf("%s", buf); > return (0); > } > + > + /* don't fetch opaques that we don't know how to print */ > + if (ctltype == CTLTYPE_OPAQUE) { > + if (strcmp(fmt, "S,clockinfo") == 0) > + func = S_clockinfo; > + else if (strcmp(fmt, "S,timeval") == 0) > + func = S_timeval; > + else if (strcmp(fmt, "S,loadavg") == 0) > + func = S_loadavg; > + else if (strcmp(fmt, "S,vmtotal") == 0) > + func = S_vmtotal; > +#ifdef __amd64__ > + else if (strcmp(fmt, "S,efi_map_header") == 0) > + func = S_efi_map; > +#endif > +#if defined(__amd64__) || defined(__i386__) > + else if (strcmp(fmt, "S,bios_smap_xattr") == 0) > + func = S_bios_smap_xattr; > +#endif > + else { > + func = NULL; > + if (!bflag && !oflag && !xflag) > + return (1); > + } > + } > + > /* find an estimate of how much we need for this var */ > if (Bflag) > j = Bflag; > @@ -1045,24 +1071,6 @@ show_var(int *oid, int nlen) > > case CTLTYPE_OPAQUE: > i = 0; > - if (strcmp(fmt, "S,clockinfo") == 0) > - func = S_clockinfo; > - else if (strcmp(fmt, "S,timeval") == 0) > - func = S_timeval; > - else if (strcmp(fmt, "S,loadavg") == 0) > - func = S_loadavg; > - else if (strcmp(fmt, "S,vmtotal") == 0) > - func = S_vmtotal; > -#ifdef __amd64__ > - else if (strcmp(fmt, "S,efi_map_header") == 0) > - func = S_efi_map; > -#endif > -#if defined(__amd64__) || defined(__i386__) > - else if (strcmp(fmt, "S,bios_smap_xattr") == 0) > - func = S_bios_smap_xattr; > -#endif > - else > - func = NULL; > if (func) { func should always be true now? -- John Baldwin From owner-svn-src-all@freebsd.org Mon Jul 31 20:35:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEB31DBD1CE; Mon, 31 Jul 2017 20:35:48 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CE5B678D4; Mon, 31 Jul 2017 20:35:48 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 0149210AF01; Mon, 31 Jul 2017 16:35:42 -0400 (EDT) From: John Baldwin To: Alexander Motin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r321720 - head/sys/dev/ichwd Date: Mon, 31 Jul 2017 10:13:56 -0700 Message-ID: <21813108.1FpTYCymMM@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201707301519.v6UFJ7AT004183@repo.freebsd.org> References: <201707301519.v6UFJ7AT004183@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); Mon, 31 Jul 2017 16:35:42 -0400 (EDT) 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 20:35:48 -0000 On Sunday, July 30, 2017 03:19:07 PM Alexander Motin wrote: > Author: mav > Date: Sun Jul 30 15:19:07 2017 > New Revision: 321720 > URL: https://svnweb.freebsd.org/changeset/base/321720 > > Log: > Attach ichwd(4) only to ISA bus of the LPC bridge. > > Resource allocation for parent device does not look good by itself, but > attempt to allocate them for unrelated device just does not end up good. > On Asus X99-E WS/USB3.1 system reporting ISA bridge via both PCI and ACPI > this reported to cause kernel panic on shutdown due to messed resources: > https://bugs.freenas.org/issues/25237. > > MFC after: 1 week > > Modified: > head/sys/dev/ichwd/ichwd.c > > Modified: head/sys/dev/ichwd/ichwd.c > ============================================================================== > --- head/sys/dev/ichwd/ichwd.c Sun Jul 30 11:50:16 2017 (r321719) > +++ head/sys/dev/ichwd/ichwd.c Sun Jul 30 15:19:07 2017 (r321720) > @@ -533,23 +533,26 @@ ichwd_event(void *arg, unsigned int cmd, int *error) > } > > static device_t > -ichwd_find_ich_lpc_bridge(struct ichwd_device **id_p) > +ichwd_find_ich_lpc_bridge(device_t isa, struct ichwd_device **id_p) > { > struct ichwd_device *id; > - device_t ich = NULL; > + device_t isab; > + uint16_t devid; > > - /* look for an ICH LPC interface bridge */ > - for (id = ichwd_devices; id->desc != NULL; ++id) > - if ((ich = pci_find_device(VENDORID_INTEL, id->device)) != NULL) > - break; > - > - if (ich == NULL) > + /* Check whether parent ISA bridge looks familiar. */ > + isab = device_get_parent(isa); > + if (pci_get_vendor(isab) != VENDORID_INTEL) > return (NULL); You probably need to do slightly more work to verify that the isab device is a PCI child before you use pci_get_vendor(). I believe isa0 can be a child of legacy0 for example (though I doubt we run on such hardware without PCI anymore). Seeing if the devclass of device_get_parent(isab) == devclass_find("pci") would be sufficient. It might also be nice to add a 'device_is_pci()' helper function as I think we probably have a similar check in some other places. The general change is definitely an improvement though. -- John Baldwin From owner-svn-src-all@freebsd.org Mon Jul 31 20:41:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBAFDDBD608; Mon, 31 Jul 2017 20:41: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 mx1.freebsd.org (Postfix) with ESMTPS id B86AD681EA; Mon, 31 Jul 2017 20:41: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 v6VKfjUg031280; Mon, 31 Jul 2017 20:41:45 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VKfjw7031279; Mon, 31 Jul 2017 20:41:45 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201707312041.v6VKfjw7031279@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Mon, 31 Jul 2017 20:41:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321816 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 321816 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 20:41:47 -0000 Author: mckusick Date: Mon Jul 31 20:41:45 2017 New Revision: 321816 URL: https://svnweb.freebsd.org/changeset/base/321816 Log: Avoid reading a snapshot block when it is already in the cache. Update the use of the B_CACHE flag (since the May 1999 commit that made it the correct test here). Reported by: Andreas Longwitz Reviewed by: kib Tested by: Peter Holm MFC after: 1 week Modified: head/sys/ufs/ffs/ffs_snapshot.c Modified: head/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- head/sys/ufs/ffs/ffs_snapshot.c Mon Jul 31 20:28:26 2017 (r321815) +++ head/sys/ufs/ffs/ffs_snapshot.c Mon Jul 31 20:41:45 2017 (r321816) @@ -1394,7 +1394,7 @@ indiracct_ufs2(snapvp, cancelvp, level, blkno, lbn, rl */ bp = getblk(cancelvp, lbn, fs->fs_bsize, 0, 0, 0); bp->b_blkno = fsbtodb(fs, blkno); - if ((bp->b_flags & (B_DONE | B_DELWRI)) == 0 && + if ((bp->b_flags & B_CACHE) == 0 && (error = readblock(cancelvp, bp, fragstoblks(fs, blkno)))) { brelse(bp); return (error); From owner-svn-src-all@freebsd.org Mon Jul 31 20:54:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48466DBD7F3; Mon, 31 Jul 2017 20:54:25 +0000 (UTC) (envelope-from pawel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0831B6870D; Mon, 31 Jul 2017 20:54:24 +0000 (UTC) (envelope-from pawel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6VKsO9R035579; Mon, 31 Jul 2017 20:54:24 GMT (envelope-from pawel@FreeBSD.org) Received: (from pawel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VKsOBh035578; Mon, 31 Jul 2017 20:54:24 GMT (envelope-from pawel@FreeBSD.org) Message-Id: <201707312054.v6VKsOBh035578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pawel set sender to pawel@FreeBSD.org using -f From: Pawel Pekala Date: Mon, 31 Jul 2017 20:54:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321817 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: pawel X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321817 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 20:54:25 -0000 Author: pawel (ports committer) Date: Mon Jul 31 20:54:23 2017 New Revision: 321817 URL: https://svnweb.freebsd.org/changeset/base/321817 Log: Add myself to the calendar.freebsd Reported by: mckusick Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 20:41:45 2017 (r321816) +++ head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 20:54:23 2017 (r321817) @@ -188,6 +188,7 @@ 05/23 Munechika Sumikawa born in Osaka, Osaka, Japan, 1972 05/24 Duncan McLennan Barclay born in London, Middlesex, United Kingdom, 1970 05/24 Oliver Lehmann born in Karlsburg, Germany, 1981 +05/25 Pawel Pekala born in Swidnica, Poland, 1980 05/25 Tom Rhodes born in Ellwood City, Pennsylvania, United States, 1981 05/25 Roman Divacky born in Brno, Czech Republic, 1983 05/26 Jim Pirzyk born in Chicago, Illinois, United States, 1968 From owner-svn-src-all@freebsd.org Mon Jul 31 21:08:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7ED1DBDA51; Mon, 31 Jul 2017 21:08:32 +0000 (UTC) (envelope-from tcberner@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 79B5868C93; Mon, 31 Jul 2017 21:08:32 +0000 (UTC) (envelope-from tcberner@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6VL8V07039676; Mon, 31 Jul 2017 21:08:31 GMT (envelope-from tcberner@FreeBSD.org) Received: (from tcberner@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VL8VBr039675; Mon, 31 Jul 2017 21:08:31 GMT (envelope-from tcberner@FreeBSD.org) Message-Id: <201707312108.v6VL8VBr039675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tcberner set sender to tcberner@FreeBSD.org using -f From: "Tobias C. Berner" Date: Mon, 31 Jul 2017 21:08:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321818 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: tcberner X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321818 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 21:08:32 -0000 Author: tcberner (ports committer) Date: Mon Jul 31 21:08:31 2017 New Revision: 321818 URL: https://svnweb.freebsd.org/changeset/base/321818 Log: Add myself to the calendar.freebsd Reported by: mckusick Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 20:54:23 2017 (r321817) +++ head/usr.bin/calendar/calendars/calendar.freebsd Mon Jul 31 21:08:31 2017 (r321818) @@ -71,6 +71,7 @@ 02/14 Martin Blapp born in Olten, Switzerland, 1976 02/15 Hiren Panchasara born in Ahmedabad, Gujarat, India, 1984 02/16 Justin Hibbits born in Toledo, Ohio, United States, 1983 +02/16 Tobias Christian Berner born in Bern, Switzerland, 1985 02/19 Murray Stokely born in Jacksonville, Florida, United States, 1979 02/20 Anders Nordby born in Oslo, Norway, 1976 02/21 Alexey Zelkin born in Simferopol, Ukraine, 1978 From owner-svn-src-all@freebsd.org Mon Jul 31 21:34:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0579BDBE2DE; Mon, 31 Jul 2017 21:34:18 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-wr0-x236.google.com (mail-wr0-x236.google.com [IPv6:2a00:1450:400c:c0c::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8F2446996A; Mon, 31 Jul 2017 21:34:17 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-wr0-x236.google.com with SMTP id k71so130613617wrc.2; Mon, 31 Jul 2017 14:34:17 -0700 (PDT) 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=ePoEDXOTV4tNbUsk7KOdRiFYKh+Me4RvGtJ7HjMjmeg=; b=kRLkNmEYPgnj/W4BAoAMPKL5zpwk0L0UMih/nWyAMv2E8c5QUXLASygBS+YwqoefLF scUrEshfj+hKgBDuzEyeEzqRCiKhGr3DldQZNXaiE9Kh7SvhR+NifsAzE6kNl0M0MBwp jIoZwNJgxme/h1VJFylYryRYM6uUqR/ItQnJr21MX4xlkPN5xk7zC23RTOvxDMTnPNAD qMGslSaTzdQ9laugaglTgzbYb9y78PpEMQ5dMFgBswRfIrTxN41GYUC6KhbYhZYp/kTM +f6Z1sHKWkLk/+XsUYC5a7yq1aHXvPxxwRLdlg/d0ceE7DBz0q5c+fCk4uWsi3GY7RYU FNmw== 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=ePoEDXOTV4tNbUsk7KOdRiFYKh+Me4RvGtJ7HjMjmeg=; b=X79DuK/PZo70T2vBozVYiIr9BRPNrP9p2oRfuzcdAJUymJXkxc4BSQl5JryouaGvdO gLJfgdMLHT6eqcRWxKCDbul9MKCmbYFsJB+D2/jqQYFqCXGRAnoB93nCmW9vlBMZgLXt z5LTTkNPNpIzLAHRprqarZnJ2UUuY6D1hbbdc35wJUFKAHlK8PUzaTUhlF8cOLFyNxkK Th3/f5I74FXjhXtyVAoE3RwzZsLBgNy7hSoBDIgKgCi7YiJwp56Dqduzac8fEYpUJgM4 1ipz0q+4TDMHWrIBxkGIYSlEc3i/SyykQTwWc5YBWfYpbZAs5/1+TsouHdIzt/sZ5Hyh UmBw== X-Gm-Message-State: AIVw111CWAPnl3Ud1Xd1vls16NJSHdwZRmY6VZu/mfRI3EFzXjAA6xiT fLvFpqU3gtW0/qUCWkbIOqxCMHsZ72ns X-Received: by 10.223.174.209 with SMTP id y75mr12381378wrc.19.1501536855005; Mon, 31 Jul 2017 14:34:15 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.28.208.3 with HTTP; Mon, 31 Jul 2017 14:34:14 -0700 (PDT) In-Reply-To: <201707172112.v6HLC2In057796@repo.freebsd.org> References: <201707172112.v6HLC2In057796@repo.freebsd.org> From: Alan Somers Date: Mon, 31 Jul 2017 15:34:14 -0600 X-Google-Sender-Auth: 51n7hh27qLUN5-gSsD8UMUSzeX4 Message-ID: Subject: Re: svn commit: r321093 - in stable/10: bin/ln bin/ln/tests etc/mtree To: Ngie Cooper 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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 21:34:18 -0000 On Mon, Jul 17, 2017 at 3:12 PM, Ngie Cooper wrote: > Author: ngie > Date: Mon Jul 17 21:12:02 2017 > New Revision: 321093 > URL: https://svnweb.freebsd.org/changeset/base/321093 > > Log: > MFC r319857: > > ln(1): wordsmith -F option description > > Added: > stable/10/bin/ln/tests/ > - copied from r319714, head/bin/ln/tests/ > Modified: > stable/10/bin/ln/Makefile > stable/10/etc/mtree/BSD.tests.dist > Directory Properties: > stable/10/ (props changed) It looks like the commit message for this one was wrong, though the merge tracking info is correct. The commit message should've read: MFC r319714: Add tests for ln(1) * Verify that when creating a hard link to a symbolic link, '-L' option creates a hard link to the target of the symbolic link * Verify that when creating a hard link to a symbolic link, '-P' option creates a hard link to the symbolic link itself * Verify that if the target file already exists, '-f' option unlinks it so that link may occur * Verify that if the target file or directory is a symbolic link, '-shf' option prevents following the link * Verify that if the target file or directory is a symbolic link, '-snf' option prevents following the link * Verify that '-s' option creates a symbolic link * Verify that '-w' option produces a warning if the source of a symbolic link does not currently exist Submitted by: shivansh Reviewed by: asomers, ngie MFC after: 1 month Sponsored by: Google, Inc (GSoC 2017) Differential Revision: https://reviews.freebsd.org/D11084 From owner-svn-src-all@freebsd.org Mon Jul 31 21:42:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 020D7DBE75A; Mon, 31 Jul 2017 21:42:20 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE94169FAC; Mon, 31 Jul 2017 21:42:19 +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 v6VLgIuj055692; Mon, 31 Jul 2017 21:42:18 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VLgIX5055691; Mon, 31 Jul 2017 21:42:18 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201707312142.v6VLgIX5055691@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 31 Jul 2017 21:42:18 +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: r321819 - stable/10/bin/ln/tests X-SVN-Group: stable-10 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/10/bin/ln/tests X-SVN-Commit-Revision: 321819 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 21:42:20 -0000 Author: asomers Date: Mon Jul 31 21:42:18 2017 New Revision: 321819 URL: https://svnweb.freebsd.org/changeset/base/321819 Log: MFC r319854: bin/ln: Set umask appropriately before creating files for testing These changes were missed in D11084 Submitted by: shivansh Reviewed by: asomers X-MFC-With: 319714 Sponsored by: Google, Inc (GSoC 2017) Differential Revision: https://reviews.freebsd.org/D11158 Modified: stable/10/bin/ln/tests/ln_test.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/ln/tests/ln_test.sh ============================================================================== --- stable/10/bin/ln/tests/ln_test.sh Mon Jul 31 21:08:31 2017 (r321818) +++ stable/10/bin/ln/tests/ln_test.sh Mon Jul 31 21:42:18 2017 (r321819) @@ -98,6 +98,7 @@ target_exists_hard_head() target_exists_hard_body() { + set_umask atf_check touch A B atf_check -s exit:1 -e inline:'ln: B: File exists\n' \ ln A B @@ -112,6 +113,7 @@ target_exists_symbolic_head() target_exists_symbolic_body() { + set_umask atf_check touch A B atf_check -s exit:1 -e inline:'ln: B: File exists\n' \ ln -s A B @@ -171,6 +173,7 @@ sf_flag_head() sf_flag_body() { + set_umask atf_check touch A B atf_check ln -sf A B atf_check -o inline:'B: symbolic link to A\n' file B From owner-svn-src-all@freebsd.org Mon Jul 31 21:52:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B85E9DBE9C6; Mon, 31 Jul 2017 21:52:09 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 877F36A549; Mon, 31 Jul 2017 21:52:09 +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 v6VLq8N5060071; Mon, 31 Jul 2017 21:52:08 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VLq8P3060070; Mon, 31 Jul 2017 21:52:08 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201707312152.v6VLq8P3060070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 31 Jul 2017 21:52:08 +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: r321820 - stable/10/usr.sbin/makefs/tests X-SVN-Group: stable-10 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/10/usr.sbin/makefs/tests X-SVN-Commit-Revision: 321820 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 21:52:09 -0000 Author: asomers Date: Mon Jul 31 21:52:08 2017 New Revision: 321820 URL: https://svnweb.freebsd.org/changeset/base/321820 Log: MFC r320163: Fix usr.sbin/makefs/makefs_ffs_tests when /etc/fstab does not exist dumpfs prints a harmless warning message (via ufs_disk_fillout(3) and getfsfile(3)), when /etc/fstab does not exist. We can ignore it. PR: 220165 Reported by: gjb Sponsored by: Spectra Logic Corp Modified: stable/10/usr.sbin/makefs/tests/makefs_ffs_tests.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/makefs/tests/makefs_ffs_tests.sh ============================================================================== --- stable/10/usr.sbin/makefs/tests/makefs_ffs_tests.sh Mon Jul 31 21:42:18 2017 (r321819) +++ stable/10/usr.sbin/makefs/tests/makefs_ffs_tests.sh Mon Jul 31 21:52:08 2017 (r321820) @@ -182,7 +182,7 @@ o_flag_version_1_body() $MAKEFS -M 1m -o version=$ffs_version $TEST_IMAGE $TEST_INPUTS_DIR mount_image - atf_check -e empty -o match:"$ffs_label" dumpfs $TEST_MOUNT_DIR + atf_check -e ignore -o match:"$ffs_label" dumpfs $TEST_MOUNT_DIR check_ffs_image_contents } o_flag_version_1_cleanup() @@ -214,7 +214,7 @@ o_flag_version_2_body() $MAKEFS -M 1m -o version=$ffs_version $TEST_IMAGE $TEST_INPUTS_DIR mount_image - atf_check -e empty -o match:"$ffs_label" dumpfs $TEST_MOUNT_DIR + atf_check -e ignore -o match:"$ffs_label" dumpfs $TEST_MOUNT_DIR check_ffs_image_contents } o_flag_version_2_cleanup() From owner-svn-src-all@freebsd.org Mon Jul 31 21:53:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E170CDBEB59; Mon, 31 Jul 2017 21:53:01 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AEF366A7B6; Mon, 31 Jul 2017 21:53:01 +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 v6VLr0ll060161; Mon, 31 Jul 2017 21:53:00 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VLr0cm060160; Mon, 31 Jul 2017 21:53:00 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201707312153.v6VLr0cm060160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 31 Jul 2017 21:53:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321821 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 321821 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 21:53:02 -0000 Author: ian Date: Mon Jul 31 21:53:00 2017 New Revision: 321821 URL: https://svnweb.freebsd.org/changeset/base/321821 Log: No need to call getnanotime() now that the waiting is done by the central subr_rtc code, switch from CLOCKF_SETTIME_NO_TS to CLOCKF_SETTIME_NO_ADJ so that we get fed a timestamp, but it's not adjusted to compensate for inaccuracy in setting time. Modified: head/sys/dev/iicbus/ds1307.c Modified: head/sys/dev/iicbus/ds1307.c ============================================================================== --- head/sys/dev/iicbus/ds1307.c Mon Jul 31 21:52:08 2017 (r321820) +++ head/sys/dev/iicbus/ds1307.c Mon Jul 31 21:53:00 2017 (r321821) @@ -303,12 +303,12 @@ ds1307_start(void *xdev) CTLFLAG_RW | CTLTYPE_UINT | CTLFLAG_MPSAFE, sc, 0, ds1307_sqw_out_sysctl, "IU", "DS1307 square-wave output state"); - /* - * Register as a clock with 1 second resolution. Schedule the - * clock_settime() method to be called just after top-of-second; - * resetting the time resets top-of-second in the hardware. - */ - clock_register_flags(dev, 1000000, CLOCKF_SETTIME_NO_TS); + /* + * Register as a clock with 1 second resolution. Schedule the + * clock_settime() method to be called just after top-of-second; + * resetting the time resets top-of-second in the hardware. + */ + clock_register_flags(dev, 1000000, CLOCKF_SETTIME_NO_ADJ); clock_schedule(dev, 1); } @@ -368,6 +368,13 @@ ds1307_settime(device_t dev, struct timespec *ts) sc = device_get_softc(dev); + /* + * We request a timespec with no resolution-adjustment. That also + * disables utc adjustment, so apply that ourselves. + */ + ts->tv_sec -= utc_offset(); + clock_ts_to_ct(ts, &ct); + /* If the chip is in AM/PM mode, adjust hour and set flags as needed. */ if (sc->sc_use_ampm) { pmflags = DS1307_HOUR_USE_AMPM; @@ -379,10 +386,6 @@ ds1307_settime(device_t dev, struct timespec *ts) ct.hour = 12; } else pmflags = 0; - - getnanotime(ts); - ts->tv_sec -= utc_offset(); - clock_ts_to_ct(ts, &ct); data[DS1307_SECS] = TOBCD(ct.sec); data[DS1307_MINS] = TOBCD(ct.min); From owner-svn-src-all@freebsd.org Mon Jul 31 22:00:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3EA4DBEC17; Mon, 31 Jul 2017 22:00:01 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE0F86AA4E; Mon, 31 Jul 2017 22:00:01 +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 v6VM00HU060554; Mon, 31 Jul 2017 22:00:00 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VM00U9060552; Mon, 31 Jul 2017 22:00:00 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201707312200.v6VM00U9060552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 31 Jul 2017 22:00:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321823 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 321823 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 22:00:02 -0000 Author: ian Date: Mon Jul 31 22:00:00 2017 New Revision: 321823 URL: https://svnweb.freebsd.org/changeset/base/321823 Log: Bugfixes and enhancements... Don't enable the oscillator when it is found to be stopped at init time, just let the first setting of valid time start it. But still report a dead battery if it's stopped at init time. Don't force the chip into 24hr mode, just cope with whatever mode it is already in. Schedule the clock_settime() callbacks to align the RTC clock to top of second when setting it. Modified: head/sys/dev/iicbus/ds3231.c head/sys/dev/iicbus/ds3231reg.h Modified: head/sys/dev/iicbus/ds3231.c ============================================================================== --- head/sys/dev/iicbus/ds3231.c Mon Jul 31 21:59:06 2017 (r321822) +++ head/sys/dev/iicbus/ds3231.c Mon Jul 31 22:00:00 2017 (r321823) @@ -62,6 +62,7 @@ struct ds3231_softc { uint16_t sc_addr; /* DS3231 slave address. */ uint8_t sc_ctrl; uint8_t sc_status; + bool sc_use_ampm; }; static void ds3231_start(void *); @@ -141,25 +142,6 @@ ds3231_status_write(struct ds3231_softc *sc, int clear } static int -ds3231_set_24hrs_mode(struct ds3231_softc *sc) -{ - int error; - uint8_t hour; - - error = ds3231_read1(sc->sc_dev, DS3231_HOUR, &hour); - if (error) { - device_printf(sc->sc_dev, "cannot read from RTC.\n"); - return (error); - } - hour &= ~DS3231_C_MASK; - error = ds3231_write1(sc->sc_dev, DS3231_HOUR, hour); - if (error != 0) - device_printf(sc->sc_dev, "cannot write to RTC.\n"); - - return (error); -} - -static int ds3231_temp_read(struct ds3231_softc *sc, int *temp) { int error, neg, t; @@ -437,20 +419,20 @@ ds3231_start(void *xdev) return; if (ds3231_status_read(sc) != 0) return; - /* Clear the OSF bit and ack any pending alarm interrupt. */ + /* + * Warn if the clock stopped, but don't restart it until the first + * clock_settime() call. + */ if (sc->sc_status & DS3231_STATUS_OSF) { device_printf(sc->sc_dev, - "oscillator has stopped, check the battery.\n"); - sc->sc_status &= ~DS3231_STATUS_OSF; + "WARNING: RTC clock stopped, check the battery.\n"); } + /* Ack any pending alarm interrupt. */ if (ds3231_status_write(sc, 1, 1) != 0) return; /* Always enable the oscillator. */ if (ds3231_ctrl_write(sc) != 0) return; - /* Set the 24 hours mode. */ - if (ds3231_set_24hrs_mode(sc) != 0) - return; /* Temperature. */ SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "temperature", @@ -476,8 +458,13 @@ ds3231_start(void *xdev) CTLFLAG_RW | CTLTYPE_UINT | CTLFLAG_MPSAFE, sc, 0, ds3231_en32khz_sysctl, "IU", "DS3231 enable the 32kHz output"); - /* 1 second resolution. */ - clock_register(dev, 1000000); + /* + * Register as a clock with 1 second resolution. Schedule the + * clock_settime() method to be called just after top-of-second; + * resetting the time resets top-of-second in the hardware. + */ + clock_register_flags(dev, 1000000, CLOCKF_SETTIME_NO_ADJ); + clock_schedule(dev, 1); } static int @@ -486,24 +473,45 @@ ds3231_gettime(device_t dev, struct timespec *ts) int c, error; struct clocktime ct; struct ds3231_softc *sc; - uint8_t data[7]; + uint8_t data[7], hourmask; sc = device_get_softc(dev); - memset(data, 0, sizeof(data)); + + /* If the clock halted, we don't have good data. */ + if ((error = ds3231_status_read(sc)) != 0) { + device_printf(dev, "cannot read from RTC.\n"); + return (error); + } + if (sc->sc_status & DS3231_STATUS_OSF) + return (EINVAL); + error = iicdev_readfrom(sc->sc_dev, DS3231_SECS, data, sizeof(data), IIC_INTRWAIT); if (error != 0) { device_printf(dev, "cannot read from RTC.\n"); return (error); } + + /* If chip is in AM/PM mode remember that. */ + if (data[DS3231_HOUR] & DS3231_HOUR_USE_AMPM) { + sc->sc_use_ampm = true; + hourmask = DS3231_HOUR_MASK_12HR; + } else + hourmask = DS3231_HOUR_MASK_24HR; + ct.nsec = 0; - ct.sec = FROMBCD(data[DS3231_SECS] & DS3231_SECS_MASK); - ct.min = FROMBCD(data[DS3231_MINS] & DS3231_MINS_MASK); - ct.hour = FROMBCD(data[DS3231_HOUR] & DS3231_HOUR_MASK); - ct.day = FROMBCD(data[DS3231_DATE] & DS3231_DATE_MASK); - ct.dow = data[DS3231_WEEKDAY] & DS3231_WEEKDAY_MASK; - ct.mon = FROMBCD(data[DS3231_MONTH] & DS3231_MONTH_MASK); - ct.year = FROMBCD(data[DS3231_YEAR] & DS3231_YEAR_MASK); + ct.sec = FROMBCD(data[DS3231_SECS] & DS3231_SECS_MASK); + ct.min = FROMBCD(data[DS3231_MINS] & DS3231_MINS_MASK); + ct.hour = FROMBCD(data[DS3231_HOUR] & hourmask); + ct.day = FROMBCD(data[DS3231_DATE] & DS3231_DATE_MASK); + ct.mon = FROMBCD(data[DS3231_MONTH] & DS3231_MONTH_MASK); + ct.year = FROMBCD(data[DS3231_YEAR] & DS3231_YEAR_MASK); + + /* + * If the century flag has toggled since we last saw it, there has been + * a century rollover. If this is the first time we're seeing it, + * remember the state so we can preserve its polarity on writes. + */ c = (data[DS3231_MONTH] & DS3231_C_MASK) ? 1 : 0; if (sc->sc_last_c == -1) sc->sc_last_c = c; @@ -515,6 +523,14 @@ ds3231_gettime(device_t dev, struct timespec *ts) if (ct.year < POSIX_BASE_YEAR) ct.year += 100; /* assume [1970, 2069] */ + /* If running in AM/PM mode, deal with it. */ + if (sc->sc_use_ampm) { + if (ct.hour == 12) + ct.hour = 0; + if (data[DS3231_HOUR] & DS3231_HOUR_IS_PM) + ct.hour += 12; + } + return (clock_ct_to_ts(&ct, ts)); } @@ -525,28 +541,62 @@ ds3231_settime(device_t dev, struct timespec *ts) struct clocktime ct; struct ds3231_softc *sc; uint8_t data[7]; + uint8_t pmflags; sc = device_get_softc(dev); - /* Accuracy is only one second. */ - if (ts->tv_nsec >= 500000000) - ts->tv_sec++; - ts->tv_nsec = 0; + + /* + * We request a timespec with no resolution-adjustment. That also + * disables utc adjustment, so apply that ourselves. + */ + ts->tv_sec -= utc_offset(); clock_ts_to_ct(ts, &ct); - memset(data, 0, sizeof(data)); - data[DS3231_SECS] = TOBCD(ct.sec); - data[DS3231_MINS] = TOBCD(ct.min); - data[DS3231_HOUR] = TOBCD(ct.hour); - data[DS3231_DATE] = TOBCD(ct.day); + + /* If the chip is in AM/PM mode, adjust hour and set flags as needed. */ + if (sc->sc_use_ampm) { + pmflags = DS3231_HOUR_USE_AMPM; + if (ct.hour >= 12) { + ct.hour -= 12; + pmflags |= DS3231_HOUR_IS_PM; + } + if (ct.hour == 0) + ct.hour = 12; + } else + pmflags = 0; + + data[DS3231_SECS] = TOBCD(ct.sec); + data[DS3231_MINS] = TOBCD(ct.min); + data[DS3231_HOUR] = TOBCD(ct.hour) | pmflags; + data[DS3231_DATE] = TOBCD(ct.day); data[DS3231_WEEKDAY] = ct.dow; - data[DS3231_MONTH] = TOBCD(ct.mon); - data[DS3231_YEAR] = TOBCD(ct.year % 100); + data[DS3231_MONTH] = TOBCD(ct.mon); + data[DS3231_YEAR] = TOBCD(ct.year % 100); if (sc->sc_last_c) data[DS3231_MONTH] |= DS3231_C_MASK; + /* Write the time back to RTC. */ error = iicdev_writeto(dev, DS3231_SECS, data, sizeof(data), IIC_INTRWAIT); - if (error != 0) + if (error != 0) { device_printf(dev, "cannot write to RTC.\n"); + return (error); + } + + /* + * Unlike most hardware, the osc-was-stopped bit does not clear itself + * after setting the time, it has to be manually written to zero. + */ + if (sc->sc_status & DS3231_STATUS_OSF) { + if ((error = ds3231_status_read(sc)) != 0) { + device_printf(dev, "cannot read from RTC.\n"); + return (error); + } + sc->sc_status &= ~DS3231_STATUS_OSF; + if ((error = ds3231_status_write(sc, 0, 0)) != 0) { + device_printf(dev, "cannot write to RTC.\n"); + return (error); + } + } return (error); } Modified: head/sys/dev/iicbus/ds3231reg.h ============================================================================== --- head/sys/dev/iicbus/ds3231reg.h Mon Jul 31 21:59:06 2017 (r321822) +++ head/sys/dev/iicbus/ds3231reg.h Mon Jul 31 22:00:00 2017 (r321823) @@ -38,7 +38,10 @@ #define DS3231_MINS 0x01 #define DS3231_MINS_MASK 0x7f #define DS3231_HOUR 0x02 -#define DS3231_HOUR_MASK 0x3f +#define DS3231_HOUR_MASK_12HR 0x3f +#define DS3231_HOUR_MASK_24HR 0x1f +#define DS3231_HOUR_IS_PM 0x20 +#define DS3231_HOUR_USE_AMPM 0x40 #define DS3231_WEEKDAY 0x03 #define DS3231_WEEKDAY_MASK 0x07 #define DS3231_DATE 0x04 From owner-svn-src-all@freebsd.org Mon Jul 31 22:00:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AFC9DBEC90; Mon, 31 Jul 2017 22:00:28 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39EB06AB96; Mon, 31 Jul 2017 22:00:28 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6VM0REw060610; Mon, 31 Jul 2017 22:00:27 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VM0R19060609; Mon, 31 Jul 2017 22:00:27 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201707312200.v6VM0R19060609@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 31 Jul 2017 22:00:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321824 - head/tests/sys/file X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/tests/sys/file X-SVN-Commit-Revision: 321824 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 22:00:28 -0000 Author: bdrewery Date: Mon Jul 31 22:00:27 2017 New Revision: 321824 URL: https://svnweb.freebsd.org/changeset/base/321824 Log: Allow changing the test PORT at compile-time. Sponsored by: Dell EMC Isilon Modified: head/tests/sys/file/newfileops_on_fork_test.c Modified: head/tests/sys/file/newfileops_on_fork_test.c ============================================================================== --- head/tests/sys/file/newfileops_on_fork_test.c Mon Jul 31 22:00:00 2017 (r321823) +++ head/tests/sys/file/newfileops_on_fork_test.c Mon Jul 31 22:00:27 2017 (r321824) @@ -50,7 +50,9 @@ #include #include +#ifndef PORT #define PORT 9000 +#endif static int listen_fd; From owner-svn-src-all@freebsd.org Mon Jul 31 22:01:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A15E6DBECF3; Mon, 31 Jul 2017 22:01:05 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x232.google.com (mail-pf0-x232.google.com [IPv6:2607:f8b0:400e:c00::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D6F56AD36; Mon, 31 Jul 2017 22:01:05 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x232.google.com with SMTP id d67so58128939pfc.0; Mon, 31 Jul 2017 15:01:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=RCeU0MuR7n4GeD552nL/gPI8l4ninCavuIfj7EMHIn4=; b=lbOvWU8ZYqMWVHlzdt72W+NcOf6+Xh0TZMD9G0bT004AmC0hE+HDVsszCUxFjiBiSd t4XFEXb/6d9UVTIMgLjNc8fWY1lJF8gz8Me4Jq6Btrrs86UZB7b0JggJFtd3bq8JMJZY F/QX1ZjzLIW/zYsVxI4HXDQ2woPjcEsHuQezulI0XHHqmgLBOFbiEXhCgbWMM26jFyhJ k+uYE7oWjJYG8J01V0CdNs6me2U65Nr3wEmet6TT4gQsBlulKLAblcij0TlWP7adpZJR HD6ZPqxEILTKjMBf+bkp7nVDpel46zUfLTJouLKo53TUk6RZLkwu/CYsJPFj2vFdaeLF BP9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=RCeU0MuR7n4GeD552nL/gPI8l4ninCavuIfj7EMHIn4=; b=bV1ZI/pEysVM47uLH3ooP8PMI+TNWz4d43FHxrqLXstBTq1uriVdjlccGzUjMj+MK6 v8/zOyEevaL2pofXTt/YUfUZsNdGaFUyjP0KU119/vKT8vcxlMHRonK3p4PXYj+Hu8nG tGxRTbbYOJ2wJDGZfjQvnInWOFGhBMYyjqDauaqa2OJreNg9mpSLXhTNpBT4592tt1ks MDlI8JCadyWzXpPTmgaJpOFBCrtbCVSfuHFyqs6f7XFwNrDU3QtxF0ZrjYIQDYbWsNeB E5SaqugFz3SkFFz77tgSi4ekPs2tYpyiPwbHPHbLXBThFt0TzCptCJCTxGgzeV1L27bP M2mA== X-Gm-Message-State: AIVw112B59lB1Ruhj42LwseetW4IGIY4WpUN9pLjlIN4I57N0fxx2VOR J+NO06IY+6nnMLJzmDw= X-Received: by 10.84.229.8 with SMTP id b8mr18004421plk.93.1501538464689; Mon, 31 Jul 2017 15:01:04 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id v9sm68876486pge.26.2017.07.31.15.01.03 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 31 Jul 2017 15:01:03 -0700 (PDT) Subject: Re: svn commit: r321824 - head/tests/sys/file Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_DF4AEF59-FC31-49E5-A956-59AD01EC9F47"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201707312200.v6VM0R19060609@repo.freebsd.org> Date: Mon, 31 Jul 2017 15:01:01 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201707312200.v6VM0R19060609@repo.freebsd.org> To: Bryan Drewery X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 22:01:05 -0000 --Apple-Mail=_DF4AEF59-FC31-49E5-A956-59AD01EC9F47 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii > On Jul 31, 2017, at 15:00, Bryan Drewery wrote: > > Author: bdrewery > Date: Mon Jul 31 22:00:27 2017 > New Revision: 321824 > URL: https://svnweb.freebsd.org/changeset/base/321824 > > Log: > Allow changing the test PORT at compile-time. > > Sponsored by: Dell EMC Isilon MFC after? --Apple-Mail=_DF4AEF59-FC31-49E5-A956-59AD01EC9F47 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZf6ieAAoJEPWDqSZpMIYVbLkP/1lt4k9EnxVN5KJxC4fgqW05 8+GbMdJ0Z0kZDJl/36QC8RuiCBtXJCSWnRYJjv7aGKVd+rINVHzAN8OMRDq+QUl3 XWp66vRM2nUsZGGaxN7q4umF7HM+oJ8XNfTkL5XXInZ03ChVvHA6Ln4j8+6Qwu3h VQ/HLuNIM2UrPvLxeehfb6Aa4/qhpVhIobZBf0qfdFhT8mRNhKdFBaTGVnIagF5P kOfqLtv11a0fUxLvYqdQHlqp1DE8AB9N6zq83/ID6C4bcmaqJ5U/fcaZrmOZol2j zVncJ1hz1Q1v5IB6wcV/MT1zv2e5UROKR3mBKDUjA1fwWyVrTTREJlDGJyJwTcI2 XQ3Vn41xf2g9YP79dPFwES39i6TEmgDsY2tagfgETlWJoDLOI+IcnHlMhPjdH/di GkfTq/BsbIjXUKNJ6c69cN0KtXdHBaUD/De0LjVtXR4s3KeN4UoLnIi9VX8Y+KTw Ui2VpcyurIVkW9et+ZEP7PZUZbNBUIZeDXfbAI9ZKc3rj7wWpZ8wFrRCE3FIhyJG pVZYtgdp/VnU2SRi/90IuJnIJzwcWPK3H9Vzjxwn10BNgafkj7a2P5ahf8q5oGYg w+GLjlaDENqtmY9HpFDdo3PVo10zuYBNKIlHdCAYaysGPahBbXFnk8WoralabDER YauacuPiSnSWhArbdEPU =+LZs -----END PGP SIGNATURE----- --Apple-Mail=_DF4AEF59-FC31-49E5-A956-59AD01EC9F47-- From owner-svn-src-all@freebsd.org Mon Jul 31 22:19:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE646DBF0A0; Mon, 31 Jul 2017 22:19:40 +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 mx1.freebsd.org (Postfix) with ESMTPS id BC1D26B685; Mon, 31 Jul 2017 22:19:40 +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 v6VMJdFK069077; Mon, 31 Jul 2017 22:19:39 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VMJdAl069073; Mon, 31 Jul 2017 22:19:39 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201707312219.v6VMJdAl069073@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Mon, 31 Jul 2017 22:19:39 +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: r321825 - in stable/10: . gnu/usr.bin/groff/tmac lib/clang sys/conf X-SVN-Group: stable-10 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: in stable/10: . gnu/usr.bin/groff/tmac lib/clang sys/conf X-SVN-Commit-Revision: 321825 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 22:19:41 -0000 Author: marius Date: Mon Jul 31 22:19:39 2017 New Revision: 321825 URL: https://svnweb.freebsd.org/changeset/base/321825 Log: Update stable/10 from 10.3-STABLE to 10.4-PRERELEASE as part of the 10.4 release cycle, also belatedly marking the official start of the code slush. Set the default mdoc(7) version to 10.4, and update the clang(1) TARGET_TRIPLE to reflect 10.4. While at it, add missing FreeBSD major versions to mdoc(7). Approved by: re (implicit) Modified: stable/10/Makefile.inc1 stable/10/gnu/usr.bin/groff/tmac/mdoc.local.in stable/10/lib/clang/clang.build.mk stable/10/sys/conf/newvers.sh Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Mon Jul 31 22:00:27 2017 (r321824) +++ stable/10/Makefile.inc1 Mon Jul 31 22:19:39 2017 (r321825) @@ -359,7 +359,7 @@ TARGET_ABI= gnueabi .else TARGET_ABI= unknown .endif -TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd10.0 +TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd10.4 XFLAGS+= -target ${TARGET_TRIPLE} .endif .endif Modified: stable/10/gnu/usr.bin/groff/tmac/mdoc.local.in ============================================================================== --- stable/10/gnu/usr.bin/groff/tmac/mdoc.local.in Mon Jul 31 22:00:27 2017 (r321824) +++ stable/10/gnu/usr.bin/groff/tmac/mdoc.local.in Mon Jul 31 22:19:39 2017 (r321825) @@ -50,7 +50,7 @@ .ds doc-str-Lb-libstdthreads C11 Threads Library (libstdthreads, \-lstdthreads) . .\" Default .Os value -.ds doc-default-operating-system FreeBSD\~10.3 +.ds doc-default-operating-system FreeBSD\~10.4 . .\" FreeBSD releases not found in doc-common .ds doc-operating-system-FreeBSD-7.4 7.4 @@ -63,7 +63,9 @@ .ds doc-operating-system-FreeBSD-10.1 10.1 .ds doc-operating-system-FreeBSD-10.2 10.2 .ds doc-operating-system-FreeBSD-10.3 10.3 +.ds doc-operating-system-FreeBSD-10.4 10.4 .ds doc-operating-system-FreeBSD-11.0 11.0 +.ds doc-operating-system-FreeBSD-11.1 11.1 . .\" Definitions for other *BSDs not (yet) in doc-common .ds doc-operating-system-NetBSD-7.0 7.0 Modified: stable/10/lib/clang/clang.build.mk ============================================================================== --- stable/10/lib/clang/clang.build.mk Mon Jul 31 22:00:27 2017 (r321824) +++ stable/10/lib/clang/clang.build.mk Mon Jul 31 22:19:39 2017 (r321825) @@ -27,8 +27,8 @@ TARGET_ABI= gnueabi TARGET_ABI= unknown .endif -TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd10.3 -BUILD_TRIPLE?= ${BUILD_ARCH:C/amd64/x86_64/}-unknown-freebsd10.3 +TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd10.4 +BUILD_TRIPLE?= ${BUILD_ARCH:C/amd64/x86_64/}-unknown-freebsd10.4 CFLAGS+= -DLLVM_DEFAULT_TARGET_TRIPLE=\"${TARGET_TRIPLE}\" \ -DLLVM_HOST_TRIPLE=\"${BUILD_TRIPLE}\" \ -DDEFAULT_SYSROOT=\"${TOOLS_PREFIX}\" Modified: stable/10/sys/conf/newvers.sh ============================================================================== --- stable/10/sys/conf/newvers.sh Mon Jul 31 22:00:27 2017 (r321824) +++ stable/10/sys/conf/newvers.sh Mon Jul 31 22:19:39 2017 (r321825) @@ -31,8 +31,8 @@ # $FreeBSD$ TYPE="FreeBSD" -REVISION="10.3" -BRANCH="STABLE" +REVISION="10.4" +BRANCH="PRERELEASE" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Mon Jul 31 22:26:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AB18DBF2B3; Mon, 31 Jul 2017 22:26:31 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 53C0E6BCD0; Mon, 31 Jul 2017 22:26:31 +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 v6VMQUop073098; Mon, 31 Jul 2017 22:26:30 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VMQUtS073097; Mon, 31 Jul 2017 22:26:30 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201707312226.v6VMQUtS073097@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 31 Jul 2017 22:26:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321826 - head/sys/modules/i2c X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/modules/i2c X-SVN-Commit-Revision: 321826 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 22:26:31 -0000 Author: ian Date: Mon Jul 31 22:26:30 2017 New Revision: 321826 URL: https://svnweb.freebsd.org/changeset/base/321826 Log: Restructure the SUBDIR list as 1-per-line and alphabetize, so it will be easier to add new things (and see what changed) in the future. Modified: head/sys/modules/i2c/Makefile Modified: head/sys/modules/i2c/Makefile ============================================================================== --- head/sys/modules/i2c/Makefile Mon Jul 31 22:19:39 2017 (r321825) +++ head/sys/modules/i2c/Makefile Mon Jul 31 22:26:30 2017 (r321826) @@ -1,6 +1,16 @@ # $FreeBSD$ -SUBDIR = -SUBDIR += controllers if_ic smbus iicbus iicbb iicsmb iic cyapa smb isl jedec_ts +SUBDIR = \ + controllers \ + cyapa \ + if_ic \ + iic \ + iicbb \ + iicbus \ + iicsmb \ + isl \ + jedec_ts \ + smb \ + smbus \ .include From owner-svn-src-all@freebsd.org Mon Jul 31 22:28:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C09F4DBF338; Mon, 31 Jul 2017 22:28:34 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CD6D6BE33; Mon, 31 Jul 2017 22:28:34 +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 v6VMSXMv073208; Mon, 31 Jul 2017 22:28:33 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VMSXcx073206; Mon, 31 Jul 2017 22:28:33 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201707312228.v6VMSXcx073206@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 31 Jul 2017 22:28:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321827 - in stable/10/sbin/devd: . tests X-SVN-Group: stable-10 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in stable/10/sbin/devd: . tests X-SVN-Commit-Revision: 321827 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 22:28:34 -0000 Author: asomers Date: Mon Jul 31 22:28:33 2017 New Revision: 321827 URL: https://svnweb.freebsd.org/changeset/base/321827 Log: MFC r320165-r320166 r320165: devd(8): Remove pidfile on shutdown Sponsored by: Spectra Logic Corp r320166: Require devd to be running for its ATF tests to run The ATF tests communicate with the system's running devd PR: 220169 Reported by: gjb Sponsored by: Spectra Logic Corp Modified: stable/10/sbin/devd/devd.cc stable/10/sbin/devd/tests/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/devd/devd.cc ============================================================================== --- stable/10/sbin/devd/devd.cc Mon Jul 31 22:26:30 2017 (r321826) +++ stable/10/sbin/devd/devd.cc Mon Jul 31 22:28:33 2017 (r321827) @@ -1070,6 +1070,7 @@ event_loop(void) if (FD_ISSET(seqpacket_fd, &fds)) new_client(seqpacket_fd, SOCK_SEQPACKET); } + cfg.remove_pidfile(); close(seqpacket_fd); close(stream_fd); close(fd); Modified: stable/10/sbin/devd/tests/Makefile ============================================================================== --- stable/10/sbin/devd/tests/Makefile Mon Jul 31 22:26:30 2017 (r321826) +++ stable/10/sbin/devd/tests/Makefile Mon Jul 31 22:28:33 2017 (r321827) @@ -1,7 +1,8 @@ # $FreeBSD$ ATF_TESTS_C= client_test -TEST_METADATA.client_test= required_programs="devd" +TEST_METADATA.client_test= required_files="/var/run/devd.pid" +TEST_METADATA.client_test+= required_programs="devd" TEST_METADATA.client_test+= required_user="root" TEST_METADATA.client_test+= timeout=15 From owner-svn-src-all@freebsd.org Mon Jul 31 22:32:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11C63DBF4DB; Mon, 31 Jul 2017 22:32:13 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA0D36C07B; Mon, 31 Jul 2017 22:32:12 +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 v6VMWBN4076250; Mon, 31 Jul 2017 22:32:11 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VMWBvV076246; Mon, 31 Jul 2017 22:32:11 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201707312232.v6VMWBvV076246@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 31 Jul 2017 22:32:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321828 - in head/sys/modules/i2c: . ds1307 ds3231 nxprtc X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys/modules/i2c: . ds1307 ds3231 nxprtc X-SVN-Commit-Revision: 321828 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 22:32:13 -0000 Author: ian Date: Mon Jul 31 22:32:11 2017 New Revision: 321828 URL: https://svnweb.freebsd.org/changeset/base/321828 Log: Build iicbus/{ds1307,ds3231,nxprtc} as modules. Added: head/sys/modules/i2c/ds1307/ head/sys/modules/i2c/ds1307/Makefile (contents, props changed) head/sys/modules/i2c/ds3231/ head/sys/modules/i2c/ds3231/Makefile (contents, props changed) head/sys/modules/i2c/nxprtc/ head/sys/modules/i2c/nxprtc/Makefile (contents, props changed) Modified: head/sys/modules/i2c/Makefile Modified: head/sys/modules/i2c/Makefile ============================================================================== --- head/sys/modules/i2c/Makefile Mon Jul 31 22:28:33 2017 (r321827) +++ head/sys/modules/i2c/Makefile Mon Jul 31 22:32:11 2017 (r321828) @@ -3,6 +3,8 @@ SUBDIR = \ controllers \ cyapa \ + ds1307 \ + ds3231 \ if_ic \ iic \ iicbb \ @@ -10,6 +12,7 @@ SUBDIR = \ iicsmb \ isl \ jedec_ts \ + nxprtc \ smb \ smbus \ Added: head/sys/modules/i2c/ds1307/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/i2c/ds1307/Makefile Mon Jul 31 22:32:11 2017 (r321828) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/dev/iicbus +KMOD = ds1307 +SRCS = ds1307.c bus_if.h clock_if.h device_if.h iicbus_if.h + +.include Added: head/sys/modules/i2c/ds3231/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/i2c/ds3231/Makefile Mon Jul 31 22:32:11 2017 (r321828) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/dev/iicbus +KMOD = ds3231 +SRCS = ds3231.c bus_if.h clock_if.h device_if.h iicbus_if.h + +.include Added: head/sys/modules/i2c/nxprtc/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/i2c/nxprtc/Makefile Mon Jul 31 22:32:11 2017 (r321828) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/dev/iicbus +KMOD = nxprtc +SRCS = nxprtc.c bus_if.h clock_if.h device_if.h iicbus_if.h + +.include From owner-svn-src-all@freebsd.org Mon Jul 31 22:36:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFE67DBF585; Mon, 31 Jul 2017 22:36:04 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ABB786C333; Mon, 31 Jul 2017 22:36:04 +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 v6VMa38g077123; Mon, 31 Jul 2017 22:36:03 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VMa31R077121; Mon, 31 Jul 2017 22:36:03 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201707312236.v6VMa31R077121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 31 Jul 2017 22:36:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321829 - in stable/10: lib/libc/sys share/man/man4 X-SVN-Group: stable-10 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in stable/10: lib/libc/sys share/man/man4 X-SVN-Commit-Revision: 321829 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 22:36:04 -0000 Author: asomers Date: Mon Jul 31 22:36:03 2017 New Revision: 321829 URL: https://svnweb.freebsd.org/changeset/base/321829 Log: Clarify usage of aio(4) with kqueue(2) Reviewed by: jhb MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D11299 Modified: stable/10/lib/libc/sys/kqueue.2 stable/10/share/man/man4/aio.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/sys/kqueue.2 ============================================================================== --- stable/10/lib/libc/sys/kqueue.2 Mon Jul 31 22:32:11 2017 (r321828) +++ stable/10/lib/libc/sys/kqueue.2 Mon Jul 31 22:36:03 2017 (r321829) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 3, 2016 +.Dd June 22, 2017 .Dt KQUEUE 2 .Os .Sh NAME @@ -327,33 +327,18 @@ identical to the .Dv EVFILT_READ case. .It Dv EVFILT_AIO -The sigevent portion of the AIO request is filled in, with -.Va sigev_notify_kqueue -containing the descriptor of the kqueue that the event should -be attached to, -.Va sigev_notify_kevent_flags -containing the kevent flags which should be -.Dv EV_ONESHOT , -.Dv EV_CLEAR -or -.Dv EV_DISPATCH , -.Va sigev_value -containing the udata value, and -.Va sigev_notify -set to -.Dv SIGEV_KEVENT . -When the -.Fn aio_* -system call is made, the event will be registered -with the specified kqueue, and the -.Va ident -argument set to the -.Fa struct aiocb -returned by the -.Fn aio_* -system call. +Events for this filter are not registered with +.Fn kevent +directly but are registered via the +.Va aio_sigevent +member of an asychronous I/O request when it is scheduled via an asychronous I/O +system call such as +.Fn aio_read . The filter returns under the same conditions as .Fn aio_error . +For more details on this filter see +.Xr sigevent 3 and +.Xr aio 4 . .It Dv EVFILT_VNODE Takes a file descriptor as the identifier and the events to watch for in .Va fflags , Modified: stable/10/share/man/man4/aio.4 ============================================================================== --- stable/10/share/man/man4/aio.4 Mon Jul 31 22:32:11 2017 (r321828) +++ stable/10/share/man/man4/aio.4 Mon Jul 31 22:36:03 2017 (r321829) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 15, 2016 +.Dd June 22, 2017 .Dt AIO 4 .Os .Sh NAME @@ -59,11 +59,27 @@ field which can be used to request notification when a For .Dv SIGEV_KEVENT notifications, -the posted kevent will contain: +the +.Va sigevent +.Ap +s +.Va sigev_notify_kqueue +field should contain the descriptor of the kqueue that the event should be attached +to, its +.Va sigev_notify_kevent_flags +field may contain +.Dv EV_ONESHOT , +.Dv EV_CLEAR , and/or +.Dv EV_DISPATCH , and its +.Va sigev_notify +field should be set to +.Dv SIGEV_KEVENT . +The posted kevent will contain: .Bl -column ".Va filter" .It Sy Member Ta Sy Value .It Va ident Ta asynchronous I/O control buffer pointer .It Va filter Ta Dv EVFILT_AIO +.It Va flags Ta Dv EV_EOF .It Va udata Ta value stored in .Va aio_sigevent.sigev_value From owner-svn-src-all@freebsd.org Mon Jul 31 22:57:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DEEADBFB04 for ; Mon, 31 Jul 2017 22:57:30 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-wr0-x244.google.com (mail-wr0-x244.google.com [IPv6:2a00:1450:400c:c0c::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C56DC6CB3C for ; Mon, 31 Jul 2017 22:57:29 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-wr0-x244.google.com with SMTP id 12so6024wrb.4 for ; Mon, 31 Jul 2017 15:57:29 -0700 (PDT) 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:cc; bh=JqI8217HcOKvtz25HaA5IzgFx3oNoSVKLWSFm/0zx2s=; b=glZgSi90WY1W27sSbgE6MSt6eRhQZLxQT5FD5eCV1hNV8uLy+cJYfxpa0xiaEE3Llj 4XmU0MuzBqZpvpKQ2WJMINex1AVVSCtFDRk0MWHfT7mUJp30Riw+eJZ1WrIz2o52lRHx 8muUNPbeLU79iX+xFlkSksi+VEbUI4sk779xi1qdyXcE9keqq7Fq6LkrxLQPJoUkLAVB OTRb9nFNYU+gwOfWmZnGJfphyI1sYNudmJ4VpWL34YJop9HigfJWkYWdbnxdICrOjdfh ER6MF/E/zeFhsWhMMJxn/ZdKSoOlrJwitohc9gyfXHYarp8p9I4wWklEjl8aHXlUT50Y 45QQ== 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:cc; bh=JqI8217HcOKvtz25HaA5IzgFx3oNoSVKLWSFm/0zx2s=; b=KaZ6g1C1JYO5ltCaJJYOdMlk1yHY0FTRmw2GF/cYCwgWjw344H24GxO5ZeJlR3+thc Tyx8Itnh603/q+VRE8HpnMyj5v53xreLkBewfjXSJpmQTq9dprGEvEO5cIXofWjouQTC 5s7kBC37RoviNS8LgVbXbbccaQFPdsaA9BK3wEuu/W9lM3mvEPXZZGrwcScnQ0tMoIJs OjmZkDXgasqgry31434Zg1AZD5fBpVd5nX1KkmGiojijOy2GeI4Kz4L1X3PMpq8ahZt6 TPVfRM9Vw78FrigmEcGLTh0tMtlKwRayedem14or+gPFfBMU9n0bH2BboH8XEHPU60Xj h8FQ== X-Gm-Message-State: AIVw110E51yvU/MIA5hb7QsIg3yuGxZLDnAWgoqMH3OMdO31mnoNKOko OBXrXAWqS4nZjpPItFRF2Qk2bgUnXw== X-Received: by 10.223.174.209 with SMTP id y75mt13604454wrc.19.1501541848288; Mon, 31 Jul 2017 15:57:28 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.28.208.3 with HTTP; Mon, 31 Jul 2017 15:57:27 -0700 (PDT) In-Reply-To: <201707312236.v6VMa31R077121@repo.freebsd.org> References: <201707312236.v6VMa31R077121@repo.freebsd.org> From: Alan Somers Date: Mon, 31 Jul 2017 16:57:27 -0600 X-Google-Sender-Auth: XxGll0vCoNqDwzGDrJCSrBc6RRM Message-ID: Subject: Re: svn commit: r321829 - in stable/10: lib/libc/sys share/man/man4 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-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 22:57:30 -0000 On Mon, Jul 31, 2017 at 4:36 PM, Alan Somers wrote: > Author: asomers > Date: Mon Jul 31 22:36:03 2017 > New Revision: 321829 > URL: https://svnweb.freebsd.org/changeset/base/321829 > > Log: > Clarify usage of aio(4) with kqueue(2) > > Reviewed by: jhb > MFC after: 3 weeks > Differential Revision: https://reviews.freebsd.org/D11299 > > Modified: > stable/10/lib/libc/sys/kqueue.2 > stable/10/share/man/man4/aio.4 > Directory Properties: > stable/10/ (props changed) Oops, I truncated the commit message. The full commit message should've been: MFC r320255: Clarify usage of aio(4) with kqueue(2) Reviewed by: jhb MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D11299 From owner-svn-src-all@freebsd.org Mon Jul 31 23:03:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80B34DBFCD3; Mon, 31 Jul 2017 23:03:11 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44C3F6CF13; Mon, 31 Jul 2017 23:03:11 +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 v6VN3AeZ089196; Mon, 31 Jul 2017 23:03:10 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6VN3AMi089195; Mon, 31 Jul 2017 23:03:10 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201707312303.v6VN3AMi089195@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 31 Jul 2017 23:03: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: r321830 - stable/10/bin/echo/tests X-SVN-Group: stable-10 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/10/bin/echo/tests X-SVN-Commit-Revision: 321830 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.23 Precedence: list List-Id: "SVN commit messages 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, 31 Jul 2017 23:03:11 -0000 Author: asomers Date: Mon Jul 31 23:03:10 2017 New Revision: 321830 URL: https://svnweb.freebsd.org/changeset/base/321830 Log: MFC r320269: style fixes in bin/echo/tests Submitted by: shivansh Reviewed by: asomers X-MFC-With: 319626 Sponsored by: Google, Inc (GSoC 2017) Differential Revision: https://reviews.freebsd.org/D11318 Modified: stable/10/bin/echo/tests/echo_test.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/echo/tests/echo_test.sh ============================================================================== --- stable/10/bin/echo/tests/echo_test.sh Mon Jul 31 22:36:03 2017 (r321829) +++ stable/10/bin/echo/tests/echo_test.sh Mon Jul 31 23:03:10 2017 (r321830) @@ -27,29 +27,33 @@ # atf_test_case n_output -n_output_head() { - atf_set "descr" "Verify that echo(1) does not print the trailing " \ - "newline character with option '-n'" +n_output_head() +{ + atf_set "descr" "Verify that echo(1) does not print the trailing " \ + "newline character with option '-n'" } -n_output_body() { - atf_check -s ignore -o inline:"Hello world" \ - /bin/echo -n "Hello world" +n_output_body() +{ + atf_check -s ignore -o inline:"Hello world" \ + /bin/echo -n "Hello world" } atf_test_case append_c_output -append_c_output_head() { - atf_set "descr" "Verify that echo(1) does not print the trailing newline " \ - "character when '\c' is appended to the end of the string" +append_c_output_head() +{ + atf_set "descr" "Verify that echo(1) does not print the trailing newline " \ + "character when '\c' is appended to the end of the string" } -append_c_output_body() { - atf_check -s ignore -o inline:"Hello world" \ - /bin/echo "Hello world\c" +append_c_output_body() +{ + atf_check -s ignore -o inline:"Hello world" \ + /bin/echo "Hello world\c" } atf_init_test_cases() { - atf_add_test_case n_output - atf_add_test_case append_c_output + atf_add_test_case n_output + atf_add_test_case append_c_output } From owner-svn-src-all@freebsd.org Tue Aug 1 01:23:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33E32DC2EE5; Tue, 1 Aug 2017 01:23:56 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02B9C70EAC; Tue, 1 Aug 2017 01:23:55 +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 v711NtQI046673; Tue, 1 Aug 2017 01:23:55 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v711Nte5046672; Tue, 1 Aug 2017 01:23:55 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201708010123.v711Nte5046672@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 1 Aug 2017 01:23:55 +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: r321832 - stable/11/lib/libthr/thread X-SVN-Group: stable-11 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: stable/11/lib/libthr/thread X-SVN-Commit-Revision: 321832 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 01:23:56 -0000 Author: pfg Date: Tue Aug 1 01:23:55 2017 New Revision: 321832 URL: https://svnweb.freebsd.org/changeset/base/321832 Log: MFC r320990, r321011: libthr: Avoid checking for negative values in usigned count. Check for overflow instead. Modified: stable/11/lib/libthr/thread/thr_barrier.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libthr/thread/thr_barrier.c ============================================================================== --- stable/11/lib/libthr/thread/thr_barrier.c Mon Jul 31 23:04:12 2017 (r321831) +++ stable/11/lib/libthr/thread/thr_barrier.c Tue Aug 1 01:23:55 2017 (r321832) @@ -100,7 +100,7 @@ _pthread_barrier_init(pthread_barrier_t *barrier, pthread_barrier_t bar; int pshared; - if (barrier == NULL || count <= 0) + if (barrier == NULL || count == 0 || count > INT_MAX) return (EINVAL); if (attr == NULL || *attr == NULL || From owner-svn-src-all@freebsd.org Tue Aug 1 01:25:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3BAF9DC306D; Tue, 1 Aug 2017 01:25:19 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0811F71054; Tue, 1 Aug 2017 01:25:18 +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 v711PIgU046796; Tue, 1 Aug 2017 01:25:18 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v711PIUP046795; Tue, 1 Aug 2017 01:25:18 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201708010125.v711PIUP046795@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 1 Aug 2017 01:25:18 +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: r321833 - stable/10/lib/libthr/thread X-SVN-Group: stable-10 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: stable/10/lib/libthr/thread X-SVN-Commit-Revision: 321833 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 01:25:19 -0000 Author: pfg Date: Tue Aug 1 01:25:18 2017 New Revision: 321833 URL: https://svnweb.freebsd.org/changeset/base/321833 Log: MFC r320990, r321011: libthr: Avoid checking for negative values in usigned count. Check for overflow instead. Modified: stable/10/lib/libthr/thread/thr_barrier.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libthr/thread/thr_barrier.c ============================================================================== --- stable/10/lib/libthr/thread/thr_barrier.c Tue Aug 1 01:23:55 2017 (r321832) +++ stable/10/lib/libthr/thread/thr_barrier.c Tue Aug 1 01:25:18 2017 (r321833) @@ -83,7 +83,7 @@ _pthread_barrier_init(pthread_barrier_t *barrier, (void)attr; - if (barrier == NULL || count <= 0) + if (barrier == NULL || count == 0 || count > INT_MAX) return (EINVAL); bar = calloc(1, sizeof(struct pthread_barrier)); From owner-svn-src-all@freebsd.org Tue Aug 1 01:35:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6E2BDC3995; Tue, 1 Aug 2017 01:35:24 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A34E971771; Tue, 1 Aug 2017 01:35:24 +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 v711ZNfd051181; Tue, 1 Aug 2017 01:35:23 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v711ZNAj051180; Tue, 1 Aug 2017 01:35:23 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201708010135.v711ZNAj051180@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 1 Aug 2017 01:35:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321834 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321834 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 01:35:24 -0000 Author: pfg Date: Tue Aug 1 01:35:23 2017 New Revision: 321834 URL: https://svnweb.freebsd.org/changeset/base/321834 Log: Bring my aging self to calendar.freebsd. Requested by: mckusick Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Tue Aug 1 01:25:18 2017 (r321833) +++ head/usr.bin/calendar/calendars/calendar.freebsd Tue Aug 1 01:35:23 2017 (r321834) @@ -353,6 +353,7 @@ 10/18 Sheldon Hearn born in Cape Town, Western Cape, South Africa, 1974 10/19 Nicholas Souchu born in Suresnes, Hauts-de-Seine, France, 1972 10/19 Nick Barkas born in Longview, Washington, United States, 1981 +10/19 Pedro Giffuni born in Bogotá, Colombia, 1968 10/20 Joel Dahl born in Bitterna, Skaraborg, Sweden, 1983 10/20 Dmitry Marakasov born in Moscow, Russian Federation, 1984 10/21 Ben Smithurst born in Sheffield, South Yorkshire, United Kingdom, 1981 From owner-svn-src-all@freebsd.org Tue Aug 1 01:39:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 106D9DC3D1B; Tue, 1 Aug 2017 01:39:56 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D1B5A71A2E; Tue, 1 Aug 2017 01:39:55 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v711dttB051483; Tue, 1 Aug 2017 01:39:55 GMT (envelope-from jah@FreeBSD.org) Received: (from jah@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v711dtYC051482; Tue, 1 Aug 2017 01:39:55 GMT (envelope-from jah@FreeBSD.org) Message-Id: <201708010139.v711dtYC051482@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jah set sender to jah@FreeBSD.org using -f From: "Jason A. Harmening" Date: Tue, 1 Aug 2017 01:39:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321835 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: jah X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321835 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 01:39:56 -0000 Author: jah Date: Tue Aug 1 01:39:54 2017 New Revision: 321835 URL: https://svnweb.freebsd.org/changeset/base/321835 Log: Add myself to FreeBSD calendar Requested by: mckusick Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Tue Aug 1 01:35:23 2017 (r321834) +++ head/usr.bin/calendar/calendars/calendar.freebsd Tue Aug 1 01:39:54 2017 (r321835) @@ -290,6 +290,7 @@ 08/19 Chin-San Huang born in Yi-Lan, Taiwan, Republic of China, 1979 08/19 Pav Lucistnik born in Kutna Hora, Czech Republic, 1980 08/20 Michael Heffner born in Cleona, Pennsylvania, United States, 1981 +08/21 Jason A. Harmening born in Fort Wayne, Indiana, United States, 1981 08/24 Mark Linimon born in Houston, Texas, United States, 1955 08/24 Alexander Botero-Lowry died in San Francisco, California, United States, 2012 08/25 Beech Rintoul born in Oakland, California, United States, 1952 From owner-svn-src-all@freebsd.org Tue Aug 1 02:45:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95B90DC721A; Tue, 1 Aug 2017 02:45:55 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A6FF74345; Tue, 1 Aug 2017 02:45:55 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v712jskZ081175; Tue, 1 Aug 2017 02:45:54 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v712js5h081173; Tue, 1 Aug 2017 02:45:54 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201708010245.v712js5h081173@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 1 Aug 2017 02:45:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321836 - head/sys/dev/hyperv/netvsc X-SVN-Group: head X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: head/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 321836 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 02:45:55 -0000 Author: sephe Date: Tue Aug 1 02:45:54 2017 New Revision: 321836 URL: https://svnweb.freebsd.org/changeset/base/321836 Log: hyperv/hn: Renaming and minor cleanup This prepares for the upcoming transparent VF support. MFC after: 3 days Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D11708 Modified: head/sys/dev/hyperv/netvsc/if_hn.c head/sys/dev/hyperv/netvsc/if_hnvar.h Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Tue Aug 1 01:39:54 2017 (r321835) +++ head/sys/dev/hyperv/netvsc/if_hn.c Tue Aug 1 02:45:54 2017 (r321836) @@ -222,9 +222,9 @@ struct hn_rxinfo { uint32_t hash_value; }; -struct hn_update_vf { +struct hn_rxvf_setarg { struct hn_rx_ring *rxr; - struct ifnet *vf; + struct ifnet *vf_ifp; }; #define HN_RXINFO_VLAN 0x0001 @@ -264,6 +264,13 @@ static void hn_ifaddr_event(void *, struct ifnet *); static void hn_ifnet_attevent(void *, struct ifnet *); static void hn_ifnet_detevent(void *, struct ifnet *); +static bool hn_ismyvf(const struct hn_softc *, + const struct ifnet *); +static void hn_rxvf_change(struct hn_softc *, + struct ifnet *, bool); +static void hn_rxvf_set(struct hn_softc *, struct ifnet *); +static void hn_rxvf_set_task(void *, int); + static int hn_rndis_rxinfo(const void *, int, struct hn_rxinfo *); static void hn_rndis_rx_data(struct hn_rx_ring *, @@ -801,7 +808,7 @@ hn_rxfilter_config(struct hn_softc *sc) HN_LOCK_ASSERT(sc); if ((ifp->if_flags & IFF_PROMISC) || - (sc->hn_flags & HN_FLAG_VF)) { + (sc->hn_flags & HN_FLAG_RXVF)) { filter = NDIS_PACKET_TYPE_PROMISCUOUS; } else { filter = NDIS_PACKET_TYPE_DIRECTED; @@ -991,39 +998,39 @@ hn_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *i } static void -hn_update_vf_task(void *arg, int pending __unused) +hn_rxvf_set_task(void *xarg, int pending __unused) { - struct hn_update_vf *uv = arg; + struct hn_rxvf_setarg *arg = xarg; - uv->rxr->hn_rxvf_ifp = uv->vf; + arg->rxr->hn_rxvf_ifp = arg->vf_ifp; } static void -hn_update_vf(struct hn_softc *sc, struct ifnet *vf) +hn_rxvf_set(struct hn_softc *sc, struct ifnet *vf_ifp) { struct hn_rx_ring *rxr; - struct hn_update_vf uv; + struct hn_rxvf_setarg arg; struct task task; int i; HN_LOCK_ASSERT(sc); - TASK_INIT(&task, 0, hn_update_vf_task, &uv); + TASK_INIT(&task, 0, hn_rxvf_set_task, &arg); for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { rxr = &sc->hn_rx_ring[i]; if (i < sc->hn_rx_ring_inuse) { - uv.rxr = rxr; - uv.vf = vf; + arg.rxr = rxr; + arg.vf_ifp = vf_ifp; vmbus_chan_run_task(rxr->hn_chan, &task); } else { - rxr->hn_rxvf_ifp = vf; + rxr->hn_rxvf_ifp = vf_ifp; } } } -static __inline bool +static bool hn_ismyvf(const struct hn_softc *sc, const struct ifnet *ifp) { const struct ifnet *hn_ifp; @@ -1048,7 +1055,7 @@ hn_ismyvf(const struct hn_softc *sc, const struct ifne } static void -hn_set_vf(struct hn_softc *sc, struct ifnet *ifp, bool vf) +hn_rxvf_change(struct hn_softc *sc, struct ifnet *ifp, bool rxvf) { struct ifnet *hn_ifp; @@ -1059,21 +1066,19 @@ hn_set_vf(struct hn_softc *sc, struct ifnet *ifp, bool if (!hn_ismyvf(sc, ifp)) goto out; - hn_ifp = sc->hn_ifp; - /* Now we're sure 'ifp' is a real VF device. */ - if (vf) { - if (sc->hn_flags & HN_FLAG_VF) + if (rxvf) { + if (sc->hn_flags & HN_FLAG_RXVF) goto out; - sc->hn_flags |= HN_FLAG_VF; + sc->hn_flags |= HN_FLAG_RXVF; hn_rxfilter_config(sc); } else { - if (!(sc->hn_flags & HN_FLAG_VF)) + if (!(sc->hn_flags & HN_FLAG_RXVF)) goto out; - sc->hn_flags &= ~HN_FLAG_VF; + sc->hn_flags &= ~HN_FLAG_RXVF; if (hn_ifp->if_drv_flags & IFF_DRV_RUNNING) hn_rxfilter_config(sc); else @@ -1081,11 +1086,11 @@ hn_set_vf(struct hn_softc *sc, struct ifnet *ifp, bool } hn_nvs_set_datapath(sc, - vf ? HN_NVS_DATAPATH_VF : HN_NVS_DATAPATH_SYNTHETIC); + rxvf ? HN_NVS_DATAPATH_VF : HN_NVS_DATAPATH_SYNTHETIC); - hn_update_vf(sc, vf ? ifp : NULL); + hn_rxvf_set(sc, rxvf ? ifp : NULL); - if (vf) { + if (rxvf) { hn_suspend_mgmt(sc); sc->hn_link_flags &= ~(HN_LINK_FLAG_LINKUP | HN_LINK_FLAG_NETCHG); @@ -1094,12 +1099,13 @@ hn_set_vf(struct hn_softc *sc, struct ifnet *ifp, bool hn_resume_mgmt(sc); } - devctl_notify("HYPERV_NIC_VF", if_name(hn_ifp), - vf ? "VF_UP" : "VF_DOWN", NULL); + devctl_notify("HYPERV_NIC_VF", hn_ifp->if_xname, + rxvf ? "VF_UP" : "VF_DOWN", NULL); - if (bootverbose) - if_printf(hn_ifp, "Data path is switched %s %s\n", - vf ? "to" : "from", if_name(ifp)); + if (bootverbose) { + if_printf(hn_ifp, "datapath is switched %s %s\n", + rxvf ? "to" : "from", ifp->if_xname); + } out: HN_UNLOCK(sc); } @@ -1107,16 +1113,17 @@ out: static void hn_ifnet_event(void *arg, struct ifnet *ifp, int event) { + if (event != IFNET_EVENT_UP && event != IFNET_EVENT_DOWN) return; - - hn_set_vf(arg, ifp, event == IFNET_EVENT_UP); + hn_rxvf_change(arg, ifp, event == IFNET_EVENT_UP); } static void hn_ifaddr_event(void *arg, struct ifnet *ifp) { - hn_set_vf(arg, ifp, ifp->if_flags & IFF_UP); + + hn_rxvf_change(arg, ifp, ifp->if_flags & IFF_UP); } static void @@ -2902,7 +2909,7 @@ hn_stop(struct hn_softc *sc, bool detaching) * If the VF is active, make sure the filter is not 0, even if * the synthetic NIC is down. */ - if (!detaching && (sc->hn_flags & HN_FLAG_VF)) + if (!detaching && (sc->hn_flags & HN_FLAG_RXVF)) hn_rxfilter_config(sc); } @@ -3438,13 +3445,13 @@ hn_vf_sysctl(SYSCTL_HANDLER_ARGS) { struct hn_softc *sc = arg1; char vf_name[IFNAMSIZ + 1]; - struct ifnet *vf; + struct ifnet *vf_ifp; HN_LOCK(sc); vf_name[0] = '\0'; - vf = sc->hn_vf_ifp; - if (vf != NULL) - snprintf(vf_name, sizeof(vf_name), "%s", if_name(vf)); + vf_ifp = sc->hn_vf_ifp; + if (vf_ifp != NULL) + snprintf(vf_name, sizeof(vf_name), "%s", vf_ifp->if_xname); HN_UNLOCK(sc); return sysctl_handle_string(oidp, vf_name, sizeof(vf_name), req); } @@ -3454,13 +3461,13 @@ hn_rxvf_sysctl(SYSCTL_HANDLER_ARGS) { struct hn_softc *sc = arg1; char vf_name[IFNAMSIZ + 1]; - struct ifnet *vf; + struct ifnet *vf_ifp; HN_LOCK(sc); vf_name[0] = '\0'; - vf = sc->hn_rx_ring[0].hn_rxvf_ifp; - if (vf != NULL) - snprintf(vf_name, sizeof(vf_name), "%s", if_name(vf)); + vf_ifp = sc->hn_rx_ring[0].hn_rxvf_ifp; + if (vf_ifp != NULL) + snprintf(vf_name, sizeof(vf_name), "%s", vf_ifp->if_xname); HN_UNLOCK(sc); return sysctl_handle_string(oidp, vf_name, sizeof(vf_name), req); } @@ -5445,7 +5452,7 @@ hn_suspend(struct hn_softc *sc) hn_polling(sc, 0); if ((sc->hn_ifp->if_drv_flags & IFF_DRV_RUNNING) || - (sc->hn_flags & HN_FLAG_VF)) + (sc->hn_flags & HN_FLAG_RXVF)) hn_suspend_data(sc); hn_suspend_mgmt(sc); } @@ -5535,16 +5542,16 @@ hn_resume(struct hn_softc *sc) { if ((sc->hn_ifp->if_drv_flags & IFF_DRV_RUNNING) || - (sc->hn_flags & HN_FLAG_VF)) + (sc->hn_flags & HN_FLAG_RXVF)) hn_resume_data(sc); /* * When the VF is activated, the synthetic interface is changed - * to DOWN in hn_set_vf(). Here, if the VF is still active, we - * don't call hn_resume_mgmt() until the VF is deactivated in - * hn_set_vf(). + * to DOWN in hn_rxvf_change(). Here, if the VF is still active, + * we don't call hn_resume_mgmt() until the VF is deactivated in + * hn_rxvf_change(). */ - if (!(sc->hn_flags & HN_FLAG_VF)) + if (!(sc->hn_flags & HN_FLAG_RXVF)) hn_resume_mgmt(sc); /* Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnvar.h Tue Aug 1 01:39:54 2017 (r321835) +++ head/sys/dev/hyperv/netvsc/if_hnvar.h Tue Aug 1 02:45:54 2017 (r321836) @@ -251,7 +251,7 @@ struct hn_softc { #define HN_FLAG_NO_SLEEPING 0x0020 #define HN_FLAG_RXBUF_REF 0x0040 #define HN_FLAG_CHIM_REF 0x0080 -#define HN_FLAG_VF 0x0100 +#define HN_FLAG_RXVF 0x0100 #define HN_FLAG_ERRORS (HN_FLAG_RXBUF_REF | HN_FLAG_CHIM_REF) From owner-svn-src-all@freebsd.org Tue Aug 1 02:55:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DAEBDC76F7; Tue, 1 Aug 2017 02:55:45 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBF0B7493B; Tue, 1 Aug 2017 02:55:44 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v712th0l085305; Tue, 1 Aug 2017 02:55:43 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v712th0p085304; Tue, 1 Aug 2017 02:55:43 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201708010255.v712th0p085304@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 1 Aug 2017 02:55:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321837 - head/sys/dev/hyperv/netvsc X-SVN-Group: head X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: head/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 321837 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 02:55:45 -0000 Author: sephe Date: Tue Aug 1 02:55:43 2017 New Revision: 321837 URL: https://svnweb.freebsd.org/changeset/base/321837 Log: hyperv/hn: Add comment about ether_ifattach event subscription. MFC after: 3 days Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D11710 Modified: head/sys/dev/hyperv/netvsc/if_hn.c Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Tue Aug 1 02:45:54 2017 (r321836) +++ head/sys/dev/hyperv/netvsc/if_hn.c Tue Aug 1 02:55:43 2017 (r321837) @@ -1541,6 +1541,12 @@ hn_attach(device_t dev) sc->hn_ifaddr_evthand = EVENTHANDLER_REGISTER(ifaddr_event, hn_ifaddr_event, sc, EVENTHANDLER_PRI_ANY); + /* + * NOTE: + * Subscribe ether_ifattach event, instead of ifnet_arrival event, + * since interface's LLADDR is needed; interface LLADDR is not + * available when ifnet_arrival event is triggered. + */ sc->hn_ifnet_atthand = EVENTHANDLER_REGISTER(ether_ifattach_event, hn_ifnet_attevent, sc, EVENTHANDLER_PRI_ANY); sc->hn_ifnet_dethand = EVENTHANDLER_REGISTER(ifnet_departure_event, From owner-svn-src-all@freebsd.org Tue Aug 1 03:13:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 568BEDC7F6C; Tue, 1 Aug 2017 03:13:44 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 235E675441; Tue, 1 Aug 2017 03:13:44 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v713DhdF093990; Tue, 1 Aug 2017 03:13:43 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v713Dh1L093988; Tue, 1 Aug 2017 03:13:43 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201708010313.v713Dh1L093988@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 1 Aug 2017 03:13:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321838 - head/sys/net80211 X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/net80211 X-SVN-Commit-Revision: 321838 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 03:13:44 -0000 Author: pfg Date: Tue Aug 1 03:13:43 2017 New Revision: 321838 URL: https://svnweb.freebsd.org/changeset/base/321838 Log: sys/net8021: Add missing braces in setcurchan(). Obtained from: DragonFlyBSD (git c69e37d6) MFC after: 3 days Modified: head/sys/net80211/ieee80211_ioctl.c head/sys/net80211/ieee80211_mesh.c Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Tue Aug 1 02:55:43 2017 (r321837) +++ head/sys/net80211/ieee80211_ioctl.c Tue Aug 1 03:13:43 2017 (r321838) @@ -2014,9 +2014,10 @@ setcurchan(struct ieee80211vap *vap, struct ieee80211_ /* XXX need state machine for other vap's to follow */ ieee80211_setcurchan(ic, vap->iv_des_chan); vap->iv_bss->ni_chan = ic->ic_curchan; - } else + } else { ic->ic_curchan = vap->iv_des_chan; ic->ic_rt = ieee80211_get_ratetable(ic->ic_curchan); + } } else { /* * Need to go through the state machine in case we Modified: head/sys/net80211/ieee80211_mesh.c ============================================================================== --- head/sys/net80211/ieee80211_mesh.c Tue Aug 1 02:55:43 2017 (r321837) +++ head/sys/net80211/ieee80211_mesh.c Tue Aug 1 03:13:43 2017 (r321838) @@ -2630,7 +2630,7 @@ mesh_recv_action_meshgate(struct ieee80211_node *ni, /* popagate only if decremented ttl >= 1 && forwarding is enabled */ if ((ie.gann_ttl - 1) < 1 && !(ms->ms_flags & IEEE80211_MESHFLAGS_FWD)) return 0; - pgann.gann_flags = ie.gann_flags; /* Reserved */ + pgann.gann_flags = ie.gann_flags; /* Reserved */ pgann.gann_hopcount = ie.gann_hopcount + 1; pgann.gann_ttl = ie.gann_ttl - 1; IEEE80211_ADDR_COPY(pgann.gann_addr, ie.gann_addr); From owner-svn-src-all@freebsd.org Tue Aug 1 03:40:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7081EDC88EE; Tue, 1 Aug 2017 03:40:21 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C83E75F72; Tue, 1 Aug 2017 03:40:21 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v713eKUv002484; Tue, 1 Aug 2017 03:40:20 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v713eJVp002477; Tue, 1 Aug 2017 03:40:19 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201708010340.v713eJVp002477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Tue, 1 Aug 2017 03:40:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321839 - in head: share/man/man4 share/man/man5 sys/fs/fdescfs sys/kern sys/sys X-SVN-Group: head X-SVN-Commit-Author: dchagin X-SVN-Commit-Paths: in head: share/man/man4 share/man/man5 sys/fs/fdescfs sys/kern sys/sys X-SVN-Commit-Revision: 321839 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 03:40:21 -0000 Author: dchagin Date: Tue Aug 1 03:40:19 2017 New Revision: 321839 URL: https://svnweb.freebsd.org/changeset/base/321839 Log: Implement proper Linux /dev/fd and /proc/self/fd behavior by adding Linux specific things to the native fdescfs file system. Unlike FreeBSD, the Linux fdescfs is a directory containing a symbolic links to the actual files, which the process has open. A readlink(2) call on this file returns a full path in case of regular file or a string in a special format (type:[inode], anon_inode:, etc..). As well as in a FreeBSD, opening the file in the Linux fdescfs directory is equivalent to duplicating the corresponding file descriptor. Here we have mutually exclusive requirements: - in case of readlink(2) call fdescfs lookup() method should return VLNK vnode otherwise our kern_readlink() fail with EINVAL error; - in the other calls fdescfs lookup() method should return non VLNK vnode. For what new vnode v_flag VV_READLINK was added, which is set if fdescfs has beed mounted with linrdlnk option an modified kern_readlinkat() to properly handle it. For now For Linux ABI compatibility mount fdescfs volume with linrdlnk option: mount -t fdescfs -o linrdlnk null /compat/linux/dev/fd Reviewed by: kib@ MFC after: 1 week Relnotes: yes Modified: head/share/man/man4/linux.4 head/share/man/man5/fdescfs.5 head/sys/fs/fdescfs/fdesc.h head/sys/fs/fdescfs/fdesc_vfsops.c head/sys/fs/fdescfs/fdesc_vnops.c head/sys/kern/vfs_syscalls.c head/sys/sys/vnode.h Modified: head/share/man/man4/linux.4 ============================================================================== --- head/share/man/man4/linux.4 Tue Aug 1 03:13:43 2017 (r321838) +++ head/share/man/man4/linux.4 Tue Aug 1 03:40:19 2017 (r321839) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 8, 2010 +.Dd August 1, 2017 .Dt LINUX 4 .Os .Sh NAME @@ -127,9 +127,11 @@ regardless of whether the module is statically linked into the kernel or loaded as a module. .Sh FILES -.Bl -tag -width /compat/linux/proc -compact +.Bl -tag -width /compat/linux/dev/fd -compact .It Pa /compat/linux minimal Linux run-time environment +.It Pa /compat/linux/dev/fd +limited Linux file-descriptor file system .It Pa /compat/linux/proc limited Linux process file system .It Pa /compat/linux/sys @@ -138,6 +140,7 @@ limited Linux system file system .Sh SEE ALSO .Xr brandelf 1 , .Xr elf 5 , +.Xr fdescfs 5 , .Xr linprocfs 5 , .Xr linsysfs 5 .Sh HISTORY Modified: head/share/man/man5/fdescfs.5 ============================================================================== --- head/share/man/man5/fdescfs.5 Tue Aug 1 03:13:43 2017 (r321838) +++ head/share/man/man5/fdescfs.5 Tue Aug 1 03:40:19 2017 (r321839) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 18, 2010 +.Dd August 1, 2017 .Dt FDESCFS 5 .Os .Sh NAME @@ -92,6 +92,14 @@ and files are created by default when devfs alone is mounted. .Nm creates entries for all file descriptors opened by the process. +.Pp +For +.Xr linux 4 +ABI compatibility mount +.Nm +volume with +.Cm linrdlnk +option. .Sh FILES .Bl -tag -width /dev/stderr -compact .It Pa /dev/fd/# @@ -103,6 +111,12 @@ volume located on .Pa /dev/fd : .Pp .Dl "mount -t fdescfs null /dev/fd" +.Pp +For +.Xr linux 4 +ABI compatibility: +.Pp +.Dl "mount -t fdescfs -o linrdlnk null /compat/linux/dev/fd" .Sh SEE ALSO .Xr devfs 5 , .Xr mount 8 Modified: head/sys/fs/fdescfs/fdesc.h ============================================================================== --- head/sys/fs/fdescfs/fdesc.h Tue Aug 1 03:13:43 2017 (r321838) +++ head/sys/fs/fdescfs/fdesc.h Tue Aug 1 03:40:19 2017 (r321839) @@ -38,7 +38,9 @@ #define _FS_FDESC_H_ /* Private mount flags for fdescfs. */ -#define FMNT_UNMOUNTF 0x01 +#define FMNT_UNMOUNTF 0x01 +#define FMNT_LINRDLNKF 0x02 + struct fdescmount { struct vnode *f_root; /* Root node */ int flags; Modified: head/sys/fs/fdescfs/fdesc_vfsops.c ============================================================================== --- head/sys/fs/fdescfs/fdesc_vfsops.c Tue Aug 1 03:13:43 2017 (r321838) +++ head/sys/fs/fdescfs/fdesc_vfsops.c Tue Aug 1 03:40:19 2017 (r321839) @@ -101,6 +101,8 @@ fdesc_mount(struct mount *mp) */ mp->mnt_data = fmp; fmp->flags = 0; + if (vfs_getopt(mp->mnt_optnew, "linrdlnk", NULL, NULL) == 0) + fmp->flags |= FMNT_LINRDLNKF; error = fdesc_allocvp(Froot, -1, FD_ROOT, mp, &rvp); if (error) { free(fmp, M_FDESCMNT); Modified: head/sys/fs/fdescfs/fdesc_vnops.c ============================================================================== --- head/sys/fs/fdescfs/fdesc_vnops.c Tue Aug 1 03:13:43 2017 (r321838) +++ head/sys/fs/fdescfs/fdesc_vnops.c Tue Aug 1 03:40:19 2017 (r321839) @@ -69,6 +69,7 @@ static vop_getattr_t fdesc_getattr; static vop_lookup_t fdesc_lookup; static vop_open_t fdesc_open; static vop_readdir_t fdesc_readdir; +static vop_readlink_t fdesc_readlink; static vop_reclaim_t fdesc_reclaim; static vop_setattr_t fdesc_setattr; @@ -81,6 +82,7 @@ static struct vop_vector fdesc_vnodeops = { .vop_open = fdesc_open, .vop_pathconf = vop_stdpathconf, .vop_readdir = fdesc_readdir, + .vop_readlink = fdesc_readlink, .vop_reclaim = fdesc_reclaim, .vop_setattr = fdesc_setattr, }; @@ -195,6 +197,8 @@ loop: fd->fd_type = ftype; fd->fd_fd = fd_fd; fd->fd_ix = ix; + if (ftype == Fdesc && fmp->flags & FMNT_LINRDLNKF) + vp->v_vflag |= VV_READLINK; error = insmntque1(vp, mp, fdesc_insmntque_dtr, NULL); if (error != 0) { *vpp = NULLVP; @@ -420,7 +424,7 @@ fdesc_getattr(struct vop_getattr_args *ap) break; case Fdesc: - vap->va_type = VCHR; + vap->va_type = (vp->v_vflag & VV_READLINK) == 0 ? VCHR : VLNK; vap->va_nlink = 1; vap->va_size = 0; vap->va_rdev = makedev(0, vap->va_fileid); @@ -490,6 +494,7 @@ fdesc_setattr(struct vop_setattr_args *ap) static int fdesc_readdir(struct vop_readdir_args *ap) { + struct fdescmount *fmp; struct uio *uio = ap->a_uio; struct filedesc *fdp; struct dirent d; @@ -499,6 +504,7 @@ fdesc_readdir(struct vop_readdir_args *ap) if (VTOFDESC(ap->a_vp)->fd_type != Froot) panic("fdesc_readdir: not dir"); + fmp = VFSTOFDESC(ap->a_vp->v_mount); if (ap->a_ncookies != NULL) *ap->a_ncookies = 0; @@ -530,7 +536,8 @@ fdesc_readdir(struct vop_readdir_args *ap) break; dp->d_namlen = sprintf(dp->d_name, "%d", fcnt); dp->d_reclen = UIO_MX; - dp->d_type = DT_CHR; + dp->d_type = (fmp->flags & FMNT_LINRDLNKF) == 0 ? + DT_CHR : DT_LNK; dp->d_fileno = i + FD_DESC; break; } @@ -566,4 +573,53 @@ fdesc_reclaim(struct vop_reclaim_args *ap) free(vp->v_data, M_TEMP); vp->v_data = NULL; return (0); +} + +static int +fdesc_readlink(struct vop_readlink_args *va) +{ + struct vnode *vp, *vn; + cap_rights_t rights; + struct thread *td; + struct uio *uio; + struct file *fp; + char *freepath, *fullpath; + size_t pathlen; + int lockflags, fd_fd; + int error; + + freepath = NULL; + vn = va->a_vp; + if (VTOFDESC(vn)->fd_type != Fdesc) + panic("fdesc_readlink: not fdescfs link"); + fd_fd = ((struct fdescnode *)vn->v_data)->fd_fd; + lockflags = VOP_ISLOCKED(vn); + VOP_UNLOCK(vn, 0); + + td = curthread; + error = fget_cap(td, fd_fd, cap_rights_init(&rights), &fp, NULL); + if (error != 0) + goto out; + + switch (fp->f_type) { + case DTYPE_VNODE: + vp = fp->f_vnode; + error = vn_fullpath(td, vp, &fullpath, &freepath); + break; + default: + fullpath = "anon_inode:[unknown]"; + break; + } + if (error == 0) { + uio = va->a_uio; + pathlen = strlen(fullpath); + error = uiomove(fullpath, pathlen, uio); + } + if (freepath != NULL) + free(freepath, M_TEMP); + fdrop(fp, td); + +out: + vn_lock(vn, lockflags | LK_RETRY); + return (error); } Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Tue Aug 1 03:13:43 2017 (r321838) +++ head/sys/kern/vfs_syscalls.c Tue Aug 1 03:40:19 2017 (r321839) @@ -2484,7 +2484,7 @@ kern_readlinkat(struct thread *td, int fd, char *path, return (error); } #endif - if (vp->v_type != VLNK) + if (vp->v_type != VLNK && (vp->v_vflag & VV_READLINK) == 0) error = EINVAL; else { aiov.iov_base = buf; Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Tue Aug 1 03:13:43 2017 (r321838) +++ head/sys/sys/vnode.h Tue Aug 1 03:40:19 2017 (r321839) @@ -250,6 +250,7 @@ struct xvnode { #define VV_DELETED 0x0400 /* should be removed */ #define VV_MD 0x0800 /* vnode backs the md device */ #define VV_FORCEINSMQ 0x1000 /* force the insmntque to succeed */ +#define VV_READLINK 0x2000 /* fdescfs linux vnode */ #define VMP_TMPMNTFREELIST 0x0001 /* Vnode is on mnt's tmp free list */ From owner-svn-src-all@freebsd.org Tue Aug 1 03:51:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 481A8DC8D24; Tue, 1 Aug 2017 03:51:28 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0ECF976509; Tue, 1 Aug 2017 03:51:27 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v713pRkL007141; Tue, 1 Aug 2017 03:51:27 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v713pRAJ007139; Tue, 1 Aug 2017 03:51:27 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201708010351.v713pRAJ007139@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Tue, 1 Aug 2017 03:51:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321840 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 321840 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 03:51:28 -0000 Author: alc Date: Tue Aug 1 03:51:26 2017 New Revision: 321840 URL: https://svnweb.freebsd.org/changeset/base/321840 Log: The blist_meta_* routines that process a subtree take arguments 'radix' and 'skip', which denote, respectively, the largest number of blocks that can be managed by a subtree of that height, and one less than the number of nodes in a subtree of that height. This change removes the 'skip' argument from those functions because 'skip' can be trivially computed from 'radius'. This change also redefines 'skip' so that it denotes the number of nodes in the subtree, and so changes loop upper bound tests from '<= skip' to '< skip' to account for the change. The 'skip' field is also removed from the blist struct. The self-test program is changed so that the print command includes the cursor value in the output. Submitted by: Doug Moore MFC after: 1 week Modified: head/sys/kern/subr_blist.c head/sys/sys/blist.h Modified: head/sys/kern/subr_blist.c ============================================================================== --- head/sys/kern/subr_blist.c Tue Aug 1 03:40:19 2017 (r321839) +++ head/sys/kern/subr_blist.c Tue Aug 1 03:51:26 2017 (r321840) @@ -123,20 +123,19 @@ void panic(const char *ctl, ...); static daddr_t blst_leaf_alloc(blmeta_t *scan, daddr_t blk, int count, daddr_t cursor); static daddr_t blst_meta_alloc(blmeta_t *scan, daddr_t blk, daddr_t count, - daddr_t radix, daddr_t skip, daddr_t cursor); + daddr_t radix, daddr_t cursor); static void blst_leaf_free(blmeta_t *scan, daddr_t relblk, int count); static void blst_meta_free(blmeta_t *scan, daddr_t freeBlk, daddr_t count, - daddr_t radix, daddr_t skip, daddr_t blk); + daddr_t radix, daddr_t blk); static void blst_copy(blmeta_t *scan, daddr_t blk, daddr_t radix, - daddr_t skip, blist_t dest, daddr_t count); + blist_t dest, daddr_t count); static daddr_t blst_leaf_fill(blmeta_t *scan, daddr_t blk, int count); static daddr_t blst_meta_fill(blmeta_t *scan, daddr_t allocBlk, daddr_t count, - daddr_t radix, daddr_t skip, daddr_t blk); -static daddr_t blst_radix_init(blmeta_t *scan, daddr_t radix, daddr_t skip, - daddr_t count); + daddr_t radix, daddr_t blk); +static daddr_t blst_radix_init(blmeta_t *scan, daddr_t radix, daddr_t count); #ifndef _KERNEL static void blst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t radix, - daddr_t skip, int tab); + int tab); #endif #ifdef _KERNEL @@ -144,6 +143,28 @@ static MALLOC_DEFINE(M_SWAP, "SWAP", "Swap space"); #endif /* + * For a subtree that can represent the state of up to 'radix' blocks, the + * number of leaf nodes of the subtree is L=radix/BLIST_BMAP_RADIX. If 'm' + * is short for BLIST_META_RADIX, then for a tree of height h with L=m**h + * leaf nodes, the total number of tree nodes is 1 + m + m**2 + ... + m**h, + * or, equivalently, (m**(h+1)-1)/(m-1). This quantity is called 'skip' + * in the 'meta' functions that process subtrees. Since integer division + * discards remainders, we can express this computation as + * skip = (m * m**h) / (m - 1) + * skip = (m * radix / BLIST_BMAP_RADIX) / (m - 1) + * and if m divides BLIST_BMAP_RADIX, we can simplify further to + * skip = radix / (BLIST_BMAP_RADIX / m * (m - 1)) + * so that a simple integer division is enough for the calculation. + */ +static inline daddr_t +radix_to_skip(daddr_t radix) +{ + + return (radix / + (BLIST_BMAP_RADIX / BLIST_META_RADIX * (BLIST_META_RADIX - 1))); +} + +/* * blist_create() - create a blist capable of handling up to the specified * number of blocks * @@ -157,18 +178,16 @@ blist_t blist_create(daddr_t blocks, int flags) { blist_t bl; - daddr_t nodes, radix, skip; + daddr_t nodes, radix; /* - * Calculate radix and skip field used for scanning. + * Calculate the radix field used for scanning. */ radix = BLIST_BMAP_RADIX; - skip = 0; while (radix < blocks) { radix *= BLIST_META_RADIX; - skip = (skip + 1) * BLIST_META_RADIX; } - nodes = 1 + blst_radix_init(NULL, radix, skip, blocks); + nodes = 1 + blst_radix_init(NULL, radix, blocks); bl = malloc(sizeof(struct blist), M_SWAP, flags); if (bl == NULL) @@ -176,14 +195,13 @@ blist_create(daddr_t blocks, int flags) bl->bl_blocks = blocks; bl->bl_radix = radix; - bl->bl_skip = skip; bl->bl_cursor = 0; bl->bl_root = malloc(nodes * sizeof(blmeta_t), M_SWAP, flags); if (bl->bl_root == NULL) { free(bl, M_SWAP); return (NULL); } - blst_radix_init(bl->bl_root, radix, skip, blocks); + blst_radix_init(bl->bl_root, radix, blocks); #if defined(BLIST_DEBUG) printf( @@ -225,7 +243,7 @@ blist_alloc(blist_t bl, daddr_t count) */ while (count <= bl->bl_root->bm_bighint) { blk = blst_meta_alloc(bl->bl_root, 0, count, bl->bl_radix, - bl->bl_skip, bl->bl_cursor); + bl->bl_cursor); if (blk != SWAPBLK_NONE) { bl->bl_cursor = blk + count; return (blk); @@ -257,7 +275,7 @@ void blist_free(blist_t bl, daddr_t blkno, daddr_t count) { - blst_meta_free(bl->bl_root, blkno, count, bl->bl_radix, bl->bl_skip, 0); + blst_meta_free(bl->bl_root, blkno, count, bl->bl_radix, 0); } /* @@ -270,8 +288,7 @@ daddr_t blist_fill(blist_t bl, daddr_t blkno, daddr_t count) { - return (blst_meta_fill(bl->bl_root, blkno, count, bl->bl_radix, - bl->bl_skip, 0)); + return (blst_meta_fill(bl->bl_root, blkno, count, bl->bl_radix, 0)); } /* @@ -290,7 +307,7 @@ blist_resize(blist_t *pbl, daddr_t count, int freenew, *pbl = newbl; if (count > save->bl_blocks) count = save->bl_blocks; - blst_copy(save->bl_root, 0, save->bl_radix, save->bl_skip, newbl, count); + blst_copy(save->bl_root, 0, save->bl_radix, newbl, count); /* * If resizing upwards, should we free the new space or not? @@ -309,8 +326,8 @@ blist_resize(blist_t *pbl, daddr_t count, int freenew, void blist_print(blist_t bl) { - printf("BLIST {\n"); - blst_radix_print(bl->bl_root, 0, bl->bl_radix, bl->bl_skip, 4); + printf("BLIST cursor = %08jx {\n", (uintmax_t)bl->bl_cursor); + blst_radix_print(bl->bl_root, 0, bl->bl_radix, 4); printf("}\n"); } @@ -426,9 +443,9 @@ blst_leaf_alloc(blmeta_t *scan, daddr_t blk, int count */ static daddr_t blst_meta_alloc(blmeta_t *scan, daddr_t blk, daddr_t count, daddr_t radix, - daddr_t skip, daddr_t cursor) + daddr_t cursor) { - daddr_t i, next_skip, r; + daddr_t i, next_skip, r, skip; int child; bool scan_from_start; @@ -443,6 +460,7 @@ blst_meta_alloc(blmeta_t *scan, daddr_t blk, daddr_t c scan->bm_bighint = scan->u.bmu_avail; return (SWAPBLK_NONE); } + skip = radix_to_skip(radix); next_skip = skip / BLIST_META_RADIX; /* @@ -456,7 +474,7 @@ blst_meta_alloc(blmeta_t *scan, daddr_t blk, daddr_t c * Reinitialize each of the meta node's children. An ALL-FREE * meta node cannot have a terminator in any subtree. */ - for (i = 1; i <= skip; i += next_skip) { + for (i = 1; i < skip; i += next_skip) { if (next_skip == 1) scan[i].u.bmu_bitmap = (u_daddr_t)-1; else @@ -477,13 +495,13 @@ blst_meta_alloc(blmeta_t *scan, daddr_t blk, daddr_t c scan_from_start = cursor == blk; child = (cursor - blk) / radix; blk += child * radix; - for (i = 1 + child * next_skip; i <= skip; i += next_skip) { + for (i = 1 + child * next_skip; i < skip; i += next_skip) { if (count <= scan[i].bm_bighint) { /* * The allocation might fit in the i'th subtree. */ r = blst_meta_alloc(&scan[i], blk, count, radix, - next_skip - 1, cursor > blk ? cursor : blk); + cursor > blk ? cursor : blk); if (r != SWAPBLK_NONE) { scan->u.bmu_avail -= count; return (r); @@ -552,15 +570,16 @@ blst_leaf_free(blmeta_t *scan, daddr_t blk, int count) */ static void blst_meta_free(blmeta_t *scan, daddr_t freeBlk, daddr_t count, daddr_t radix, - daddr_t skip, daddr_t blk) + daddr_t blk) { - daddr_t i, next_skip, v; + daddr_t i, next_skip, skip, v; int child; if (scan->bm_bighint == (daddr_t)-1) panic("freeing invalid range"); if (radix == BLIST_BMAP_RADIX) return (blst_leaf_free(scan, freeBlk, count)); + skip = radix_to_skip(radix); next_skip = skip / BLIST_META_RADIX; if (scan->u.bmu_avail == 0) { @@ -572,7 +591,7 @@ blst_meta_free(blmeta_t *scan, daddr_t freeBlk, daddr_ scan->bm_bighint = count; if (count != radix) { - for (i = 1; i <= skip; i += next_skip) { + for (i = 1; i < skip; i += next_skip) { if (scan[i].bm_bighint == (daddr_t)-1) break; scan[i].bm_bighint = 0; @@ -609,11 +628,11 @@ blst_meta_free(blmeta_t *scan, daddr_t freeBlk, daddr_ child = (freeBlk - blk) / radix; blk += child * radix; i = 1 + child * next_skip; - while (i <= skip && blk < freeBlk + count) { + while (i < skip && blk < freeBlk + count) { v = blk + radix - freeBlk; if (v > count) v = count; - blst_meta_free(&scan[i], freeBlk, v, radix, next_skip - 1, blk); + blst_meta_free(&scan[i], freeBlk, v, radix, blk); if (scan->bm_bighint < scan[i].bm_bighint) scan->bm_bighint = scan[i].bm_bighint; count -= v; @@ -630,10 +649,10 @@ blst_meta_free(blmeta_t *scan, daddr_t freeBlk, daddr_ * tree. The space may not already be free in the destination. */ static void -blst_copy(blmeta_t *scan, daddr_t blk, daddr_t radix, daddr_t skip, - blist_t dest, daddr_t count) +blst_copy(blmeta_t *scan, daddr_t blk, daddr_t radix, blist_t dest, + daddr_t count) { - daddr_t i, next_skip; + daddr_t i, next_skip, skip; /* * Leaf node @@ -677,21 +696,20 @@ blst_copy(blmeta_t *scan, daddr_t blk, daddr_t radix, } - radix /= BLIST_META_RADIX; + skip = radix_to_skip(radix); next_skip = skip / BLIST_META_RADIX; + radix /= BLIST_META_RADIX; - for (i = 1; count && i <= skip; i += next_skip) { + for (i = 1; count && i < skip; i += next_skip) { if (scan[i].bm_bighint == (daddr_t)-1) break; if (count >= radix) { - blst_copy(&scan[i], blk, radix, next_skip - 1, dest, - radix); + blst_copy(&scan[i], blk, radix, dest, radix); count -= radix; } else { if (count) { - blst_copy(&scan[i], blk, radix, next_skip - 1, - dest, count); + blst_copy(&scan[i], blk, radix, dest, count); } count = 0; } @@ -733,9 +751,9 @@ blst_leaf_fill(blmeta_t *scan, daddr_t blk, int count) */ static daddr_t blst_meta_fill(blmeta_t *scan, daddr_t allocBlk, daddr_t count, daddr_t radix, - daddr_t skip, daddr_t blk) + daddr_t blk) { - daddr_t i, nblks, next_skip, v; + daddr_t i, nblks, next_skip, skip, v; int child; if (scan->bm_bighint == (daddr_t)-1) @@ -758,6 +776,7 @@ blst_meta_fill(blmeta_t *scan, daddr_t allocBlk, daddr scan->bm_bighint = 0; return (nblks); } + skip = radix_to_skip(radix); next_skip = skip / BLIST_META_RADIX; /* @@ -771,7 +790,7 @@ blst_meta_fill(blmeta_t *scan, daddr_t allocBlk, daddr * Reinitialize each of the meta node's children. An ALL-FREE * meta node cannot have a terminator in any subtree. */ - for (i = 1; i <= skip; i += next_skip) { + for (i = 1; i < skip; i += next_skip) { if (next_skip == 1) scan[i].u.bmu_bitmap = (u_daddr_t)-1; else @@ -786,12 +805,11 @@ blst_meta_fill(blmeta_t *scan, daddr_t allocBlk, daddr child = (allocBlk - blk) / radix; blk += child * radix; i = 1 + child * next_skip; - while (i <= skip && blk < allocBlk + count) { + while (i < skip && blk < allocBlk + count) { v = blk + radix - allocBlk; if (v > count) v = count; - nblks += blst_meta_fill(&scan[i], allocBlk, v, radix, - next_skip - 1, blk); + nblks += blst_meta_fill(&scan[i], allocBlk, v, radix, blk); count -= v; allocBlk += v; blk += radix; @@ -810,9 +828,9 @@ blst_meta_fill(blmeta_t *scan, daddr_t allocBlk, daddr * RADIX values we use. */ static daddr_t -blst_radix_init(blmeta_t *scan, daddr_t radix, daddr_t skip, daddr_t count) +blst_radix_init(blmeta_t *scan, daddr_t radix, daddr_t count) { - daddr_t i, memindex, next_skip; + daddr_t i, memindex, next_skip, skip; memindex = 0; @@ -839,17 +857,18 @@ blst_radix_init(blmeta_t *scan, daddr_t radix, daddr_t scan->u.bmu_avail = 0; } - radix /= BLIST_META_RADIX; + skip = radix_to_skip(radix); next_skip = skip / BLIST_META_RADIX; + radix /= BLIST_META_RADIX; - for (i = 1; i <= skip; i += next_skip) { + for (i = 1; i < skip; i += next_skip) { if (count >= radix) { /* * Allocate the entire object */ memindex = i + blst_radix_init(((scan) ? &scan[i] : NULL), radix, - next_skip - 1, radix); + radix); count -= radix; } else if (count > 0) { /* @@ -857,7 +876,7 @@ blst_radix_init(blmeta_t *scan, daddr_t radix, daddr_t */ memindex = i + blst_radix_init(((scan) ? &scan[i] : NULL), radix, - next_skip - 1, count); + count); count = 0; } else { /* @@ -876,10 +895,9 @@ blst_radix_init(blmeta_t *scan, daddr_t radix, daddr_t #ifdef BLIST_DEBUG static void -blst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t radix, daddr_t skip, - int tab) +blst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t radix, int tab) { - daddr_t i, next_skip; + daddr_t i, next_skip, skip; if (radix == BLIST_BMAP_RADIX) { printf( @@ -920,11 +938,12 @@ blst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t (long long)scan->bm_bighint ); - radix /= BLIST_META_RADIX; + skip = radix_to_skip(radix); next_skip = skip / BLIST_META_RADIX; + radix /= BLIST_META_RADIX; tab += 4; - for (i = 1; i <= skip; i += next_skip) { + for (i = 1; i < skip; i += next_skip) { if (scan[i].bm_bighint == (daddr_t)-1) { printf( "%*.*s(%08llx,%lld): Terminator\n", @@ -933,7 +952,7 @@ blst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t ); break; } - blst_radix_print(&scan[i], blk, radix, next_skip - 1, tab); + blst_radix_print(&scan[i], blk, radix, tab); blk += radix; } tab -= 4; Modified: head/sys/sys/blist.h ============================================================================== --- head/sys/sys/blist.h Tue Aug 1 03:40:19 2017 (r321839) +++ head/sys/sys/blist.h Tue Aug 1 03:51:26 2017 (r321840) @@ -81,7 +81,6 @@ typedef struct blmeta { typedef struct blist { daddr_t bl_blocks; /* area of coverage */ daddr_t bl_radix; /* coverage radix */ - daddr_t bl_skip; /* starting skip */ daddr_t bl_cursor; /* next-fit search starts at */ blmeta_t *bl_root; /* root of radix tree */ } *blist_t; From owner-svn-src-all@freebsd.org Tue Aug 1 04:04:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F043FDC919E; Tue, 1 Aug 2017 04:04:46 +0000 (UTC) (envelope-from dchagin@mordor.heemeyer.club) Received: from heemeyer.club (heemeyer.club [108.61.204.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "heemeyer.club", Issuer "heemeyer.club" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C52B576C9B; Tue, 1 Aug 2017 04:04:46 +0000 (UTC) (envelope-from dchagin@mordor.heemeyer.club) Received: from mordor.heemeyer.club (dchagin.static.corbina.ru [78.107.232.239] (may be forged)) by heemeyer.club (8.15.2/8.15.1) with ESMTPS id v713hmA6029901 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 1 Aug 2017 03:43:49 GMT (envelope-from dchagin@mordor.heemeyer.club) X-Authentication-Warning: heemeyer.club: Host dchagin.static.corbina.ru [78.107.232.239] (may be forged) claimed to be mordor.heemeyer.club Received: from mordor.heemeyer.club (localhost [127.0.0.1]) by mordor.heemeyer.club (8.15.2/8.15.1) with ESMTPS id v713hfCC036505 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 1 Aug 2017 06:43:41 +0300 (MSK) (envelope-from dchagin@mordor.heemeyer.club) Received: (from dchagin@localhost) by mordor.heemeyer.club (8.15.2/8.15.2/Submit) id v713hfKm036504; Tue, 1 Aug 2017 06:43:41 +0300 (MSK) (envelope-from dchagin) Date: Tue, 1 Aug 2017 06:43:40 +0300 From: Chagin Dmitry To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r321839 - in head: share/man/man4 share/man/man5 sys/fs/fdescfs sys/kern sys/sys Message-ID: <20170801034340.GA36494@mordor.heemeyer.club> References: <201708010340.v713eJVp002477@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201708010340.v713eJVp002477@repo.freebsd.org> User-Agent: Mutt/1.8.3 (2017-05-23) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 04:04:47 -0000 On Tue, Aug 01, 2017 at 03:40:19AM +0000, Dmitry Chagin wrote: > Author: dchagin > Date: Tue Aug 1 03:40:19 2017 > New Revision: 321839 > URL: https://svnweb.freebsd.org/changeset/base/321839 > > Log: > Implement proper Linux /dev/fd and /proc/self/fd behavior by adding > Linux specific things to the native fdescfs file system. > > Unlike FreeBSD, the Linux fdescfs is a directory containing a symbolic > links to the actual files, which the process has open. > A readlink(2) call on this file returns a full path in case of regular file > or a string in a special format (type:[inode], anon_inode:, etc..). > As well as in a FreeBSD, opening the file in the Linux fdescfs directory is > equivalent to duplicating the corresponding file descriptor. > > Here we have mutually exclusive requirements: > - in case of readlink(2) call fdescfs lookup() method should return VLNK > vnode otherwise our kern_readlink() fail with EINVAL error; > - in the other calls fdescfs lookup() method should return non VLNK vnode. > > For what new vnode v_flag VV_READLINK was added, which is set if fdescfs has beed > mounted with linrdlnk option an modified kern_readlinkat() to properly handle it. > > For now For Linux ABI compatibility mount fdescfs volume with linrdlnk option: > > mount -t fdescfs -o linrdlnk null /compat/linux/dev/fd > > Reviewed by: kib@ > MFC after: 1 week > Relnotes: yes Differential Revision: https://reviews.freebsd.org/D11452 From owner-svn-src-all@freebsd.org Tue Aug 1 04:16:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A09CDC969A; Tue, 1 Aug 2017 04:16:54 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E0181771BE; Tue, 1 Aug 2017 04:16:53 +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 v714Gq3e018458; Tue, 1 Aug 2017 04:16:52 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v714Gqv7018454; Tue, 1 Aug 2017 04:16:52 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201708010416.v714Gqv7018454@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 1 Aug 2017 04:16:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321841 - in head/sys: conf dev/iicbus modules/i2c modules/i2c/isl12xx X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys: conf dev/iicbus modules/i2c modules/i2c/isl12xx X-SVN-Commit-Revision: 321841 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 04:16:54 -0000 Author: ian Date: Tue Aug 1 04:16:52 2017 New Revision: 321841 URL: https://svnweb.freebsd.org/changeset/base/321841 Log: Add a driver for the Intersil ISL12xx family of i2c RTC chips. Supports ISL1209, ISL1218, ISL1219, ISL1220, ISL1221 (just basic RTC functionality, not all the other fancy stuff the chips can do). Added: head/sys/dev/iicbus/isl12xx.c (contents, props changed) head/sys/modules/i2c/isl12xx/ head/sys/modules/i2c/isl12xx/Makefile (contents, props changed) Modified: head/sys/conf/files head/sys/modules/i2c/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Aug 1 03:51:26 2017 (r321840) +++ head/sys/conf/files Tue Aug 1 04:16:52 2017 (r321841) @@ -1736,6 +1736,7 @@ dev/iicbus/iiconf.c optional iicbus dev/iicbus/iicsmb.c optional iicsmb \ dependency "iicbus_if.h" dev/iicbus/iicoc.c optional iicoc +dev/iicbus/isl12xx.c optional isl12xx dev/iicbus/lm75.c optional lm75 dev/iicbus/nxprtc.c optional nxprtc | pcf8563 dev/iicbus/ofw_iicbus.c optional fdt iicbus Added: head/sys/dev/iicbus/isl12xx.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/iicbus/isl12xx.c Tue Aug 1 04:16:52 2017 (r321841) @@ -0,0 +1,354 @@ +/*- + * Copyright (c) 2017 Ian Lepore. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * Driver for ISL12xx family i2c realtime clocks: + * - ISL1209 = 2B sram, tamper/event timestamp + * - ISL1218 = 8B sram, DS13xx pin compatible (but not software compatible) + * - ISL1219 = 2B sram, tamper/event timestamp + * - ISL1220 = 8B sram, separate Fout + * - ISL1221 = 2B sram, separate Fout, tamper/event timestamp + * + * This driver supports only the basic RTC functionality in all these chips. + */ + +#include "opt_platform.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef FDT +#include +#include +#endif + +#include +#include + +#include "clock_if.h" +#include "iicbus_if.h" + +/* + * All register and bit names as found in the datasheet. When a bit name ends + * in 'B' that stands for "bar" and it is an active-low signal; something named + * "EVENB" implies 1=event-disable, 0=event-enable. + */ + +#define ISL12XX_SC_REG 0x00 /* RTC Seconds */ + +#define ISL12XX_SR_REG 0x07 /* Status */ +#define ISL12XX_SR_ARST (1u << 7) /* Auto-reset on status read */ +#define ISL12XX_SR_XTOSCB (1u << 5) /* Osc disable (use ext osc) */ +#define ISL12XX_SR_WRTC (1u << 4) /* Write RTC enable */ +#define ISL12XX_SR_EVT (1u << 3) /* Event occurred (w0c) */ +#define ISL12XX_SR_ALM (1u << 2) /* Alarm occurred (w0c) */ +#define ISL12XX_SR_BAT (1u << 1) /* Running on battery (w0c) */ +#define ISL12XX_SR_RTCF (1u << 0) /* RTC fail (power loss) */ +#define ISL12XX_SR_W0C_BITS (ISL12XX_SR_BAT | ISL12XX_SR_ALM | ISL12XX_SR_EVT) + +#define ISL12XX_INT_REG 0x08 /* Interrupts */ +#define ISL12XX_INT_IM (1u << 7) /* Alarm interrupt mode */ +#define ISL12XX_INT_ALME (1u << 6) /* Alarm enable */ +#define ISL12XX_INT_LPMODE (1u << 5) /* Low Power mode */ +#define ISL12XX_INT_FOBATB (1u << 4) /* Fout/IRQ disabled on bat */ +#define ISL12XX_INT_FO_SHIFT 0 /* Frequency output select */ +#define ISL12XX_INT_FO_MASK 0x0f /* shift and mask. */ + +#define ISL12XX_EV_REG 0x09 /* Event */ +#define ISL12XX_EV_EVIENB (1u << 7) /* Disable internal pullup */ +#define ISL12XX_EV_EVBATB (1u << 6) /* Disable ev detect on bat */ +#define ISL12XX_EV_RTCHLT (1u << 5) /* Halt RTC on event */ +#define ISL12XX_EV_EVEN (1u << 4) /* Event detect enable */ +#define ISL12XX_EV_EHYS_SHIFT 2 /* Event input hysteresis */ +#define ISL12XX_EV_EHYS_MASK 0x03 /* selection; see datasheet */ +#define ISL12XX_EV_ESMP_SHIFT 0 /* Event input sample rate */ +#define ISL12XX_EV_ESMP_MASK 0x03 /* selection; see datasheet */ + +#define ISL12XX_ATR_REG 0x0a /* Analog trim (osc adjust) */ + +#define ISL12XX_DTR_REG 0x0b /* Digital trim (osc adjust) */ + +#define ISL12XX_SCA_REG 0x0c /* Alarm seconds */ + +#define ISL12XX_USR1_REG 0x12 /* User byte 1 */ + +#define ISL12XX_USR2_REG 0x13 /* User byte 2 */ + +#define ISL12XX_SCT_REG 0x14 /* Timestamp (event) seconds */ + +#define ISL12XX_24HR_FLAG (1u << 7) /* Hours register 24-hr mode */ +#define ISL12XX_PM_FLAG (1u << 5) /* Hours register PM flag */ +#define ISL12xx_12HR_MASK 0x1f /* Hours mask in AM/PM mode */ +#define ISL12xx_24HR_MASK 0x3f /* Hours mask in 24-hr mode */ + +/* + * A struct laid out in the same order as the time registers in the chip. + */ +struct time_regs { + uint8_t sec, min, hour, day, month, year; +}; + +struct isl12xx_softc { + device_t dev; + device_t busdev; + struct intr_config_hook + init_hook; + bool use_ampm; +}; + +#ifdef FDT +static struct ofw_compat_data compat_data[] = { + {"isil,isl1209", 1}, + {"isil,isl1218", 1}, + {"isil,isl1219", 1}, + {"isil,isl1220", 1}, + {"isil,isl1221", 1}, + {NULL, 0}, +}; +#endif + +static inline int +isl12xx_read1(struct isl12xx_softc *sc, uint8_t reg, uint8_t *data) +{ + + return (iicdev_readfrom(sc->dev, reg, data, 1, IIC_WAIT)); +} + +static inline int +isl12xx_write1(struct isl12xx_softc *sc, uint8_t reg, uint8_t val) +{ + + return (iicdev_writeto(sc->dev, reg, &val, 1, IIC_WAIT)); +} + +static void +isl12xx_init(void *arg) +{ + struct isl12xx_softc *sc = arg; + uint8_t sreg; + + config_intrhook_disestablish(&sc->init_hook); + + /* + * Check the clock-stopped/power-fail bit, just so we can report it to + * the user at boot time. + */ + isl12xx_read1(sc, ISL12XX_SR_REG, &sreg); + if (sreg & ISL12XX_SR_RTCF) { + device_printf(sc->dev, + "RTC clock stopped; check battery\n"); + } + + /* + * Register as a system realtime clock. + */ + clock_register_flags(sc->dev, 1000000, CLOCKF_SETTIME_NO_ADJ); + clock_schedule(sc->dev, 1); +} + +static int +isl12xx_probe(device_t dev) +{ + +#ifdef FDT + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data != 0) { + device_set_desc(dev, "Intersil ISL12xx RTC"); + return (BUS_PROBE_DEFAULT); + } +#endif + return (ENXIO); +} + +static int +isl12xx_attach(device_t dev) +{ + struct isl12xx_softc *sc = device_get_softc(dev); + + sc->dev = dev; + sc->busdev = device_get_parent(sc->dev); + + /* + * Chip init must wait until interrupts are enabled. Often i2c access + * works only when the interrupts are available. + */ + sc->init_hook.ich_func = isl12xx_init; + sc->init_hook.ich_arg = sc; + if (config_intrhook_establish(&sc->init_hook) != 0) + return (ENOMEM); + + return (0); +} + +static int +isl12xx_detach(device_t dev) +{ + + clock_unregister(dev); + return (0); +} + +static int +isl12xx_gettime(device_t dev, struct timespec *ts) +{ + struct isl12xx_softc *sc = device_get_softc(dev); + struct clocktime ct; + struct time_regs tregs; + int err; + uint8_t hourmask, sreg; + + /* If power failed, we can't provide valid time. */ + if ((err = isl12xx_read1(sc, ISL12XX_SR_REG, &sreg)) != 0) + return (err); + if (sreg & ISL12XX_SR_RTCF) + return (EINVAL); + + /* Read the bcd time registers. */ + if ((err = iicdev_readfrom(sc->dev, ISL12XX_SC_REG, &tregs, sizeof(tregs), + IIC_WAIT)) != 0) + return (EINVAL); + + /* If chip is in AM/PM mode remember that for when we set time. */ + if (tregs.hour & ISL12XX_24HR_FLAG) { + hourmask = ISL12xx_24HR_MASK; + } else { + sc->use_ampm = true; + hourmask = ISL12xx_12HR_MASK; + } + + ct.nsec = 0; + ct.sec = FROMBCD(tregs.sec); + ct.min = FROMBCD(tregs.min); + ct.hour = FROMBCD(tregs.hour & hourmask); + ct.day = FROMBCD(tregs.day); + ct.mon = FROMBCD(tregs.month); + ct.year = FROMBCD(tregs.year); + + if (sc->use_ampm) { + if (ct.hour == 12) + ct.hour = 0; + if (tregs.hour & ISL12XX_PM_FLAG) + ct.hour += 12; + } + + return (clock_ct_to_ts(&ct, ts)); +} + +static int +isl12xx_settime(device_t dev, struct timespec *ts) +{ + struct isl12xx_softc *sc = device_get_softc(dev); + struct clocktime ct; + struct time_regs tregs; + int err; + uint8_t ampmflags, sreg; + + /* + * We request a timespec with no resolution-adjustment. That also + * disables utc adjustment, so apply that ourselves. + */ + ts->tv_sec -= utc_offset(); + ts->tv_nsec = 0; + clock_ts_to_ct(ts, &ct); + + /* If the chip is in AM/PM mode, adjust hour and set flags as needed. */ + if (!sc->use_ampm) { + ampmflags = ISL12XX_24HR_FLAG; + } else { + ampmflags = 0; + if (ct.hour >= 12) { + ct.hour -= 12; + ampmflags |= ISL12XX_PM_FLAG; + } + if (ct.hour == 0) + ct.hour = 12; + } + + tregs.sec = TOBCD(ct.sec); + tregs.min = TOBCD(ct.min); + tregs.hour = TOBCD(ct.hour) | ampmflags; + tregs.day = TOBCD(ct.day); + tregs.month = TOBCD(ct.mon); + tregs.year = TOBCD(ct.year % 100); + + /* + * To set the time we have to set the WRTC enable bit in the control + * register, then write the time regs, then clear the WRTC bit. While + * doing so we have to be careful to not write a 0 to any sreg bit which + * is "write 0 to clear". One of those bits could get set between + * reading and writing the register. All those bits ignore attempts to + * write a 1, so just always OR-in all the W0C bits to be sure we never + * accidentally clear one. We hold ownership of the i2c bus for the + * whole read-modify-write sequence. + */ + if ((err = iicbus_request_bus(sc->busdev, sc->dev, IIC_WAIT)) != 0) + return (err); + if ((err = isl12xx_read1(sc, ISL12XX_SR_REG, &sreg)) == 0) { + sreg |= ISL12XX_SR_WRTC | ISL12XX_SR_W0C_BITS; + if ((err = isl12xx_write1(sc, ISL12XX_SR_REG, sreg)) == 0) { + err = iicdev_writeto(sc->dev, ISL12XX_SC_REG, &tregs, + sizeof(tregs), IIC_WAIT); + sreg &= ~ISL12XX_SR_WRTC; + isl12xx_write1(sc, ISL12XX_SR_REG, sreg); + } + } + iicbus_release_bus(sc->busdev, sc->dev); + + return (err); +} + +static device_method_t isl12xx_methods[] = { + /* device_if methods */ + DEVMETHOD(device_probe, isl12xx_probe), + DEVMETHOD(device_attach, isl12xx_attach), + DEVMETHOD(device_detach, isl12xx_detach), + + /* clock_if methods */ + DEVMETHOD(clock_gettime, isl12xx_gettime), + DEVMETHOD(clock_settime, isl12xx_settime), + + DEVMETHOD_END, +}; + +static driver_t isl12xx_driver = { + "isl12xx", + isl12xx_methods, + sizeof(struct isl12xx_softc), +}; +static devclass_t isl12xx_devclass; + +DRIVER_MODULE(isl12xx, iicbus, isl12xx_driver, isl12xx_devclass, NULL, NULL); +MODULE_VERSION(isl12xx, 1); +MODULE_DEPEND(isl12xx, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER); Modified: head/sys/modules/i2c/Makefile ============================================================================== --- head/sys/modules/i2c/Makefile Tue Aug 1 03:51:26 2017 (r321840) +++ head/sys/modules/i2c/Makefile Tue Aug 1 04:16:52 2017 (r321841) @@ -11,6 +11,7 @@ SUBDIR = \ iicbus \ iicsmb \ isl \ + isl12xx \ jedec_ts \ nxprtc \ smb \ Added: head/sys/modules/i2c/isl12xx/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/i2c/isl12xx/Makefile Tue Aug 1 04:16:52 2017 (r321841) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/dev/iicbus +KMOD = isl12xx +SRCS = isl12xx.c bus_if.h clock_if.h device_if.h iicbus_if.h + +.include From owner-svn-src-all@freebsd.org Tue Aug 1 04:20:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10C4FDC986B for ; Tue, 1 Aug 2017 04:20:34 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x234.google.com (mail-it0-x234.google.com [IPv6:2607:f8b0:4001:c0b::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9E712773A4 for ; Tue, 1 Aug 2017 04:20:33 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x234.google.com with SMTP id h199so1917071ith.0 for ; Mon, 31 Jul 2017 21:20:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=date:subject:message-id:from:to:mime-version; bh=FNVfozCdDnuoeO8usbX0jFwC/YoiWnVuUVt9RFNDAHo=; b=YTWBI5f+2634a6I2HD9oMQvdG0hSMt5ZrYKWzrzwPURm5ZhacEQgi4XmqpXBebOA7/ OsI6aSmNhyIxCnvOqGGC07FCmtXc/Wt5TeHIIRL9j5rx4sDT7jdQXd1fk7DqShKYj8tK YQlpGNKFhMf68ZeNCSk/wp6nogQeqKhtBYXVEp9nJDdZtdggDdxp0Fvtf7k+MZwlCakM epjecklm8+99bAxpPPqvbWWC5F2PiCikfoSPcX829h3gE1pMcZOa0lZpPQfnbxwhZHQu juzECIWmRwPSYGGYmCs6f8IYg83yfLgKWN1v1GnbEswNPKlHmTmbC+98iseyNtam1Dwu Vmfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:subject:message-id:from:to:mime-version; bh=FNVfozCdDnuoeO8usbX0jFwC/YoiWnVuUVt9RFNDAHo=; b=Q9sBW+c5Vmj8/Xa84pkSHiBqbv0QZ1d+2fsD8IA7kooggRK3FnmQrliP8z6gdd6h3e UyxZvxGn9mIrb7hOcqKo4dAemfB/+6/RyHmk/JkUJybBJ03fSb3wwhNlFd5K3I9zhPQW 8+UTf0zIgKFpIz6T5zynCAi83LltX84eVVX/UrRAJGR2UdOwchjvEHXfhd1PQoGDH7b+ NWSALhgNvpi37teIjEYuyUBkuSnZCM8hNXi/r4kI/AASHpStbKi8wHq8zU17M2RqwpD4 m/f7rhiBCMl/0949ZdHXuI+Uo+QW+rHmQaBR/1X4LksnmOUAx0xas+JzESe2ZycMDwJR n2gA== X-Gm-Message-State: AIVw110dj+M4tTe1N2VwpEGy5Cl/yceTPZMWyrkm4DblGUWQ6qj6plZ+ oc9gFJ4d5AN1r4A6 X-Received: by 10.36.121.207 with SMTP id z198mr415849itc.83.1501561232376; Mon, 31 Jul 2017 21:20:32 -0700 (PDT) Received: from [10.0.0.93] (50-253-99-174-static.hfc.comcastbusiness.net. [50.253.99.174]) by smtp.gmail.com with ESMTPSA id b14sm242738itb.18.2017.07.31.21.20.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 31 Jul 2017 21:20:31 -0700 (PDT) Date: Mon, 31 Jul 2017 22:20:29 -0600 Subject: Re: svn commit: r321840 - in head/sys: kern sys Message-ID: <5lny7794f8b19a2l8vlaannr.1501561229506@email.android.com> From: Warner Losh To: Alan Cox , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: base64 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 04:20:34 -0000 CgpPbiBKdWx5IDMxLCAyMDE3LCBhdCA5OjUxIFBNLCBBbGFuIENveCA8YWxjQGZyZWVic2Qub3Jn PiB3cm90ZToKCj5BdXRob3I6IGFsYwo+RGF0ZTogVHVlIEF1Z8KgIDEgMDM6NTE6MjYgMjAxNwo+ TmV3IFJldmlzaW9uOiAzMjE4NDAKPlVSTDogaHR0cHM6Ly9zdm53ZWIuZnJlZWJzZC5vcmcvY2hh bmdlc2V0L2Jhc2UvMzIxODQwCj5Mb2c6Cj7CoCBUaGUgYmxpc3RfbWV0YV8qIHJvdXRpbmVzIHRo YXQgcHJvY2VzcyBhIHN1YnRyZWUgdGFrZSBhcmd1bWVudHMgJ3JhZGl4JyBhbmQKPsKgICdza2lw Jywgd2hpY2ggZGVub3RlLCByZXNwZWN0aXZlbHksIHRoZSBsYXJnZXN0IG51bWJlciBvZiBibG9j a3MgdGhhdCBjYW4gYmUKPsKgIG1hbmFnZWQgYnkgYSBzdWJ0cmVlIG9mIHRoYXQgaGVpZ2h0LCBh bmQgb25lIGxlc3MgdGhhbiB0aGUgbnVtYmVyIG9mIG5vZGVzCj7CoCBpbiBhIHN1YnRyZWUgb2Yg dGhhdCBoZWlnaHQuwqAgVGhpcyBjaGFuZ2UgcmVtb3ZlcyB0aGUgJ3NraXAnIGFyZ3VtZW50IGZy b20KPsKgIHRob3NlIGZ1bmN0aW9ucyBiZWNhdXNlICdza2lwJyBjYW4gYmUgdHJpdmlhbGx5IGNv bXB1dGVkIGZyb20gJ3JhZGl1cycuCj7CoCBUaGlzIGNoYW5nZSBhbHNvIHJlZGVmaW5lcyAnc2tp cCcgc28gdGhhdCBpdCBkZW5vdGVzIHRoZSBudW1iZXIgb2Ygbm9kZXMgaW4KPsKgIHRoZSBzdWJ0 cmVlLCBhbmQgc28gY2hhbmdlcyBsb29wIHVwcGVyIGJvdW5kIHRlc3RzIGZyb20gJzw9IHNraXAn IHRvICc8Cj7CoCBza2lwJyB0byBhY2NvdW50IGZvciB0aGUgY2hhbmdlLgo+wqAgCj7CoCBUaGUg J3NraXAnIGZpZWxkIGlzIGFsc28gcmVtb3ZlZCBmcm9tIHRoZSBibGlzdCBzdHJ1Y3QuCj7CoCAK PsKgIFRoZSBzZWxmLXRlc3QgcHJvZ3JhbSBpcyBjaGFuZ2VkIHNvIHRoYXQgdGhlIHByaW50IGNv bW1hbmQgaW5jbHVkZXMgdGhlCj7CoCBjdXJzb3IgdmFsdWUgaW4gdGhlIG91dHB1dC4KPsKgIAo+ wqAgU3VibWl0dGVkIGJ5OiBEb3VnIE1vb3JlIDxkb3VnbUByaWNlLmVkdT4KPsKgIE1GQyBhZnRl cjogMSB3ZWVrCj5Nb2RpZmllZDoKPsKgIGhlYWQvc3lzL2tlcm4vc3Vicl9ibGlzdC5jCj7CoCBo ZWFkL3N5cy9zeXMvYmxpc3QuaAo+TW9kaWZpZWQ6IGhlYWQvc3lzL2tlcm4vc3Vicl9ibGlzdC5j Cj49PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT0KPi0tLSBoZWFkL3N5cy9rZXJuL3N1YnJfYmxpc3QuYyBU dWUgQXVnwqAgMSAwMzo0MDoxOSAyMDE3IChyMzIxODM5KQo+KysrIGhlYWQvc3lzL2tlcm4vc3Vi cl9ibGlzdC5jIFR1ZSBBdWfCoCAxIDAzOjUxOjI2IDIwMTcgKHIzMjE4NDApCj5AQCAtMTIzLDIw ICsxMjMsMTkgQEAgdm9pZCBwYW5pYyhjb25zdCBjaGFyICpjdGwsIC4uLik7Cj5zdGF0aWMgZGFk ZHJfdCBibHN0X2xlYWZfYWxsb2MoYmxtZXRhX3QgKnNjYW4sIGRhZGRyX3QgYmxrLCBpbnQgY291 bnQsCj7CoMKgwqAgZGFkZHJfdCBjdXJzb3IpOwo+c3RhdGljIGRhZGRyX3QgYmxzdF9tZXRhX2Fs bG9jKGJsbWV0YV90ICpzY2FuLCBkYWRkcl90IGJsaywgZGFkZHJfdCBjb3VudCwKPi0gwqDCoMKg IGRhZGRyX3QgcmFkaXgsIGRhZGRyX3Qgc2tpcCwgZGFkZHJfdCBjdXJzb3IpOwo+KyDCoMKgwqAg ZGFkZHJfdCByYWRpeCwgZGFkZHJfdCBjdXJzb3IpOwo+c3RhdGljIHZvaWQgYmxzdF9sZWFmX2Zy ZWUoYmxtZXRhX3QgKnNjYW4sIGRhZGRyX3QgcmVsYmxrLCBpbnQgY291bnQpOwo+c3RhdGljIHZv aWQgYmxzdF9tZXRhX2ZyZWUoYmxtZXRhX3QgKnNjYW4sIGRhZGRyX3QgZnJlZUJsaywgZGFkZHJf dCBjb3VudCwKPi0gwqDCoMKgIGRhZGRyX3QgcmFkaXgsIGRhZGRyX3Qgc2tpcCwgZGFkZHJfdCBi bGspOwo+KyDCoMKgwqAgZGFkZHJfdCByYWRpeCwgZGFkZHJfdCBibGspOwo+c3RhdGljIHZvaWQg YmxzdF9jb3B5KGJsbWV0YV90ICpzY2FuLCBkYWRkcl90IGJsaywgZGFkZHJfdCByYWRpeCwKPi0g wqDCoMKgIGRhZGRyX3Qgc2tpcCwgYmxpc3RfdCBkZXN0LCBkYWRkcl90IGNvdW50KTsKPisgwqDC oMKgIGJsaXN0X3QgZGVzdCwgZGFkZHJfdCBjb3VudCk7Cj5zdGF0aWMgZGFkZHJfdCBibHN0X2xl YWZfZmlsbChibG1ldGFfdCAqc2NhbiwgZGFkZHJfdCBibGssIGludCBjb3VudCk7Cj5zdGF0aWMg ZGFkZHJfdCBibHN0X21ldGFfZmlsbChibG1ldGFfdCAqc2NhbiwgZGFkZHJfdCBhbGxvY0Jsaywg ZGFkZHJfdCBjb3VudCwKPi0gwqDCoMKgIGRhZGRyX3QgcmFkaXgsIGRhZGRyX3Qgc2tpcCwgZGFk ZHJfdCBibGspOwo+LXN0YXRpYyBkYWRkcl90IGJsc3RfcmFkaXhfaW5pdChibG1ldGFfdCAqc2Nh biwgZGFkZHJfdCByYWRpeCwgZGFkZHJfdCBza2lwLAo+LSDCoMKgwqAgZGFkZHJfdCBjb3VudCk7 Cj4rIMKgwqDCoCBkYWRkcl90IHJhZGl4LCBkYWRkcl90IGJsayk7Cj4rc3RhdGljIGRhZGRyX3Qg YmxzdF9yYWRpeF9pbml0KGJsbWV0YV90ICpzY2FuLCBkYWRkcl90IHJhZGl4LCBkYWRkcl90IGNv dW50KTsKPiNpZm5kZWYgX0tFUk5FTAo+c3RhdGljIHZvaWQgYmxzdF9yYWRpeF9wcmludChibG1l dGFfdCAqc2NhbiwgZGFkZHJfdCBibGssIGRhZGRyX3QgcmFkaXgsCj4tIMKgwqDCoCBkYWRkcl90 IHNraXAsIGludCB0YWIpOwo+KyDCoMKgwqAgaW50IHRhYik7Cj4jZW5kaWYKPiNpZmRlZiBfS0VS TkVMCj5AQCAtMTQ0LDYgKzE0MywyOCBAQCBzdGF0aWMgTUFMTE9DX0RFRklORShNX1NXQVAsICJT V0FQIiwgIlN3YXAgc3BhY2UiKTsKPiNlbmRpZgo+LyoKPisgKiBGb3IgYSBzdWJ0cmVlIHRoYXQg Y2FuIHJlcHJlc2VudCB0aGUgc3RhdGUgb2YgdXAgdG8gJ3JhZGl4JyBibG9ja3MsIHRoZQo+KyAq IG51bWJlciBvZiBsZWFmIG5vZGVzIG9mIHRoZSBzdWJ0cmVlIGlzIEw9cmFkaXgvQkxJU1RfQk1B UF9SQURJWC7CoCBJZiAnbScKPisgKiBpcyBzaG9ydCBmb3IgQkxJU1RfTUVUQV9SQURJWCwgdGhl biBmb3IgYSB0cmVlIG9mIGhlaWdodCBoIHdpdGggTD1tKipoCj4rICogbGVhZiBub2RlcywgdGhl IHRvdGFsIG51bWJlciBvZiB0cmVlIG5vZGVzIGlzIDEgKyBtICsgbSoqMiArIC4uLiArIG0qKmgs Cj4rICogb3IsIGVxdWl2YWxlbnRseSwgKG0qKihoKzEpLTEpLyhtLTEpLsKgIFRoaXMgcXVhbnRp dHkgaXMgY2FsbGVkICdza2lwJwo+KyAqIGluIHRoZSAnbWV0YScgZnVuY3Rpb25zIHRoYXQgcHJv Y2VzcyBzdWJ0cmVlcy7CoCBTaW5jZSBpbnRlZ2VyIGRpdmlzaW9uCj4rICogZGlzY2FyZHMgcmVt YWluZGVycywgd2UgY2FuIGV4cHJlc3MgdGhpcyBjb21wdXRhdGlvbiBhcwo+KyAqIHNraXAgPSAo bSAqIG0qKmgpIC8gKG0gLSAxKQo+KyAqIHNraXAgPSAobSAqIHJhZGl4IC8gQkxJU1RfQk1BUF9S QURJWCkgLyAobSAtIDEpCj4rICogYW5kIGlmIG0gZGl2aWRlcyBCTElTVF9CTUFQX1JBRElYLCB3 ZSBjYW4gc2ltcGxpZnkgZnVydGhlciB0bwo+KyAqIHNraXAgPSByYWRpeCAvIChCTElTVF9CTUFQ X1JBRElYIC8gbSAqIChtIC0gMSkpCj4rICogc28gdGhhdCBhIHNpbXBsZSBpbnRlZ2VyIGRpdmlz aW9uIGlzIGVub3VnaCBmb3IgdGhlIGNhbGN1bGF0aW9uLgo+KyAqLwo+K3N0YXRpYyBpbmxpbmUg ZGFkZHJfdAo+K3JhZGl4X3RvX3NraXAoZGFkZHJfdCByYWRpeCkKPit7Cj4rCj4rIHJldHVybiAo cmFkaXggLwo+KyDCoMKgwqAgKEJMSVNUX0JNQVBfUkFESVggLyBCTElTVF9NRVRBX1JBRElYICog KEJMSVNUX01FVEFfUkFESVggLSAxKSkpOwoKSSBkb24ndCB0aGluayB0aGlzIG1hdGNoZXMgdGhl IGNvbW1lbnQuIEl0IGlzIG1pc3NpbmcgcGFyZW5zLCBubz8KCldhcm5lcgo+K30KPisKPisvKgo+ wqAgKiBibGlzdF9jcmVhdGUoKSAtIGNyZWF0ZSBhIGJsaXN0IGNhcGFibGUgb2YgaGFuZGxpbmcg dXAgdG8gdGhlIHNwZWNpZmllZAo+wqAgKiDCoMKgwqAgbnVtYmVyIG9mIGJsb2Nrcwo+wqAgKgo+ QEAgLTE1NywxOCArMTc4LDE2IEBAIGJsaXN0X3QKPmJsaXN0X2NyZWF0ZShkYWRkcl90IGJsb2Nr cywgaW50IGZsYWdzKQo+ewo+Ymxpc3RfdCBibDsKPi0gZGFkZHJfdCBub2RlcywgcmFkaXgsIHNr aXA7Cj4rIGRhZGRyX3Qgbm9kZXMsIHJhZGl4Owo+LyoKPi0gKiBDYWxjdWxhdGUgcmFkaXggYW5k IHNraXAgZmllbGQgdXNlZCBmb3Igc2Nhbm5pbmcuCj4rICogQ2FsY3VsYXRlIHRoZSByYWRpeCBm aWVsZCB1c2VkIGZvciBzY2FubmluZy4KPiovCj5yYWRpeCA9IEJMSVNUX0JNQVBfUkFESVg7Cj4t IHNraXAgPSAwOwo+d2hpbGUgKHJhZGl4IDwgYmxvY2tzKSB7Cj5yYWRpeCAqPSBCTElTVF9NRVRB X1JBRElYOwo+LSBza2lwID0gKHNraXAgKyAxKSAqIEJMSVNUX01FVEFfUkFESVg7Cj59Cj4tIG5v ZGVzID0gMSArIGJsc3RfcmFkaXhfaW5pdChOVUxMLCByYWRpeCwgc2tpcCwgYmxvY2tzKTsKPisg bm9kZXMgPSAxICsgYmxzdF9yYWRpeF9pbml0KE5VTEwsIHJhZGl4LCBibG9ja3MpOwo+YmwgPSBt YWxsb2Moc2l6ZW9mKHN0cnVjdCBibGlzdCksIE1fU1dBUCwgZmxhZ3MpOwo+aWYgKGJsID09IE5V TEwpCj5AQCAtMTc2LDE0ICsxOTUsMTMgQEAgYmxpc3RfY3JlYXRlKGRhZGRyX3QgYmxvY2tzLCBp bnQgZmxhZ3MpCj5ibC0+YmxfYmxvY2tzID0gYmxvY2tzOwo+YmwtPmJsX3JhZGl4ID0gcmFkaXg7 Cj4tIGJsLT5ibF9za2lwID0gc2tpcDsKPmJsLT5ibF9jdXJzb3IgPSAwOwo+YmwtPmJsX3Jvb3Qg PSBtYWxsb2Mobm9kZXMgKiBzaXplb2YoYmxtZXRhX3QpLCBNX1NXQVAsIGZsYWdzKTsKPmlmIChi bC0+Ymxfcm9vdCA9PSBOVUxMKSB7Cj5mcmVlKGJsLCBNX1NXQVApOwo+cmV0dXJuIChOVUxMKTsK Pn0KPi0gYmxzdF9yYWRpeF9pbml0KGJsLT5ibF9yb290LCByYWRpeCwgc2tpcCwgYmxvY2tzKTsK PisgYmxzdF9yYWRpeF9pbml0KGJsLT5ibF9yb290LCByYWRpeCwgYmxvY2tzKTsKPiNpZiBkZWZp bmVkKEJMSVNUX0RFQlVHKQo+cHJpbnRmKAo+QEAgLTIyNSw3ICsyNDMsNyBAQCBibGlzdF9hbGxv YyhibGlzdF90IGJsLCBkYWRkcl90IGNvdW50KQo+Ki8KPndoaWxlIChjb3VudCA8PSBibC0+Ymxf cm9vdC0+Ym1fYmlnaGludCkgewo+YmxrID0gYmxzdF9tZXRhX2FsbG9jKGJsLT5ibF9yb290LCAw LCBjb3VudCwgYmwtPmJsX3JhZGl4LAo+LSDCoMKgwqAgYmwtPmJsX3NraXAsIGJsLT5ibF9jdXJz b3IpOwo+KyDCoMKgwqAgYmwtPmJsX2N1cnNvcik7Cj5pZiAoYmxrICE9IFNXQVBCTEtfTk9ORSkg ewo+YmwtPmJsX2N1cnNvciA9IGJsayArIGNvdW50Owo+cmV0dXJuIChibGspOwo+QEAgLTI1Nyw3 ICsyNzUsNyBAQCB2b2lkCj5ibGlzdF9mcmVlKGJsaXN0X3QgYmwsIGRhZGRyX3QgYmxrbm8sIGRh ZGRyX3QgY291bnQpCj57Cj4tIGJsc3RfbWV0YV9mcmVlKGJsLT5ibF9yb290LCBibGtubywgY291 bnQsIGJsLT5ibF9yYWRpeCwgYmwtPmJsX3NraXAsIDApOwo+KyBibHN0X21ldGFfZnJlZShibC0+ Ymxfcm9vdCwgYmxrbm8sIGNvdW50LCBibC0+YmxfcmFkaXgsIDApOwo+fQo+LyoKPkBAIC0yNzAs OCArMjg4LDcgQEAgZGFkZHJfdAo+Ymxpc3RfZmlsbChibGlzdF90IGJsLCBkYWRkcl90IGJsa25v LCBkYWRkcl90IGNvdW50KQo+ewo+LSByZXR1cm4gKGJsc3RfbWV0YV9maWxsKGJsLT5ibF9yb290 LCBibGtubywgY291bnQsIGJsLT5ibF9yYWRpeCwKPi0gwqDCoMKgIGJsLT5ibF9za2lwLCAwKSk7 Cj4rIHJldHVybiAoYmxzdF9tZXRhX2ZpbGwoYmwtPmJsX3Jvb3QsIGJsa25vLCBjb3VudCwgYmwt PmJsX3JhZGl4LCAwKSk7Cj59Cj4vKgo+QEAgLTI5MCw3ICszMDcsNyBAQCBibGlzdF9yZXNpemUo Ymxpc3RfdCAqcGJsLCBkYWRkcl90IGNvdW50LCBpbnQgZnJlZW5ldywKPsKgwqDCoMKgICpwYmwg PSBuZXdibDsKPsKgwqDCoMKgIGlmIChjb3VudCA+IHNhdmUtPmJsX2Jsb2NrcykKPsKgwqDCoCBj b3VudCA9IHNhdmUtPmJsX2Jsb2NrczsKPi3CoMKgwqAgYmxzdF9jb3B5KHNhdmUtPmJsX3Jvb3Qs IDAsIHNhdmUtPmJsX3JhZGl4LCBzYXZlLT5ibF9za2lwLCBuZXdibCwgY291bnQpOwo+K8KgwqDC oCBibHN0X2NvcHkoc2F2ZS0+Ymxfcm9vdCwgMCwgc2F2ZS0+YmxfcmFkaXgsIG5ld2JsLCBjb3Vu dCk7Cj7CoMKgwqDCoCAvKgo+wqDCoMKgwqDCoCAqIElmIHJlc2l6aW5nIHVwd2FyZHMsIHNob3Vs ZCB3ZSBmcmVlIHRoZSBuZXcgc3BhY2Ugb3Igbm90Pwo+QEAgLTMwOSw4ICszMjYsOCBAQCBibGlz dF9yZXNpemUoYmxpc3RfdCAqcGJsLCBkYWRkcl90IGNvdW50LCBpbnQgZnJlZW5ldywKPnZvaWQK PmJsaXN0X3ByaW50KGJsaXN0X3QgYmwpCj57Cj4tIHByaW50ZigiQkxJU1Qge1xuIik7Cj4tIGJs c3RfcmFkaXhfcHJpbnQoYmwtPmJsX3Jvb3QsIDAsIGJsLT5ibF9yYWRpeCwgYmwtPmJsX3NraXAs IDQpOwo+KyBwcmludGYoIkJMSVNUIGN1cnNvciA9ICUwOGp4IHtcbiIsICh1aW50bWF4X3QpYmwt PmJsX2N1cnNvcik7Cj4rIGJsc3RfcmFkaXhfcHJpbnQoYmwtPmJsX3Jvb3QsIDAsIGJsLT5ibF9y YWRpeCwgNCk7Cj5wcmludGYoIn1cbiIpOwo+fQo+QEAgLTQyNiw5ICs0NDMsOSBAQCBibHN0X2xl YWZfYWxsb2MoYmxtZXRhX3QgKnNjYW4sIGRhZGRyX3QgYmxrLCBpbnQgY291bnQKPsKgICovCj5z dGF0aWMgZGFkZHJfdAo+YmxzdF9tZXRhX2FsbG9jKGJsbWV0YV90ICpzY2FuLCBkYWRkcl90IGJs aywgZGFkZHJfdCBjb3VudCwgZGFkZHJfdCByYWRpeCwKPi3CoMKgwqAgZGFkZHJfdCBza2lwLCBk YWRkcl90IGN1cnNvcikKPivCoMKgwqAgZGFkZHJfdCBjdXJzb3IpCj57Cj4tIGRhZGRyX3QgaSwg bmV4dF9za2lwLCByOwo+KyBkYWRkcl90IGksIG5leHRfc2tpcCwgciwgc2tpcDsKPmludCBjaGls ZDsKPmJvb2wgc2Nhbl9mcm9tX3N0YXJ0Owo+QEAgLTQ0Myw2ICs0NjAsNyBAQCBibHN0X21ldGFf YWxsb2MoYmxtZXRhX3QgKnNjYW4sIGRhZGRyX3QgYmxrLCBkYWRkcl90IGMKPnNjYW4tPmJtX2Jp Z2hpbnQgPSBzY2FuLT51LmJtdV9hdmFpbDsKPnJldHVybiAoU1dBUEJMS19OT05FKTsKPn0KPisg c2tpcCA9IHJhZGl4X3RvX3NraXAocmFkaXgpOwo+bmV4dF9za2lwID0gc2tpcCAvIEJMSVNUX01F VEFfUkFESVg7Cj4vKgo+QEAgLTQ1Niw3ICs0NzQsNyBAQCBibHN0X21ldGFfYWxsb2MoYmxtZXRh X3QgKnNjYW4sIGRhZGRyX3QgYmxrLCBkYWRkcl90IGMKPiogUmVpbml0aWFsaXplIGVhY2ggb2Yg dGhlIG1ldGEgbm9kZSdzIGNoaWxkcmVuLsKgIEFuIEFMTC1GUkVFCj4qIG1ldGEgbm9kZSBjYW5u b3QgaGF2ZSBhIHRlcm1pbmF0b3IgaW4gYW55IHN1YnRyZWUuCj4qLwo+LSBmb3IgKGkgPSAxOyBp IDw9IHNraXA7IGkgKz0gbmV4dF9za2lwKSB7Cj4rIGZvciAoaSA9IDE7IGkgPCBza2lwOyBpICs9 IG5leHRfc2tpcCkgewo+aWYgKG5leHRfc2tpcCA9PSAxKQo+c2NhbltpXS51LmJtdV9iaXRtYXAg PSAodV9kYWRkcl90KS0xOwo+ZWxzZQo+QEAgLTQ3NywxMyArNDk1LDEzIEBAIGJsc3RfbWV0YV9h bGxvYyhibG1ldGFfdCAqc2NhbiwgZGFkZHJfdCBibGssIGRhZGRyX3QgYwo+c2Nhbl9mcm9tX3N0 YXJ0ID0gY3Vyc29yID09IGJsazsKPmNoaWxkID0gKGN1cnNvciAtIGJsaykgLyByYWRpeDsKPmJs ayArPSBjaGlsZCAqIHJhZGl4Owo+LSBmb3IgKGkgPSAxICsgY2hpbGQgKiBuZXh0X3NraXA7IGkg PD0gc2tpcDsgaSArPSBuZXh0X3NraXApIHsKPisgZm9yIChpID0gMSArIGNoaWxkICogbmV4dF9z a2lwOyBpIDwgc2tpcDsgaSArPSBuZXh0X3NraXApIHsKPmlmIChjb3VudCA8PSBzY2FuW2ldLmJt X2JpZ2hpbnQpIHsKPi8qCj4qIFRoZSBhbGxvY2F0aW9uIG1pZ2h0IGZpdCBpbiB0aGUgaSd0aCBz dWJ0cmVlLgo+Ki8KPnIgPSBibHN0X21ldGFfYWxsb2MoJnNjYW5baV0sIGJsaywgY291bnQsIHJh ZGl4LAo+LSDCoMKgwqAgbmV4dF9za2lwIC0gMSwgY3Vyc29yID4gYmxrID8gY3Vyc29yIDogYmxr KTsKPisgwqDCoMKgIGN1cnNvciA+IGJsayA/IGN1cnNvciA6IGJsayk7Cj5pZiAociAhPSBTV0FQ QkxLX05PTkUpIHsKPnNjYW4tPnUuYm11X2F2YWlsIC09IGNvdW50Owo+cmV0dXJuIChyKTsKPkBA IC01NTIsMTUgKzU3MCwxNiBAQCBibHN0X2xlYWZfZnJlZShibG1ldGFfdCAqc2NhbiwgZGFkZHJf dCBibGssIGludCBjb3VudCkKPsKgICovCj5zdGF0aWMgdm9pZAo+YmxzdF9tZXRhX2ZyZWUoYmxt ZXRhX3QgKnNjYW4sIGRhZGRyX3QgZnJlZUJsaywgZGFkZHJfdCBjb3VudCwgZGFkZHJfdCByYWRp eCwKPi3CoMKgwqAgZGFkZHJfdCBza2lwLCBkYWRkcl90IGJsaykKPivCoMKgwqAgZGFkZHJfdCBi bGspCj57Cj4tIGRhZGRyX3QgaSwgbmV4dF9za2lwLCB2Owo+KyBkYWRkcl90IGksIG5leHRfc2tp cCwgc2tpcCwgdjsKPmludCBjaGlsZDsKPmlmIChzY2FuLT5ibV9iaWdoaW50ID09IChkYWRkcl90 KS0xKQo+cGFuaWMoImZyZWVpbmcgaW52YWxpZCByYW5nZSIpOwo+aWYgKHJhZGl4ID09IEJMSVNU X0JNQVBfUkFESVgpCj5yZXR1cm4gKGJsc3RfbGVhZl9mcmVlKHNjYW4sIGZyZWVCbGssIGNvdW50 KSk7Cj4rIHNraXAgPSByYWRpeF90b19za2lwKHJhZGl4KTsKPm5leHRfc2tpcCA9IHNraXAgLyBC TElTVF9NRVRBX1JBRElYOwo+aWYgKHNjYW4tPnUuYm11X2F2YWlsID09IDApIHsKPkBAIC01NzIs NyArNTkxLDcgQEAgYmxzdF9tZXRhX2ZyZWUoYmxtZXRhX3QgKnNjYW4sIGRhZGRyX3QgZnJlZUJs aywgZGFkZHJfCj5zY2FuLT5ibV9iaWdoaW50ID0gY291bnQ7Cj5pZiAoY291bnQgIT0gcmFkaXgp wqAgewo+LSBmb3IgKGkgPSAxOyBpIDw9IHNraXA7IGkgKz0gbmV4dF9za2lwKSB7Cj4rIGZvciAo aSA9IDE7IGkgPCBza2lwOyBpICs9IG5leHRfc2tpcCkgewo+aWYgKHNjYW5baV0uYm1fYmlnaGlu dCA9PSAoZGFkZHJfdCktMSkKPmJyZWFrOwo+c2NhbltpXS5ibV9iaWdoaW50ID0gMDsKPkBAIC02 MDksMTEgKzYyOCwxMSBAQCBibHN0X21ldGFfZnJlZShibG1ldGFfdCAqc2NhbiwgZGFkZHJfdCBm cmVlQmxrLCBkYWRkcl8KPmNoaWxkID0gKGZyZWVCbGsgLSBibGspIC8gcmFkaXg7Cj5ibGsgKz0g Y2hpbGQgKiByYWRpeDsKPmkgPSAxICsgY2hpbGQgKiBuZXh0X3NraXA7Cj4tIHdoaWxlIChpIDw9 IHNraXAgJiYgYmxrIDwgZnJlZUJsayArIGNvdW50KSB7Cj4rIHdoaWxlIChpIDwgc2tpcCAmJiBi bGsgPCBmcmVlQmxrICsgY291bnQpIHsKPnYgPSBibGsgKyByYWRpeCAtIGZyZWVCbGs7Cj5pZiAo diA+IGNvdW50KQo+diA9IGNvdW50Owo+LSBibHN0X21ldGFfZnJlZSgmc2NhbltpXSwgZnJlZUJs aywgdiwgcmFkaXgsIG5leHRfc2tpcCAtIDEsIGJsayk7Cj4rIGJsc3RfbWV0YV9mcmVlKCZzY2Fu W2ldLCBmcmVlQmxrLCB2LCByYWRpeCwgYmxrKTsKPmlmIChzY2FuLT5ibV9iaWdoaW50IDwgc2Nh bltpXS5ibV9iaWdoaW50KQo+c2Nhbi0+Ym1fYmlnaGludCA9IHNjYW5baV0uYm1fYmlnaGludDsK PmNvdW50IC09IHY7Cj5AQCAtNjMwLDEwICs2NDksMTAgQEAgYmxzdF9tZXRhX2ZyZWUoYmxtZXRh X3QgKnNjYW4sIGRhZGRyX3QgZnJlZUJsaywgZGFkZHJfCj7CoCAqIHRyZWUuwqAgVGhlIHNwYWNl IG1heSBub3QgYWxyZWFkeSBiZSBmcmVlIGluIHRoZSBkZXN0aW5hdGlvbi4KPsKgICovCj5zdGF0 aWMgdm9pZAo+LWJsc3RfY29weShibG1ldGFfdCAqc2NhbiwgZGFkZHJfdCBibGssIGRhZGRyX3Qg cmFkaXgsIGRhZGRyX3Qgc2tpcCwKPi3CoMKgwqAgYmxpc3RfdCBkZXN0LCBkYWRkcl90IGNvdW50 KQo+K2Jsc3RfY29weShibG1ldGFfdCAqc2NhbiwgZGFkZHJfdCBibGssIGRhZGRyX3QgcmFkaXgs IGJsaXN0X3QgZGVzdCwKPivCoMKgwqAgZGFkZHJfdCBjb3VudCkKPnsKPi0gZGFkZHJfdCBpLCBu ZXh0X3NraXA7Cj4rIGRhZGRyX3QgaSwgbmV4dF9za2lwLCBza2lwOwo+LyoKPiogTGVhZiBub2Rl Cj5AQCAtNjc3LDIxICs2OTYsMjAgQEAgYmxzdF9jb3B5KGJsbWV0YV90ICpzY2FuLCBkYWRkcl90 IGJsaywgZGFkZHJfdCByYWRpeCwgCj59Cj4tIHJhZGl4IC89IEJMSVNUX01FVEFfUkFESVg7Cj4r IHNraXAgPSByYWRpeF90b19za2lwKHJhZGl4KTsKPm5leHRfc2tpcCA9IHNraXAgLyBCTElTVF9N RVRBX1JBRElYOwo+KyByYWRpeCAvPSBCTElTVF9NRVRBX1JBRElYOwo+LSBmb3IgKGkgPSAxOyBj b3VudCAmJiBpIDw9IHNraXA7IGkgKz0gbmV4dF9za2lwKSB7Cj4rIGZvciAoaSA9IDE7IGNvdW50 ICYmIGkgPCBza2lwOyBpICs9IG5leHRfc2tpcCkgewo+aWYgKHNjYW5baV0uYm1fYmlnaGludCA9 PSAoZGFkZHJfdCktMSkKPmJyZWFrOwo+aWYgKGNvdW50ID49IHJhZGl4KSB7Cj4tIGJsc3RfY29w eSgmc2NhbltpXSwgYmxrLCByYWRpeCwgbmV4dF9za2lwIC0gMSwgZGVzdCwKPi0gwqDCoMKgIHJh ZGl4KTsKPisgYmxzdF9jb3B5KCZzY2FuW2ldLCBibGssIHJhZGl4LCBkZXN0LCByYWRpeCk7Cj5j b3VudCAtPSByYWRpeDsKPn0gZWxzZSB7Cj5pZiAoY291bnQpIHsKPi0gYmxzdF9jb3B5KCZzY2Fu W2ldLCBibGssIHJhZGl4LCBuZXh0X3NraXAgLSAxLAo+LSDCoMKgwqAgZGVzdCwgY291bnQpOwo+ KyBibHN0X2NvcHkoJnNjYW5baV0sIGJsaywgcmFkaXgsIGRlc3QsIGNvdW50KTsKPn0KPmNvdW50 ID0gMDsKPn0KPkBAIC03MzMsOSArNzUxLDkgQEAgYmxzdF9sZWFmX2ZpbGwoYmxtZXRhX3QgKnNj YW4sIGRhZGRyX3QgYmxrLCBpbnQgY291bnQpCj7CoCAqLwo+c3RhdGljIGRhZGRyX3QKPmJsc3Rf bWV0YV9maWxsKGJsbWV0YV90ICpzY2FuLCBkYWRkcl90IGFsbG9jQmxrLCBkYWRkcl90IGNvdW50 LCBkYWRkcl90IHJhZGl4LAo+LcKgwqDCoCBkYWRkcl90IHNraXAsIGRhZGRyX3QgYmxrKQo+K8Kg wqDCoCBkYWRkcl90IGJsaykKPnsKPi0gZGFkZHJfdCBpLCBuYmxrcywgbmV4dF9za2lwLCB2Owo+ KyBkYWRkcl90IGksIG5ibGtzLCBuZXh0X3NraXAsIHNraXAsIHY7Cj5pbnQgY2hpbGQ7Cj5pZiAo c2Nhbi0+Ym1fYmlnaGludCA9PSAoZGFkZHJfdCktMSkKPkBAIC03NTgsNiArNzc2LDcgQEAgYmxz dF9tZXRhX2ZpbGwoYmxtZXRhX3QgKnNjYW4sIGRhZGRyX3QgYWxsb2NCbGssIGRhZGRyCj5zY2Fu LT5ibV9iaWdoaW50ID0gMDsKPnJldHVybiAobmJsa3MpOwo+fQo+KyBza2lwID0gcmFkaXhfdG9f c2tpcChyYWRpeCk7Cj5uZXh0X3NraXAgPSBza2lwIC8gQkxJU1RfTUVUQV9SQURJWDsKPi8qCj5A QCAtNzcxLDcgKzc5MCw3IEBAIGJsc3RfbWV0YV9maWxsKGJsbWV0YV90ICpzY2FuLCBkYWRkcl90 IGFsbG9jQmxrLCBkYWRkcgo+KiBSZWluaXRpYWxpemUgZWFjaCBvZiB0aGUgbWV0YSBub2RlJ3Mg Y2hpbGRyZW4uwqAgQW4gQUxMLUZSRUUKPiogbWV0YSBub2RlIGNhbm5vdCBoYXZlIGEgdGVybWlu YXRvciBpbiBhbnkgc3VidHJlZS4KPiovCj4tIGZvciAoaSA9IDE7IGkgPD0gc2tpcDsgaSArPSBu ZXh0X3NraXApIHsKPisgZm9yIChpID0gMTsgaSA8IHNraXA7IGkgKz0gbmV4dF9za2lwKSB7Cj5p ZiAobmV4dF9za2lwID09IDEpCj5zY2FuW2ldLnUuYm11X2JpdG1hcCA9ICh1X2RhZGRyX3QpLTE7 Cj5lbHNlCj5AQCAtNzg2LDEyICs4MDUsMTEgQEAgYmxzdF9tZXRhX2ZpbGwoYmxtZXRhX3QgKnNj YW4sIGRhZGRyX3QgYWxsb2NCbGssIGRhZGRyCj5jaGlsZCA9IChhbGxvY0JsayAtIGJsaykgLyBy YWRpeDsKPmJsayArPSBjaGlsZCAqIHJhZGl4Owo+aSA9IDEgKyBjaGlsZCAqIG5leHRfc2tpcDsK Pi0gd2hpbGUgKGkgPD0gc2tpcCAmJiBibGsgPCBhbGxvY0JsayArIGNvdW50KSB7Cj4rIHdoaWxl IChpIDwgc2tpcCAmJiBibGsgPCBhbGxvY0JsayArIGNvdW50KSB7Cj52ID0gYmxrICsgcmFkaXgg LSBhbGxvY0JsazsKPmlmICh2ID4gY291bnQpCj52ID0gY291bnQ7Cj4tIG5ibGtzICs9IGJsc3Rf bWV0YV9maWxsKCZzY2FuW2ldLCBhbGxvY0JsaywgdiwgcmFkaXgsCj4tIMKgwqDCoCBuZXh0X3Nr aXAgLSAxLCBibGspOwo+KyBuYmxrcyArPSBibHN0X21ldGFfZmlsbCgmc2NhbltpXSwgYWxsb2NC bGssIHYsIHJhZGl4LCBibGspOwo+Y291bnQgLT0gdjsKPmFsbG9jQmxrICs9IHY7Cj5ibGsgKz0g cmFkaXg7Cj5AQCAtODEwLDkgKzgyOCw5IEBAIGJsc3RfbWV0YV9maWxsKGJsbWV0YV90ICpzY2Fu LCBkYWRkcl90IGFsbG9jQmxrLCBkYWRkcgo+wqAgKiBSQURJWCB2YWx1ZXMgd2UgdXNlLgo+wqAg Ki8KPnN0YXRpYyBkYWRkcl90Cj4tYmxzdF9yYWRpeF9pbml0KGJsbWV0YV90ICpzY2FuLCBkYWRk cl90IHJhZGl4LCBkYWRkcl90IHNraXAsIGRhZGRyX3QgY291bnQpCj4rYmxzdF9yYWRpeF9pbml0 KGJsbWV0YV90ICpzY2FuLCBkYWRkcl90IHJhZGl4LCBkYWRkcl90IGNvdW50KQo+ewo+LSBkYWRk cl90IGksIG1lbWluZGV4LCBuZXh0X3NraXA7Cj4rIGRhZGRyX3QgaSwgbWVtaW5kZXgsIG5leHRf c2tpcCwgc2tpcDsKPm1lbWluZGV4ID0gMDsKPkBAIC04MzksMTcgKzg1NywxOCBAQCBibHN0X3Jh ZGl4X2luaXQoYmxtZXRhX3QgKnNjYW4sIGRhZGRyX3QgcmFkaXgsIGRhZGRyX3QKPnNjYW4tPnUu Ym11X2F2YWlsID0gMDsKPn0KPi0gcmFkaXggLz0gQkxJU1RfTUVUQV9SQURJWDsKPisgc2tpcCA9 IHJhZGl4X3RvX3NraXAocmFkaXgpOwo+bmV4dF9za2lwID0gc2tpcCAvIEJMSVNUX01FVEFfUkFE SVg7Cj4rIHJhZGl4IC89IEJMSVNUX01FVEFfUkFESVg7Cj4tIGZvciAoaSA9IDE7IGkgPD0gc2tp cDsgaSArPSBuZXh0X3NraXApIHsKPisgZm9yIChpID0gMTsgaSA8IHNraXA7IGkgKz0gbmV4dF9z a2lwKSB7Cj5pZiAoY291bnQgPj0gcmFkaXgpIHsKPi8qCj4qIEFsbG9jYXRlIHRoZSBlbnRpcmUg b2JqZWN0Cj4qLwo+bWVtaW5kZXggPSBpICsKPsKgwqDCoCBibHN0X3JhZGl4X2luaXQoKChzY2Fu KSA/ICZzY2FuW2ldIDogTlVMTCksIHJhZGl4LAo+LSDCoMKgwqAgbmV4dF9za2lwIC0gMSwgcmFk aXgpOwo+KyDCoMKgwqAgcmFkaXgpOwo+Y291bnQgLT0gcmFkaXg7Cj59IGVsc2UgaWYgKGNvdW50 ID4gMCkgewo+LyoKPkBAIC04NTcsNyArODc2LDcgQEAgYmxzdF9yYWRpeF9pbml0KGJsbWV0YV90 ICpzY2FuLCBkYWRkcl90IHJhZGl4LCBkYWRkcl90Cj4qLwo+bWVtaW5kZXggPSBpICsKPsKgwqDC oCBibHN0X3JhZGl4X2luaXQoKChzY2FuKSA/ICZzY2FuW2ldIDogTlVMTCksIHJhZGl4LAo+LSDC oMKgwqAgbmV4dF9za2lwIC0gMSwgY291bnQpOwo+KyDCoMKgwqAgY291bnQpOwo+Y291bnQgPSAw Owo+fSBlbHNlIHsKPi8qCj5AQCAtODc2LDEwICs4OTUsOSBAQCBibHN0X3JhZGl4X2luaXQoYmxt ZXRhX3QgKnNjYW4sIGRhZGRyX3QgcmFkaXgsIGRhZGRyX3QKPiNpZmRlZiBCTElTVF9ERUJVRwo+ c3RhdGljIHZvaWQKPi1ibHN0X3JhZGl4X3ByaW50KGJsbWV0YV90ICpzY2FuLCBkYWRkcl90IGJs aywgZGFkZHJfdCByYWRpeCwgZGFkZHJfdCBza2lwLAo+LcKgwqDCoCBpbnQgdGFiKQo+K2Jsc3Rf cmFkaXhfcHJpbnQoYmxtZXRhX3QgKnNjYW4sIGRhZGRyX3QgYmxrLCBkYWRkcl90IHJhZGl4LCBp bnQgdGFiKQo+ewo+LSBkYWRkcl90IGksIG5leHRfc2tpcDsKPisgZGFkZHJfdCBpLCBuZXh0X3Nr aXAsIHNraXA7Cj5pZiAocmFkaXggPT0gQkxJU1RfQk1BUF9SQURJWCkgewo+cHJpbnRmKAo+QEAg LTkyMCwxMSArOTM4LDEyIEBAIGJsc3RfcmFkaXhfcHJpbnQoYmxtZXRhX3QgKnNjYW4sIGRhZGRy X3QgYmxrLCBkYWRkcl90IAo+wqDCoMKgIChsb25nIGxvbmcpc2Nhbi0+Ym1fYmlnaGludAo+KTsK Pi0gcmFkaXggLz0gQkxJU1RfTUVUQV9SQURJWDsKPisgc2tpcCA9IHJhZGl4X3RvX3NraXAocmFk aXgpOwo+bmV4dF9za2lwID0gc2tpcCAvIEJMSVNUX01FVEFfUkFESVg7Cj4rIHJhZGl4IC89IEJM SVNUX01FVEFfUkFESVg7Cj50YWIgKz0gNDsKPi0gZm9yIChpID0gMTsgaSA8PSBza2lwOyBpICs9 IG5leHRfc2tpcCkgewo+KyBmb3IgKGkgPSAxOyBpIDwgc2tpcDsgaSArPSBuZXh0X3NraXApIHsK PmlmIChzY2FuW2ldLmJtX2JpZ2hpbnQgPT0gKGRhZGRyX3QpLTEpIHsKPnByaW50ZigKPsKgwqDC oCAiJSouKnMoJTA4bGx4LCVsbGQpOiBUZXJtaW5hdG9yXG4iLAo+QEAgLTkzMyw3ICs5NTIsNyBA QCBibHN0X3JhZGl4X3ByaW50KGJsbWV0YV90ICpzY2FuLCBkYWRkcl90IGJsaywgZGFkZHJfdCAK Pik7Cj5icmVhazsKPn0KPi0gYmxzdF9yYWRpeF9wcmludCgmc2NhbltpXSwgYmxrLCByYWRpeCwg bmV4dF9za2lwIC0gMSwgdGFiKTsKPisgYmxzdF9yYWRpeF9wcmludCgmc2NhbltpXSwgYmxrLCBy YWRpeCwgdGFiKTsKPmJsayArPSByYWRpeDsKPn0KPnRhYiAtPSA0Owo+TW9kaWZpZWQ6IGhlYWQv c3lzL3N5cy9ibGlzdC5oCj49PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KPi0tLSBoZWFkL3N5cy9zeXMv Ymxpc3QuaCBUdWUgQXVnwqAgMSAwMzo0MDoxOSAyMDE3IChyMzIxODM5KQo+KysrIGhlYWQvc3lz L3N5cy9ibGlzdC5oIFR1ZSBBdWfCoCAxIDAzOjUxOjI2IDIwMTcgKHIzMjE4NDApCj5AQCAtODEs NyArODEsNiBAQCB0eXBlZGVmIHN0cnVjdCBibG1ldGEgewo+dHlwZWRlZiBzdHJ1Y3QgYmxpc3Qg ewo+ZGFkZHJfdCBibF9ibG9ja3M7IC8qIGFyZWEgb2YgY292ZXJhZ2UgKi8KPmRhZGRyX3QgYmxf cmFkaXg7IC8qIGNvdmVyYWdlIHJhZGl4ICovCj4tIGRhZGRyX3QgYmxfc2tpcDsgLyogc3RhcnRp bmcgc2tpcCAqLwo+ZGFkZHJfdCBibF9jdXJzb3I7IC8qIG5leHQtZml0IHNlYXJjaCBzdGFydHMg YXQgKi8KPmJsbWV0YV90ICpibF9yb290OyAvKiByb290IG9mIHJhZGl4IHRyZWUgKi8KPn0gKmJs aXN0X3Q7Cg== From owner-svn-src-all@freebsd.org Tue Aug 1 04:49:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 729E0DCA281; Tue, 1 Aug 2017 04:49:55 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 399A27C2AD; Tue, 1 Aug 2017 04:49:55 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v714nstj030906; Tue, 1 Aug 2017 04:49:54 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v714ns4b030905; Tue, 1 Aug 2017 04:49:54 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201708010449.v714ns4b030905@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 1 Aug 2017 04:49:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321842 - head/cddl/contrib/opensolaris/cmd/lockstat X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/lockstat X-SVN-Commit-Revision: 321842 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 04:49:55 -0000 Author: markj Date: Tue Aug 1 04:49:54 2017 New Revision: 321842 URL: https://svnweb.freebsd.org/changeset/base/321842 Log: Let lockstat use ksyms(4)'s mmap interface. The workaround described in the deleted comment is no longer needed. MFC after: 1 week Modified: head/cddl/contrib/opensolaris/cmd/lockstat/sym.c Modified: head/cddl/contrib/opensolaris/cmd/lockstat/sym.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/lockstat/sym.c Tue Aug 1 04:16:52 2017 (r321841) +++ head/cddl/contrib/opensolaris/cmd/lockstat/sym.c Tue Aug 1 04:49:54 2017 (r321842) @@ -194,33 +194,9 @@ symtab_init(void) return (-1); #endif -#ifdef illumos (void) elf_version(EV_CURRENT); elf = elf_begin(fd, ELF_C_READ, NULL); -#else - /* - * XXX - libelf needs to be fixed so it will work with - * non 'ordinary' files like /dev/ksyms. The following - * is a work around for now. - */ - if (elf_version(EV_CURRENT) == EV_NONE) { - close(fd); - return (-1); - } - if (ioctl(fd, KIOCGSIZE, &sz) < 0) { - close(fd); - return (-1); - } - if (ioctl(fd, KIOCGADDR, &ksyms) < 0) { - close(fd); - return (-1); - } - if ((elf = elf_memory(ksyms, sz)) == NULL) { - close(fd); - return (-1); - } -#endif for (cnt = 1; (scn = elf_nextscn(elf, scn)) != NULL; cnt++) { Shdr *shdr = elf_getshdr(scn); From owner-svn-src-all@freebsd.org Tue Aug 1 04:50:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FE06DCA2AA; Tue, 1 Aug 2017 04:50:00 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pp2.rice.edu (proofpoint2.mail.rice.edu [128.42.201.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2322C7C2CD; Tue, 1 Aug 2017 04:49:59 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pps.filterd (pp2.rice.edu [127.0.0.1]) by pp2.rice.edu (8.16.0.17/8.16.0.17) with SMTP id v714PXRF024207; Mon, 31 Jul 2017 23:26:55 -0500 Received: from mh3.mail.rice.edu (mh3.mail.rice.edu [128.42.199.10]) by pp2.rice.edu with ESMTP id 2c0ndj8rne-1; Mon, 31 Jul 2017 23:26:55 -0500 X-Virus-Scanned: by amavis-2.7.0 at mh3.mail.rice.edu, auth channel Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net (108-254-203-201.lightspeed.hstntx.sbcglobal.net [108.254.203.201]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh3.mail.rice.edu (Postfix) with ESMTPSA id 4784D40448; Mon, 31 Jul 2017 23:26:54 -0500 (CDT) Subject: Re: svn commit: r321840 - in head/sys: kern sys To: Warner Losh , Alan Cox , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <5lny7794f8b19a2l8vlaannr.1501561229506@email.android.com> From: Alan Cox Message-ID: <5cc355e9-817c-1b61-14f5-59270d7cba9a@rice.edu> Date: Mon, 31 Jul 2017 23:26:53 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <5lny7794f8b19a2l8vlaannr.1501561229506@email.android.com> Content-Language: en-US X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=10 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1611190142 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 04:50:00 -0000 On 07/31/2017 23:20, Warner Losh wrote: > > On July 31, 2017, at 9:51 PM, Alan Cox wrote: > > >Author: alc > >Date: Tue Aug 1 03:51:26 2017 > >New Revision: 321840 > >URL: https://svnweb.freebsd.org/changeset/base/321840 > >Log: > > The blist_meta_* routines that process a subtree take arguments > 'radix' and > > 'skip', which denote, respectively, the largest number of blocks > that can be > > managed by a subtree of that height, and one less than the number > of nodes > > in a subtree of that height. This change removes the 'skip' > argument from > > those functions because 'skip' can be trivially computed from 'radius'. > > This change also redefines 'skip' so that it denotes the number of > nodes in > > the subtree, and so changes loop upper bound tests from '<= skip' to '< > > skip' to account for the change. > > > > The 'skip' field is also removed from the blist struct. > > > > The self-test program is changed so that the print command includes the > > cursor value in the output. > > > > Submitted by: Doug Moore > > MFC after: 1 week > >Modified: > > head/sys/kern/subr_blist.c > > head/sys/sys/blist.h > >Modified: head/sys/kern/subr_blist.c > >============================================================================== > >--- head/sys/kern/subr_blist.c Tue Aug 1 03:40:19 2017 (r321839) > >+++ head/sys/kern/subr_blist.c Tue Aug 1 03:51:26 2017 (r321840) > >@@ -123,20 +123,19 @@ void panic(const char *ctl, ...); > >static daddr_t blst_leaf_alloc(blmeta_t *scan, daddr_t blk, int count, > > daddr_t cursor); > >static daddr_t blst_meta_alloc(blmeta_t *scan, daddr_t blk, daddr_t > count, > >- daddr_t radix, daddr_t skip, daddr_t cursor); > >+ daddr_t radix, daddr_t cursor); > >static void blst_leaf_free(blmeta_t *scan, daddr_t relblk, int count); > >static void blst_meta_free(blmeta_t *scan, daddr_t freeBlk, daddr_t > count, > >- daddr_t radix, daddr_t skip, daddr_t blk); > >+ daddr_t radix, daddr_t blk); > >static void blst_copy(blmeta_t *scan, daddr_t blk, daddr_t radix, > >- daddr_t skip, blist_t dest, daddr_t count); > >+ blist_t dest, daddr_t count); > >static daddr_t blst_leaf_fill(blmeta_t *scan, daddr_t blk, int count); > >static daddr_t blst_meta_fill(blmeta_t *scan, daddr_t allocBlk, > daddr_t count, > >- daddr_t radix, daddr_t skip, daddr_t blk); > >-static daddr_t blst_radix_init(blmeta_t *scan, daddr_t radix, > daddr_t skip, > >- daddr_t count); > >+ daddr_t radix, daddr_t blk); > >+static daddr_t blst_radix_init(blmeta_t *scan, daddr_t radix, > daddr_t count); > >#ifndef _KERNEL > >static void blst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t radix, > >- daddr_t skip, int tab); > >+ int tab); > >#endif > >#ifdef _KERNEL > >@@ -144,6 +143,28 @@ static MALLOC_DEFINE(M_SWAP, "SWAP", "Swap space"); > >#endif > >/* > >+ * For a subtree that can represent the state of up to 'radix' > blocks, the > >+ * number of leaf nodes of the subtree is L=radix/BLIST_BMAP_RADIX. > If 'm' > >+ * is short for BLIST_META_RADIX, then for a tree of height h with > L=m**h > >+ * leaf nodes, the total number of tree nodes is 1 + m + m**2 + ... > + m**h, > >+ * or, equivalently, (m**(h+1)-1)/(m-1). This quantity is called 'skip' > >+ * in the 'meta' functions that process subtrees. Since integer > division > >+ * discards remainders, we can express this computation as > >+ * skip = (m * m**h) / (m - 1) > >+ * skip = (m * radix / BLIST_BMAP_RADIX) / (m - 1) > >+ * and if m divides BLIST_BMAP_RADIX, we can simplify further to > >+ * skip = radix / (BLIST_BMAP_RADIX / m * (m - 1)) > >+ * so that a simple integer division is enough for the calculation. > >+ */ > >+static inline daddr_t > >+radix_to_skip(daddr_t radix) > >+{ > >+ > >+ return (radix / > >+ (BLIST_BMAP_RADIX / BLIST_META_RADIX * (BLIST_META_RADIX - 1))); > > I don't think this matches the comment. It is missing parens,no? > > Substitute BLIST_META_RADIX for 'm' in the comment and they match. (The second line of the comment defines 'm' to be BLIST_META_RADIX.) > >+} > >+ > >+/* > > * blist_create() - create a blist capable of handling up to the > specified > > * number of blocks > > * > >@@ -157,18 +178,16 @@ blist_t > >blist_create(daddr_t blocks, int flags) > >{ > >blist_t bl; > >- daddr_t nodes, radix, skip; > >+ daddr_t nodes, radix; > >/* > >- * Calculate radix and skip field used for scanning. > >+ * Calculate the radix field used for scanning. > >*/ > >radix = BLIST_BMAP_RADIX; > >- skip = 0; > >while (radix < blocks) { > >radix *= BLIST_META_RADIX; > >- skip = (skip + 1) * BLIST_META_RADIX; > >} > >- nodes = 1 + blst_radix_init(NULL, radix, skip, blocks); > >+ nodes = 1 + blst_radix_init(NULL, radix, blocks); > >bl = malloc(sizeof(struct blist), M_SWAP, flags); > >if (bl == NULL) > >@@ -176,14 +195,13 @@ blist_create(daddr_t blocks, int flags) > >bl->bl_blocks = blocks; > >bl->bl_radix = radix; > >- bl->bl_skip = skip; > >bl->bl_cursor = 0; > >bl->bl_root = malloc(nodes * sizeof(blmeta_t), M_SWAP, flags); > >if (bl->bl_root == NULL) { > >free(bl, M_SWAP); > >return (NULL); > >} > >- blst_radix_init(bl->bl_root, radix, skip, blocks); > >+ blst_radix_init(bl->bl_root, radix, blocks); > >#if defined(BLIST_DEBUG) > >printf( > >@@ -225,7 +243,7 @@ blist_alloc(blist_t bl, daddr_t count) > >*/ > >while (count <= bl->bl_root->bm_bighint) { > >blk = blst_meta_alloc(bl->bl_root, 0, count, bl->bl_radix, > >- bl->bl_skip, bl->bl_cursor); > >+ bl->bl_cursor); > >if (blk != SWAPBLK_NONE) { > >bl->bl_cursor = blk + count; > >return (blk); > >@@ -257,7 +275,7 @@ void > >blist_free(blist_t bl, daddr_t blkno, daddr_t count) > >{ > >- blst_meta_free(bl->bl_root, blkno, count, bl->bl_radix, > bl->bl_skip, 0); > >+ blst_meta_free(bl->bl_root, blkno, count, bl->bl_radix, 0); > >} > >/* > >@@ -270,8 +288,7 @@ daddr_t > >blist_fill(blist_t bl, daddr_t blkno, daddr_t count) > >{ > >- return (blst_meta_fill(bl->bl_root, blkno, count, bl->bl_radix, > >- bl->bl_skip, 0)); > >+ return (blst_meta_fill(bl->bl_root, blkno, count, bl->bl_radix, 0)); > >} > >/* > >@@ -290,7 +307,7 @@ blist_resize(blist_t *pbl, daddr_t count, int > freenew, > > *pbl = newbl; > > if (count > save->bl_blocks) > > count = save->bl_blocks; > >- blst_copy(save->bl_root, 0, save->bl_radix, save->bl_skip, > newbl, count); > >+ blst_copy(save->bl_root, 0, save->bl_radix, newbl, count); > > /* > > * If resizing upwards, should we free the new space or not? > >@@ -309,8 +326,8 @@ blist_resize(blist_t *pbl, daddr_t count, int > freenew, > >void > >blist_print(blist_t bl) > >{ > >- printf("BLIST {\n"); > >- blst_radix_print(bl->bl_root, 0, bl->bl_radix, bl->bl_skip, 4); > >+ printf("BLIST cursor = %08jx {\n", (uintmax_t)bl->bl_cursor); > >+ blst_radix_print(bl->bl_root, 0, bl->bl_radix, 4); > >printf("}\n"); > >} > >@@ -426,9 +443,9 @@ blst_leaf_alloc(blmeta_t *scan, daddr_t blk, int > count > > */ > >static daddr_t > >blst_meta_alloc(blmeta_t *scan, daddr_t blk, daddr_t count, daddr_t > radix, > >- daddr_t skip, daddr_t cursor) > >+ daddr_t cursor) > >{ > >- daddr_t i, next_skip, r; > >+ daddr_t i, next_skip, r, skip; > >int child; > >bool scan_from_start; > >@@ -443,6 +460,7 @@ blst_meta_alloc(blmeta_t *scan, daddr_t blk, > daddr_t c > >scan->bm_bighint = scan->u.bmu_avail; > >return (SWAPBLK_NONE); > >} > >+ skip = radix_to_skip(radix); > >next_skip = skip / BLIST_META_RADIX; > >/* > >@@ -456,7 +474,7 @@ blst_meta_alloc(blmeta_t *scan, daddr_t blk, > daddr_t c > >* Reinitialize each of the meta node's children. An ALL-FREE > >* meta node cannot have a terminator in any subtree. > >*/ > >- for (i = 1; i <= skip; i += next_skip) { > >+ for (i = 1; i < skip; i += next_skip) { > >if (next_skip == 1) > >scan[i].u.bmu_bitmap = (u_daddr_t)-1; > >else > >@@ -477,13 +495,13 @@ blst_meta_alloc(blmeta_t *scan, daddr_t blk, > daddr_t c > >scan_from_start = cursor == blk; > >child = (cursor - blk) / radix; > >blk += child * radix; > >- for (i = 1 + child * next_skip; i <= skip; i += next_skip) { > >+ for (i = 1 + child * next_skip; i < skip; i += next_skip) { > >if (count <= scan[i].bm_bighint) { > >/* > >* The allocation might fit in the i'th subtree. > >*/ > >r = blst_meta_alloc(&scan[i], blk, count, radix, > >- next_skip - 1, cursor > blk ? cursor : blk); > >+ cursor > blk ? cursor : blk); > >if (r != SWAPBLK_NONE) { > >scan->u.bmu_avail -= count; > >return (r); > >@@ -552,15 +570,16 @@ blst_leaf_free(blmeta_t *scan, daddr_t blk, int > count) > > */ > >static void > >blst_meta_free(blmeta_t *scan, daddr_t freeBlk, daddr_t count, > daddr_t radix, > >- daddr_t skip, daddr_t blk) > >+ daddr_t blk) > >{ > >- daddr_t i, next_skip, v; > >+ daddr_t i, next_skip, skip, v; > >int child; > >if (scan->bm_bighint == (daddr_t)-1) > >panic("freeing invalid range"); > >if (radix == BLIST_BMAP_RADIX) > >return (blst_leaf_free(scan, freeBlk, count)); > >+ skip = radix_to_skip(radix); > >next_skip = skip / BLIST_META_RADIX; > >if (scan->u.bmu_avail == 0) { > >@@ -572,7 +591,7 @@ blst_meta_free(blmeta_t *scan, daddr_t freeBlk, > daddr_ > >scan->bm_bighint = count; > >if (count != radix) { > >- for (i = 1; i <= skip; i += next_skip) { > >+ for (i = 1; i < skip; i += next_skip) { > >if (scan[i].bm_bighint == (daddr_t)-1) > >break; > >scan[i].bm_bighint = 0; > >@@ -609,11 +628,11 @@ blst_meta_free(blmeta_t *scan, daddr_t freeBlk, > daddr_ > >child = (freeBlk - blk) / radix; > >blk += child * radix; > >i = 1 + child * next_skip; > >- while (i <= skip && blk < freeBlk + count) { > >+ while (i < skip && blk < freeBlk + count) { > >v = blk + radix - freeBlk; > >if (v > count) > >v = count; > >- blst_meta_free(&scan[i], freeBlk, v, radix, next_skip - 1, blk); > >+ blst_meta_free(&scan[i], freeBlk, v, radix, blk); > >if (scan->bm_bighint < scan[i].bm_bighint) > >scan->bm_bighint = scan[i].bm_bighint; > >count -= v; > >@@ -630,10 +649,10 @@ blst_meta_free(blmeta_t *scan, daddr_t freeBlk, > daddr_ > > * tree. The space may not already be free in the destination. > > */ > >static void > >-blst_copy(blmeta_t *scan, daddr_t blk, daddr_t radix, daddr_t skip, > >- blist_t dest, daddr_t count) > >+blst_copy(blmeta_t *scan, daddr_t blk, daddr_t radix, blist_t dest, > >+ daddr_t count) > >{ > >- daddr_t i, next_skip; > >+ daddr_t i, next_skip, skip; > >/* > >* Leaf node > >@@ -677,21 +696,20 @@ blst_copy(blmeta_t *scan, daddr_t blk, daddr_t > radix, > >} > >- radix /= BLIST_META_RADIX; > >+ skip = radix_to_skip(radix); > >next_skip = skip / BLIST_META_RADIX; > >+ radix /= BLIST_META_RADIX; > >- for (i = 1; count && i <= skip; i += next_skip) { > >+ for (i = 1; count && i < skip; i += next_skip) { > >if (scan[i].bm_bighint == (daddr_t)-1) > >break; > >if (count >= radix) { > >- blst_copy(&scan[i], blk, radix, next_skip - 1, dest, > >- radix); > >+ blst_copy(&scan[i], blk, radix, dest, radix); > >count -= radix; > >} else { > >if (count) { > >- blst_copy(&scan[i], blk, radix, next_skip - 1, > >- dest, count); > >+ blst_copy(&scan[i], blk, radix, dest, count); > >} > >count = 0; > >} > >@@ -733,9 +751,9 @@ blst_leaf_fill(blmeta_t *scan, daddr_t blk, int > count) > > */ > >static daddr_t > >blst_meta_fill(blmeta_t *scan, daddr_t allocBlk, daddr_t count, > daddr_t radix, > >- daddr_t skip, daddr_t blk) > >+ daddr_t blk) > >{ > >- daddr_t i, nblks, next_skip, v; > >+ daddr_t i, nblks, next_skip, skip, v; > >int child; > >if (scan->bm_bighint == (daddr_t)-1) > >@@ -758,6 +776,7 @@ blst_meta_fill(blmeta_t *scan, daddr_t allocBlk, > daddr > >scan->bm_bighint = 0; > >return (nblks); > >} > >+ skip = radix_to_skip(radix); > >next_skip = skip / BLIST_META_RADIX; > >/* > >@@ -771,7 +790,7 @@ blst_meta_fill(blmeta_t *scan, daddr_t allocBlk, > daddr > >* Reinitialize each of the meta node's children. An ALL-FREE > >* meta node cannot have a terminator in any subtree. > >*/ > >- for (i = 1; i <= skip; i += next_skip) { > >+ for (i = 1; i < skip; i += next_skip) { > >if (next_skip == 1) > >scan[i].u.bmu_bitmap = (u_daddr_t)-1; > >else > >@@ -786,12 +805,11 @@ blst_meta_fill(blmeta_t *scan, daddr_t > allocBlk, daddr > >child = (allocBlk - blk) / radix; > >blk += child * radix; > >i = 1 + child * next_skip; > >- while (i <= skip && blk < allocBlk + count) { > >+ while (i < skip && blk < allocBlk + count) { > >v = blk + radix - allocBlk; > >if (v > count) > >v = count; > >- nblks += blst_meta_fill(&scan[i], allocBlk, v, radix, > >- next_skip - 1, blk); > >+ nblks += blst_meta_fill(&scan[i], allocBlk, v, radix, blk); > >count -= v; > >allocBlk += v; > >blk += radix; > >@@ -810,9 +828,9 @@ blst_meta_fill(blmeta_t *scan, daddr_t allocBlk, > daddr > > * RADIX values we use. > > */ > >static daddr_t > >-blst_radix_init(blmeta_t *scan, daddr_t radix, daddr_t skip, daddr_t > count) > >+blst_radix_init(blmeta_t *scan, daddr_t radix, daddr_t count) > >{ > >- daddr_t i, memindex, next_skip; > >+ daddr_t i, memindex, next_skip, skip; > >memindex = 0; > >@@ -839,17 +857,18 @@ blst_radix_init(blmeta_t *scan, daddr_t radix, > daddr_t > >scan->u.bmu_avail = 0; > >} > >- radix /= BLIST_META_RADIX; > >+ skip = radix_to_skip(radix); > >next_skip = skip / BLIST_META_RADIX; > >+ radix /= BLIST_META_RADIX; > >- for (i = 1; i <= skip; i += next_skip) { > >+ for (i = 1; i < skip; i += next_skip) { > >if (count >= radix) { > >/* > >* Allocate the entire object > >*/ > >memindex = i + > > blst_radix_init(((scan) ? &scan[i] : NULL), radix, > >- next_skip - 1, radix); > >+ radix); > >count -= radix; > >} else if (count > 0) { > >/* > >@@ -857,7 +876,7 @@ blst_radix_init(blmeta_t *scan, daddr_t radix, > daddr_t > >*/ > >memindex = i + > > blst_radix_init(((scan) ? &scan[i] : NULL), radix, > >- next_skip - 1, count); > >+ count); > >count = 0; > >} else { > >/* > >@@ -876,10 +895,9 @@ blst_radix_init(blmeta_t *scan, daddr_t radix, > daddr_t > >#ifdef BLIST_DEBUG > >static void > >-blst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t radix, daddr_t > skip, > >- int tab) > >+blst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t radix, int tab) > >{ > >- daddr_t i, next_skip; > >+ daddr_t i, next_skip, skip; > >if (radix == BLIST_BMAP_RADIX) { > >printf( > >@@ -920,11 +938,12 @@ blst_radix_print(blmeta_t *scan, daddr_t blk, > daddr_t > > (long long)scan->bm_bighint > >); > >- radix /= BLIST_META_RADIX; > >+ skip = radix_to_skip(radix); > >next_skip = skip / BLIST_META_RADIX; > >+ radix /= BLIST_META_RADIX; > >tab += 4; > >- for (i = 1; i <= skip; i += next_skip) { > >+ for (i = 1; i < skip; i += next_skip) { > >if (scan[i].bm_bighint == (daddr_t)-1) { > >printf( > > "%*.*s(%08llx,%lld): Terminator\n", > >@@ -933,7 +952,7 @@ blst_radix_print(blmeta_t *scan, daddr_t blk, > daddr_t > >); > >break; > >} > >- blst_radix_print(&scan[i], blk, radix, next_skip - 1, tab); > >+ blst_radix_print(&scan[i], blk, radix, tab); > >blk += radix; > >} > >tab -= 4; > >Modified: head/sys/sys/blist.h > >============================================================================== > >--- head/sys/sys/blist.h Tue Aug 1 03:40:19 2017 (r321839) > >+++ head/sys/sys/blist.h Tue Aug 1 03:51:26 2017 (r321840) > >@@ -81,7 +81,6 @@ typedef struct blmeta { > >typedef struct blist { > >daddr_t bl_blocks; /* area of coverage */ > >daddr_t bl_radix; /* coverage radix */ > >- daddr_t bl_skip; /* starting skip */ > >daddr_t bl_cursor; /* next-fit search starts at */ > >blmeta_t *bl_root; /* root of radix tree */ > >} *blist_t; > From owner-svn-src-all@freebsd.org Tue Aug 1 04:52:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BB8ADCA4F0; Tue, 1 Aug 2017 04:52:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 457917C7A6; Tue, 1 Aug 2017 04:52:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v714q3fL033820; Tue, 1 Aug 2017 04:52:03 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v714q37t033819; Tue, 1 Aug 2017 04:52:03 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201708010452.v714q37t033819@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 1 Aug 2017 04:52:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321843 - head/cddl/contrib/opensolaris/cmd/lockstat X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/lockstat X-SVN-Commit-Revision: 321843 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 04:52:04 -0000 Author: markj Date: Tue Aug 1 04:52:03 2017 New Revision: 321843 URL: https://svnweb.freebsd.org/changeset/base/321843 Log: Remove local variables missed in r321842. X-MFC with: r321842 Modified: head/cddl/contrib/opensolaris/cmd/lockstat/sym.c Modified: head/cddl/contrib/opensolaris/cmd/lockstat/sym.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/lockstat/sym.c Tue Aug 1 04:49:54 2017 (r321842) +++ head/cddl/contrib/opensolaris/cmd/lockstat/sym.c Tue Aug 1 04:52:03 2017 (r321843) @@ -175,10 +175,6 @@ symtab_init(void) int fd; int i; int strindex = -1; -#ifndef illumos - void *ksyms; - size_t sz; -#endif #ifndef illumos if ((fd = open("/dev/ksyms", O_RDONLY)) == -1) { From owner-svn-src-all@freebsd.org Tue Aug 1 05:16:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38B39DCB2FE; Tue, 1 Aug 2017 05:16:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F266C386C; Tue, 1 Aug 2017 05:16:15 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v715GFpL043070; Tue, 1 Aug 2017 05:16:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v715GFtQ043069; Tue, 1 Aug 2017 05:16:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201708010516.v715GFtQ043069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 1 Aug 2017 05:16:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321844 - head/sys/boot/zfs X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/sys/boot/zfs X-SVN-Commit-Revision: 321844 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 05:16:16 -0000 Author: ngie Date: Tue Aug 1 05:16:14 2017 New Revision: 321844 URL: https://svnweb.freebsd.org/changeset/base/321844 Log: Clean up style in print_state(..) and pager_printf(..) No functional change intended. MFC after: 3 days Modified: head/sys/boot/zfs/zfsimpl.c Modified: head/sys/boot/zfs/zfsimpl.c ============================================================================== --- head/sys/boot/zfs/zfsimpl.c Tue Aug 1 04:52:03 2017 (r321843) +++ head/sys/boot/zfs/zfsimpl.c Tue Aug 1 05:16:14 2017 (r321844) @@ -794,6 +794,7 @@ pager_printf(const char *fmt, ...) va_start(args, fmt); vsprintf(line, fmt, args); va_end(args); + return (pager_output(line)); } @@ -804,15 +805,15 @@ pager_printf(const char *fmt, ...) static int print_state(int indent, const char *name, vdev_state_t state) { - int i; char buf[512]; + int i; buf[0] = 0; for (i = 0; i < indent; i++) strcat(buf, " "); strcat(buf, name); + return (pager_printf(STATUS_FORMAT, buf, state_name(state))); - } static int From owner-svn-src-all@freebsd.org Tue Aug 1 05:26:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC386DADC8E; Tue, 1 Aug 2017 05:26:46 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 812C06452A; Tue, 1 Aug 2017 05:26:46 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v715QjHn047241; Tue, 1 Aug 2017 05:26:45 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v715Qje9047240; Tue, 1 Aug 2017 05:26:45 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201708010526.v715Qje9047240@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 1 Aug 2017 05:26:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321848 - head/tools/tools/bootparttest X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/tools/tools/bootparttest X-SVN-Commit-Revision: 321848 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 05:26:46 -0000 Author: ngie Date: Tue Aug 1 05:26:45 2017 New Revision: 321848 URL: https://svnweb.freebsd.org/changeset/base/321848 Log: Chase r315408 with the fourth parameter being removed from disk_open(..) This fixes one part of the build. Modified: head/tools/tools/bootparttest/bootparttest.c Modified: head/tools/tools/bootparttest/bootparttest.c ============================================================================== --- head/tools/tools/bootparttest/bootparttest.c Tue Aug 1 05:26:30 2017 (r321847) +++ head/tools/tools/bootparttest/bootparttest.c Tue Aug 1 05:26:45 2017 (r321848) @@ -124,7 +124,7 @@ main(int argc, char **argv) printf("Mediasize: %ju Bytes (%ju sectors)\nSectorsize: %u Bytes\n", disk.mediasize, disk.mediasize / disk.sectorsize, disk.sectorsize); - if (disk_open(&dev, disk.mediasize, disk.sectorsize, 0) != 0) + if (disk_open(&dev, disk.mediasize, disk.sectorsize) != 0) errx(1, "disk_open failed"); printf("\tdisk0:\n"); disk_print(&dev, "\tdisk0", 1); From owner-svn-src-all@freebsd.org Tue Aug 1 05:34:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2AEDDAEC45; Tue, 1 Aug 2017 05:34:05 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6FEB364F61; Tue, 1 Aug 2017 05:34:05 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v715Y4WU051402; Tue, 1 Aug 2017 05:34:04 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v715Y4js051401; Tue, 1 Aug 2017 05:34:04 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201708010534.v715Y4js051401@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 1 Aug 2017 05:34:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321850 - head/tools/tools/bootparttest X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/tools/tools/bootparttest X-SVN-Commit-Revision: 321850 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 05:34:05 -0000 Author: ngie Date: Tue Aug 1 05:34:04 2017 New Revision: 321850 URL: https://svnweb.freebsd.org/changeset/base/321850 Log: Makefile cleanup - Standardize on SRCTOP instead of .CURDIR-relative paths - Use LIBADD instead of a mix of specifying -lgeom via DPADD/LDADD/LDFLAGS. Specifying -lgeom via LDFLAGS is an especially unnecessary and odd pattern. MFC after: 1 week Modified: head/tools/tools/bootparttest/Makefile Modified: head/tools/tools/bootparttest/Makefile ============================================================================== --- head/tools/tools/bootparttest/Makefile Tue Aug 1 05:29:36 2017 (r321849) +++ head/tools/tools/bootparttest/Makefile Tue Aug 1 05:34:04 2017 (r321850) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../sys/boot/common +.PATH: ${SRCTOP}/sys/boot/common BINDIR?= /usr/bin @@ -9,12 +9,10 @@ MAN= SRCS= bootparttest.c crc32.c stub.c part.c disk.c -CFLAGS= -I${.CURDIR}/../../../sys/boot/common \ +CFLAGS= -I${SRCTOP}/sys/boot/common \ -DLOADER_GPT_SUPPORT -DLOADER_MBR_SUPPORT -DPART_DEBUG \ -DDISK_DEBUG -DPADD+= ${LIBGEOM} -LDADD+= ${LIBGEOM} -LDFLAGS+= -lgeom +LIBADD+= geom .include From owner-svn-src-all@freebsd.org Tue Aug 1 05:23:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0587ADAD617; Tue, 1 Aug 2017 05:23:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C55BB64270; Tue, 1 Aug 2017 05:23:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v715NnjL046997; Tue, 1 Aug 2017 05:23:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v715Nn61046996; Tue, 1 Aug 2017 05:23:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201708010523.v715Nn61046996@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 1 Aug 2017 05:23:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321845 - head/tools/tools/zfsboottest X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/tools/tools/zfsboottest X-SVN-Commit-Revision: 321845 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 05:23:51 -0000 Author: ngie Date: Tue Aug 1 05:23:49 2017 New Revision: 321845 URL: https://svnweb.freebsd.org/changeset/base/321845 Log: Standardize on SRCTOP instead of .CURDIR-relative paths MFC after: 3 days Modified: head/tools/tools/zfsboottest/Makefile Modified: head/tools/tools/zfsboottest/Makefile ============================================================================== --- head/tools/tools/zfsboottest/Makefile Tue Aug 1 05:16:14 2017 (r321844) +++ head/tools/tools/zfsboottest/Makefile Tue Aug 1 05:23:49 2017 (r321845) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../sys/boot/zfs ${.CURDIR}/../../../sys/cddl/boot/zfs +.PATH: ${SRCTOP}/sys/boot/zfs ${SRCTOP}/sys/cddl/boot/zfs BINDIR?= /usr/bin SCRIPTSDIR?= /usr/bin @@ -11,8 +11,8 @@ SCRIPTSNAME= zfsboottest.sh MAN= CFLAGS= -O1 \ - -I${.CURDIR}/../../../sys/boot/zfs \ - -I${.CURDIR}/../../../sys/cddl/boot/zfs \ + -I${SRCTOP}/sys/boot/zfs \ + -I${SRCTOP}/sys/cddl/boot/zfs \ -I. \ -fdiagnostics-show-option \ -W -Wextra -Wno-sign-compare -Wno-unused-parameter @@ -23,7 +23,7 @@ LIBADD+= md beforedepend zfsboottest.o: machine CLEANFILES+= machine machine: - ln -sf ${.CURDIR}/../../../sys/i386/include machine + ln -sf ${SRCTOP}/sys/i386/include machine .endif .include From owner-svn-src-all@freebsd.org Tue Aug 1 05:26:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29FC0DADBD7; Tue, 1 Aug 2017 05:26:22 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E008764426; Tue, 1 Aug 2017 05:26:21 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v715QKIm047134; Tue, 1 Aug 2017 05:26:20 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v715QK1Z047133; Tue, 1 Aug 2017 05:26:20 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201708010526.v715QK1Z047133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 1 Aug 2017 05:26:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321846 - head/usr.sbin/ypldap X-SVN-Group: head X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: head/usr.sbin/ypldap X-SVN-Commit-Revision: 321846 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 05:26:22 -0000 Author: araujo Date: Tue Aug 1 05:26:20 2017 New Revision: 321846 URL: https://svnweb.freebsd.org/changeset/base/321846 Log: Log when we have finished pushing users and groups. Obtained from: OpenBSD (rev 1.4) MFC after: 3 weeks. Modified: head/usr.sbin/ypldap/entries.c Modified: head/usr.sbin/ypldap/entries.c ============================================================================== --- head/usr.sbin/ypldap/entries.c Tue Aug 1 05:23:49 2017 (r321845) +++ head/usr.sbin/ypldap/entries.c Tue Aug 1 05:26:20 2017 (r321846) @@ -92,6 +92,7 @@ flatten_entries(struct env *env) free(tmp); } env->sc_user_lines = linep; + log_debug("done pushing users"); wrlen = env->sc_group_line_len; if ((linep = calloc(1, env->sc_group_line_len + 1)) == NULL) { @@ -117,6 +118,7 @@ flatten_entries(struct env *env) wrlen -= len; } env->sc_group_lines = linep; + log_debug("done pushing groups"); } int From owner-svn-src-all@freebsd.org Tue Aug 1 05:26:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CD2FDADC3B; Tue, 1 Aug 2017 05:26:32 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 284B764473; Tue, 1 Aug 2017 05:26:32 +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 v715QVRg047187; Tue, 1 Aug 2017 05:26:31 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v715QUDD047185; Tue, 1 Aug 2017 05:26:30 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201708010526.v715QUDD047185@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 1 Aug 2017 05:26:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321847 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 321847 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 05:26:32 -0000 Author: markj Date: Tue Aug 1 05:26:30 2017 New Revision: 321847 URL: https://svnweb.freebsd.org/changeset/base/321847 Log: Batch updates to v_wire_count when freeing page table pages on x86. The removed release stores are not needed since stores are totally ordered on i386 and amd64. Reviewed by: alc, kib (previous revision) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D11790 Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Tue Aug 1 05:26:20 2017 (r321846) +++ head/sys/amd64/amd64/pmap.c Tue Aug 1 05:26:30 2017 (r321847) @@ -2209,12 +2209,14 @@ static __inline void pmap_free_zero_pages(struct spglist *free) { vm_page_t m; + int count; - while ((m = SLIST_FIRST(free)) != NULL) { + for (count = 0; (m = SLIST_FIRST(free)) != NULL; count++) { SLIST_REMOVE_HEAD(free, plinks.s.ss); /* Preserve the page's PG_ZERO setting. */ vm_page_free_toq(m); } + atomic_subtract_int(&vm_cnt.v_wire_count, count); } /* @@ -2320,13 +2322,6 @@ _pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, vm_page_ pmap_unwire_ptp(pmap, va, pdppg, free); } - /* - * 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); - /* * Put page on a list so that it is released after * *ALL* TLB shootdown is done @@ -3010,7 +3005,6 @@ reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **l SLIST_REMOVE_HEAD(&free, plinks.s.ss); /* Recycle a freed page table page. */ m_pc->wire_count = 1; - atomic_add_int(&vm_cnt.v_wire_count, 1); } pmap_free_zero_pages(&free); return (m_pc); @@ -3678,7 +3672,6 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t *pdq, vm_offse ("pmap_remove_pde: pte page wire count error")); mpte->wire_count = 0; pmap_add_delayed_free_list(mpte, free, FALSE); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); } } return (pmap_unuse_pt(pmap, sva, *pmap_pdpe(pmap, sva), free)); @@ -5622,7 +5615,6 @@ pmap_remove_pages(pmap_t pmap) ("pmap_remove_pages: pte page wire count error")); mpte->wire_count = 0; pmap_add_delayed_free_list(mpte, &free, FALSE); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); } } else { pmap_resident_count_dec(pmap, 1); Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Tue Aug 1 05:26:20 2017 (r321846) +++ head/sys/i386/i386/pmap.c Tue Aug 1 05:26:30 2017 (r321847) @@ -1709,12 +1709,14 @@ static __inline void pmap_free_zero_pages(struct spglist *free) { vm_page_t m; + int count; - while ((m = SLIST_FIRST(free)) != NULL) { + for (count = 0; (m = SLIST_FIRST(free)) != NULL; count++) { SLIST_REMOVE_HEAD(free, plinks.s.ss); /* Preserve the page's PG_ZERO setting. */ vm_page_free_toq(m); } + atomic_subtract_int(&vm_cnt.v_wire_count, count); } /* @@ -1792,13 +1794,6 @@ _pmap_unwire_ptp(pmap_t pmap, vm_page_t m, struct spgl --pmap->pm_stats.resident_count; /* - * 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); - - /* * Do an invltlb to make the invalidated mapping * take effect immediately. */ @@ -2061,11 +2056,11 @@ pmap_release(pmap_t pmap) ("pmap_release: got wrong ptd page")); #endif m->wire_count--; - atomic_subtract_int(&vm_cnt.v_wire_count, 1); vm_page_free_zero(m); } + atomic_subtract_int(&vm_cnt.v_wire_count, NPGPTD); } - + static int kvm_size(SYSCTL_HANDLER_ARGS) { @@ -2324,7 +2319,6 @@ out: SLIST_REMOVE_HEAD(&free, plinks.s.ss); /* Recycle a freed page table page. */ m_pc->wire_count = 1; - atomic_add_int(&vm_cnt.v_wire_count, 1); } pmap_free_zero_pages(&free); return (m_pc); @@ -2873,7 +2867,6 @@ pmap_remove_pde(pmap_t pmap, pd_entry_t *pdq, vm_offse ("pmap_remove_pde: pte page wire count error")); mpte->wire_count = 0; pmap_add_delayed_free_list(mpte, free, FALSE); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); } } } @@ -4593,7 +4586,6 @@ pmap_remove_pages(pmap_t pmap) ("pmap_remove_pages: pte page wire count error")); mpte->wire_count = 0; pmap_add_delayed_free_list(mpte, &free, FALSE); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); } } else { pmap->pm_stats.resident_count--; From owner-svn-src-all@freebsd.org Tue Aug 1 05:39:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64055DAF9EE; Tue, 1 Aug 2017 05:39:41 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 330A765242; Tue, 1 Aug 2017 05:39:41 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v715derb051623; Tue, 1 Aug 2017 05:39:40 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v715depQ051622; Tue, 1 Aug 2017 05:39:40 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201708010539.v715depQ051622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 1 Aug 2017 05:39:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321851 - head/sys/boot/geli X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/sys/boot/geli X-SVN-Commit-Revision: 321851 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 05:39:41 -0000 Author: ngie Date: Tue Aug 1 05:39:40 2017 New Revision: 321851 URL: https://svnweb.freebsd.org/changeset/base/321851 Log: Standardize paths on SRCTOP instead of .CURDIR-relative paths MFC after: 1 week Modified: head/sys/boot/geli/Makefile Modified: head/sys/boot/geli/Makefile ============================================================================== --- head/sys/boot/geli/Makefile Tue Aug 1 05:34:04 2017 (r321850) +++ head/sys/boot/geli/Makefile Tue Aug 1 05:39:40 2017 (r321851) @@ -28,16 +28,16 @@ SRCS+= bcmp.c bcopy.c bzero.c SRCS+= pwgets.c # sha256 and sha512 from sys/crypto -.PATH: ${.CURDIR}/../../crypto/sha2 +.PATH: ${SRCTOP}/sys/crypto/sha2 CFLAGS+= -DWEAK_REFS SRCS+= sha256c.c sha512c.c # md5 from libmd -.PATH: ${.CURDIR}/../../../lib/libmd +.PATH: ${SRCTOP}/lib/libmd SRCS+= md5c.c # AES implementation from sys/crypto -.PATH: ${.CURDIR}/../../crypto/rijndael +.PATH: ${SRCTOP}/sys/crypto/rijndael CFLAGS+= -I${.CURDIR}/../../ CFLAGS+= -I${.CURDIR}/../common/ # Remove asserts @@ -45,7 +45,7 @@ CFLAGS+= -DNDEBUG SRCS+= rijndael-alg-fst.c rijndael-api-fst.c rijndael-api.c # local GELI Implementation -.PATH: ${.CURDIR}/../../geom/eli +.PATH: ${SRCTOP}/sys/geom/eli CFLAGS+= -D_STAND SRCS+= geliboot_crypto.c g_eli_hmac.c g_eli_key.c g_eli_key_cache.c pkcs5v2.c From owner-svn-src-all@freebsd.org Tue Aug 1 05:29:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAA6EDAE093; Tue, 1 Aug 2017 05:29:37 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A409C64730; Tue, 1 Aug 2017 05:29:37 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v715Taur047373; Tue, 1 Aug 2017 05:29:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v715Ta2p047371; Tue, 1 Aug 2017 05:29:36 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201708010529.v715Ta2p047371@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 1 Aug 2017 05:29:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321849 - in head/tools/tools: bootparttest zfsboottest X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in head/tools/tools: bootparttest zfsboottest X-SVN-Commit-Revision: 321849 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 05:29:38 -0000 Author: ngie Date: Tue Aug 1 05:29:36 2017 New Revision: 321849 URL: https://svnweb.freebsd.org/changeset/base/321849 Log: Fix the return type for pager_output(..) in bootparttest and zfsboottest pager_output(..) has always returned int. For some reason (probably the clang 5.0 update), this mismatch now results in an error with CC=clang. MFC after: 1 week Modified: head/tools/tools/bootparttest/stub.c head/tools/tools/zfsboottest/zfsboottest.c Modified: head/tools/tools/bootparttest/stub.c ============================================================================== --- head/tools/tools/bootparttest/stub.c Tue Aug 1 05:26:45 2017 (r321848) +++ head/tools/tools/bootparttest/stub.c Tue Aug 1 05:29:36 2017 (r321849) @@ -44,9 +44,9 @@ Free(void *ptr, const char *file, int line) return (free(ptr)); } -void +int pager_output(const char *s) { - printf("%s", s); + return (printf("%s", s)); } Modified: head/tools/tools/zfsboottest/zfsboottest.c ============================================================================== --- head/tools/tools/zfsboottest/zfsboottest.c Tue Aug 1 05:26:45 2017 (r321848) +++ head/tools/tools/zfsboottest/zfsboottest.c Tue Aug 1 05:29:36 2017 (r321849) @@ -43,11 +43,11 @@ #define NBBY 8 -void +int pager_output(const char *line) { - fprintf(stderr, "%s", line); + return (fprintf(stderr, "%s", line)); } #define ZFS_TEST From owner-svn-src-all@freebsd.org Tue Aug 1 06:51:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AC7FDB76E9; Tue, 1 Aug 2017 06:51:04 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A2EB670A0; Tue, 1 Aug 2017 06:51:04 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v716p3I2082581; Tue, 1 Aug 2017 06:51:03 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v716p3MW082483; Tue, 1 Aug 2017 06:51:03 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201708010651.v716p3MW082483@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 1 Aug 2017 06:51:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321852 - in head/tools/tools: bootparttest zfsboottest X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in head/tools/tools: bootparttest zfsboottest X-SVN-Commit-Revision: 321852 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 06:51:04 -0000 Author: ngie Date: Tue Aug 1 06:51:03 2017 New Revision: 321852 URL: https://svnweb.freebsd.org/changeset/base/321852 Log: Fix up r321849 pager_output should return 0 if no more output needs to be paged; non-zero otherwise. MFC after: 1 week MFC with: r321849 Reported by: avg Modified: head/tools/tools/bootparttest/stub.c head/tools/tools/zfsboottest/zfsboottest.c Modified: head/tools/tools/bootparttest/stub.c ============================================================================== --- head/tools/tools/bootparttest/stub.c Tue Aug 1 05:39:40 2017 (r321851) +++ head/tools/tools/bootparttest/stub.c Tue Aug 1 06:51:03 2017 (r321852) @@ -48,5 +48,6 @@ int pager_output(const char *s) { - return (printf("%s", s)); + printf("%s", s); + return (0); } Modified: head/tools/tools/zfsboottest/zfsboottest.c ============================================================================== --- head/tools/tools/zfsboottest/zfsboottest.c Tue Aug 1 05:39:40 2017 (r321851) +++ head/tools/tools/zfsboottest/zfsboottest.c Tue Aug 1 06:51:03 2017 (r321852) @@ -47,7 +47,8 @@ int pager_output(const char *line) { - return (fprintf(stderr, "%s", line)); + fprintf(stderr, "%s", line); + return (0); } #define ZFS_TEST From owner-svn-src-all@freebsd.org Tue Aug 1 08:26:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABFC6DC47CF; Tue, 1 Aug 2017 08:26:22 +0000 (UTC) (envelope-from yaneurabeya@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 760156A3EB; Tue, 1 Aug 2017 08:26:22 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x22f.google.com with SMTP id c14so5220206pgn.0; Tue, 01 Aug 2017 01:26:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=L8GBMqncdF+Nt+3+Yaoju/ipqkahSscAMSdzlQ144M4=; b=JsejKkvBiUDHzwCKLmJzt9oQmMsFNAe7AD+5XqQmfCbNigPIKPZrjnH3uUefkVkAxx wRX1n676fZE68wvOwakXpGjeOMsnL2SxvDhiowLv32Gm+3qwGkg699/us9y7SkgC1vxb yjRlEpthNFSQDQHTzS0GVRkk/Y/UVLgnMRs7UP1SIpORlpu6CXWfuUd7Q+MhP9N7w6Jk 6lldaYay0vjNuUURWQWd3xv/kxKMUw567iXSw4fYH+GcUZMIwutWp/O4iTlDJqdn4J0v lLzOaE2mYmpo62negZ9db6ZQCDnyweSQZuUd4MP5lltEQ5U7C6k94VTA2OPpPjEq42p6 6b8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=L8GBMqncdF+Nt+3+Yaoju/ipqkahSscAMSdzlQ144M4=; b=YhhqircGOP7lhj8FtW7Sh64JhX9dCLOoR9Aw793gggjCq5snGj4OHJnqcxS+zlNLyU rEPEnh4hZnnv96NWEv9ZCYB1/9FjTsvCCY/k3EocfUVpfh0/FFlOLZYeh0hNfaA+78su pNH4e0U8h4uMqGPrwk/ekL07ko3bmITE79d85RIYwrd51dWttkIldiJaSMs8WfosVWGn VnMi4l9m54Wgeg9/mSTb/SW0OO09nrUTJ+0kUxaIohehFGSJctH6eTh1qBxZBFvuk87v Q/FwrR4nuymJeBX0N5LcF157kjApXQ0QSc9pfZ8V5raVUeFsnAN/YLRmqaRCn1rChQSB +b5A== X-Gm-Message-State: AIVw113Vy1xMZ8/JtP5/IBgPm6DLs1tLhPjJzQxlzQsz4wZ3IAnDtk35 rYdGc1AgOdgaCSCyy2M= X-Received: by 10.99.137.194 with SMTP id v185mr18796705pgd.279.1501575981838; Tue, 01 Aug 2017 01:26:21 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id b6sm48733430pgn.67.2017.08.01.01.26.20 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 01 Aug 2017 01:26:21 -0700 (PDT) Subject: Re: svn commit: r321849 - in head/tools/tools: bootparttest zfsboottest Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_8FAFA912-AD0C-4732-A63A-1D85179A117D"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <96cee950-35c2-3971-defa-be4b5493cfd3@FreeBSD.org> Date: Tue, 1 Aug 2017 01:26:19 -0700 Cc: Ngie Cooper , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Message-Id: <21962A53-0DA3-4C10-8075-923948AB83E6@gmail.com> References: <201708010529.v715Ta2p047371@repo.freebsd.org> <96cee950-35c2-3971-defa-be4b5493cfd3@FreeBSD.org> To: Andriy Gapon X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 08:26:22 -0000 --Apple-Mail=_8FAFA912-AD0C-4732-A63A-1D85179A117D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Aug 1, 2017, at 00:13, Andriy Gapon wrote: =E2=80=A6 > Thank you! > The next problem you are going to encounter would be missing = ldi_get_size(). > I have some WIP for that if you are interested. That=E2=80=99d be great =E2=80=94 please feel free to pass it along :)! -Ngie --Apple-Mail=_8FAFA912-AD0C-4732-A63A-1D85179A117D Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZgDssAAoJEPWDqSZpMIYV7/sQAMwRGHc9TWj4AwDFt8bDElpH RxoOV01e4hFITBq+T4eFWDrymcqYrEYCFotW0mzE1u81lj5VgbWvAC2wEXdMjVSN m4ObT0LUBvd1dB7bDbLipzHOhY36xp3HoRsmsRuMjIGRjBbvC+z4k6hOBaplzleG McUXikYr9Y4LntUDadYqtEZr9tNnotLb0BXUm0QLQKTjttgbypqwJrYoec8Rlkfh LgI1H1A1urbbU2oFwZdPO3TXl9dfiHfziic4OtvRfBAevDmsaF8tr+yAm25JdrMd 9z0mm8nV8hJfoGAcH8wvTmvSf2xKxBC4yYPkmZ/qomi2gYwbzG0rdF8wUMkbfO9L PiG7fo6zJ5OOg8L3dgKtAUMDX8ppWzAqUsGfKEzttn93y7CVyGO3zdhhXY5u+CHk LpiPDYEy55R2v+6kb/pHvdDJkLCG9HVsnKURKu/9jdTPRT3p9vcgUWUP5k6ixVcx FEhWrNUgiyplZfFZbAOijE904FuScTqZQkfqMYLpqPtlv7t53fHVEcmEcNweZpMo CnGBo508rMB2EzghU3bRpZt39DFEtGlWsqqhwgxA3jLmx6OKpETeBcRfVWimQUdY L5GFpul+G9GebfTfsZpSfmi1uQZewZN2cVZNBWvOkWXRTaPX1nkWgK3g/ReOt3fB R3kF3BpoIePOv0dhQj+3 =8TSI -----END PGP SIGNATURE----- --Apple-Mail=_8FAFA912-AD0C-4732-A63A-1D85179A117D-- From owner-svn-src-all@freebsd.org Tue Aug 1 06:39:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88F58DB64EE; Tue, 1 Aug 2017 06:39:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 4FFB266B99; Tue, 1 Aug 2017 06:39:52 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id JAA17505; Tue, 01 Aug 2017 09:39:44 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1dcQqG-000OhV-HI; Tue, 01 Aug 2017 09:39:44 +0300 Subject: Re: svn commit: r321849 - in head/tools/tools: bootparttest zfsboottest To: Ngie Cooper , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201708010529.v715Ta2p047371@repo.freebsd.org> From: Andriy Gapon Message-ID: Date: Tue, 1 Aug 2017 09:39:08 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <201708010529.v715Ta2p047371@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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 06:39:54 -0000 On 01/08/2017 08:29, Ngie Cooper wrote: > Author: ngie > Date: Tue Aug 1 05:29:36 2017 > New Revision: 321849 > URL: https://svnweb.freebsd.org/changeset/base/321849 > > Log: > Fix the return type for pager_output(..) in bootparttest and zfsboottest > > pager_output(..) has always returned int. For some reason (probably the > clang 5.0 update), this mismatch now results in an error with CC=clang. > > MFC after: 1 week I am not sure if this a correct fix... Return value of pager_output() signifies whether to continue printing, return value of printf is a number of characters printed. > head/tools/tools/bootparttest/stub.c > head/tools/tools/zfsboottest/zfsboottest.c > > Modified: head/tools/tools/bootparttest/stub.c > ============================================================================== > --- head/tools/tools/bootparttest/stub.c Tue Aug 1 05:26:45 2017 (r321848) > +++ head/tools/tools/bootparttest/stub.c Tue Aug 1 05:29:36 2017 (r321849) > @@ -44,9 +44,9 @@ Free(void *ptr, const char *file, int line) > return (free(ptr)); > } > > -void > +int > pager_output(const char *s) > { > > - printf("%s", s); > + return (printf("%s", s)); > } > > Modified: head/tools/tools/zfsboottest/zfsboottest.c > ============================================================================== > --- head/tools/tools/zfsboottest/zfsboottest.c Tue Aug 1 05:26:45 2017 (r321848) > +++ head/tools/tools/zfsboottest/zfsboottest.c Tue Aug 1 05:29:36 2017 (r321849) > @@ -43,11 +43,11 @@ > > #define NBBY 8 > > -void > +int > pager_output(const char *line) > { > > - fprintf(stderr, "%s", line); > + return (fprintf(stderr, "%s", line)); > } > > #define ZFS_TEST > -- Andriy Gapon From owner-svn-src-all@freebsd.org Tue Aug 1 07:05:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8567DBD14A; Tue, 1 Aug 2017 07:05:30 +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 mx1.freebsd.org (Postfix) with ESMTPS id 7587667A26; Tue, 1 Aug 2017 07:05:30 +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 v7175TUS087714; Tue, 1 Aug 2017 07:05:29 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7175TKp087713; Tue, 1 Aug 2017 07:05:29 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201708010705.v7175TKp087713@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Tue, 1 Aug 2017 07:05:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321853 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321853 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 07:05:30 -0000 Author: wulf Date: Tue Aug 1 07:05:29 2017 New Revision: 321853 URL: https://svnweb.freebsd.org/changeset/base/321853 Log: Add myself to the calendar Reminded by: mckusick Approved by: gonzo (mentor) Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Tue Aug 1 06:51:03 2017 (r321852) +++ head/usr.bin/calendar/calendars/calendar.freebsd Tue Aug 1 07:05:29 2017 (r321853) @@ -352,6 +352,7 @@ 10/16 Remko Lodder born in Rotterdam, the Netherlands, 1983 10/17 Maho NAKATA born in Osaka, Japan, 1974 10/18 Sheldon Hearn born in Cape Town, Western Cape, South Africa, 1974 +10/18 Vladimir Kondratyev born in Ryazan, USSR, 1975 10/19 Nicholas Souchu born in Suresnes, Hauts-de-Seine, France, 1972 10/19 Nick Barkas born in Longview, Washington, United States, 1981 10/19 Pedro Giffuni born in Bogotá, Colombia, 1968 From owner-svn-src-all@freebsd.org Tue Aug 1 06:51:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92AB5DB7756; Tue, 1 Aug 2017 06:51:30 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x22b.google.com (mail-pg0-x22b.google.com [IPv6:2607:f8b0:400e:c05::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 60261671C6; Tue, 1 Aug 2017 06:51:30 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x22b.google.com with SMTP id 125so4251802pgi.3; Mon, 31 Jul 2017 23:51:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=R6TOO8i+1pyGyximchJxkJVokE4ssxcJPQ+5PQuZGRk=; b=iKk5ERn9EH+g5peg2zaG1XtzN4JbMz4/dZrUwOvTNOV5g98HjKxX2k6rcLMyjf976c 7yQXIaXMIufWjZ/RpoRR7PUznj9tDR9lRjmlMjn1OGbgtepGSVTTaoh6mzQMHuXVQRBY EqizgpsRXzKWSJYpi9RlW9nZbQK5kmw0veNEzIi4uiKTQwicMyfWkirbpRst88qJtYtJ iaQdwL3F42/pcrSdcs9THrwBUWi2QegyAnVv1v6DyzSUXLf4hVhtvinDUOV4iNARGT+B Cj3nMKQ1VKMdCGpa5DHz5mZWU8Lk+FAbfnIDguR596UwV8dv/RtpNUFhB3EVEmt5SmiT ejnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=R6TOO8i+1pyGyximchJxkJVokE4ssxcJPQ+5PQuZGRk=; b=pmAZelmqGvK9FXyQGzqaqb10Oze3ZrwLvWVQ1nfeVxZnDSyTxXXethGDnewubrJDJw /d9LqfIihqeUO8tekDhzrCq379I8t33ePa8lyRTu8wh9z8m+/3awE9HFhi7YYj+MMKl3 emMTRru/fPMyHYVArckOhJMAiisIBokYaxoJOQa2noKN3uwqnGsnKzfbAJTMyh/fOAhK asIJLAyvM1cD6t10P/YdkoW82JQup0NioCDi7xLtKIFCNU60Yn4H3LjmfL4xQYy857Sb bwXk2L2kPvkskdcVWV6U7lLt7NaHEmkcHmORIEayDzlgm6MrTyGKlaz8SLvt5hINY1g6 p3rw== X-Gm-Message-State: AIVw110mF5SHJzql4lPAihQwyiyZ6nPFZsRmEp0Xqiz8c4tu7IFx4y8N X3sAQ4on9hAO4z3psKM= X-Received: by 10.84.241.207 with SMTP id t15mr19747900plm.338.1501570289428; Mon, 31 Jul 2017 23:51:29 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id q80sm42051040pfj.187.2017.07.31.23.51.28 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 31 Jul 2017 23:51:28 -0700 (PDT) Subject: Re: svn commit: r321849 - in head/tools/tools: bootparttest zfsboottest Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_F8D108D6-504F-4974-B02F-C6F859EDE526"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: Date: Mon, 31 Jul 2017 23:51:27 -0700 Cc: Ngie Cooper , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Message-Id: References: <201708010529.v715Ta2p047371@repo.freebsd.org> To: Andriy Gapon X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 06:51:30 -0000 --Apple-Mail=_F8D108D6-504F-4974-B02F-C6F859EDE526 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jul 31, 2017, at 23:39, Andriy Gapon wrote: >=20 > On 01/08/2017 08:29, Ngie Cooper wrote: >> Author: ngie >> Date: Tue Aug 1 05:29:36 2017 >> New Revision: 321849 >> URL: https://svnweb.freebsd.org/changeset/base/321849 >>=20 >> Log: >> Fix the return type for pager_output(..) in bootparttest and = zfsboottest >>=20 >> pager_output(..) has always returned int. For some reason (probably = the >> clang 5.0 update), this mismatch now results in an error with = CC=3Dclang. >>=20 >> MFC after: 1 week >=20 > I am not sure if this a correct fix... > Return value of pager_output() signifies whether to continue printing, = return > value of printf is a number of characters printed. You=E2=80=99re right =E2=80=94 it was wrong. Fixed in r321852. Thanks, -Ngie --Apple-Mail=_F8D108D6-504F-4974-B02F-C6F859EDE526 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZgCTvAAoJEPWDqSZpMIYVsDUP/0KWwpRIrElxGwHZfKJlWdwF kD64DnKZgz7uyWxyAJO8/FdD+SKAqyN9sVZsQPnSaP/JU2Yji6j9OMTwzmfy84Fo SayNGrIFBqn7aipeJSbgXt+0C5Q+3uA64fZ4gDCNrnHZlMbPojYziFOy5cpTsdkg mShZJihWYNrA/mS/F06h3RSmEj+ZWBigmXloRceKOiZyhM4Kw55kEMgbQp8cD8nq ZhrXyZnNurIrULOgQaS8I518xhRO5iIpVkNdOo5aGAa7WeK6qiquQbQ4/EXo/T4Y z4KI2sZx0/8TqJaHlN22eoWoIQkN5mQFjCBT9xJzB9yoZSmuxYcPjEYUwdxNmF+f R6p4RdbOFbbRO7lPVC9CoBLwShT9MaW5EMON/K0POTS2akeV/8SLFA5qp8VKjB8x WY0vok2T3WCH4mwJrdzD7+6tpgbZ+kCk4tJOnSrGvHbZqIKH3MXzDVBS4o4wAIQv 2TyXDfUNNwPC2BQL/5hzWzSsQ8UmpSnjS0blFbpe5p6nwsjkyGTiSv7bBiTiQkgn ynt/oCSbdIOd4cpJSfW6/4WMnuAFC46IAWXlJ3BcKRQZEpsCUPd6v0+xNaLG22uw wFNtk/Jpey1JEbWHUH4ZdYxZji8UmPR7Gd0Fp7EayuPNqSI8lDTUHj1f2OLt1+9J 7RH6Sx4Pxoml/YOujSWV =9USm -----END PGP SIGNATURE----- --Apple-Mail=_F8D108D6-504F-4974-B02F-C6F859EDE526-- From owner-svn-src-all@freebsd.org Tue Aug 1 07:14:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE60ADBDB7B; Tue, 1 Aug 2017 07:14:04 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 87BFF67E47; Tue, 1 Aug 2017 07:14:03 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id KAA17592; Tue, 01 Aug 2017 10:14:01 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1dcRNR-000Ojb-Eh; Tue, 01 Aug 2017 10:14:01 +0300 Subject: Re: svn commit: r321849 - in head/tools/tools: bootparttest zfsboottest To: "Ngie Cooper (yaneurabeya)" Cc: Ngie Cooper , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201708010529.v715Ta2p047371@repo.freebsd.org> From: Andriy Gapon Message-ID: <96cee950-35c2-3971-defa-be4b5493cfd3@FreeBSD.org> Date: Tue, 1 Aug 2017 10:13:25 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 07:14:04 -0000 On 01/08/2017 09:51, Ngie Cooper (yaneurabeya) wrote: > >> On Jul 31, 2017, at 23:39, Andriy Gapon wrote: >> >> On 01/08/2017 08:29, Ngie Cooper wrote: >>> Author: ngie >>> Date: Tue Aug 1 05:29:36 2017 >>> New Revision: 321849 >>> URL: https://svnweb.freebsd.org/changeset/base/321849 >>> >>> Log: >>> Fix the return type for pager_output(..) in bootparttest and zfsboottest >>> >>> pager_output(..) has always returned int. For some reason (probably the >>> clang 5.0 update), this mismatch now results in an error with CC=clang. >>> >>> MFC after: 1 week >> >> I am not sure if this a correct fix... >> Return value of pager_output() signifies whether to continue printing, return >> value of printf is a number of characters printed. > > You’re right — it was wrong. Fixed in r321852. Thank you! The next problem you are going to encounter would be missing ldi_get_size(). I have some WIP for that if you are interested. -- Andriy Gapon From owner-svn-src-all@freebsd.org Tue Aug 1 09:26:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80130DC9282; Tue, 1 Aug 2017 09:26:23 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C6EB6CABC; Tue, 1 Aug 2017 09:26:23 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v719QMmo044952; Tue, 1 Aug 2017 09:26:22 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v719QM7d044951; Tue, 1 Aug 2017 09:26:22 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201708010926.v719QM7d044951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 1 Aug 2017 09:26:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321857 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321857 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 09:26:23 -0000 Author: tuexen Date: Tue Aug 1 09:26:22 2017 New Revision: 321857 URL: https://svnweb.freebsd.org/changeset/base/321857 Log: Add myself to calendar. Reminded by: mckusick Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Tue Aug 1 09:22:10 2017 (r321856) +++ head/usr.bin/calendar/calendars/calendar.freebsd Tue Aug 1 09:26:22 2017 (r321857) @@ -401,6 +401,7 @@ 12/04 Mariusz Zaborski born in Skierniewice, Poland, 1990 12/05 Ivan Voras born in Slavonski Brod, Croatia, 1981 12/06 Stefan Farfeleder born in Wien, Austria, 1980 +12/08 Michael Tuexen born in Oldenburg, Germany, 1966 12/11 Ganael Laplanche born in Reims, France, 1980 12/15 James FitzGibbon born in Amersham, Buckinghamshire, United Kingdom, 1974 12/15 Timur I. Bakeyev born in Kazan, Republic of Tatarstan, USSR, 1974 From owner-svn-src-all@freebsd.org Tue Aug 1 09:07:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 930DCDC7C40; Tue, 1 Aug 2017 09:07:27 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 621B86BFA8; Tue, 1 Aug 2017 09:07:27 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7197Q1j036960; Tue, 1 Aug 2017 09:07:26 GMT (envelope-from matthew@FreeBSD.org) Received: (from matthew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7197QL5036959; Tue, 1 Aug 2017 09:07:26 GMT (envelope-from matthew@FreeBSD.org) Message-Id: <201708010907.v7197QL5036959@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: matthew set sender to matthew@FreeBSD.org using -f From: Matthew Seaman Date: Tue, 1 Aug 2017 09:07:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r321855 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: matthew X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 321855 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 09:07:27 -0000 Author: matthew (ports committer) Date: Tue Aug 1 09:07:26 2017 New Revision: 321855 URL: https://svnweb.freebsd.org/changeset/base/321855 Log: Reap edavis' commit bit with his approval Approved by: core (implicit) Modified: svnadmin/conf/access Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Tue Aug 1 08:42:08 2017 (r321854) +++ svnadmin/conf/access Tue Aug 1 09:07:26 2017 (r321855) @@ -67,7 +67,6 @@ dumbbell dwmalone dwmalone=freebsd-committers@maths.tcd.ie eadler ed -edavis emaste emax eri From owner-svn-src-all@freebsd.org Tue Aug 1 09:30:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3CBADC962C; Tue, 1 Aug 2017 09:30:22 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 807F56CC00; Tue, 1 Aug 2017 09:30:22 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v719ULXO045151; Tue, 1 Aug 2017 09:30:21 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v719ULnj045148; Tue, 1 Aug 2017 09:30:21 GMT (envelope-from se@FreeBSD.org) Message-Id: <201708010930.v719ULnj045148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: Stefan Esser Date: Tue, 1 Aug 2017 09:30:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321858 - head/share/vt/keymaps X-SVN-Group: head X-SVN-Commit-Author: se X-SVN-Commit-Paths: head/share/vt/keymaps X-SVN-Commit-Revision: 321858 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 09:30:22 -0000 Author: se Date: Tue Aug 1 09:30:21 2017 New Revision: 321858 URL: https://svnweb.freebsd.org/changeset/base/321858 Log: Add alternate Turkish keyboard layout F. The layout and menu texts have been provided by Ufuk Güler, with minor changes for consistency by me. Submitted by: Ufuk Güler MFC after: 1 week Added: head/share/vt/keymaps/tr.f.kbd (contents, props changed) Modified: head/share/vt/keymaps/INDEX.keymaps head/share/vt/keymaps/Makefile Modified: head/share/vt/keymaps/INDEX.keymaps ============================================================================== --- head/share/vt/keymaps/INDEX.keymaps Tue Aug 1 09:26:22 2017 (r321857) +++ head/share/vt/keymaps/INDEX.keymaps Tue Aug 1 09:30:21 2017 (r321858) @@ -31,6 +31,7 @@ MENU:he:ךלש תדלקמה תפש ×ª× ×¨×—×‘ MENU:uk:ОберiÑ‚ÑŒ розкладку клавіатури MENU:el:Επιλέξτε το πληκτÏολόγιο της κονσόλας MENU:hy:Ô¸Õ¶Õ¿Ö€Õ¥Ö„ Õ½Õ¿Õ¥Õ²Õ¶Õ¡Õ·Õ¡Ö€Õ« Õ¤Õ¡Õ½Õ¡Õ¾Õ¸Ö€Õ¸Ö‚Õ©ÕµÕ¸Ö‚Õ¶Õ¨ +MENU:tr:Klavye düzeninizi seçiniz # # The font definition for "en" is the fall-back font for @@ -210,6 +211,7 @@ de.kbd:de:Deutsch de.kbd:fr:Allemand de.kbd:pt:Alemão de.kbd:es:Alemán +de.kbd:tr:Almanca de.kbd:uk:Ðімецька de.acc.kbd:en:German (accent keys) @@ -488,10 +490,17 @@ ch.macbook.acc.kbd:fr:Suisse-Allemand Macbook/Macbook ch.macbook.acc.kbd:pt:Suiço-Alemão Macbook/Macbook Pro (com acentos) ch.macbook.acc.kbd:es:Germanosuizo Macbook/Macbook Pro (con acentos) -tr.kbd:en:Turkish -tr.kbd:de:Türkisch -tr.kbd:fr:Turc -tr.kbd:uk:Турецька +tr.kbd:en:Turkish (Q) +tr.kbd:de:Türkisch (Q) +tr.kbd:fr:Turc (Q) +tr.kbd:uk:Турецька (Q) +tr.kbd:tr:Türkçe (Q) + +tr.f.kbd:en:Turkish (F) +tr.f.kbd:de:Türkisch (F) +tr.f.kbd:fr:Turc (F) +tr.f.kbd:uk:Турецька (F) +tr.f.kbd:tr:Türkçe (F) uk.kbd:en:United Kingdom uk.kbd:de:Vereinigtes Königreich Modified: head/share/vt/keymaps/Makefile ============================================================================== --- head/share/vt/keymaps/Makefile Tue Aug 1 09:26:22 2017 (r321857) +++ head/share/vt/keymaps/Makefile Tue Aug 1 09:30:21 2017 (r321858) @@ -67,6 +67,7 @@ FILES= INDEX.keymaps \ se.kbd \ si.kbd \ sk.kbd \ + tr.f.kbd \ tr.kbd \ ua.kbd \ ua.shift.alt.kbd \ Added: head/share/vt/keymaps/tr.f.kbd ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/vt/keymaps/tr.f.kbd Tue Aug 1 09:30:21 2017 (r321858) @@ -0,0 +1,121 @@ +# Turkish F Keyboard (01-08-2017) +# +# $FreeBSD$ +# +# Ufuk Guler +# ufukguler@yahoo.com +# +# Mobile : +(90) 544 848 39 09 +# alt +# scan cntrl alt alt cntrl lock +# code base shift cntrl shift alt shift cntrl shift state +# ------------------------------------------------------------------ + 000 nop nop nop nop nop nop nop nop O + 001 esc esc esc esc esc esc debug esc O + 002 '1' '!' '1' '!' 0xB9 0xA1 '1' '!' O + 003 '2' '"' nul '"' 0xB2 nop '2' nul O + 004 '3' '^' nop nop '#' 0xB3 '#' '#' O + 005 '4' '$' nop '$' 0xBC nop '4' '$' O + 006 '5' '%' nop '%' 0xBD nop '5' '%' O + 007 '6' '&' nop '&' 0xBE nop '6' nop O + 008 '7' ''' nop ''' '{' nop nop '&' O + 009 '8' '(' nop '(' '[' nop nop '*' O + 010 '9' ')' '9' ')' ']' 0xB1 gs '(' O + 011 '0' '=' nop '=' '}' 0xB0 nop ')' O + 012 '/' '?' nop nop '\' 0xBF fs nop O + 013 '-' '_' nop nop '|' nop nop '+' O + 014 bs bs del del bs bs del del O + 015 ht btab nop nop ht btab nop nop O + 016 'f' 'F' ack ack '@' nop ack ack C + 017 'g' 'G' bel bel bel bel bel bel C + 018 0x011F 0x011E nop nop nop nop nop nop C + 019 0x0131 'I' ht ht 0xB6 ht ht ht C + 020 'o' 'O' si si 0xF4 0xD4 si si C + 021 'd' 'D' eot eot 0xA5 eot eot eot C + 022 'r' 'R' dc2 dc2 0xAE dc2 dc2 dc2 C + 023 'n' 'N' so so so so so so C + 024 'h' 'H' bs bs 0xB0 bs bs bs C + 025 'p' 'P' dle dle 0xA3 dle dle dle C + 026 'q' 'Q' dc1 dc1 0xA8 dc1 dc1 dc1 C + 027 'w' 'W' etb etb 0x7E nop nop nop C + 028 cr cr nl nl cr cr nl nl O + 029 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O + 030 'u' 'U' nak nak 0xFB 0xDB nak nak C + 031 'i' 0x0130 nop nop 0xEE 0x0130 nop nop C + 032 'e' 'E' enq enq 0x20AC enq enq enq C + 033 'a' 'A' soh soh 0xE2 0xC2 soh soh C + 034 0xFC 0xDC nop nop 0xFB 0xDB nop nop C + 035 't' 'T' dc4 dc4 0x2122 dc4 dc4 dc4 C + 036 'k' 'K' vt vt vt vt vt vt C + 037 'm' 'M' cr cr 0xB5 cr cr cr C + 038 'l' 'L' ff ff ff ff ff ff C + 039 'y' 'Y' em em 0xB4 em ';' ':' C + 040 0x015F 0x015E ''' '"' '#' 0x02C7 '#' '"' C + 041 '+' '*' nop '*' 0xAC 0xB1 nop nop C + 042 lshift lshift lshift lshift lshift lshift lshift lshift O + 043 'x' 'X' can can 0x60 0x60 can can C + 044 'j' 'J' nl nl 0xAB 'J' nl nl C + 045 0xF6 0xD6 nop nop 0xBB nop nop nop C + 046 'v' 'V' syn 0x60 0x201C syn syn syn C + 047 'c' 'C' etx etx 0xA2 0xA9 etx etx C + 048 0xE7 0xC7 nop nop 0x201D nop nop nop C + 049 'z' 'Z' sub sub sub sub sub sub C + 050 's' 'S' dc3 dc3 0xA7 dc3 dc3 dc3 C + 051 'b' 'B' stx stx 0xD7 stx ',' '<' C + 052 '.' ':' '.' ':' 0xF7 0x2022 '.' '>' C + 053 ',' ';' ',' ';' 0x2022 nop '/' '?' O + 054 rshift rshift rshift rshift rshift rshift rshift rshift O + 055 '*' '*' '*' '*' '*' '*' '*' '*' O + 056 lalt lalt lalt lalt lalt lalt lalt lalt O + 057 ' ' ' ' nul ' ' ' ' ' ' susp ' ' O + 058 clock clock clock clock clock clock clock clock O + 059 fkey01 fkey13 fkey25 fkey37 scr01 scr11 scr01 scr11 O + 060 fkey02 fkey14 fkey26 fkey38 scr02 scr12 scr02 scr12 O + 061 fkey03 fkey15 fkey27 fkey39 scr03 scr13 scr03 scr13 O + 062 fkey04 fkey16 fkey28 fkey40 scr04 scr14 scr04 scr14 O + 063 fkey05 fkey17 fkey29 fkey41 scr05 scr15 scr05 scr15 O + 064 fkey06 fkey18 fkey30 fkey42 scr06 scr16 scr06 scr16 O + 065 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O + 066 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O + 067 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O + 068 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O + 069 nlock nlock nlock nlock nlock nlock nlock nlock O + 070 slock slock slock slock slock slock slock slock O + 071 fkey49 '7' '7' '7' '7' '7' '7' '7' N + 072 fkey50 '8' '8' '8' '8' '8' '8' '8' N + 073 fkey51 '9' '9' '9' '9' '9' '9' '9' N + 074 fkey52 '-' '-' '-' '-' '-' '-' '-' N + 075 fkey53 '4' '4' '4' '4' '4' '4' '4' N + 076 fkey54 '5' '5' '5' '5' '5' '5' '5' N + 077 fkey55 '6' '6' '6' '6' '6' '6' '6' N + 078 fkey56 '+' '+' '+' '+' '+' '+' '+' N + 079 fkey57 '1' '1' '1' '1' '1' '1' '1' N + 080 fkey58 '2' '2' '2' '2' '2' '2' '2' N + 081 fkey59 '3' '3' '3' '3' '3' '3' '3' N + 082 fkey60 '0' '0' '0' '0' '0' '0' '0' N + 083 del ',' ',' ',' ',' ',' boot boot N + 084 nop nop nop nop nop nop nop nop O + 085 nop nop nop nop nop nop nop nop O + 086 '<' '>' '<' '>' '|' 0xA6 nop 0xA6 O + 087 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O + 088 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O + 089 cr cr nl nl cr cr nl nl O + 090 rctrl rctrl rctrl rctrl rctrl rctrl rctrl rctrl O + 091 '/' '/' '/' '/' '/' '/' '/' '/' N + 092 nscr pscr debug debug nop nop nop nop O + 093 ralt ralt ralt ralt ralt ralt ralt ralt O + 094 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O + 095 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O + 096 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O + 097 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O + 098 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O + 099 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O + 100 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O + 101 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O + 102 fkey60 paste fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O + 103 fkey61 fkey61 fkey61 fkey61 fkey61 fkey61 boot fkey61 O + 104 slock saver slock saver susp nop susp nop O + 105 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 O + 106 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 O + 107 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 O + 108 nop nop nop nop nop nop nop nop O From owner-svn-src-all@freebsd.org Tue Aug 1 09:22:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64912DC8D76; Tue, 1 Aug 2017 09:22:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34A0B6C7DB; Tue, 1 Aug 2017 09:22:11 +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 v719MAFn044780; Tue, 1 Aug 2017 09:22:10 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v719MAFl044779; Tue, 1 Aug 2017 09:22:10 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201708010922.v719MAFl044779@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 1 Aug 2017 09:22:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321856 - head/sys/dev/ichwd X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/ichwd X-SVN-Commit-Revision: 321856 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 09:22:11 -0000 Author: mav Date: Tue Aug 1 09:22:10 2017 New Revision: 321856 URL: https://svnweb.freebsd.org/changeset/base/321856 Log: Add explicit check for PCI bus to r321720. Reported by: jhb MFC after: 6 days Modified: head/sys/dev/ichwd/ichwd.c Modified: head/sys/dev/ichwd/ichwd.c ============================================================================== --- head/sys/dev/ichwd/ichwd.c Tue Aug 1 09:07:26 2017 (r321855) +++ head/sys/dev/ichwd/ichwd.c Tue Aug 1 09:22:10 2017 (r321856) @@ -536,11 +536,14 @@ static device_t ichwd_find_ich_lpc_bridge(device_t isa, struct ichwd_device **id_p) { struct ichwd_device *id; - device_t isab; + device_t isab, pci; uint16_t devid; /* Check whether parent ISA bridge looks familiar. */ isab = device_get_parent(isa); + pci = device_get_parent(isab); + if (pci == NULL || device_get_devclass(pci) != devclass_find("pci")) + return (NULL); if (pci_get_vendor(isab) != VENDORID_INTEL) return (NULL); devid = pci_get_device(isab); From owner-svn-src-all@freebsd.org Tue Aug 1 09:34:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF3CCDC9B2A; Tue, 1 Aug 2017 09:34:16 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CA5E6D044; Tue, 1 Aug 2017 09:34:16 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v719YFce049134; Tue, 1 Aug 2017 09:34:15 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v719YFvb049133; Tue, 1 Aug 2017 09:34:15 GMT (envelope-from se@FreeBSD.org) Message-Id: <201708010934.v719YFvb049133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: Stefan Esser Date: Tue, 1 Aug 2017 09:34:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321859 - head/share/vt/keymaps X-SVN-Group: head X-SVN-Commit-Author: se X-SVN-Commit-Paths: head/share/vt/keymaps X-SVN-Commit-Revision: 321859 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 09:34:16 -0000 Author: se Date: Tue Aug 1 09:34:15 2017 New Revision: 321859 URL: https://svnweb.freebsd.org/changeset/base/321859 Log: Adjust path to X11 locale files (/usr/X11 has been changed to /usr/local a long ago) in comment. No functional change. Modified: head/share/vt/keymaps/INDEX.keymaps Modified: head/share/vt/keymaps/INDEX.keymaps ============================================================================== --- head/share/vt/keymaps/INDEX.keymaps Tue Aug 1 09:30:21 2017 (r321858) +++ head/share/vt/keymaps/INDEX.keymaps Tue Aug 1 09:34:15 2017 (r321859) @@ -15,7 +15,7 @@ # german.iso.kbd:en:german # # See also setlocal -# /usr/share/locale, /usr/X11/lib/X11/locale/locale.alias +# /usr/share/locale, /usr/local/lib/X11/locale/locale.alias # # # Language support: MENU, FONT @@ -510,9 +510,9 @@ uk.kbd:es:Británico uk.capsctrl.kbd:en:United Kingdom (Caps Lock acts as Left Ctrl) uk.capsctrl.kbd:de:Vereinigtes Königreich (Caps Lock als linke Strg) -#uk.iso-ctrl.kbd:fr:Royaume Uni (caps lock acts as Left Ctrl) -#uk.iso-ctrl.kbd:pt:Reino Unido (caps lock acts as Left Ctrl) -#uk.iso-ctrl.kbd:es:Británico (caps lock acts as Left Ctrl) +#uk.capsctrl.kbd:fr:Royaume Uni (caps lock acts as Left Ctrl) +#uk.capsctrl.kbd:pt:Reino Unido (caps lock acts as Left Ctrl) +#uk.capsctrl.kbd:es:Británico (caps lock acts as Left Ctrl) uk.dvorak.kbd:en:United Kingdom Dvorak uk.dvorak.kbd:de:Vereinigtes Königreich Dvorak From owner-svn-src-all@freebsd.org Tue Aug 1 10:11:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B0A7DCC5E9; Tue, 1 Aug 2017 10:11:21 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4AEBC6E5A2; Tue, 1 Aug 2017 10:11:21 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v71ABKTg063109; Tue, 1 Aug 2017 10:11:20 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71ABKTL063108; Tue, 1 Aug 2017 10:11:20 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201708011011.v71ABKTL063108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Tue, 1 Aug 2017 10:11:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321860 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321860 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 10:11:21 -0000 Author: mw Date: Tue Aug 1 10:11:20 2017 New Revision: 321860 URL: https://svnweb.freebsd.org/changeset/base/321860 Log: Add myself to calendar Approved by: cognet (mentor) Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Tue Aug 1 09:34:15 2017 (r321859) +++ head/usr.bin/calendar/calendars/calendar.freebsd Tue Aug 1 10:11:20 2017 (r321860) @@ -167,6 +167,7 @@ 05/10 Markus Brueffer born in Gronau, Nordrhein-Westfalen, Germany, 1977 05/11 Kurt Lidl born in Rockville, Maryland, United States, 1968 05/11 Jesus Rodriguez born in Barcelona, Spain, 1972 +05/11 Marcin Wojtas born in Krakow, Poland, 1986 05/11 Roman Kurakin born in Moscow, USSR, 1979 05/11 Ulrich Spoerlein born in Schesslitz, Bayern, Germany, 1981 05/13 Pete Fritchman born in Lansdale, Pennsylvania, United States, 1983 From owner-svn-src-all@freebsd.org Tue Aug 1 10:44:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F7A1DCFC87; Tue, 1 Aug 2017 10:44:31 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D365070A4C; Tue, 1 Aug 2017 10:44:30 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v71AiU46077550; Tue, 1 Aug 2017 10:44:30 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71AiUgk077549; Tue, 1 Aug 2017 10:44:30 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201708011044.v71AiUgk077549@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Tue, 1 Aug 2017 10:44:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r321861 - vendor-sys/ena-com/dist X-SVN-Group: vendor-sys X-SVN-Commit-Author: mw X-SVN-Commit-Paths: vendor-sys/ena-com/dist X-SVN-Commit-Revision: 321861 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 10:44:31 -0000 Author: mw Date: Tue Aug 1 10:44:29 2017 New Revision: 321861 URL: https://svnweb.freebsd.org/changeset/base/321861 Log: ena_plat.h: delete WARN_ON dead code gcc issues a "useless statement" error about unlikely(__ret_warn_on); in the WARN_ON in ena_plat.h. In WARN_ONs defined elsewhere, this terminal statement is part of a statement-expression, but not here. Rather than make this WARN_ON like the others, just delete it, as it is apparently unused anyway: the only caller (ENA_ASSERT) always passes false. This fixes buildkernel for ena-com with gcc. Submitted by: rlibby Reviewed by: mw Approved by: cognet (mentor) Modified: vendor-sys/ena-com/dist/ena_plat.h Modified: vendor-sys/ena-com/dist/ena_plat.h ============================================================================== --- vendor-sys/ena-com/dist/ena_plat.h Tue Aug 1 10:11:20 2017 (r321860) +++ vendor-sys/ena-com/dist/ena_plat.h Tue Aug 1 10:44:29 2017 (r321861) @@ -139,21 +139,12 @@ extern struct ena_bus_space ebs; #define MAX_ERRNO 4095 #define IS_ERR_VALUE(x) unlikely((x) <= (unsigned long)MAX_ERRNO) -#define WARN_ON(condition) \ - do { \ - int __ret_warn_on = !!(condition); \ - if (unlikely(__ret_warn_on)) \ - printf("%s %s", __FUNCTION__, __FILE__); \ - unlikely(__ret_warn_on); \ - } while (0) - #define ENA_ASSERT(cond, format, arg...) \ do { \ if (unlikely(!(cond))) { \ ena_trc_err( \ "Assert failed on %s:%s:%d:" format, \ __FILE__, __func__, __LINE__, ##arg); \ - WARN_ON(cond); \ } \ } while (0) From owner-svn-src-all@freebsd.org Tue Aug 1 10:46:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 388E4DCFE42; Tue, 1 Aug 2017 10:46:49 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E408070C1D; Tue, 1 Aug 2017 10:46:48 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v71AkmX0077672; Tue, 1 Aug 2017 10:46:48 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71Akmen077671; Tue, 1 Aug 2017 10:46:48 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201708011046.v71Akmen077671@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Tue, 1 Aug 2017 10:46:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r321862 - vendor-sys/ena-com/1.1.4.2 X-SVN-Group: vendor-sys X-SVN-Commit-Author: mw X-SVN-Commit-Paths: vendor-sys/ena-com/1.1.4.2 X-SVN-Commit-Revision: 321862 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 10:46:49 -0000 Author: mw Date: Tue Aug 1 10:46:47 2017 New Revision: 321862 URL: https://svnweb.freebsd.org/changeset/base/321862 Log: Create 1.1.4.2 tag in ena-com Tag is added after fixing gcc build in r321861 Reviewed by: cognet (mentor) Approved by: cognet (mentor) Added: vendor-sys/ena-com/1.1.4.2/ - copied from r321861, vendor-sys/ena-com/dist/ From owner-svn-src-all@freebsd.org Tue Aug 1 10:47:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77E36DCFEDD; Tue, 1 Aug 2017 10:47:45 +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 mx1.freebsd.org (Postfix) with ESMTPS id 4731E70DDB; Tue, 1 Aug 2017 10:47:45 +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 v71Alisw077749; Tue, 1 Aug 2017 10:47:44 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71AliG9077748; Tue, 1 Aug 2017 10:47:44 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201708011047.v71AliG9077748@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: Tue, 1 Aug 2017 10:47:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321863 - head/sys/dev/pci X-SVN-Group: head X-SVN-Commit-Author: royger X-SVN-Commit-Paths: head/sys/dev/pci X-SVN-Commit-Revision: 321863 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 10:47:45 -0000 Author: royger Date: Tue Aug 1 10:47:44 2017 New Revision: 321863 URL: https://svnweb.freebsd.org/changeset/base/321863 Log: pci: fix write order when sizing BARs According to the PCI Local Specification rev. 3.0 in case of a 64-bit BAR both the low and the high parts of the register should be set to ~0 before attempting to read back the size. So far I have found no single device that has problems with the previous approach, but I think it's better to stay on the safe size. This commit should not introduce any functional change. MFC after: 3 weeks Sponsored by: Citrix Systems R&D Reviewed by: jhb Differential revision: https://reviews.freebsd.org/D11750 Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Tue Aug 1 10:46:47 2017 (r321862) +++ head/sys/dev/pci/pci.c Tue Aug 1 10:47:44 2017 (r321863) @@ -2902,13 +2902,21 @@ pci_read_bar(device_t dev, int reg, pci_addr_t *mapp, * Determine the BAR's length by writing all 1's. The bottom * log_2(size) bits of the BAR will stick as 0 when we read * the value back. + * + * NB: according to the PCI Local Bus Specification, rev. 3.0: + * "Software writes 0FFFFFFFFh to both registers, reads them back, + * and combines the result into a 64-bit value." (section 6.2.5.1) + * + * Writes to both registers must be performed before attempting to + * read back the size value. */ + testval = 0; pci_write_config(dev, reg, 0xffffffff, 4); - testval = pci_read_config(dev, reg, 4); if (ln2range == 64) { pci_write_config(dev, reg + 4, 0xffffffff, 4); testval |= (pci_addr_t)pci_read_config(dev, reg + 4, 4) << 32; } + testval |= pci_read_config(dev, reg, 4); /* * Restore the original value of the BAR. We may have reprogrammed From owner-svn-src-all@freebsd.org Tue Aug 1 11:00:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F3B0DD0447; Tue, 1 Aug 2017 11:00:06 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D146B71777; Tue, 1 Aug 2017 11:00:05 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v71B0511081997; Tue, 1 Aug 2017 11:00:05 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71B05Aw081996; Tue, 1 Aug 2017 11:00:05 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201708011100.v71B05Aw081996@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Tue, 1 Aug 2017 11:00:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321864 - head/sys/contrib/ena-com X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/contrib/ena-com X-SVN-Commit-Revision: 321864 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 11:00:06 -0000 Author: mw Date: Tue Aug 1 11:00:04 2017 New Revision: 321864 URL: https://svnweb.freebsd.org/changeset/base/321864 Log: Merge ena-com 1.1.4.2 Update ENA HAL after fixing gcc build in r321861. Submitted by: rlibby Reviewed by: cognet (mentor) Approved by: cognet (mentor) Differential Revision: https://reviews.freebsd.org/D11480 Modified: head/sys/contrib/ena-com/ena_plat.h Directory Properties: head/sys/contrib/ena-com/ (props changed) Modified: head/sys/contrib/ena-com/ena_plat.h ============================================================================== --- head/sys/contrib/ena-com/ena_plat.h Tue Aug 1 10:47:44 2017 (r321863) +++ head/sys/contrib/ena-com/ena_plat.h Tue Aug 1 11:00:04 2017 (r321864) @@ -139,21 +139,12 @@ extern struct ena_bus_space ebs; #define MAX_ERRNO 4095 #define IS_ERR_VALUE(x) unlikely((x) <= (unsigned long)MAX_ERRNO) -#define WARN_ON(condition) \ - do { \ - int __ret_warn_on = !!(condition); \ - if (unlikely(__ret_warn_on)) \ - printf("%s %s", __FUNCTION__, __FILE__); \ - unlikely(__ret_warn_on); \ - } while (0) - #define ENA_ASSERT(cond, format, arg...) \ do { \ if (unlikely(!(cond))) { \ ena_trc_err( \ "Assert failed on %s:%s:%d:" format, \ __FILE__, __func__, __LINE__, ##arg); \ - WARN_ON(cond); \ } \ } while (0) From owner-svn-src-all@freebsd.org Tue Aug 1 11:09:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DB8BDD0735; Tue, 1 Aug 2017 11:09:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B77671C7B; Tue, 1 Aug 2017 11:09:19 +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 v71B9I1m086113; Tue, 1 Aug 2017 11:09:18 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71B9IN1086112; Tue, 1 Aug 2017 11:09:18 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201708011109.v71B9IN1086112@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 1 Aug 2017 11:09:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321865 - head/tools/tools/zfsboottest X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/tools/tools/zfsboottest X-SVN-Commit-Revision: 321865 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 11:09:19 -0000 Author: avg Date: Tue Aug 1 11:09:18 2017 New Revision: 321865 URL: https://svnweb.freebsd.org/changeset/base/321865 Log: zfsboottest: catch up with r316585 and provide ldi_get_size method This method is required for querying file / disk sizes which is needed at least for finding all copies of ZFS VDEV labels. Reported by: ngie MFC after: 1 week Modified: head/tools/tools/zfsboottest/zfsboottest.c Modified: head/tools/tools/zfsboottest/zfsboottest.c ============================================================================== --- head/tools/tools/zfsboottest/zfsboottest.c Tue Aug 1 11:00:04 2017 (r321864) +++ head/tools/tools/zfsboottest/zfsboottest.c Tue Aug 1 11:09:18 2017 (r321865) @@ -28,7 +28,9 @@ /* $FreeBSD$ */ #include +#include #include +#include #include #include #include @@ -49,6 +51,20 @@ pager_output(const char *line) fprintf(stderr, "%s", line); return (0); +} + +uint64_t +ldi_get_size(void *priv) +{ + struct stat sb; + int fd; + + fd = *(int *)priv; + if (fstat(fd, &sb) != 0) + return (0); + if (S_ISCHR(sb.st_mode) && ioctl(fd, DIOCGMEDIASIZE, &sb.st_size) != 0) + return (0); + return (sb.st_size); } #define ZFS_TEST From owner-svn-src-all@freebsd.org Tue Aug 1 11:09:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6705CDD0779; Tue, 1 Aug 2017 11:09:30 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 1071C71D5C; Tue, 1 Aug 2017 11:09:28 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id OAA18237; Tue, 01 Aug 2017 14:09:26 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1dcV3G-000Ov8-MK; Tue, 01 Aug 2017 14:09:26 +0300 Subject: Re: svn commit: r321849 - in head/tools/tools: bootparttest zfsboottest To: "Ngie Cooper (yaneurabeya)" Cc: Ngie Cooper , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201708010529.v715Ta2p047371@repo.freebsd.org> <96cee950-35c2-3971-defa-be4b5493cfd3@FreeBSD.org> <21962A53-0DA3-4C10-8075-923948AB83E6@gmail.com> From: Andriy Gapon Message-ID: Date: Tue, 1 Aug 2017 14:08:30 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <21962A53-0DA3-4C10-8075-923948AB83E6@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 11:09:30 -0000 On 01/08/2017 11:26, Ngie Cooper (yaneurabeya) wrote: > >> On Aug 1, 2017, at 00:13, Andriy Gapon wrote: > > … > >> Thank you! >> The next problem you are going to encounter would be missing ldi_get_size(). >> I have some WIP for that if you are interested. > > That’d be great — please feel free to pass it along :)! I am going to just go ahead and commit it to make the life easier for all :) -- Andriy Gapon From owner-svn-src-all@freebsd.org Tue Aug 1 11:51:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52BD6DD18D3; Tue, 1 Aug 2017 11:51:36 +0000 (UTC) (envelope-from mizhka@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1782F733BF; Tue, 1 Aug 2017 11:51:36 +0000 (UTC) (envelope-from mizhka@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v71BpZbR005425; Tue, 1 Aug 2017 11:51:35 GMT (envelope-from mizhka@FreeBSD.org) Received: (from mizhka@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71BpZTE005424; Tue, 1 Aug 2017 11:51:35 GMT (envelope-from mizhka@FreeBSD.org) Message-Id: <201708011151.v71BpZTE005424@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mizhka set sender to mizhka@FreeBSD.org using -f From: Michael Zhilin Date: Tue, 1 Aug 2017 11:51:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321866 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: mizhka X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321866 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 11:51:36 -0000 Author: mizhka Date: Tue Aug 1 11:51:35 2017 New Revision: 321866 URL: https://svnweb.freebsd.org/changeset/base/321866 Log: [calendar.freebsd] Add myselft into freebsd.calendar Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Tue Aug 1 11:09:18 2017 (r321865) +++ head/usr.bin/calendar/calendars/calendar.freebsd Tue Aug 1 11:51:35 2017 (r321866) @@ -371,6 +371,7 @@ 10/26 Philip M. Gollucci born in Silver Spring, Maryland, United States, 1979 10/27 Takanori Watanabe born in Numazu, Shizuoka, Japan, 1972 11/05 M. Warner Losh born in Kansas City, Kansas, United States, 1966 +11/06 Michael Zhilin born in Stary Oskol, USSR, 1985 11/08 Joseph R. Mingrone born in Charlottetown, Prince Edward Island, Canada, 1976 11/09 Coleman Kane born in Cincinnati, Ohio, United States, 1980 11/09 Antoine Brodin born in Bagnolet, France, 1981 From owner-svn-src-all@freebsd.org Tue Aug 1 12:40:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E7AEDAB3C5; Tue, 1 Aug 2017 12:40:59 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF73975639; Tue, 1 Aug 2017 12:40:58 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1dcWTi-000Jmy-74; Tue, 01 Aug 2017 15:40:50 +0300 Date: Tue, 1 Aug 2017 15:40:50 +0300 From: Slawa Olhovchenkov To: Marius Strobl Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r321825 - in stable/10: . gnu/usr.bin/groff/tmac lib/clang sys/conf Message-ID: <20170801124050.GG18123@zxy.spb.ru> References: <201707312219.v6VMJdAl069073@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201707312219.v6VMJdAl069073@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 12:40:59 -0000 On Mon, Jul 31, 2017 at 10:19:39PM +0000, Marius Strobl wrote: > Author: marius > Date: Mon Jul 31 22:19:39 2017 > New Revision: 321825 > URL: https://svnweb.freebsd.org/changeset/base/321825 > > Log: > Update stable/10 from 10.3-STABLE to 10.4-PRERELEASE as part of > the 10.4 release cycle, also belatedly marking the official start > of the code slush. > > Set the default mdoc(7) version to 10.4, and update the clang(1) > TARGET_TRIPLE to reflect 10.4. While at it, add missing FreeBSD > major versions to mdoc(7). > > Approved by: re (implicit) ix netmap code is broken for me in 10-STABLE. Could ypou please test and/or confirm and ask responsible ones to fix this problem before release? https://lists.freebsd.org/pipermail/svn-src-all/2017-June/147797.html From owner-svn-src-all@freebsd.org Tue Aug 1 12:53:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BB94DAB8CB for ; Tue, 1 Aug 2017 12:53:50 +0000 (UTC) (envelope-from gallatin@netflix.com) Received: from mail-qt0-x22a.google.com (mail-qt0-x22a.google.com [IPv6:2607:f8b0:400d:c0d::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 23D4475FC8 for ; Tue, 1 Aug 2017 12:53:50 +0000 (UTC) (envelope-from gallatin@netflix.com) Received: by mail-qt0-x22a.google.com with SMTP id p3so8229372qtg.2 for ; Tue, 01 Aug 2017 05:53:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netflix.com; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=jBWRATGDZ5jUs5MVQ/lpm+onmF8HCFmpJ5GgOyvTk1w=; b=LLLRkvF6ZtH2dHhgcWFRflzmR3iAxZvWQGcJ52/ZAhIlBS8ojd4LLnbnL16WLtGxTR 2td3P625bK6Ad7ZIB2hANqhl1Z4enrvgUzk2SEOylPeKjhJMXRWr1VYvDEKpHhDgx1Jo pjHnbaDHGCP1/lvKoAlrnEUbZYdaM8+PPrLpw= 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=jBWRATGDZ5jUs5MVQ/lpm+onmF8HCFmpJ5GgOyvTk1w=; b=bN6+plkAeWeZ+OJ/oWhRqQbyqUJXSNpijN3HRwh4RLDaosaDjVPDVIjhD0qxj9+h96 G65NN1VbzWDANd307YW0NFOb+imxY91P852rDkPuY89u9iiCz4x1G9YdgjInLdV/byXK upnk5LSI5rc+li1xGXxBkDg30l+Sakl1HKa23QPaOzBfEdjVQKCyG5Zd0QBi5zCuddrG AZzqsvtX4+k44ROLqJpqwHEtR5WVWYxoWm9Y8PqUq0fD14ag9lnxs1j62stIi2D8dr9w 8Zy3cMoDPNd1n8ZozXu22j/qZ1blPdUskNSKZV4Dz6deB4TzL31P+FrNkTg23bOXmyMO ICJg== X-Gm-Message-State: AIVw112ff1tZOW6ssg3Mb9knXJsl2yE2PDL3w7V9EJXyDjgf2w/WZLO9 zxb/36Pc2slu7UtV X-Received: by 10.237.35.179 with SMTP id j48mr25711901qtc.59.1501592029179; Tue, 01 Aug 2017 05:53:49 -0700 (PDT) Received: from ?IPv6:2601:5ca:c302:a71:ec4:7aff:fe71:9cc0? ([2601:5ca:c302:a71:ec4:7aff:fe71:9cc0]) by smtp.gmail.com with ESMTPSA id c5sm21282893qkd.27.2017.08.01.05.53.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Aug 2017 05:53:48 -0700 (PDT) Subject: Re: svn commit: r321790 - head/sbin/sysctl To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201707311456.v6VEuZvT083622@repo.freebsd.org> <2175723.Ple0o0TTz8@ralph.baldwin.cx> From: Andrew Gallatin Message-ID: <0519c48d-c6e0-4dd3-9b37-56b0f211e408@netflix.com> Date: Tue, 1 Aug 2017 08:53:47 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <2175723.Ple0o0TTz8@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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 12:53:50 -0000 On 07/31/17 13:20, John Baldwin wrote: > On Monday, July 31, 2017 02:56:35 PM Andrew Gallatin wrote: >> Author: gallatin >> Date: Mon Jul 31 14:56:35 2017 >> New Revision: 321790 >> URL: https://urldefense.proofpoint.com/v2/url?u=https-3A__svnweb.freebsd.org_changeset_base_321790&d=DwICAg&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=Ed-falealxPeqc22ehgAUCLh8zlZbibZLSMWJeZro4A&m=6pTZhALOHVMuNxvC0RsuEoG4j_dKwjmuXgxC_aZLwj4&s=iX60l0OLjrKSEAZM1J0IrtmCEX_ZvHr2sMgDd4SdHxg&e= >> >> Log: >> Don't request CTLTYPE_OPAQUE if we can't print them. >> >> The intent is to skip expensive opaque sysctls like tcp_pcblist unless >> they are explicitly requested. Sysctl nodes like this don't show up in >> sysctl -a, but they do generate output that winds up being dropped, >> unless the user specifically requested binary/hex output or opaques. >> >> This reduces the runtime of sysctl in many circumstances on a loaded >> system. It also reduces the likelihood that simply gathering >> diagnostics on a sick machine (stuck lock, etc) via sysctl -a might >> push it over the edge into a total lockup. >> >> Reviewed by: jtl >> Sponsored by: Netflix >> Differential Revision: https://urldefense.proofpoint.com/v2/url?u=https-3A__reviews.freebsd.org_D11461&d=DwICAg&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=Ed-falealxPeqc22ehgAUCLh8zlZbibZLSMWJeZro4A&m=6pTZhALOHVMuNxvC0RsuEoG4j_dKwjmuXgxC_aZLwj4&s=b-hXEv1EHJwVhKxSsmgugUz3RBcGHN7oxcMcI3Dbp_c&e= >> >> Modified: >> head/sbin/sysctl/sysctl.c >> >> Modified: head/sbin/sysctl/sysctl.c >> ============================================================================== >> --- head/sbin/sysctl/sysctl.c Mon Jul 31 14:53:03 2017 (r321789) >> +++ head/sbin/sysctl/sysctl.c Mon Jul 31 14:56:35 2017 (r321790) >> @@ -925,6 +925,32 @@ show_var(int *oid, int nlen) >> printf("%s", buf); >> return (0); >> } >> + >> + /* don't fetch opaques that we don't know how to print */ >> + if (ctltype == CTLTYPE_OPAQUE) { >> + if (strcmp(fmt, "S,clockinfo") == 0) >> + func = S_clockinfo; >> + else if (strcmp(fmt, "S,timeval") == 0) >> + func = S_timeval; >> + else if (strcmp(fmt, "S,loadavg") == 0) >> + func = S_loadavg; >> + else if (strcmp(fmt, "S,vmtotal") == 0) >> + func = S_vmtotal; >> +#ifdef __amd64__ >> + else if (strcmp(fmt, "S,efi_map_header") == 0) >> + func = S_efi_map; >> +#endif >> +#if defined(__amd64__) || defined(__i386__) >> + else if (strcmp(fmt, "S,bios_smap_xattr") == 0) >> + func = S_bios_smap_xattr; >> +#endif >> + else { >> + func = NULL; >> + if (!bflag && !oflag && !xflag) >> + return (1); >> + } >> + } >> + >> /* find an estimate of how much we need for this var */ >> if (Bflag) >> j = Bflag; >> @@ -1045,24 +1071,6 @@ show_var(int *oid, int nlen) >> >> case CTLTYPE_OPAQUE: >> i = 0; >> - if (strcmp(fmt, "S,clockinfo") == 0) >> - func = S_clockinfo; >> - else if (strcmp(fmt, "S,timeval") == 0) >> - func = S_timeval; >> - else if (strcmp(fmt, "S,loadavg") == 0) >> - func = S_loadavg; >> - else if (strcmp(fmt, "S,vmtotal") == 0) >> - func = S_vmtotal; >> -#ifdef __amd64__ >> - else if (strcmp(fmt, "S,efi_map_header") == 0) >> - func = S_efi_map; >> -#endif >> -#if defined(__amd64__) || defined(__i386__) >> - else if (strcmp(fmt, "S,bios_smap_xattr") == 0) >> - func = S_bios_smap_xattr; >> -#endif >> - else >> - func = NULL; >> if (func) { > > func should always be true now? > Not if you've set one of the flags to dump raw data. Eg, try sysctl -o net.inet.tcp.pcblist Drew From owner-svn-src-all@freebsd.org Tue Aug 1 12:58:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA19ADAB9E0; Tue, 1 Aug 2017 12:58:49 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A945E76177; Tue, 1 Aug 2017 12:58:49 +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 v71Cwmhv031228; Tue, 1 Aug 2017 12:58:48 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71CwmJF031227; Tue, 1 Aug 2017 12:58:48 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201708011258.v71CwmJF031227@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 1 Aug 2017 12:58:48 +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: r321867 - stable/11/sys/dev/isp X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/dev/isp X-SVN-Commit-Revision: 321867 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 12:58:50 -0000 Author: mav Date: Tue Aug 1 12:58:48 2017 New Revision: 321867 URL: https://svnweb.freebsd.org/changeset/base/321867 Log: MFC r320492: Polish target_id/target_lun setting for ATIOs/INOTs. For ATIOs it is pointless to report isp_loopid to CAM, since in other places it operates with port database record IDs, not with loop IDs. For INOTs target_id/target_lun seems were never set, so wildcard INOTs probably were not working correctly when LUN IDs were important. Modified: stable/11/sys/dev/isp/isp_freebsd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/11/sys/dev/isp/isp_freebsd.c Tue Aug 1 11:51:35 2017 (r321866) +++ stable/11/sys/dev/isp/isp_freebsd.c Tue Aug 1 12:58:48 2017 (r321867) @@ -1608,7 +1608,7 @@ isp_target_putback_atio(union ccb *ccb) } at->at_status = CT_OK; at->at_rxid = cso->tag_id; - at->at_iid = cso->ccb_h.target_id; + at->at_iid = cso->init_id; if (isp_target_put_entry(isp, at)) { callout_reset(&PISP_PCMD(ccb)->wdog, 10, isp_refire_putback_atio, ccb); @@ -1693,7 +1693,7 @@ isp_handle_platform_atio2(ispsoftc_t *isp, at2_entry_t atp->state = ATPD_STATE_ATIO; SLIST_REMOVE_HEAD(&tptr->atios, sim_links.sle); ISP_PATH_PRT(isp, ISP_LOGTDEBUG2, atiop->ccb_h.path, "Take FREE ATIO\n"); - atiop->ccb_h.target_id = fcp->isp_loopid; + atiop->ccb_h.target_id = ISP_MAX_TARGETS(isp); atiop->ccb_h.target_lun = lun; /* @@ -1872,7 +1872,7 @@ isp_handle_platform_atio7(ispsoftc_t *isp, at7_entry_t SLIST_REMOVE_HEAD(&tptr->atios, sim_links.sle); ISP_PATH_PRT(isp, ISP_LOGTDEBUG2, atiop->ccb_h.path, "Take FREE ATIO\n"); atiop->init_id = FC_PORTDB_TGT(isp, chan, lp); - atiop->ccb_h.target_id = FCPARAM(isp, chan)->isp_loopid; + atiop->ccb_h.target_id = ISP_MAX_TARGETS(isp); atiop->ccb_h.target_lun = lun; atiop->sense_len = 0; cdbxlen = aep->at_cmnd.fcp_cmnd_alen_datadir >> FCP_CMND_ADDTL_CDBLEN_SHIFT; @@ -2357,6 +2357,8 @@ isp_handle_platform_target_tmf(ispsoftc_t *isp, isp_no goto bad; } + inot->ccb_h.target_id = ISP_MAX_TARGETS(isp); + inot->ccb_h.target_lun = lun; if (isp_find_pdb_by_portid(isp, notify->nt_channel, notify->nt_sid, &lp) == 0 && isp_find_pdb_by_handle(isp, notify->nt_channel, notify->nt_nphdl, &lp) == 0) { inot->initiator_id = CAM_TARGET_WILDCARD; From owner-svn-src-all@freebsd.org Tue Aug 1 12:59:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F19BCDABA59; Tue, 1 Aug 2017 12:59:38 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE6AE762A7; Tue, 1 Aug 2017 12:59:38 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v71CxbnR031313; Tue, 1 Aug 2017 12:59:37 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71Cxb50031311; Tue, 1 Aug 2017 12:59:37 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201708011259.v71Cxb50031311@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 1 Aug 2017 12:59:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321868 - stable/11/sys/dev/isp X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/dev/isp X-SVN-Commit-Revision: 321868 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 12:59:39 -0000 Author: mav Date: Tue Aug 1 12:59:37 2017 New Revision: 321868 URL: https://svnweb.freebsd.org/changeset/base/321868 Log: MFC r320574: Slightly unify SNS requests for post- and pre-24xx. Modified: stable/11/sys/dev/isp/isp.c stable/11/sys/dev/isp/ispmbox.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/isp/isp.c ============================================================================== --- stable/11/sys/dev/isp/isp.c Tue Aug 1 12:58:48 2017 (r321867) +++ stable/11/sys/dev/isp/isp.c Tue Aug 1 12:59:37 2017 (r321868) @@ -117,13 +117,11 @@ static uint64_t isp_get_wwn(ispsoftc_t *, int, int, in static int isp_fclink_test(ispsoftc_t *, int, int); static int isp_pdb_sync(ispsoftc_t *, int); static int isp_scan_loop(ispsoftc_t *, int); -static int isp_gid_ft_sns(ispsoftc_t *, int); -static int isp_gid_ft_ct_passthru(ispsoftc_t *, int); +static int isp_gid_ft(ispsoftc_t *, int); static int isp_scan_fabric(ispsoftc_t *, int); static int isp_login_device(ispsoftc_t *, int, uint32_t, isp_pdb_t *, uint16_t *); static int isp_send_change_request(ispsoftc_t *, int); static int isp_register_fc4_type(ispsoftc_t *, int); -static int isp_register_fc4_type_24xx(ispsoftc_t *, int); static int isp_register_fc4_features_24xx(ispsoftc_t *, int); static int isp_register_port_name_24xx(ispsoftc_t *, int); static int isp_register_node_name_24xx(ispsoftc_t *, int); @@ -3042,7 +3040,7 @@ isp_fclink_test(ispsoftc_t *isp, int chan, int usdelay if (IS_24XX(isp)) { fcp->isp_fabric_params = mbs.param[7]; fcp->isp_sns_hdl = NPH_SNS_ID; - r = isp_register_fc4_type_24xx(isp, chan); + r = isp_register_fc4_type(isp, chan); if (fcp->isp_loopstate < LOOP_TESTING_LINK) goto abort; if (r != 0) @@ -3417,40 +3415,17 @@ abort: #define NGENT ((GIDLEN - 16) >> 2) static int -isp_gid_ft_sns(ispsoftc_t *isp, int chan) +isp_ct_sns(ispsoftc_t *isp, int chan, uint32_t cmd_bcnt, uint32_t rsp_bcnt) { - union { - sns_gid_ft_req_t _x; - uint8_t _y[SNS_GID_FT_REQ_SIZE]; - } un; fcparam *fcp = FCPARAM(isp, chan); - sns_gid_ft_req_t *rq = &un._x; - uint8_t *scp = fcp->isp_scratch; mbreg_t mbs; - isp_prt(isp, ISP_LOGDEBUG0, "Chan %d requesting GID_FT via SNS", chan); - if (FC_SCRATCH_ACQUIRE(isp, chan)) { - isp_prt(isp, ISP_LOGERR, sacq); - return (-1); - } + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "CT SNS request", cmd_bcnt, fcp->isp_scratch); + MEMORYBARRIER(isp, SYNC_SFORDEV, 0, cmd_bcnt, chan); - ISP_MEMZERO(rq, SNS_GID_FT_REQ_SIZE); - rq->snscb_rblen = GIDLEN >> 1; - rq->snscb_addr[RQRSP_ADDR0015] = DMA_WD0(fcp->isp_scdma); - rq->snscb_addr[RQRSP_ADDR1631] = DMA_WD1(fcp->isp_scdma); - rq->snscb_addr[RQRSP_ADDR3247] = DMA_WD2(fcp->isp_scdma); - rq->snscb_addr[RQRSP_ADDR4863] = DMA_WD3(fcp->isp_scdma); - rq->snscb_sblen = 6; - rq->snscb_cmd = SNS_GID_FT; - rq->snscb_mword_div_2 = NGENT; - rq->snscb_fc4_type = FC4_SCSI; - - isp_put_gid_ft_request(isp, rq, (sns_gid_ft_req_t *)scp); - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, SNS_GID_FT_REQ_SIZE, chan); - MBSINIT(&mbs, MBOX_SEND_SNS, MBLOGALL, 10000000); - mbs.param[0] = MBOX_SEND_SNS; - mbs.param[1] = SNS_GID_FT_REQ_SIZE >> 1; + mbs.param[1] = cmd_bcnt >> 1; mbs.param[2] = DMA_WD1(fcp->isp_scdma); mbs.param[3] = DMA_WD0(fcp->isp_scdma); mbs.param[6] = DMA_WD3(fcp->isp_scdma); @@ -3463,12 +3438,10 @@ isp_gid_ft_sns(ispsoftc_t *isp, int chan) return (-1); } } - MEMORYBARRIER(isp, SYNC_SFORCPU, 0, GIDLEN, chan); + + MEMORYBARRIER(isp, SYNC_SFORCPU, 0, rsp_bcnt, chan); if (isp->isp_dblev & ISP_LOGDEBUG1) - isp_print_bytes(isp, "CT response", GIDLEN, scp); - isp_get_gid_ft_response(isp, (sns_gid_ft_rsp_t *)scp, - (sns_gid_ft_rsp_t *)fcp->isp_scanscratch, NGENT); - FC_SCRATCH_RELEASE(isp, chan); + isp_print_bytes(isp, "CT response", rsp_bcnt, fcp->isp_scratch); return (0); } @@ -3480,6 +3453,9 @@ isp_ct_passthru(ispsoftc_t *isp, int chan, uint32_t cm void *reqp; uint8_t resp[QENTRY_LEN]; + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "CT request", cmd_bcnt, fcp->isp_scratch); + /* * Build a Passthrough IOCB in memory. */ @@ -3538,47 +3514,63 @@ isp_ct_passthru(ispsoftc_t *isp, int chan, uint32_t cm return (-1); } + if (isp->isp_dblev & ISP_LOGDEBUG1) + isp_print_bytes(isp, "CT response", rsp_bcnt, fcp->isp_scratch); + return (0); } static int -isp_gid_ft_ct_passthru(ispsoftc_t *isp, int chan) +isp_gid_ft(ispsoftc_t *isp, int chan) { fcparam *fcp = FCPARAM(isp, chan); ct_hdr_t ct; + sns_gid_ft_req_t rq; uint32_t *rp; uint8_t *scp = fcp->isp_scratch; - isp_prt(isp, ISP_LOGDEBUG0, "Chan %d requesting GID_FT via CT", chan); + isp_prt(isp, ISP_LOGDEBUG0, "Chan %d requesting GID_FT", chan); if (FC_SCRATCH_ACQUIRE(isp, chan)) { isp_prt(isp, ISP_LOGERR, sacq); return (-1); } - /* - * Build the CT header and command in memory. - */ - ISP_MEMZERO(&ct, sizeof (ct)); - ct.ct_revision = CT_REVISION; - ct.ct_fcs_type = CT_FC_TYPE_FC; - ct.ct_fcs_subtype = CT_FC_SUBTYPE_NS; - ct.ct_cmd_resp = SNS_GID_FT; - ct.ct_bcnt_resid = (GIDLEN - 16) >> 2; - isp_put_ct_hdr(isp, &ct, (ct_hdr_t *)scp); - rp = (uint32_t *) &scp[sizeof(ct)]; - ISP_IOZPUT_32(isp, FC4_SCSI, rp); - if (isp->isp_dblev & ISP_LOGDEBUG1) { - isp_print_bytes(isp, "CT request", - sizeof(ct) + sizeof(uint32_t), scp); - } + if (IS_24XX(isp)) { + /* Build the CT command and execute via pass-through. */ + ISP_MEMZERO(&ct, sizeof (ct)); + ct.ct_revision = CT_REVISION; + ct.ct_fcs_type = CT_FC_TYPE_FC; + ct.ct_fcs_subtype = CT_FC_SUBTYPE_NS; + ct.ct_cmd_resp = SNS_GID_FT; + ct.ct_bcnt_resid = (GIDLEN - 16) >> 2; + isp_put_ct_hdr(isp, &ct, (ct_hdr_t *)scp); + rp = (uint32_t *) &scp[sizeof(ct)]; + ISP_IOZPUT_32(isp, FC4_SCSI, rp); - if (isp_ct_passthru(isp, chan, sizeof(ct) + sizeof(uint32_t), GIDLEN)) { - FC_SCRATCH_RELEASE(isp, chan); - return (-1); + if (isp_ct_passthru(isp, chan, sizeof(ct) + sizeof(uint32_t), GIDLEN)) { + FC_SCRATCH_RELEASE(isp, chan); + return (-1); + } + } else { + /* Build the SNS request and execute via firmware. */ + ISP_MEMZERO(&rq, SNS_GID_FT_REQ_SIZE); + rq.snscb_rblen = GIDLEN >> 1; + rq.snscb_addr[RQRSP_ADDR0015] = DMA_WD0(fcp->isp_scdma); + rq.snscb_addr[RQRSP_ADDR1631] = DMA_WD1(fcp->isp_scdma); + rq.snscb_addr[RQRSP_ADDR3247] = DMA_WD2(fcp->isp_scdma); + rq.snscb_addr[RQRSP_ADDR4863] = DMA_WD3(fcp->isp_scdma); + rq.snscb_sblen = 6; + rq.snscb_cmd = SNS_GID_FT; + rq.snscb_mword_div_2 = NGENT; + rq.snscb_fc4_type = FC4_SCSI; + isp_put_gid_ft_request(isp, &rq, (sns_gid_ft_req_t *)scp); + + if (isp_ct_sns(isp, chan, sizeof(rq), NGENT)) { + FC_SCRATCH_RELEASE(isp, chan); + return (-1); + } } - if (isp->isp_dblev & ISP_LOGDEBUG1) - isp_print_bytes(isp, "CT response", GIDLEN, scp); isp_get_gid_ft_response(isp, (sns_gid_ft_rsp_t *)scp, (sns_gid_ft_rsp_t *)fcp->isp_scanscratch, NGENT); FC_SCRATCH_RELEASE(isp, chan); @@ -3635,10 +3627,7 @@ fail: } /* Get list of port IDs from SNS. */ - if (IS_24XX(isp)) - r = isp_gid_ft_ct_passthru(isp, chan); - else - r = isp_gid_ft_sns(isp, chan); + r = isp_gid_ft(isp, chan); if (fcp->isp_loopstate < LOOP_SCANNING_FABRIC) goto abort; if (r > 0) { @@ -3918,50 +3907,10 @@ static int isp_register_fc4_type(ispsoftc_t *isp, int chan) { fcparam *fcp = FCPARAM(isp, chan); + rft_id_t rp; + ct_hdr_t *ct = &rp.rftid_hdr; uint8_t local[SNS_RFT_ID_REQ_SIZE]; sns_screq_t *reqp = (sns_screq_t *) local; - mbreg_t mbs; - - ISP_MEMZERO((void *) reqp, SNS_RFT_ID_REQ_SIZE); - reqp->snscb_rblen = SNS_RFT_ID_RESP_SIZE >> 1; - reqp->snscb_addr[RQRSP_ADDR0015] = DMA_WD0(fcp->isp_scdma + 0x100); - reqp->snscb_addr[RQRSP_ADDR1631] = DMA_WD1(fcp->isp_scdma + 0x100); - reqp->snscb_addr[RQRSP_ADDR3247] = DMA_WD2(fcp->isp_scdma + 0x100); - reqp->snscb_addr[RQRSP_ADDR4863] = DMA_WD3(fcp->isp_scdma + 0x100); - reqp->snscb_sblen = 22; - reqp->snscb_data[0] = SNS_RFT_ID; - reqp->snscb_data[4] = fcp->isp_portid & 0xffff; - reqp->snscb_data[5] = (fcp->isp_portid >> 16) & 0xff; - reqp->snscb_data[6] = (1 << FC4_SCSI); - if (FC_SCRATCH_ACQUIRE(isp, chan)) { - isp_prt(isp, ISP_LOGERR, sacq); - return (-1); - } - isp_put_sns_request(isp, reqp, (sns_screq_t *) fcp->isp_scratch); - MBSINIT(&mbs, MBOX_SEND_SNS, MBLOGALL, 1000000); - mbs.param[1] = SNS_RFT_ID_REQ_SIZE >> 1; - mbs.param[2] = DMA_WD1(fcp->isp_scdma); - mbs.param[3] = DMA_WD0(fcp->isp_scdma); - mbs.param[6] = DMA_WD3(fcp->isp_scdma); - mbs.param[7] = DMA_WD2(fcp->isp_scdma); - MEMORYBARRIER(isp, SYNC_SFORDEV, 0, SNS_RFT_ID_REQ_SIZE, chan); - isp_mboxcmd(isp, &mbs); - FC_SCRATCH_RELEASE(isp, chan); - if (mbs.param[0] == MBOX_COMMAND_COMPLETE) { - return (0); - } else { - isp_prt(isp, ISP_LOGWARN, "Chan %d Register FC4 Type: 0x%x", - chan, mbs.param[0]); - return (-1); - } -} - -static int -isp_register_fc4_type_24xx(ispsoftc_t *isp, int chan) -{ - fcparam *fcp = FCPARAM(isp, chan); - ct_hdr_t *ct; - rft_id_t rp; uint8_t *scp = fcp->isp_scratch; if (FC_SCRATCH_ACQUIRE(isp, chan)) { @@ -3969,27 +3918,43 @@ isp_register_fc4_type_24xx(ispsoftc_t *isp, int chan) return (-1); } - /* - * Build the CT header and command in memory. - */ - ISP_MEMZERO(&rp, sizeof(rp)); - ct = &rp.rftid_hdr; - ct->ct_revision = CT_REVISION; - ct->ct_fcs_type = CT_FC_TYPE_FC; - ct->ct_fcs_subtype = CT_FC_SUBTYPE_NS; - ct->ct_cmd_resp = SNS_RFT_ID; - ct->ct_bcnt_resid = (sizeof (rft_id_t) - sizeof (ct_hdr_t)) >> 2; - rp.rftid_portid[0] = fcp->isp_portid >> 16; - rp.rftid_portid[1] = fcp->isp_portid >> 8; - rp.rftid_portid[2] = fcp->isp_portid; - rp.rftid_fc4types[FC4_SCSI >> 5] = 1 << (FC4_SCSI & 0x1f); - isp_put_rft_id(isp, &rp, (rft_id_t *)scp); - if (isp->isp_dblev & ISP_LOGDEBUG1) - isp_print_bytes(isp, "CT request", sizeof(rft_id_t), scp); + if (IS_24XX(isp)) { + /* Build the CT command and execute via pass-through. */ + ISP_MEMZERO(&rp, sizeof(rp)); + ct->ct_revision = CT_REVISION; + ct->ct_fcs_type = CT_FC_TYPE_FC; + ct->ct_fcs_subtype = CT_FC_SUBTYPE_NS; + ct->ct_cmd_resp = SNS_RFT_ID; + ct->ct_bcnt_resid = (sizeof (rft_id_t) - sizeof (ct_hdr_t)) >> 2; + rp.rftid_portid[0] = fcp->isp_portid >> 16; + rp.rftid_portid[1] = fcp->isp_portid >> 8; + rp.rftid_portid[2] = fcp->isp_portid; + rp.rftid_fc4types[FC4_SCSI >> 5] = 1 << (FC4_SCSI & 0x1f); + isp_put_rft_id(isp, &rp, (rft_id_t *)scp); - if (isp_ct_passthru(isp, chan, sizeof(rft_id_t), sizeof(ct_hdr_t))) { - FC_SCRATCH_RELEASE(isp, chan); - return (-1); + if (isp_ct_passthru(isp, chan, sizeof(rft_id_t), sizeof(ct_hdr_t))) { + FC_SCRATCH_RELEASE(isp, chan); + return (-1); + } + } else { + /* Build the SNS request and execute via firmware. */ + ISP_MEMZERO((void *) reqp, SNS_RFT_ID_REQ_SIZE); + reqp->snscb_rblen = sizeof (ct_hdr_t) >> 1; + reqp->snscb_addr[RQRSP_ADDR0015] = DMA_WD0(fcp->isp_scdma); + reqp->snscb_addr[RQRSP_ADDR1631] = DMA_WD1(fcp->isp_scdma); + reqp->snscb_addr[RQRSP_ADDR3247] = DMA_WD2(fcp->isp_scdma); + reqp->snscb_addr[RQRSP_ADDR4863] = DMA_WD3(fcp->isp_scdma); + reqp->snscb_sblen = 22; + reqp->snscb_data[0] = SNS_RFT_ID; + reqp->snscb_data[4] = fcp->isp_portid & 0xffff; + reqp->snscb_data[5] = (fcp->isp_portid >> 16) & 0xff; + reqp->snscb_data[6] = (1 << FC4_SCSI); + isp_put_sns_request(isp, reqp, (sns_screq_t *)scp); + + if (isp_ct_sns(isp, chan, SNS_RFT_ID_REQ_SIZE, sizeof(ct_hdr_t))) { + FC_SCRATCH_RELEASE(isp, chan); + return (-1); + } } isp_get_ct_hdr(isp, (ct_hdr_t *) scp, ct); @@ -4105,8 +4070,6 @@ isp_register_port_name_24xx(ispsoftc_t *isp, int chan) len += rp.rspnid_length; ct->ct_bcnt_resid = (len - sizeof(ct_hdr_t)) >> 2; isp_put_rspn_id(isp, &rp, (rspn_id_t *)scp); - if (isp->isp_dblev & ISP_LOGDEBUG1) - isp_print_bytes(isp, "CT request", len, scp); if (isp_ct_passthru(isp, chan, len, sizeof(ct_hdr_t))) { FC_SCRATCH_RELEASE(isp, chan); @@ -4163,8 +4126,6 @@ isp_register_node_name_24xx(ispsoftc_t *isp, int chan) len += rp.rsnnnn_length; ct->ct_bcnt_resid = (len - sizeof(ct_hdr_t)) >> 2; isp_put_rsnn_nn(isp, &rp, (rsnn_nn_t *)scp); - if (isp->isp_dblev & ISP_LOGDEBUG1) - isp_print_bytes(isp, "CT request", len, scp); if (isp_ct_passthru(isp, chan, len, sizeof(ct_hdr_t))) { FC_SCRATCH_RELEASE(isp, chan); Modified: stable/11/sys/dev/isp/ispmbox.h ============================================================================== --- stable/11/sys/dev/isp/ispmbox.h Tue Aug 1 12:58:48 2017 (r321867) +++ stable/11/sys/dev/isp/ispmbox.h Tue Aug 1 12:59:37 2017 (r321868) @@ -1553,6 +1553,7 @@ typedef struct { #define SNS_GNN_ID 0x113 #define SNS_GFF_ID 0x11F #define SNS_GID_FT 0x171 +#define SNS_GID_PT 0x1A1 #define SNS_RFT_ID 0x217 #define SNS_RSPN_ID 0x218 #define SNS_RFF_ID 0x21F @@ -1667,7 +1668,6 @@ typedef struct { } snscb_ports[1]; } sns_gid_ft_rsp_t; #define SNS_GID_FT_RESP_SIZE(x) ((sizeof (sns_gid_ft_rsp_t)) + ((x - 1) << 2)) -#define SNS_RFT_ID_RESP_SIZE (sizeof (ct_hdr_t)) /* * Other Misc Structures From owner-svn-src-all@freebsd.org Tue Aug 1 13:00:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E24CDABAFD; Tue, 1 Aug 2017 13:00:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C90F763E4; Tue, 1 Aug 2017 13:00:14 +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 v71D0Dhd031435; Tue, 1 Aug 2017 13:00:13 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71D0DaG031434; Tue, 1 Aug 2017 13:00:13 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201708011300.v71D0DaG031434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 1 Aug 2017 13:00: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: r321869 - stable/11/sys/dev/isp X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/dev/isp X-SVN-Commit-Revision: 321869 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 13:00:14 -0000 Author: mav Date: Tue Aug 1 13:00:13 2017 New Revision: 321869 URL: https://svnweb.freebsd.org/changeset/base/321869 Log: MFC r320575: Move comment respecting previous commit. Modified: stable/11/sys/dev/isp/isp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/isp/isp.c ============================================================================== --- stable/11/sys/dev/isp/isp.c Tue Aug 1 12:59:37 2017 (r321868) +++ stable/11/sys/dev/isp/isp.c Tue Aug 1 13:00:13 2017 (r321869) @@ -3401,19 +3401,6 @@ abort: return (0); } -/* - * Scan the fabric for devices and add them to our port database. - * - * Use the GID_FT command to get all Port IDs for FC4 SCSI devices it knows. - * - * For 2100-23XX cards, we use the SNS mailbox command to pass simple name - * server commands to the switch management server via the QLogic f/w. - * - * For the 24XX and above card, we use CT Pass-through IOCB. - */ -#define GIDLEN ISP_FC_SCRLEN -#define NGENT ((GIDLEN - 16) >> 2) - static int isp_ct_sns(ispsoftc_t *isp, int chan, uint32_t cmd_bcnt, uint32_t rsp_bcnt) { @@ -3519,6 +3506,19 @@ isp_ct_passthru(ispsoftc_t *isp, int chan, uint32_t cm return (0); } + +/* + * Scan the fabric for devices and add them to our port database. + * + * Use the GID_FT command to get all Port IDs for FC4 SCSI devices it knows. + * + * For 2100-23XX cards, we use the SNS mailbox command to pass simple name + * server commands to the switch management server via the QLogic f/w. + * + * For the 24XX and above card, we use CT Pass-through IOCB. + */ +#define GIDLEN ISP_FC_SCRLEN +#define NGENT ((GIDLEN - 16) >> 2) static int isp_gid_ft(ispsoftc_t *isp, int chan) From owner-svn-src-all@freebsd.org Tue Aug 1 13:03:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88094DABDE3; Tue, 1 Aug 2017 13:03:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 40A6476A37; Tue, 1 Aug 2017 13:03:08 +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 v71D378K035296; Tue, 1 Aug 2017 13:03:07 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71D36Ko035289; Tue, 1 Aug 2017 13:03:06 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201708011303.v71D36Ko035289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 1 Aug 2017 13:03: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: r321870 - in stable/11: share/man/man4 sys/dev/isp X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/11: share/man/man4 sys/dev/isp X-SVN-Commit-Revision: 321870 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 13:03:08 -0000 Author: mav Date: Tue Aug 1 13:03:06 2017 New Revision: 321870 URL: https://svnweb.freebsd.org/changeset/base/321870 Log: MFC r320604, r320865: Switch fabric scans from GID_FT to GID_PT+GFF_ID/GFT_ID. Instead of using GID_FT SNS request to get list of registered FCP ports, use GID_PT to get list of all Nx_Ports, and then use GFF_ID and/or GFT_ID requests to find whether they are FCP and target capable. The problem with old approach is that GID_FT does not report ports without FC-4 type registered. In particular it was impossible to boot OS from FreeBSD FC target using QLogic FC BIOS, since one does not register FC-4 type even on new cards and so ignored by old code as incompatible. As a side bonus this allows initiator to skip pointless logins to other initiators by fetching that information from SNS instead. In case some switches do not implement GFF_ID/GFT_ID correctly, add sysctls to disable that functionality. I handled broken GFF_ID of my Brocade 200E, but there may be other switches with different bugs. Linux also uses GID_PT, but GFF_ID is disabled by default there, and GFT_ID is not supported. Sponsored by: iXsystems, Inc. Modified: stable/11/share/man/man4/isp.4 stable/11/sys/dev/isp/isp.c stable/11/sys/dev/isp/isp_freebsd.c stable/11/sys/dev/isp/isp_library.c stable/11/sys/dev/isp/isp_library.h stable/11/sys/dev/isp/ispmbox.h stable/11/sys/dev/isp/ispvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/isp.4 ============================================================================== --- stable/11/share/man/man4/isp.4 Tue Aug 1 13:00:13 2017 (r321869) +++ stable/11/share/man/man4/isp.4 Tue Aug 1 13:03:06 2017 (r321870) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2009-2015 Alexander Motin +.\" Copyright (c) 2009-2017 Alexander Motin .\" Copyright (c) 2006 Marcus Alves Grando .\" Copyright (c) 1998-2001 Matthew Jacob, for NASA/Ames Research Center .\" @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 20, 2016 +.Dd July 3, 2017 .Dt ISP 4 .Os .Sh NAME @@ -221,6 +221,15 @@ This value says how long to wait for devices to reappe disappear due to loop or fabric events. While this timeout is running, I/O to those devices will simply be held. +.It Va dev.isp.N.use_gff_id +.It Va dev.isp.N.use_gft_id +Setting those options to 0 allows to disable use of GFF_ID and GFT_ID SNS +requests during FC fabric scan. +It may be useful if switch does not implement them correctly, +preventing some devices from being found. +Disabling them may cause unneeded logins to ports not supporting target role +or even FCP at all. +The default is 1 (enabled). .It Va dev.isp.N.wwnn This is the readonly World Wide Node Name value for this port. .It Va dev.isp.N.wwpn @@ -239,7 +248,7 @@ The driver was written by .An Matthew Jacob originally for NetBSD at NASA/Ames Research Center. -Some later improvement was done by +Later improvement was done by .An Alexander Motin Aq Mt mav@FreeBSD.org . .Sh BUGS The driver currently ignores some NVRAM settings. Modified: stable/11/sys/dev/isp/isp.c ============================================================================== --- stable/11/sys/dev/isp/isp.c Tue Aug 1 13:00:13 2017 (r321869) +++ stable/11/sys/dev/isp/isp.c Tue Aug 1 13:03:06 2017 (r321870) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2009-2017 Alexander Motin * Copyright (c) 1997-2009 by Matthew Jacob * All rights reserved. * @@ -117,7 +118,7 @@ static uint64_t isp_get_wwn(ispsoftc_t *, int, int, in static int isp_fclink_test(ispsoftc_t *, int, int); static int isp_pdb_sync(ispsoftc_t *, int); static int isp_scan_loop(ispsoftc_t *, int); -static int isp_gid_ft(ispsoftc_t *, int); +static int isp_gid_pt(ispsoftc_t *, int); static int isp_scan_fabric(ispsoftc_t *, int); static int isp_login_device(ispsoftc_t *, int, uint32_t, isp_pdb_t *, uint16_t *); static int isp_send_change_request(ispsoftc_t *, int); @@ -3496,7 +3497,7 @@ isp_ct_passthru(ispsoftc_t *isp, int chan, uint32_t cm isp_get_ct_pt(isp, (isp_ct_pt_t *)resp, &pt); if (pt.ctp_status && pt.ctp_status != RQCS_DATA_UNDERRUN) { isp_prt(isp, ISP_LOGWARN, - "Chan %d GID_FT CT Passthrough returned 0x%x", + "Chan %d CT pass-through returned 0x%x", chan, pt.ctp_status); return (-1); } @@ -3510,7 +3511,8 @@ isp_ct_passthru(ispsoftc_t *isp, int chan, uint32_t cm /* * Scan the fabric for devices and add them to our port database. * - * Use the GID_FT command to get all Port IDs for FC4 SCSI devices it knows. + * Use the GID_PT command to get list of all Nx_Port IDs SNS knows. + * Use GFF_ID and GFT_ID to check port type (FCP) and features (target). * * For 2100-23XX cards, we use the SNS mailbox command to pass simple name * server commands to the switch management server via the QLogic f/w. @@ -3521,15 +3523,14 @@ isp_ct_passthru(ispsoftc_t *isp, int chan, uint32_t cm #define NGENT ((GIDLEN - 16) >> 2) static int -isp_gid_ft(ispsoftc_t *isp, int chan) +isp_gid_pt(ispsoftc_t *isp, int chan) { fcparam *fcp = FCPARAM(isp, chan); ct_hdr_t ct; - sns_gid_ft_req_t rq; - uint32_t *rp; + sns_gid_pt_req_t rq; uint8_t *scp = fcp->isp_scratch; - isp_prt(isp, ISP_LOGDEBUG0, "Chan %d requesting GID_FT", chan); + isp_prt(isp, ISP_LOGDEBUG0, "Chan %d requesting GID_PT", chan); if (FC_SCRATCH_ACQUIRE(isp, chan)) { isp_prt(isp, ISP_LOGERR, sacq); return (-1); @@ -3541,11 +3542,13 @@ isp_gid_ft(ispsoftc_t *isp, int chan) ct.ct_revision = CT_REVISION; ct.ct_fcs_type = CT_FC_TYPE_FC; ct.ct_fcs_subtype = CT_FC_SUBTYPE_NS; - ct.ct_cmd_resp = SNS_GID_FT; + ct.ct_cmd_resp = SNS_GID_PT; ct.ct_bcnt_resid = (GIDLEN - 16) >> 2; isp_put_ct_hdr(isp, &ct, (ct_hdr_t *)scp); - rp = (uint32_t *) &scp[sizeof(ct)]; - ISP_IOZPUT_32(isp, FC4_SCSI, rp); + scp[sizeof(ct)] = 0x7f; /* Port Type = Nx_Port */ + scp[sizeof(ct)+1] = 0; /* Domain_ID = any */ + scp[sizeof(ct)+2] = 0; /* Area_ID = any */ + scp[sizeof(ct)+3] = 0; /* Flags = no Area_ID */ if (isp_ct_passthru(isp, chan, sizeof(ct) + sizeof(uint32_t), GIDLEN)) { FC_SCRATCH_RELEASE(isp, chan); @@ -3553,17 +3556,20 @@ isp_gid_ft(ispsoftc_t *isp, int chan) } } else { /* Build the SNS request and execute via firmware. */ - ISP_MEMZERO(&rq, SNS_GID_FT_REQ_SIZE); + ISP_MEMZERO(&rq, SNS_GID_PT_REQ_SIZE); rq.snscb_rblen = GIDLEN >> 1; rq.snscb_addr[RQRSP_ADDR0015] = DMA_WD0(fcp->isp_scdma); rq.snscb_addr[RQRSP_ADDR1631] = DMA_WD1(fcp->isp_scdma); rq.snscb_addr[RQRSP_ADDR3247] = DMA_WD2(fcp->isp_scdma); rq.snscb_addr[RQRSP_ADDR4863] = DMA_WD3(fcp->isp_scdma); rq.snscb_sblen = 6; - rq.snscb_cmd = SNS_GID_FT; + rq.snscb_cmd = SNS_GID_PT; rq.snscb_mword_div_2 = NGENT; - rq.snscb_fc4_type = FC4_SCSI; - isp_put_gid_ft_request(isp, &rq, (sns_gid_ft_req_t *)scp); + rq.snscb_port_type = 0x7f; /* Port Type = Nx_Port */ + rq.snscb_domain = 0; /* Domain_ID = any */ + rq.snscb_area = 0; /* Area_ID = any */ + rq.snscb_flags = 0; /* Flags = no Area_ID */ + isp_put_gid_pt_request(isp, &rq, (sns_gid_pt_req_t *)scp); if (isp_ct_sns(isp, chan, sizeof(rq), NGENT)) { FC_SCRATCH_RELEASE(isp, chan); @@ -3571,13 +3577,147 @@ isp_gid_ft(ispsoftc_t *isp, int chan) } } - isp_get_gid_ft_response(isp, (sns_gid_ft_rsp_t *)scp, - (sns_gid_ft_rsp_t *)fcp->isp_scanscratch, NGENT); + isp_get_gid_xx_response(isp, (sns_gid_xx_rsp_t *)scp, + (sns_gid_xx_rsp_t *)fcp->isp_scanscratch, NGENT); FC_SCRATCH_RELEASE(isp, chan); return (0); } static int +isp_gff_id(ispsoftc_t *isp, int chan, uint32_t portid) +{ + fcparam *fcp = FCPARAM(isp, chan); + ct_hdr_t ct; + uint32_t *rp; + uint8_t *scp = fcp->isp_scratch; + sns_gff_id_rsp_t rsp; + int i, res = -1; + + if (!fcp->isp_use_gff_id) /* User may block GFF_ID use. */ + return (res); + + if (!IS_24XX(isp)) /* Old chips can't request GFF_ID. */ + return (res); + + isp_prt(isp, ISP_LOGDEBUG0, "Chan %d requesting GFF_ID", chan); + if (FC_SCRATCH_ACQUIRE(isp, chan)) { + isp_prt(isp, ISP_LOGERR, sacq); + return (res); + } + + /* Build the CT command and execute via pass-through. */ + ISP_MEMZERO(&ct, sizeof (ct)); + ct.ct_revision = CT_REVISION; + ct.ct_fcs_type = CT_FC_TYPE_FC; + ct.ct_fcs_subtype = CT_FC_SUBTYPE_NS; + ct.ct_cmd_resp = SNS_GFF_ID; + ct.ct_bcnt_resid = (SNS_GFF_ID_RESP_SIZE - sizeof(ct)) / 4; + isp_put_ct_hdr(isp, &ct, (ct_hdr_t *)scp); + rp = (uint32_t *) &scp[sizeof(ct)]; + ISP_IOZPUT_32(isp, portid, rp); + + if (isp_ct_passthru(isp, chan, sizeof(ct) + sizeof(uint32_t), + SNS_GFF_ID_RESP_SIZE)) { + FC_SCRATCH_RELEASE(isp, chan); + return (res); + } + + isp_get_gff_id_response(isp, (sns_gff_id_rsp_t *)scp, &rsp); + if (rsp.snscb_cthdr.ct_cmd_resp == LS_ACC) { + for (i = 0; i < 32; i++) { + if (rsp.snscb_fc4_features[i] != 0) { + res = 0; + break; + } + } + if (((rsp.snscb_fc4_features[FC4_SCSI / 8] >> + ((FC4_SCSI % 8) * 4)) & 0x01) != 0) + res = 1; + /* Workaround for broken Brocade firmware. */ + if (((ISP_SWAP32(isp, rsp.snscb_fc4_features[FC4_SCSI / 8]) >> + ((FC4_SCSI % 8) * 4)) & 0x01) != 0) + res = 1; + } + FC_SCRATCH_RELEASE(isp, chan); + isp_prt(isp, ISP_LOGDEBUG0, "Chan %d GFF_ID result is %d", chan, res); + return (res); +} + +static int +isp_gft_id(ispsoftc_t *isp, int chan, uint32_t portid) +{ + fcparam *fcp = FCPARAM(isp, chan); + ct_hdr_t ct; + sns_gxx_id_req_t rq; + uint32_t *rp; + uint8_t *scp = fcp->isp_scratch; + sns_gft_id_rsp_t rsp; + int i, res = -1; + + if (!fcp->isp_use_gft_id) /* User may block GFT_ID use. */ + return (res); + + isp_prt(isp, ISP_LOGDEBUG0, "Chan %d requesting GFT_ID", chan); + if (FC_SCRATCH_ACQUIRE(isp, chan)) { + isp_prt(isp, ISP_LOGERR, sacq); + return (res); + } + + if (IS_24XX(isp)) { + /* Build the CT command and execute via pass-through. */ + ISP_MEMZERO(&ct, sizeof (ct)); + ct.ct_revision = CT_REVISION; + ct.ct_fcs_type = CT_FC_TYPE_FC; + ct.ct_fcs_subtype = CT_FC_SUBTYPE_NS; + ct.ct_cmd_resp = SNS_GFT_ID; + ct.ct_bcnt_resid = (SNS_GFT_ID_RESP_SIZE - sizeof(ct)) / 4; + isp_put_ct_hdr(isp, &ct, (ct_hdr_t *)scp); + rp = (uint32_t *) &scp[sizeof(ct)]; + ISP_IOZPUT_32(isp, portid, rp); + + if (isp_ct_passthru(isp, chan, sizeof(ct) + sizeof(uint32_t), + SNS_GFT_ID_RESP_SIZE)) { + FC_SCRATCH_RELEASE(isp, chan); + return (res); + } + } else { + /* Build the SNS request and execute via firmware. */ + ISP_MEMZERO(&rq, SNS_GXX_ID_REQ_SIZE); + rq.snscb_rblen = SNS_GFT_ID_RESP_SIZE >> 1; + rq.snscb_addr[RQRSP_ADDR0015] = DMA_WD0(fcp->isp_scdma); + rq.snscb_addr[RQRSP_ADDR1631] = DMA_WD1(fcp->isp_scdma); + rq.snscb_addr[RQRSP_ADDR3247] = DMA_WD2(fcp->isp_scdma); + rq.snscb_addr[RQRSP_ADDR4863] = DMA_WD3(fcp->isp_scdma); + rq.snscb_sblen = 6; + rq.snscb_cmd = SNS_GFT_ID; + rq.snscb_mword_div_2 = (SNS_GFT_ID_RESP_SIZE - sizeof(ct)) / 4; + rq.snscb_portid = portid; + isp_put_gxx_id_request(isp, &rq, (sns_gxx_id_req_t *)scp); + + if (isp_ct_sns(isp, chan, sizeof(rq), SNS_GFT_ID_RESP_SIZE)) { + FC_SCRATCH_RELEASE(isp, chan); + return (res); + } + } + + isp_get_gft_id_response(isp, (sns_gft_id_rsp_t *)scp, &rsp); + if (rsp.snscb_cthdr.ct_cmd_resp == LS_ACC) { + for (i = 0; i < 8; i++) { + if (rsp.snscb_fc4_types[i] != 0) { + res = 0; + break; + } + } + if (((rsp.snscb_fc4_types[FC4_SCSI / 32] >> + (FC4_SCSI % 32)) & 0x01) != 0) + res = 1; + } + FC_SCRATCH_RELEASE(isp, chan); + isp_prt(isp, ISP_LOGDEBUG0, "Chan %d GFT_ID result is %d", chan, res); + return (res); +} + +static int isp_scan_fabric(ispsoftc_t *isp, int chan) { fcparam *fcp = FCPARAM(isp, chan); @@ -3586,7 +3726,7 @@ isp_scan_fabric(ispsoftc_t *isp, int chan) uint16_t nphdl; isp_pdb_t pdb; int portidx, portlim, r; - sns_gid_ft_rsp_t *rs; + sns_gid_xx_rsp_t *rs; if (fcp->isp_loopstate < LOOP_LSCAN_DONE) return (-1); @@ -3627,7 +3767,7 @@ fail: } /* Get list of port IDs from SNS. */ - r = isp_gid_ft(isp, chan); + r = isp_gid_pt(isp, chan); if (fcp->isp_loopstate < LOOP_SCANNING_FABRIC) goto abort; if (r > 0) { @@ -3638,17 +3778,20 @@ fail: return (-1); } - rs = (sns_gid_ft_rsp_t *) fcp->isp_scanscratch; + rs = (sns_gid_xx_rsp_t *) fcp->isp_scanscratch; if (fcp->isp_loopstate < LOOP_SCANNING_FABRIC) goto abort; if (rs->snscb_cthdr.ct_cmd_resp != LS_ACC) { int level; - if (rs->snscb_cthdr.ct_reason == 9 && rs->snscb_cthdr.ct_explanation == 7) { + /* FC-4 Type and Port Type not registered are not errors. */ + if (rs->snscb_cthdr.ct_reason == 9 && + (rs->snscb_cthdr.ct_explanation == 0x07 || + rs->snscb_cthdr.ct_explanation == 0x0a)) { level = ISP_LOG_SANCFG; } else { level = ISP_LOGWARN; } - isp_prt(isp, level, "Chan %d Fabric Nameserver rejected GID_FT" + isp_prt(isp, level, "Chan %d Fabric Nameserver rejected GID_PT" " (Reason=0x%x Expl=0x%x)", chan, rs->snscb_cthdr.ct_reason, rs->snscb_cthdr.ct_explanation); @@ -3777,6 +3920,20 @@ relogin: if ((fcp->role & ISP_ROLE_INITIATOR) == 0) { isp_prt(isp, ISP_LOG_SANCFG, "Chan %d Port 0x%06x is not logged in", chan, portid); + continue; + } + + r = isp_gff_id(isp, chan, portid); + if (r == 0) { + isp_prt(isp, ISP_LOG_SANCFG, + "Chan %d Port 0x%06x is not an FCP target", chan, portid); + continue; + } + if (r < 0) + r = isp_gft_id(isp, chan, portid); + if (r == 0) { + isp_prt(isp, ISP_LOG_SANCFG, + "Chan %d Port 0x%06x is not FCP", chan, portid); continue; } Modified: stable/11/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/11/sys/dev/isp/isp_freebsd.c Tue Aug 1 13:00:13 2017 (r321869) +++ stable/11/sys/dev/isp/isp_freebsd.c Tue Aug 1 13:03:06 2017 (r321870) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2009-2017 Alexander Motin * Copyright (c) 1997-2009 by Matthew Jacob * All rights reserved. * @@ -169,6 +170,8 @@ isp_attach_chan(ispsoftc_t *isp, struct cam_devq *devq fc->path = path; fc->isp = isp; fc->ready = 1; + fcp->isp_use_gft_id = 1; + fcp->isp_use_gff_id = 1; callout_init_mtx(&fc->gdt, &isp->isp_lock, 0); TASK_INIT(&fc->gtask, 1, isp_gdt_task, fc); @@ -235,6 +238,12 @@ isp_attach_chan(ispsoftc_t *isp, struct cam_devq *devq SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "topo", CTLFLAG_RD, &fcp->isp_topo, 0, "Connection topology"); + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "use_gft_id", CTLFLAG_RWTUN, &fcp->isp_use_gft_id, 0, + "Use GFT_ID during fabric scan"); + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "use_gff_id", CTLFLAG_RWTUN, &fcp->isp_use_gff_id, 0, + "Use GFF_ID during fabric scan"); } return (0); } Modified: stable/11/sys/dev/isp/isp_library.c ============================================================================== --- stable/11/sys/dev/isp/isp_library.c Tue Aug 1 13:00:13 2017 (r321869) +++ stable/11/sys/dev/isp/isp_library.c Tue Aug 1 13:03:06 2017 (r321870) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2009-2017 Alexander Motin * Copyright (c) 1997-2009 by Matthew Jacob * All rights reserved. * @@ -1742,7 +1743,7 @@ isp_put_gid_ft_request(ispsoftc_t *isp, sns_gid_ft_req } void -isp_put_gxn_id_request(ispsoftc_t *isp, sns_gxn_id_req_t *src, sns_gxn_id_req_t *dst) +isp_put_gid_pt_request(ispsoftc_t *isp, sns_gid_pt_req_t *src, sns_gid_pt_req_t *dst) { ISP_IOXPUT_16(isp, src->snscb_rblen, &dst->snscb_rblen); ISP_IOXPUT_16(isp, src->snscb_reserved0, &dst->snscb_reserved0); @@ -1753,48 +1754,46 @@ isp_put_gxn_id_request(ispsoftc_t *isp, sns_gxn_id_req ISP_IOXPUT_16(isp, src->snscb_sblen, &dst->snscb_sblen); ISP_IOXPUT_16(isp, src->snscb_reserved1, &dst->snscb_reserved1); ISP_IOXPUT_16(isp, src->snscb_cmd, &dst->snscb_cmd); - ISP_IOXPUT_16(isp, src->snscb_reserved2, &dst->snscb_reserved2); + ISP_IOXPUT_16(isp, src->snscb_mword_div_2, &dst->snscb_mword_div_2); ISP_IOXPUT_32(isp, src->snscb_reserved3, &dst->snscb_reserved3); - ISP_IOXPUT_32(isp, src->snscb_portid, &dst->snscb_portid); + ISP_IOXPUT_8(isp, src->snscb_port_type, &dst->snscb_port_type); + ISP_IOXPUT_8(isp, src->snscb_domain, &dst->snscb_domain); + ISP_IOXPUT_8(isp, src->snscb_area, &dst->snscb_area); + ISP_IOXPUT_8(isp, src->snscb_flags, &dst->snscb_flags); } -/* - * Generic SNS response - not particularly useful since the per-command data - * isn't always 16 bit words. - */ void -isp_get_sns_response(ispsoftc_t *isp, sns_scrsp_t *src, sns_scrsp_t *dst, int nwords) +isp_put_gxx_id_request(ispsoftc_t *isp, sns_gxx_id_req_t *src, sns_gxx_id_req_t *dst) { - int i; - isp_get_ct_hdr(isp, &src->snscb_cthdr, &dst->snscb_cthdr); - ISP_IOXGET_8(isp, &src->snscb_port_type, dst->snscb_port_type); - for (i = 0; i < 3; i++) { - ISP_IOXGET_8(isp, &src->snscb_port_id[i], - dst->snscb_port_id[i]); - } - for (i = 0; i < 8; i++) { - ISP_IOXGET_8(isp, &src->snscb_portname[i], - dst->snscb_portname[i]); - } - for (i = 0; i < nwords; i++) { - ISP_IOXGET_16(isp, &src->snscb_data[i], dst->snscb_data[i]); - } + ISP_IOXPUT_16(isp, src->snscb_rblen, &dst->snscb_rblen); + ISP_IOXPUT_16(isp, src->snscb_reserved0, &dst->snscb_reserved0); + ISP_IOXPUT_16(isp, src->snscb_addr[0], &dst->snscb_addr[0]); + ISP_IOXPUT_16(isp, src->snscb_addr[1], &dst->snscb_addr[1]); + ISP_IOXPUT_16(isp, src->snscb_addr[2], &dst->snscb_addr[2]); + ISP_IOXPUT_16(isp, src->snscb_addr[3], &dst->snscb_addr[3]); + ISP_IOXPUT_16(isp, src->snscb_sblen, &dst->snscb_sblen); + ISP_IOXPUT_16(isp, src->snscb_reserved1, &dst->snscb_reserved1); + ISP_IOXPUT_16(isp, src->snscb_cmd, &dst->snscb_cmd); + ISP_IOXPUT_16(isp, src->snscb_mword_div_2, &dst->snscb_mword_div_2); + ISP_IOXPUT_32(isp, src->snscb_reserved3, &dst->snscb_reserved3); + ISP_IOXPUT_32(isp, src->snscb_portid, &dst->snscb_portid); } void -isp_get_gid_ft_response(ispsoftc_t *isp, sns_gid_ft_rsp_t *src, sns_gid_ft_rsp_t *dst, int nwords) +isp_get_gid_xx_response(ispsoftc_t *isp, sns_gid_xx_rsp_t *src, sns_gid_xx_rsp_t *dst, int nwords) { - int i; + int i, j; + isp_get_ct_hdr(isp, &src->snscb_cthdr, &dst->snscb_cthdr); for (i = 0; i < nwords; i++) { - int j; - ISP_IOXGET_8(isp, &src->snscb_ports[i].control, dst->snscb_ports[i].control); + ISP_IOZGET_8(isp, &src->snscb_ports[i].control, + dst->snscb_ports[i].control); for (j = 0; j < 3; j++) { - ISP_IOXGET_8(isp, &src->snscb_ports[i].portid[j], dst->snscb_ports[i].portid[j]); + ISP_IOZGET_8(isp, &src->snscb_ports[i].portid[j], + dst->snscb_ports[i].portid[j]); } - if (dst->snscb_ports[i].control & 0x80) { + if (dst->snscb_ports[i].control & 0x80) break; - } } } @@ -1802,9 +1801,21 @@ void isp_get_gxn_id_response(ispsoftc_t *isp, sns_gxn_id_rsp_t *src, sns_gxn_id_rsp_t *dst) { int i; + isp_get_ct_hdr(isp, &src->snscb_cthdr, &dst->snscb_cthdr); + for (i = 0; i < 8; i++) + ISP_IOZGET_8(isp, &src->snscb_wwn[i], dst->snscb_wwn[i]); +} + +void +isp_get_gft_id_response(ispsoftc_t *isp, sns_gft_id_rsp_t *src, sns_gft_id_rsp_t *dst) +{ + int i; + + isp_get_ct_hdr(isp, &src->snscb_cthdr, &dst->snscb_cthdr); for (i = 0; i < 8; i++) { - ISP_IOXGET_8(isp, &src->snscb_wwn[i], dst->snscb_wwn[i]); + ISP_IOZGET_32(isp, &src->snscb_fc4_types[i], + dst->snscb_fc4_types[i]); } } @@ -1812,9 +1823,11 @@ void isp_get_gff_id_response(ispsoftc_t *isp, sns_gff_id_rsp_t *src, sns_gff_id_rsp_t *dst) { int i; + isp_get_ct_hdr(isp, &src->snscb_cthdr, &dst->snscb_cthdr); for (i = 0; i < 32; i++) { - ISP_IOXGET_32(isp, &src->snscb_fc4_features[i], dst->snscb_fc4_features[i]); + ISP_IOZGET_32(isp, &src->snscb_fc4_features[i], + dst->snscb_fc4_features[i]); } } @@ -1823,42 +1836,42 @@ isp_get_ga_nxt_response(ispsoftc_t *isp, sns_ga_nxt_rs { int i; isp_get_ct_hdr(isp, &src->snscb_cthdr, &dst->snscb_cthdr); - ISP_IOXGET_8(isp, &src->snscb_port_type, dst->snscb_port_type); + ISP_IOZGET_8(isp, &src->snscb_port_type, dst->snscb_port_type); for (i = 0; i < 3; i++) { - ISP_IOXGET_8(isp, &src->snscb_port_id[i], dst->snscb_port_id[i]); + ISP_IOZGET_8(isp, &src->snscb_port_id[i], dst->snscb_port_id[i]); } for (i = 0; i < 8; i++) { - ISP_IOXGET_8(isp, &src->snscb_portname[i], dst->snscb_portname[i]); + ISP_IOZGET_8(isp, &src->snscb_portname[i], dst->snscb_portname[i]); } - ISP_IOXGET_8(isp, &src->snscb_pnlen, dst->snscb_pnlen); + ISP_IOZGET_8(isp, &src->snscb_pnlen, dst->snscb_pnlen); for (i = 0; i < 255; i++) { - ISP_IOXGET_8(isp, &src->snscb_pname[i], dst->snscb_pname[i]); + ISP_IOZGET_8(isp, &src->snscb_pname[i], dst->snscb_pname[i]); } for (i = 0; i < 8; i++) { - ISP_IOXGET_8(isp, &src->snscb_nodename[i], dst->snscb_nodename[i]); + ISP_IOZGET_8(isp, &src->snscb_nodename[i], dst->snscb_nodename[i]); } - ISP_IOXGET_8(isp, &src->snscb_nnlen, dst->snscb_nnlen); + ISP_IOZGET_8(isp, &src->snscb_nnlen, dst->snscb_nnlen); for (i = 0; i < 255; i++) { - ISP_IOXGET_8(isp, &src->snscb_nname[i], dst->snscb_nname[i]); + ISP_IOZGET_8(isp, &src->snscb_nname[i], dst->snscb_nname[i]); } for (i = 0; i < 8; i++) { - ISP_IOXGET_8(isp, &src->snscb_ipassoc[i], dst->snscb_ipassoc[i]); + ISP_IOZGET_8(isp, &src->snscb_ipassoc[i], dst->snscb_ipassoc[i]); } for (i = 0; i < 16; i++) { - ISP_IOXGET_8(isp, &src->snscb_ipaddr[i], dst->snscb_ipaddr[i]); + ISP_IOZGET_8(isp, &src->snscb_ipaddr[i], dst->snscb_ipaddr[i]); } for (i = 0; i < 4; i++) { - ISP_IOXGET_8(isp, &src->snscb_svc_class[i], dst->snscb_svc_class[i]); + ISP_IOZGET_8(isp, &src->snscb_svc_class[i], dst->snscb_svc_class[i]); } for (i = 0; i < 32; i++) { - ISP_IOXGET_8(isp, &src->snscb_fc4_types[i], dst->snscb_fc4_types[i]); + ISP_IOZGET_8(isp, &src->snscb_fc4_types[i], dst->snscb_fc4_types[i]); } for (i = 0; i < 8; i++) { - ISP_IOXGET_8(isp, &src->snscb_fpname[i], dst->snscb_fpname[i]); + ISP_IOZGET_8(isp, &src->snscb_fpname[i], dst->snscb_fpname[i]); } - ISP_IOXGET_8(isp, &src->snscb_reserved, dst->snscb_reserved); + ISP_IOZGET_8(isp, &src->snscb_reserved, dst->snscb_reserved); for (i = 0; i < 3; i++) { - ISP_IOXGET_8(isp, &src->snscb_hardaddr[i], dst->snscb_hardaddr[i]); + ISP_IOZGET_8(isp, &src->snscb_hardaddr[i], dst->snscb_hardaddr[i]); } } Modified: stable/11/sys/dev/isp/isp_library.h ============================================================================== --- stable/11/sys/dev/isp/isp_library.h Tue Aug 1 13:00:13 2017 (r321869) +++ stable/11/sys/dev/isp/isp_library.h Tue Aug 1 13:03:06 2017 (r321870) @@ -1,5 +1,6 @@ /* $FreeBSD$ */ /*- + * Copyright (c) 2009-2017 Alexander Motin * Copyright (c) 1997-2009 by Matthew Jacob * All rights reserved. * @@ -127,10 +128,11 @@ void isp_put_ct_pt(ispsoftc_t *isp, isp_ct_pt_t *, isp void isp_put_ms(ispsoftc_t *isp, isp_ms_t *, isp_ms_t *); void isp_put_sns_request(ispsoftc_t *, sns_screq_t *, sns_screq_t *); void isp_put_gid_ft_request(ispsoftc_t *, sns_gid_ft_req_t *, sns_gid_ft_req_t *); -void isp_put_gxn_id_request(ispsoftc_t *, sns_gxn_id_req_t *, sns_gxn_id_req_t *); -void isp_get_sns_response(ispsoftc_t *, sns_scrsp_t *, sns_scrsp_t *, int); -void isp_get_gid_ft_response(ispsoftc_t *, sns_gid_ft_rsp_t *, sns_gid_ft_rsp_t *, int); +void isp_put_gid_pt_request(ispsoftc_t *, sns_gid_pt_req_t *, sns_gid_pt_req_t *); +void isp_put_gxx_id_request(ispsoftc_t *, sns_gxx_id_req_t *, sns_gxx_id_req_t *); +void isp_get_gid_xx_response(ispsoftc_t *, sns_gid_xx_rsp_t *, sns_gid_xx_rsp_t *, int); void isp_get_gxn_id_response(ispsoftc_t *, sns_gxn_id_rsp_t *, sns_gxn_id_rsp_t *); +void isp_get_gft_id_response(ispsoftc_t *, sns_gft_id_rsp_t *, sns_gft_id_rsp_t *); void isp_get_gff_id_response(ispsoftc_t *, sns_gff_id_rsp_t *, sns_gff_id_rsp_t *); void isp_get_ga_nxt_response(ispsoftc_t *, sns_ga_nxt_rsp_t *, sns_ga_nxt_rsp_t *); void isp_get_els(ispsoftc_t *, els_t *, els_t *); Modified: stable/11/sys/dev/isp/ispmbox.h ============================================================================== --- stable/11/sys/dev/isp/ispmbox.h Tue Aug 1 13:00:13 2017 (r321869) +++ stable/11/sys/dev/isp/ispmbox.h Tue Aug 1 13:03:06 2017 (r321870) @@ -1,5 +1,6 @@ /* $FreeBSD$ */ /*- + * Copyright (c) 2009-2017 Alexander Motin * Copyright (c) 1997-2009 by Matthew Jacob * All rights reserved. * @@ -1551,6 +1552,7 @@ typedef struct { #define SNS_GA_NXT 0x100 #define SNS_GPN_ID 0x112 #define SNS_GNN_ID 0x113 +#define SNS_GFT_ID 0x117 #define SNS_GFF_ID 0x11F #define SNS_GID_FT 0x171 #define SNS_GID_PT 0x1A1 @@ -1580,18 +1582,18 @@ typedef struct { } sns_ga_nxt_req_t; #define SNS_GA_NXT_REQ_SIZE (sizeof (sns_ga_nxt_req_t)) -typedef struct { +typedef struct { /* Used for GFT_ID, GFF_ID, etc. */ uint16_t snscb_rblen; /* response buffer length (words) */ uint16_t snscb_reserved0; uint16_t snscb_addr[4]; /* response buffer address */ uint16_t snscb_sblen; /* subcommand buffer length (words) */ uint16_t snscb_reserved1; uint16_t snscb_cmd; - uint16_t snscb_reserved2; + uint16_t snscb_mword_div_2; uint32_t snscb_reserved3; uint32_t snscb_portid; -} sns_gxn_id_req_t; -#define SNS_GXN_ID_REQ_SIZE (sizeof (sns_gxn_id_req_t)) +} sns_gxx_id_req_t; +#define SNS_GXX_ID_REQ_SIZE (sizeof (sns_gxx_id_req_t)) typedef struct { uint16_t snscb_rblen; /* response buffer length (words) */ @@ -1613,6 +1615,22 @@ typedef struct { uint16_t snscb_sblen; /* subcommand buffer length (words) */ uint16_t snscb_reserved1; uint16_t snscb_cmd; + uint16_t snscb_mword_div_2; + uint32_t snscb_reserved3; + uint8_t snscb_port_type; + uint8_t snscb_domain; + uint8_t snscb_area; + uint8_t snscb_flags; +} sns_gid_pt_req_t; +#define SNS_GID_PT_REQ_SIZE (sizeof (sns_gid_pt_req_t)) + +typedef struct { + uint16_t snscb_rblen; /* response buffer length (words) */ + uint16_t snscb_reserved0; + uint16_t snscb_addr[4]; /* response buffer address */ + uint16_t snscb_sblen; /* subcommand buffer length (words) */ + uint16_t snscb_reserved1; + uint16_t snscb_cmd; uint16_t snscb_reserved2; uint32_t snscb_reserved3; uint32_t snscb_port; @@ -1656,18 +1674,24 @@ typedef struct { typedef struct { ct_hdr_t snscb_cthdr; + uint32_t snscb_fc4_types[8]; +} sns_gft_id_rsp_t; +#define SNS_GFT_ID_RESP_SIZE (sizeof (sns_gft_id_rsp_t)) + +typedef struct { + ct_hdr_t snscb_cthdr; uint32_t snscb_fc4_features[32]; } sns_gff_id_rsp_t; #define SNS_GFF_ID_RESP_SIZE (sizeof (sns_gff_id_rsp_t)) -typedef struct { +typedef struct { /* Used for GID_FT, GID_PT, etc. */ ct_hdr_t snscb_cthdr; struct { uint8_t control; uint8_t portid[3]; } snscb_ports[1]; -} sns_gid_ft_rsp_t; -#define SNS_GID_FT_RESP_SIZE(x) ((sizeof (sns_gid_ft_rsp_t)) + ((x - 1) << 2)) +} sns_gid_xx_rsp_t; +#define SNS_GID_XX_RESP_SIZE(x) ((sizeof (sns_gid_xx_rsp_t)) + ((x - 1) << 2)) /* * Other Misc Structures Modified: stable/11/sys/dev/isp/ispvar.h ============================================================================== --- stable/11/sys/dev/isp/ispvar.h Tue Aug 1 13:00:13 2017 (r321869) +++ stable/11/sys/dev/isp/ispvar.h Tue Aug 1 13:03:06 2017 (r321870) @@ -1,5 +1,6 @@ /* $FreeBSD$ */ /*- + * Copyright (c) 2009-2017 Alexander Motin * Copyright (c) 1997-2009 by Matthew Jacob * All rights reserved. * @@ -446,6 +447,8 @@ typedef struct { uint16_t isp_login_hdl; /* Logging in handle */ uint8_t isp_retry_delay; uint8_t isp_retry_count; + int isp_use_gft_id; /* Use GFT_ID */ + int isp_use_gff_id; /* Use GFF_ID */ /* * Current active WWNN/WWPN From owner-svn-src-all@freebsd.org Tue Aug 1 13:07:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B433ADAD05F; Tue, 1 Aug 2017 13:07:06 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 838BD76DBF; Tue, 1 Aug 2017 13:07:06 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v71D75OU035516; Tue, 1 Aug 2017 13:07:05 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71D7522035515; Tue, 1 Aug 2017 13:07:05 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201708011307.v71D7522035515@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 1 Aug 2017 13:07: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: r321871 - stable/11/sys/cam/ctl X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/cam/ctl X-SVN-Commit-Revision: 321871 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 13:07:06 -0000 Author: mav Date: Tue Aug 1 13:07:05 2017 New Revision: 321871 URL: https://svnweb.freebsd.org/changeset/base/321871 Log: MFC r320493: Unify INOT/ATIO setup. Modified: stable/11/sys/cam/ctl/scsi_ctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/11/sys/cam/ctl/scsi_ctl.c Tue Aug 1 13:03:06 2017 (r321870) +++ stable/11/sys/cam/ctl/scsi_ctl.c Tue Aug 1 13:07:05 2017 (r321871) @@ -529,7 +529,7 @@ ctlferegister(struct cam_periph *periph, void *arg) new_ccb->ccb_h.io_ptr = new_io; LIST_INSERT_HEAD(&softc->atio_list, &new_ccb->ccb_h, periph_links.le); - xpt_setup_ccb(&new_ccb->ccb_h, periph->path, /*priority*/ 1); + xpt_setup_ccb(&new_ccb->ccb_h, periph->path, CAM_PRIORITY_NONE); new_ccb->ccb_h.func_code = XPT_ACCEPT_TARGET_IO; new_ccb->ccb_h.cbfcnp = ctlfedone; new_ccb->ccb_h.flags |= CAM_UNLOCKED; @@ -576,7 +576,7 @@ ctlferegister(struct cam_periph *periph, void *arg) new_ccb->ccb_h.io_ptr = new_io; LIST_INSERT_HEAD(&softc->inot_list, &new_ccb->ccb_h, periph_links.le); - xpt_setup_ccb(&new_ccb->ccb_h, periph->path, /*priority*/ 1); + xpt_setup_ccb(&new_ccb->ccb_h, periph->path, CAM_PRIORITY_NONE); new_ccb->ccb_h.func_code = XPT_IMMEDIATE_NOTIFY; new_ccb->ccb_h.cbfcnp = ctlfedone; new_ccb->ccb_h.flags |= CAM_UNLOCKED; @@ -1009,10 +1009,7 @@ ctlfe_requeue_ccb(struct cam_periph *periph, union ccb * target/lun. Reset the target and LUN fields back to the wildcard * values before we send them back down to the SIM. */ - if (softc->flags & CTLFE_LUN_WILDCARD) { - ccb->ccb_h.target_id = CAM_TARGET_WILDCARD; - ccb->ccb_h.target_lun = CAM_LUN_WILDCARD; - } + xpt_setup_ccb(&ccb->ccb_h, periph->path, CAM_PRIORITY_NONE); xpt_action(ccb); } From owner-svn-src-all@freebsd.org Tue Aug 1 13:07:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63255DAD12A; Tue, 1 Aug 2017 13:07:55 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3217676EFE; Tue, 1 Aug 2017 13:07:55 +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 v71D7sZo035601; Tue, 1 Aug 2017 13:07:54 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71D7sqU035600; Tue, 1 Aug 2017 13:07:54 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201708011307.v71D7sqU035600@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 1 Aug 2017 13:07: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: r321872 - stable/11/sys/cam/ctl X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/cam/ctl X-SVN-Commit-Revision: 321872 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 13:07:55 -0000 Author: mav Date: Tue Aug 1 13:07:54 2017 New Revision: 321872 URL: https://svnweb.freebsd.org/changeset/base/321872 Log: MFC r320495: Allow status aggregation for ramdisk reads. Modified: stable/11/sys/cam/ctl/ctl_backend_ramdisk.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- stable/11/sys/cam/ctl/ctl_backend_ramdisk.c Tue Aug 1 13:07:05 2017 (r321871) +++ stable/11/sys/cam/ctl/ctl_backend_ramdisk.c Tue Aug 1 13:07:54 2017 (r321872) @@ -525,6 +525,11 @@ nospc: io->scsiio.kern_sg_entries = sgs; io->io_hdr.flags |= CTL_FLAG_ALLOCATED; PRIV(io)->len += lbas; + if ((ARGS(io)->flags & CTL_LLF_READ) && + ARGS(io)->len <= PRIV(io)->len) { + ctl_set_success(&io->scsiio); + ctl_serseq_done(io); + } #ifdef CTL_TIME_IO getbinuptime(&io->io_hdr.dma_start_bt); #endif From owner-svn-src-all@freebsd.org Tue Aug 1 13:15:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0482DAD3CD; Tue, 1 Aug 2017 13:15:31 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6EBE277315; Tue, 1 Aug 2017 13:15:31 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v71DFUac039448; Tue, 1 Aug 2017 13:15:30 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71DFUQf039447; Tue, 1 Aug 2017 13:15:30 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201708011315.v71DFUQf039447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Tue, 1 Aug 2017 13:15:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321873 - stable/10/sys/netpfil/ipfw X-SVN-Group: stable-10 X-SVN-Commit-Author: philip X-SVN-Commit-Paths: stable/10/sys/netpfil/ipfw X-SVN-Commit-Revision: 321873 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 13:15:31 -0000 Author: philip Date: Tue Aug 1 13:15:30 2017 New Revision: 321873 URL: https://svnweb.freebsd.org/changeset/base/321873 Log: MFC r320941: Fix GRE over IPv6 tunnels with IPFW Previously, GRE packets in IPv6 tunnels would be dropped by IPFW (unless net.inet6.ip6.fw.deny_unknown_exthdrs was unset). PR: 220640 Submitted by: Kun Xie Modified: stable/10/sys/netpfil/ipfw/ip_fw2.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- stable/10/sys/netpfil/ipfw/ip_fw2.c Tue Aug 1 13:07:54 2017 (r321872) +++ stable/10/sys/netpfil/ipfw/ip_fw2.c Tue Aug 1 13:15:30 2017 (r321873) @@ -87,6 +87,8 @@ __FBSDID("$FreeBSD$"); #include #endif +#include /* for struct grehdr */ + #include #include /* XXX for in_cksum */ @@ -1141,6 +1143,11 @@ do { \ case IPPROTO_PIM: /* XXX PIM header check? */ PULLUP_TO(hlen, ulp, struct pim); + break; + + case IPPROTO_GRE: /* RFC 1701 */ + /* XXX GRE header check? */ + PULLUP_TO(hlen, ulp, struct grehdr); break; case IPPROTO_CARP: From owner-svn-src-all@freebsd.org Tue Aug 1 13:40:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC39CDADE64; Tue, 1 Aug 2017 13:40:38 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB2B477D58; Tue, 1 Aug 2017 13:40:38 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v71DebNv048472; Tue, 1 Aug 2017 13:40:37 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71DebaQ048471; Tue, 1 Aug 2017 13:40:37 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201708011340.v71DebaQ048471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Tue, 1 Aug 2017 13:40:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r321874 - stable/9/sys/netpfil/ipfw X-SVN-Group: stable-9 X-SVN-Commit-Author: philip X-SVN-Commit-Paths: stable/9/sys/netpfil/ipfw X-SVN-Commit-Revision: 321874 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 13:40:39 -0000 Author: philip Date: Tue Aug 1 13:40:37 2017 New Revision: 321874 URL: https://svnweb.freebsd.org/changeset/base/321874 Log: MFC r320941: Fix GRE over IPv6 tunnels with IPFW Previously, GRE packets in IPv6 tunnels would be dropped by IPFW (unless net.inet6.ip6.fw.deny_unknown_exthdrs was unset). PR: 220640 Submitted by: Kun Xie Modified: stable/9/sys/netpfil/ipfw/ip_fw2.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/netpfil/ (props changed) Modified: stable/9/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- stable/9/sys/netpfil/ipfw/ip_fw2.c Tue Aug 1 13:15:30 2017 (r321873) +++ stable/9/sys/netpfil/ipfw/ip_fw2.c Tue Aug 1 13:40:37 2017 (r321874) @@ -86,6 +86,8 @@ __FBSDID("$FreeBSD$"); #include #endif +#include /* for struct gre_h */ + #include #include /* XXX for in_cksum */ @@ -1142,6 +1144,11 @@ do { \ case IPPROTO_PIM: /* XXX PIM header check? */ PULLUP_TO(hlen, ulp, struct pim); + break; + + case IPPROTO_GRE: /* RFC 1701 */ + /* XXX GRE header check? */ + PULLUP_TO(hlen, ulp, struct gre_h); break; case IPPROTO_CARP: From owner-svn-src-all@freebsd.org Tue Aug 1 14:25:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC71ADAEED9; Tue, 1 Aug 2017 14:25:28 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89D987D5A0; Tue, 1 Aug 2017 14:25:28 +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 v71EPRfT067757; Tue, 1 Aug 2017 14:25:27 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71EPRvf067756; Tue, 1 Aug 2017 14:25:27 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201708011425.v71EPRvf067756@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 1 Aug 2017 14:25: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: r321875 - stable/11/sys/fs/nfs X-SVN-Group: stable-11 X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: stable/11/sys/fs/nfs X-SVN-Commit-Revision: 321875 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 14:25:28 -0000 Author: trasz Date: Tue Aug 1 14:25:27 2017 New Revision: 321875 URL: https://svnweb.freebsd.org/changeset/base/321875 Log: MFC r320359: Add vfs.nfsd.nfsd_enable_uidtostring, which works just like vfs.nfsd.nfsd_enable_stringtouid, but in reverse - when set to 1, it forces the NFSv4 server to return numeric UIDs and GIDs instead of "user@domain" strings. This helps with clients that can't translate returned identifiers, eg when rerooting. The same can be achieved by just never running nfsuserd(8), but the sysctl is useful to toggle the behaviour back and forth without rebooting. MFC r320409: Revert part of r320359, as suggested by rmacklem@. That case is only used for nfsuserd -manage-gids and shouldn't depend on sysctl. MFC r321196: Rename vfs.nfsd.enable_uidtostring to vfs.nfs.enable_uidtostring. It applies to both NFS client and NFS server, and is useful for both. This is different from vfs.nfsd.enable_stringtouid, which is specific to server side. Sponsored by: DARPA, AFRL Modified: stable/11/sys/fs/nfs/nfs_commonsubs.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/11/sys/fs/nfs/nfs_commonsubs.c Tue Aug 1 13:40:37 2017 (r321874) +++ stable/11/sys/fs/nfs/nfs_commonsubs.c Tue Aug 1 14:25:27 2017 (r321875) @@ -68,10 +68,15 @@ gid_t nfsrv_defaultgid = GID_NOGROUP; int nfsrv_lease = NFSRV_LEASE; int ncl_mbuf_mlen = MLEN; int nfsd_enable_stringtouid = 0; +static int nfs_enable_uidtostring = 0; NFSNAMEIDMUTEX; NFSSOCKMUTEX; extern int nfsrv_lughashsize; +SYSCTL_DECL(_vfs_nfs); +SYSCTL_INT(_vfs_nfs, OID_AUTO, enable_uidtostring, CTLFLAG_RW, + &nfs_enable_uidtostring, 0, "Make nfs always send numeric owner_names"); + /* * This array of structures indicates, for V4: * retfh - which of 3 types of calling args are used @@ -2588,7 +2593,7 @@ nfsv4_uidtostr(uid_t uid, u_char **cpp, int *retlenp, cnt = 0; tryagain: - if (nfsrv_dnsnamelen > 0) { + if (nfsrv_dnsnamelen > 0 && !nfs_enable_uidtostring) { /* * Always map nfsrv_defaultuid to "nobody". */ @@ -2850,7 +2855,7 @@ nfsv4_gidtostr(gid_t gid, u_char **cpp, int *retlenp, cnt = 0; tryagain: - if (nfsrv_dnsnamelen > 0) { + if (nfsrv_dnsnamelen > 0 && !nfs_enable_uidtostring) { /* * Always map nfsrv_defaultgid to "nogroup". */ From owner-svn-src-all@freebsd.org Tue Aug 1 14:46:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60EEADAF6D0; Tue, 1 Aug 2017 14:46:25 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x241.google.com (mail-pf0-x241.google.com [IPv6:2607:f8b0:400e:c00::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2FEBF7E061; Tue, 1 Aug 2017 14:46:25 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x241.google.com with SMTP id 72so2769738pfl.4; Tue, 01 Aug 2017 07:46:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=fBTCVJycCwuxi6clpLlDH/bOaNs0DtdaQUkazbuVgDk=; b=EgBHl63cdWkroBeDxQ/qAjMLN80zNoWrnKlDFy2VenOwnduPQ4f5z86/nn61HGb21e jGm1FM9sQXkEA9MLvJpzPNthyLAxs3W9oofRr93alrZV009P1LcAqyU3LfNiwE+7wMmv 7Fc0f4zYM7N+3IqNxD8/3XYRE+agxY+yDbAHvVN7vL0OKRy9VeUKOESr2a/E0JvC2pwH 86Qo/8u0R5O2zwpmMlZW8jBGzLs7iGBIVuTA37qreC3iEhusDp+6DHlX8j68Np760LzZ JjbpDzO1iph8xAQiKzddA9mMRblCmtCk/xFd+ehZwyraEcwZYt24KZEaGD87k1OILPzf oFRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=fBTCVJycCwuxi6clpLlDH/bOaNs0DtdaQUkazbuVgDk=; b=ECQbmBD5G+0K35/kAnVCyv9OH5TMLmfkoOMb82PW5oz/13tVSis5hGjfyEOO1+PfFS K17W2MaxV1Rf1BkR0TUSiQ0/bLP/qB9MkaLL2L9TrZGW1BOKxaUV2EJVPDgFaNGCMA3v RHi4ldHsxPiV43FqfgJDXmcYTt1cT79v5cIyEUwCe2s7AoNTmR6+4I2HPoZuqn5+2QJy jI9QmB+0iQQ0ij9+M2D6uuD67xMsjlhh1wTulk85N809z7RtARFTtra8b5yxpYBiDTi0 x8MX+EmZ3OdqUYl8/lySHUgcPuFjZWlci/eG6NK45D1Mz1mh2sOfe77SLWqk1OLe7glr VhJw== X-Gm-Message-State: AIVw113BK+ty3lAZjJkc72mQTI/OUlsrL+6eUUXqk9OmpKWTkCcwOK8o 0dVF7mNImNVkqBhPgXM= X-Received: by 10.98.108.7 with SMTP id h7mr7752920pfc.61.1501598784130; Tue, 01 Aug 2017 07:46:24 -0700 (PDT) Received: from [192.168.20.13] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id a87sm10167383pfg.18.2017.08.01.07.46.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Aug 2017 07:46:22 -0700 (PDT) Content-Type: text/plain; charset=cp932 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r321849 - in head/tools/tools: bootparttest zfsboottest From: Ngie Cooper X-Mailer: iPhone Mail (14G60) In-Reply-To: Date: Tue, 1 Aug 2017 07:46:21 -0700 Cc: Ngie Cooper , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Content-Transfer-Encoding: quoted-printable Message-Id: <56CA537A-D555-4188-9DDA-B368B23B4099@gmail.com> References: <201708010529.v715Ta2p047371@repo.freebsd.org> <96cee950-35c2-3971-defa-be4b5493cfd3@FreeBSD.org> <21962A53-0DA3-4C10-8075-923948AB83E6@gmail.com> To: Andriy Gapon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 14:46:25 -0000 > On Aug 1, 2017, at 04:08, Andriy Gapon wrote: >=20 >> On 01/08/2017 11:26, Ngie Cooper (yaneurabeya) wrote: >>=20 >>> On Aug 1, 2017, at 00:13, Andriy Gapon wrote: >>=20 >> =81c >>=20 >>> Thank you! >>> The next problem you are going to encounter would be missing ldi_get_siz= e(). >>> I have some WIP for that if you are interested. >>=20 >> That=81fd be great =81\ please feel free to pass it along :)! >=20 > I am going to just go ahead and commit it to make the life easier for all := ) That works -- please be my guest! Thanks! -Ngie= From owner-svn-src-all@freebsd.org Tue Aug 1 14:54:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5044DAFB0A; Tue, 1 Aug 2017 14:54:26 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94C687E55A; Tue, 1 Aug 2017 14:54:26 +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 v71EsPZE080064; Tue, 1 Aug 2017 14:54:25 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71EsPxt080063; Tue, 1 Aug 2017 14:54:25 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201708011454.v71EsPxt080063@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 1 Aug 2017 14:54:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321876 - head X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 321876 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 14:54:26 -0000 Author: ian Date: Tue Aug 1 14:54:25 2017 New Revision: 321876 URL: https://svnweb.freebsd.org/changeset/base/321876 Log: In xdev-links, when installing symlinks to the cross-compiler pieces that includes the OS version (armv6-freebsd12.0-cc, etc), use the OS version of the compiler/world source code, not the version of the build host machine. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Aug 1 14:25:27 2017 (r321875) +++ head/Makefile.inc1 Tue Aug 1 14:54:25 2017 (r321876) @@ -2759,9 +2759,6 @@ CD2MAKE=${CD2ENV} PATH=${CDTMP}/usr/bin:${XDDESTDIR}/u CD2MAKE+= BUILD_TOOLS_META=.NOMETA .endif XDDESTDIR=${DESTDIR}/${XDTP} -.if !defined(OSREL) -OSREL!= uname -r | sed -e 's/[-(].*//' -.endif .ORDER: xdev-build xdev-install xdev-links xdev: xdev-build xdev-install .PHONY @@ -2855,7 +2852,7 @@ xdev-links: .PHONY ln -sf ../../${XDTP}/usr/bin/$$i \ ../../../../usr/bin/${XDDIR}-$$i; \ ln -sf ../../${XDTP}/usr/bin/$$i \ - ../../../../usr/bin/${XDDIR}${OSREL}-$$i; \ + ../../../../usr/bin/${XDDIR}${_REVISION}-$$i; \ done .else xdev xdev-build xdev-install xdev-links: .PHONY From owner-svn-src-all@freebsd.org Tue Aug 1 15:51:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2387FDB138D; Tue, 1 Aug 2017 15:51:18 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE40F80510; Tue, 1 Aug 2017 15:51:17 +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 v71FpHon003520; Tue, 1 Aug 2017 15:51:17 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71FpH83003519; Tue, 1 Aug 2017 15:51:17 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201708011551.v71FpH83003519@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 1 Aug 2017 15:51:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321877 - stable/10/sys/fs/nfs X-SVN-Group: stable-10 X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: stable/10/sys/fs/nfs X-SVN-Commit-Revision: 321877 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 15:51:18 -0000 Author: trasz Date: Tue Aug 1 15:51:16 2017 New Revision: 321877 URL: https://svnweb.freebsd.org/changeset/base/321877 Log: MFC r320359: Add vfs.nfsd.nfsd_enable_uidtostring, which works just like vfs.nfsd.nfsd_enable_stringtouid, but in reverse - when set to 1, it forces the NFSv4 server to return numeric UIDs and GIDs instead of "user@domain" strings. This helps with clients that can't translate returned identifiers, eg when rerooting. The same can be achieved by just never running nfsuserd(8), but the sysctl is useful to toggle the behaviour back and forth without rebooting. MFC r320409: Revert part of r320359, as suggested by rmacklem@. That case is only used for nfsuserd -manage-gids and shouldn't depend on sysctl. MFC r321196: Rename vfs.nfsd.enable_uidtostring to vfs.nfs.enable_uidtostring. It applies to both NFS client and NFS server, and is useful for both. This is different from vfs.nfsd.enable_stringtouid, which is specific to server side. Sponsored by: DARPA, AFRL Modified: stable/10/sys/fs/nfs/nfs_commonsubs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/10/sys/fs/nfs/nfs_commonsubs.c Tue Aug 1 14:54:25 2017 (r321876) +++ stable/10/sys/fs/nfs/nfs_commonsubs.c Tue Aug 1 15:51:16 2017 (r321877) @@ -68,10 +68,15 @@ gid_t nfsrv_defaultgid = GID_NOGROUP; int nfsrv_lease = NFSRV_LEASE; int ncl_mbuf_mlen = MLEN; int nfsd_enable_stringtouid = 0; +static int nfs_enable_uidtostring = 0; NFSNAMEIDMUTEX; NFSSOCKMUTEX; extern int nfsrv_lughashsize; +SYSCTL_DECL(_vfs_nfs); +SYSCTL_INT(_vfs_nfs, OID_AUTO, enable_uidtostring, CTLFLAG_RW, + &nfs_enable_uidtostring, 0, "Make nfs always send numeric owner_names"); + /* * This array of structures indicates, for V4: * retfh - which of 3 types of calling args are used @@ -2576,7 +2581,7 @@ nfsv4_uidtostr(uid_t uid, u_char **cpp, int *retlenp, cnt = 0; tryagain: - if (nfsrv_dnsnamelen > 0) { + if (nfsrv_dnsnamelen > 0 && !nfs_enable_uidtostring) { /* * Always map nfsrv_defaultuid to "nobody". */ @@ -2838,7 +2843,7 @@ nfsv4_gidtostr(gid_t gid, u_char **cpp, int *retlenp, cnt = 0; tryagain: - if (nfsrv_dnsnamelen > 0) { + if (nfsrv_dnsnamelen > 0 && !nfs_enable_uidtostring) { /* * Always map nfsrv_defaultgid to "nogroup". */ From owner-svn-src-all@freebsd.org Tue Aug 1 16:00:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB8F5DB1969; Tue, 1 Aug 2017 16:00:22 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A893480E40; Tue, 1 Aug 2017 16:00:22 +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 v71G0Lek005319; Tue, 1 Aug 2017 16:00:21 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71G0L92005317; Tue, 1 Aug 2017 16:00:21 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201708011600.v71G0L92005317@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 1 Aug 2017 16:00:21 +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: r321878 - in stable/10: contrib/netbsd-tests/lib/libc/gen lib/libc/tests/gen X-SVN-Group: stable-10 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in stable/10: contrib/netbsd-tests/lib/libc/gen lib/libc/tests/gen X-SVN-Commit-Revision: 321878 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 16:00:22 -0000 Author: asomers Date: Tue Aug 1 16:00:21 2017 New Revision: 321878 URL: https://svnweb.freebsd.org/changeset/base/321878 Log: MFC r320737, r320914 r320737: Fix cleanup in lib/libc/gen/setdomainname_test ATF cleanup routines run in separate processes from the tests themselves, so they can't share global variables. Also, setdomainname_test needs to be is_exclusive because the test cases access a global resource. PR: 219967 Reviewed by: ngie Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D11188 r320914: Remove an extraneous strlen from t_setdomainname.c Reported by: Coverity CID: 1377568 X-MFC-With: 320737 Sponsored by: Spectra Logic Corp Modified: stable/10/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c stable/10/lib/libc/tests/gen/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c ============================================================================== --- stable/10/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c Tue Aug 1 15:51:16 2017 (r321877) +++ stable/10/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c Tue Aug 1 16:00:21 2017 (r321878) @@ -34,11 +34,13 @@ __RCSID("$NetBSD: t_setdomainname.c,v 1.2 2012/03/25 0 #include #include +#include #include +#include #include #include -static char domain[MAXHOSTNAMELEN]; +#define DOMAIN_BACKUP_FILE "domain.bak" static const char domains[][MAXHOSTNAMELEN] = { "1234567890", @@ -47,6 +49,45 @@ static const char domains[][MAXHOSTNAMELEN] = { "--------------------------------------------------------------------" }; +static void +backup_domain(void) +{ + char domain[MAXHOSTNAMELEN]; + int fd; + size_t l; + ssize_t r,n = 0; + + memset(domain, 0, sizeof(domain)); + + ATF_REQUIRE_EQ(0, getdomainname(domain, sizeof(domain))); + l = strnlen(domain, MAXHOSTNAMELEN); + fd = open(DOMAIN_BACKUP_FILE, O_WRONLY | O_CREAT | O_EXCL, 0644); + ATF_REQUIRE(fd >= 0); + while ((r = write(fd, domain + n, l - n)) > 0) + n += r; + ATF_REQUIRE_EQ(0, r); + close(fd); +} + +static void +restore_domain(void) +{ + char domain[MAXHOSTNAMELEN]; + int fd; + ssize_t r, n = 0; + + memset(domain, 0, sizeof(domain)); + if ((fd = open(DOMAIN_BACKUP_FILE, O_RDONLY)) < 0) + err(1, "open"); + while ((r = read(fd, domain + n, sizeof(domain) - n)) > 0) + n += r; + if (r < 0) + err(1, "read"); + if (setdomainname(domain, n) != 0) + err(1, "setdomainname"); + close(fd); +} + ATF_TC_WITH_CLEANUP(setdomainname_basic); ATF_TC_HEAD(setdomainname_basic, tc) { @@ -59,6 +100,7 @@ ATF_TC_BODY(setdomainname_basic, tc) char name[MAXHOSTNAMELEN]; size_t i; + backup_domain(); for (i = 0; i < __arraycount(domains); i++) { (void)memset(name, 0, sizeof(name)); @@ -80,12 +122,11 @@ ATF_TC_BODY(setdomainname_basic, tc) ATF_REQUIRE(strcmp(domains[i], name) == 0); } - (void)setdomainname(domain, sizeof(domain)); } ATF_TC_CLEANUP(setdomainname_basic, tc) { - (void)setdomainname(domain, sizeof(domain)); + restore_domain(); } ATF_TC_WITH_CLEANUP(setdomainname_limit); @@ -100,6 +141,7 @@ ATF_TC_BODY(setdomainname_limit, tc) char name[MAXHOSTNAMELEN + 1]; (void)memset(name, 0, sizeof(name)); + backup_domain(); #ifdef __FreeBSD__ ATF_REQUIRE(setdomainname(name, MAXHOSTNAMELEN - 1 ) == 0); @@ -110,10 +152,10 @@ ATF_TC_BODY(setdomainname_limit, tc) ATF_TC_CLEANUP(setdomainname_limit, tc) { - (void)setdomainname(domain, sizeof(domain)); + restore_domain(); } -ATF_TC_WITH_CLEANUP(setdomainname_perm); +ATF_TC(setdomainname_perm); ATF_TC_HEAD(setdomainname_perm, tc) { atf_tc_set_md_var(tc, "descr", "Can normal user set the domain name?"); @@ -122,24 +164,16 @@ ATF_TC_HEAD(setdomainname_perm, tc) ATF_TC_BODY(setdomainname_perm, tc) { + char domain[MAXHOSTNAMELEN]; - errno = 0; + memset(domain, 0, sizeof(domain)); + errno = 0; ATF_REQUIRE_ERRNO(EPERM, setdomainname(domain, sizeof(domain)) == -1); } -ATF_TC_CLEANUP(setdomainname_perm, tc) -{ - (void)setdomainname(domain, sizeof(domain)); -} - ATF_TP_ADD_TCS(tp) { - - (void)memset(domain, 0, sizeof(domain)); - - ATF_REQUIRE(getdomainname(domain, sizeof(domain)) == 0); - ATF_TP_ADD_TC(tp, setdomainname_basic); ATF_TP_ADD_TC(tp, setdomainname_limit); ATF_TP_ADD_TC(tp, setdomainname_perm); Modified: stable/10/lib/libc/tests/gen/Makefile ============================================================================== --- stable/10/lib/libc/tests/gen/Makefile Tue Aug 1 15:51:16 2017 (r321877) +++ stable/10/lib/libc/tests/gen/Makefile Tue Aug 1 16:00:21 2017 (r321878) @@ -76,6 +76,7 @@ CFLAGS+= -I${.CURDIR} SRCS.fmtcheck2_test= fmtcheck_test.c SRCS.fnmatch2_test= fnmatch_test.c +TEST_METADATA.setdomainname_test+= is_exclusive=true TESTS_SUBDIRS= execve TESTS_SUBDIRS+= posix_spawn From owner-svn-src-all@freebsd.org Tue Aug 1 16:05:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96D3EDB1D01; Tue, 1 Aug 2017 16:05:24 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 704C481360; Tue, 1 Aug 2017 16:05:24 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v71G5NnN009048; Tue, 1 Aug 2017 16:05:23 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71G5N0k009047; Tue, 1 Aug 2017 16:05:23 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201708011605.v71G5N0k009047@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 1 Aug 2017 16:05:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321879 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 321879 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 16:05:24 -0000 Author: gjb Date: Tue Aug 1 16:05:23 2017 New Revision: 321879 URL: https://svnweb.freebsd.org/changeset/base/321879 Log: Update doceng, re, security-officer, clusteradm, webmaster and donations entries. Requested by: sevan Sponsored by: The FreeBSD Foundation Modified: head/share/misc/organization.dot Modified: head/share/misc/organization.dot ============================================================================== --- head/share/misc/organization.dot Tue Aug 1 16:00:21 2017 (r321878) +++ head/share/misc/organization.dot Tue Aug 1 16:05:23 2017 (r321879) @@ -28,15 +28,15 @@ _misc [label="Miscellaneous Hats"] core [label="Core Team\ncore@FreeBSD.org\nallanjude, bapt, bcr,\nbenno, emaste, gnn,\nhrs, jhb, kmoore"] coresecretary [label="Core Team Secretary\ncore-secretary@FreeBSD.org\nmatthew"] doccommitters [label="Doc/www Committers\ndoc-committers@FreeBSD.org"] -doceng [label="Documentation Engineering Team\ndoceng@FreeBSD.org\ngjb, blackend,\ngabor, hrs"] +doceng [label="Documentation Engineering Team\ndoceng@FreeBSD.org\ngjb, blackend,\ngabor, hrs,\nwblock"] portscommitters [label="Ports Committers\nports-committers@FreeBSD.org"] portmgr [label="Port Management Team\nportmgr@FreeBSD.org\nadamw, antoine, bapt, bdrewery\nfeld, mat, rene, swills"] portmgrsecretary [label="Port Management Team Secretary\nportmgr-secretary@FreeBSD.org\nrene"] -re [label="Primary Release Engineering Team\nre@FreeBSD.org\nkib, blackend, jpaetzel, hrs, kensmith"] +re [label="Primary Release Engineering Team\nre@FreeBSD.org\ngjb, kib,\nbdrewery, blackend,\nrgrimes, delphij,\nhrs, glebius,\nmarius, rwatson"] secteam [label="Security Team\nsecteam@FreeBSD.org\ndelphij,\ndes, gavin, gjb,\nglebius, remko"] portssecteam [label="Ports Security Team\nports-secteam@FreeBSD.org\ndelphij, amdmi3, eadler, feld, jgh, junovitch, rea, sbz, simon, swills, zi"] secteamsecretary [label="Security Team Secretary\nsecteam-secretary@FreeBSD.org\nremko"] -securityofficer [label="Security Officer Team\nsecurity-officer@FreeBSD.org\ncperciva, simon, nectar"] +securityofficer [label="Security Officer Team\nsecurity-officer@FreeBSD.org\ndelphij, des,\ngavin, gjb,\nglebius, remko"] srccommitters [label="Src Committers\nsrc-committers@FreeBSD.org"] # Admin teams go here alphabetically sorted @@ -44,7 +44,7 @@ srccommitters [label="Src Committers\nsrc-committers@F accounts [label="Accounts Team\naccounts@FreeBSD.org\nmarkm, simon, kensmith,\ndhw"] backups [label="Backup Administrators\nbackups@FreeBSD.org\nsimon, kensmith,\ndhw"] bugmeister [label="Bugmeister Team\nbugmeister@FreeBSD.org\neadler, gavin, gonzo"] -clusteradm [label="Cluster Administrators\nclusteradm@FreeBSD.org\nbrd, simon, ps,\nkensmith, peter"] +clusteradm [label="Cluster Administrators\nclusteradm@FreeBSD.org\nallanjude, brd,\ndhw, gavin,\ngjb, peter,\nsbruno, simon,\nzi"] cvsupmaster [label="CVSup Mirror Site Coordinators\ncvsup-master@FreeBSD.org\nkuriyama, jdp,\nkensmith"] dnsadm [label="DNS Administrators\ndnsadm@FreeBSD.org\nbillf, dg, ps,\nkensmith, peter"] mirroradmin [label="FTP/WWW Mirror Site Coordinators\nmirror-admin@FreeBSD.org\nkuriyama, kensmith"] @@ -52,11 +52,11 @@ ncvs [label="CVS src Repository Managers\nncvs@FreeBSD perforceadmin [label="Perforce Repository Administrators\nperforce-admin@FreeBSD.org\nscottl, kensmith, gordon,\nrwatson, peter, dhw"] postmaster [label="Postmaster Team\npostmaster@FreeBSD.org\njmb, brd, sahil, dhw"] refadm [label="Reference Systems Administrators\nrefadm@FreeBSD.org\njake, billf, markm, simon,\nobrien, ps, kensmith,\npeter, dhw"] -webmaster [label="Webmaster Team\nwebmaster@FreeBSD.org\nnik, kuriyama, simon,\njesusr, wosch"] +webmaster [label="Webmaster Team\nwebmaster@FreeBSD.org\ngjb, wblock, blackend,\ngabor, hrs, wosch"] # Misc hats go here alphabetically sorted -donations [label="Donations Team\ndonations@FreeBSD.org\ngjb, wilko, gahr, pgolluci,\nobrien, trhodes, ds,\nrwatson"] +donations [label="Donations Team\ndonations@FreeBSD.org\nwilko, gahr, pgolluci,\nobrien, trhodes, ds,\nrwatson"] marketing [label="Marketing Team\nmarketing@FreeBSD.org\nSteven Beedle, Denise Ebery, deb,\njkoshy, Dru Lavigne, mwlucas, imp,\nKris Moore, murray, mattt,\nJeremy C. Reed, rwatson"] vendorrelations [label="Vendor Relations\nvendor-relations@FreeBSD.org\ncore, FreeBSD Foundation"] From owner-svn-src-all@freebsd.org Tue Aug 1 16:15:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0372DB1FB7; Tue, 1 Aug 2017 16:15:09 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D7C68194E; Tue, 1 Aug 2017 16:15:09 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v71GF8Fo013176; Tue, 1 Aug 2017 16:15:08 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71GF8Yg013175; Tue, 1 Aug 2017 16:15:08 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201708011615.v71GF8Yg013175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 1 Aug 2017 16:15:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321880 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 321880 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 16:15:09 -0000 Author: bdrewery Date: Tue Aug 1 16:15:08 2017 New Revision: 321880 URL: https://svnweb.freebsd.org/changeset/base/321880 Log: CCACHE_BUILD: Allow setting CCACHE_BUILD_TYPE=wrapper. This uses the /usr/local/libexec/ccache/ wrappers rather than modifying CC to be '/usr/local/bin/ccache cc'. Some forms of compilation do not support the 'command' type. Sponsored by: Dell EMC Isilon Modified: head/share/mk/bsd.compiler.mk Modified: head/share/mk/bsd.compiler.mk ============================================================================== --- head/share/mk/bsd.compiler.mk Tue Aug 1 16:05:23 2017 (r321879) +++ head/share/mk/bsd.compiler.mk Tue Aug 1 16:15:08 2017 (r321880) @@ -31,6 +31,9 @@ ____: .include +# command = /usr/local/bin/ccache cc ... +# wrapper = /usr/local/libexec/ccache/cc ... +CCACHE_BUILD_TYPE?= command # Handle ccache after CC is determined, but not if CC/CXX are already # overridden with a manual setup. .if ${MK_CCACHE_BUILD:Uno} == "yes" && \ @@ -65,19 +68,23 @@ CCACHE_COMPILERCHECK?= content CCACHE_COMPILERCHECK?= mtime .endif .export CCACHE_COMPILERCHECK -# Remove ccache from the PATH to prevent double calls and wasted CPP/LD time. -PATH:= ${PATH:C,:?${CCACHE_WRAPPER_PATH}(/world)?(:$)?,,g} # Ensure no bogus CCACHE_PATH leaks in which might avoid the in-tree compiler. .if !empty(CCACHE_PATH) CCACHE_PATH= .export CCACHE_PATH .endif +.if ${CCACHE_BUILD_TYPE} == "command" +# Remove ccache from the PATH to prevent double calls and wasted CPP/LD time. +PATH:= ${PATH:C,:?${CCACHE_WRAPPER_PATH}(/world)?(:$)?,,g} # Override various toolchain vars. .for var in CC CXX HOST_CC HOST_CXX .if defined(${var}) && ${${var}:M${CCACHE_BIN}} == "" ${var}:= ${CCACHE_BIN} ${${var}} .endif .endfor +.elif empty(PATH:M*${CCACHE_WRAPPER_PATH}*) +PATH:= ${CCACHE_WRAPPER_PATH}:${PATH} +.endif # ${CCACHE_BUILD_TYPE} == "command" # GCC does not need the CCACHE_CPP2 hack enabled by default in devel/ccache. # The port enables it due to ccache passing preprocessed C to clang # which fails with -Wparentheses-equality, -Wtautological-compare, and From owner-svn-src-all@freebsd.org Tue Aug 1 16:20:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91D41DB2124; Tue, 1 Aug 2017 16:20:34 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5AD0581C39; Tue, 1 Aug 2017 16:20:34 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v71GKXBM013409; Tue, 1 Aug 2017 16:20:33 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71GKX35013408; Tue, 1 Aug 2017 16:20:33 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201708011620.v71GKX35013408@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Tue, 1 Aug 2017 16:20:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321881 - head/share/examples/ppp X-SVN-Group: head X-SVN-Commit-Author: sevan X-SVN-Commit-Paths: head/share/examples/ppp X-SVN-Commit-Revision: 321881 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 16:20:34 -0000 Author: sevan (doc committer) Date: Tue Aug 1 16:20:33 2017 New Revision: 321881 URL: https://svnweb.freebsd.org/changeset/base/321881 Log: For the udp-client example, instruct user to add an entry for a udp based service. For tcp-client & udp-client, use the same port in configuration snippet as used in the comment prior to remove any ambiguity on the port number which needs to be specified. Reviewed by: bcr (mentor) wblock (mentor) Approved by: gavin MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D9830 Modified: head/share/examples/ppp/ppp.conf.sample Modified: head/share/examples/ppp/ppp.conf.sample ============================================================================== --- head/share/examples/ppp/ppp.conf.sample Tue Aug 1 16:15:08 2017 (r321880) +++ head/share/examples/ppp/ppp.conf.sample Tue Aug 1 16:20:33 2017 (r321881) @@ -523,7 +523,7 @@ compuserve: # such as `rlogin' is involved, you may need to ``set escape 0xff'' # tcp-client: - set device tcpsrv.mynet:1234 + set device tcpsrv.mynet:6671 set dial set login set ifaddr 10.0.5.1 10.0.4.1 255.255.255.0 @@ -538,10 +538,10 @@ tcp-server: # # and this in /etc/services: # -# ppp 6671/tcp +# ppp 6671/udp # udp-client: - set device udpsrv.mynet:1234/udp + set device udpsrv.mynet:6671/udp set dial set login set ifaddr 10.0.5.1 10.0.4.1 255.255.255.0 From owner-svn-src-all@freebsd.org Tue Aug 1 16:41:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51637DB2C57; Tue, 1 Aug 2017 16:41:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F3FE827FA; Tue, 1 Aug 2017 16:41:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v71GfH7T025402; Tue, 1 Aug 2017 16:41:17 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71GfHKq025401; Tue, 1 Aug 2017 16:41:17 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201708011641.v71GfHKq025401@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 1 Aug 2017 16:41:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321882 - head X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 321882 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 16:41:18 -0000 Author: bdrewery Date: Tue Aug 1 16:41:17 2017 New Revision: 321882 URL: https://svnweb.freebsd.org/changeset/base/321882 Log: NO_CLEAN: No need to run delete-old if the directories don't exist. X-MFC-With: r321443 MFC after: 1 month Sponsored by: Dell EMC Isilon Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Aug 1 16:20:33 2017 (r321881) +++ head/Makefile.inc1 Tue Aug 1 16:41:17 2017 (r321882) @@ -760,10 +760,12 @@ _worldtmp: .PHONY rm -rf ${LIBCOMPATTMP} .endif .else +.if exists(${WORLDTMP}) @echo ">>> Deleting stale files in build tree..." ${_+_}cd ${.CURDIR}; ${WMAKE} -DBATCH_DELETE_OLD_FILES \ delete-old delete-old-libs >/dev/null -.if defined(LIBCOMPAT) +.endif +.if defined(LIBCOMPAT) && exists(${LIBCOMPATTMP}) ${_+_}cd ${.CURDIR}; ${WMAKE} -DBATCH_DELETE_OLD_FILES \ DESTDIR=${LIBCOMPATTMP} \ delete-old delete-old-libs >/dev/null From owner-svn-src-all@freebsd.org Tue Aug 1 16:48:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22FF8DB3204; Tue, 1 Aug 2017 16:48:35 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E46EF8308B; Tue, 1 Aug 2017 16:48:34 +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 v71GmXhJ026544; Tue, 1 Aug 2017 16:48:33 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71GmXmd026543; Tue, 1 Aug 2017 16:48:33 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201708011648.v71GmXmd026543@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 1 Aug 2017 16:48:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321883 - stable/10/usr.bin/stdbuf X-SVN-Group: stable-10 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/10/usr.bin/stdbuf X-SVN-Commit-Revision: 321883 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 16:48:35 -0000 Author: asomers Date: Tue Aug 1 16:48:33 2017 New Revision: 321883 URL: https://svnweb.freebsd.org/changeset/base/321883 Log: MFC r320807: stdbuf(1): Add buffer definition "B" to the usage message This option has been missing from the usage message ever since the program was first imported. Submitted by: shivansh Reviewed by: asomers Sponsored by: Google, Inc (GSoC 2017) Differential Revision: https://reviews.freebsd.org/D11529 Modified: stable/10/usr.bin/stdbuf/stdbuf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/stdbuf/stdbuf.c ============================================================================== --- stable/10/usr.bin/stdbuf/stdbuf.c Tue Aug 1 16:41:17 2017 (r321882) +++ stable/10/usr.bin/stdbuf/stdbuf.c Tue Aug 1 16:48:33 2017 (r321883) @@ -40,7 +40,7 @@ static void usage(int s) { - fprintf(stderr, "Usage: %s [-e 0|L|] [-i 0|L|] [-o 0|L|] " + fprintf(stderr, "Usage: %s [-e 0|L|B|] [-i 0|L|B|] [-o 0|L|B|] " " [args ...]\n", __progname); exit(s); } From owner-svn-src-all@freebsd.org Tue Aug 1 17:50:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B570DB5404; Tue, 1 Aug 2017 17:50:29 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5277F313D; Tue, 1 Aug 2017 17:50:29 +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 v71HoSeW055272; Tue, 1 Aug 2017 17:50:28 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71HoSn6055271; Tue, 1 Aug 2017 17:50:28 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201708011750.v71HoSn6055271@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 1 Aug 2017 17:50:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321884 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 321884 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 17:50:29 -0000 Author: markj Date: Tue Aug 1 17:50:28 2017 New Revision: 321884 URL: https://svnweb.freebsd.org/changeset/base/321884 Log: Fix a witness assertion that fires when a lock type's class changes. When all instances of a lock type are destroyed (for example, after a module unload), the corresponding witness entry remains associated with that lock type. In this case, we shouldn't panic if a new instance of the lock type is created and its lock class does not match that recorded in the witness entry. Reviewed by: jhb MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D11788 Modified: head/sys/kern/subr_witness.c Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Tue Aug 1 16:48:33 2017 (r321883) +++ head/sys/kern/subr_witness.c Tue Aug 1 17:50:28 2017 (r321884) @@ -1850,11 +1850,13 @@ enroll(const char *description, struct lock_class *loc found: w->w_refcount++; mtx_unlock_spin(&w_mtx); - if (lock_class != w->w_class) + if (w->w_refcount == 1) + w->w_class = lock_class; + else if (lock_class != w->w_class) kassert_panic( - "lock (%s) %s does not match earlier (%s) lock", - description, lock_class->lc_name, - w->w_class->lc_name); + "lock (%s) %s does not match earlier (%s) lock", + description, lock_class->lc_name, + w->w_class->lc_name); return (w); } From owner-svn-src-all@freebsd.org Tue Aug 1 18:05:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA00EDB59A4; Tue, 1 Aug 2017 18:05:20 +0000 (UTC) (envelope-from lev@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A96873CA9; Tue, 1 Aug 2017 18:05:20 +0000 (UTC) (envelope-from lev@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v71I5J2o064017; Tue, 1 Aug 2017 18:05:19 GMT (envelope-from lev@FreeBSD.org) Received: (from lev@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71I5JDd064016; Tue, 1 Aug 2017 18:05:19 GMT (envelope-from lev@FreeBSD.org) Message-Id: <201708011805.v71I5JDd064016@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lev set sender to lev@FreeBSD.org using -f From: "Lev A. Serebryakov" Date: Tue, 1 Aug 2017 18:05:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321885 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: lev X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321885 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 18:05:21 -0000 Author: lev (ports committer) Date: Tue Aug 1 18:05:19 2017 New Revision: 321885 URL: https://svnweb.freebsd.org/changeset/base/321885 Log: Add myself to the calendar.freebsd Reported by: mckusick Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Tue Aug 1 17:50:28 2017 (r321884) +++ head/usr.bin/calendar/calendars/calendar.freebsd Tue Aug 1 18:05:19 2017 (r321885) @@ -8,6 +8,7 @@ #define _calendar_freebsd_ 01/01 Dimitry Andric born in Utrecht, the Netherlands, 1969 +01/01 Lev Serebryakov born in Leningrad, USSR, 1979 01/01 Alexander Langer born in Duesseldorf, Nordrhein-Westfalen, Germany, 1981 01/02 Ion-Mihai "IOnut" Tetcu born in Bucharest, Romania, 1980 01/02 Patrick Li born in Beijing, People's Republic of China, 1985 From owner-svn-src-all@freebsd.org Tue Aug 1 18:25:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09A43DB643D; Tue, 1 Aug 2017 18:25:06 +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 mx1.freebsd.org (Postfix) with ESMTPS id B3D9F63C88; Tue, 1 Aug 2017 18:25: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 v71IP4OR072122; Tue, 1 Aug 2017 18:25:04 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71IP4j8072121; Tue, 1 Aug 2017 18:25:04 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201708011825.v71IP4j8072121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Tue, 1 Aug 2017 18:25:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321886 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321886 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 18:25:06 -0000 Author: mckusick Date: Tue Aug 1 18:25:04 2017 New Revision: 321886 URL: https://svnweb.freebsd.org/changeset/base/321886 Log: Add Anne Dickison. Requested by: Anne Dickison Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Tue Aug 1 18:05:19 2017 (r321885) +++ head/usr.bin/calendar/calendars/calendar.freebsd Tue Aug 1 18:25:04 2017 (r321886) @@ -22,6 +22,7 @@ 01/12 Kristof Provost born in Aalst, Belgium, 1983 01/13 Ruslan Bukin born in Dudinka, Russian Federation, 1985 01/14 Yi-Jheng Lin born in Taichung, Taiwan, Republic of China, 1985 +01/15 Anne Dickison born in Madison, Indiana, United States, 1976 01/16 Ariff Abdullah born in Kuala Lumpur, Malaysia, 1978 01/16 Dmitry Sivachenko born in Moscow, USSR, 1978 01/16 Vanilla I. Shu born in Taipei, Taiwan, Republic of China, 1978 @@ -357,7 +358,7 @@ 10/18 Vladimir Kondratyev born in Ryazan, USSR, 1975 10/19 Nicholas Souchu born in Suresnes, Hauts-de-Seine, France, 1972 10/19 Nick Barkas born in Longview, Washington, United States, 1981 -10/19 Pedro Giffuni born in Bogotá, Colombia, 1968 +10/19 Pedro Giffuni born in Bogoto, Colombia, 1968 10/20 Joel Dahl born in Bitterna, Skaraborg, Sweden, 1983 10/20 Dmitry Marakasov born in Moscow, Russian Federation, 1984 10/21 Ben Smithurst born in Sheffield, South Yorkshire, United Kingdom, 1981 @@ -372,7 +373,7 @@ 10/26 Philip M. Gollucci born in Silver Spring, Maryland, United States, 1979 10/27 Takanori Watanabe born in Numazu, Shizuoka, Japan, 1972 11/05 M. Warner Losh born in Kansas City, Kansas, United States, 1966 -11/06 Michael Zhilin born in Stary Oskol, USSR, 1985 +11/06 Michael Zhilin born in Stary Oskol, USSR, 1985 11/08 Joseph R. Mingrone born in Charlottetown, Prince Edward Island, Canada, 1976 11/09 Coleman Kane born in Cincinnati, Ohio, United States, 1980 11/09 Antoine Brodin born in Bagnolet, France, 1981 From owner-svn-src-all@freebsd.org Tue Aug 1 18:26:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9394DB64C1; Tue, 1 Aug 2017 18:26:21 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B67CF63DD6; Tue, 1 Aug 2017 18:26:21 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v71IQK84072220; Tue, 1 Aug 2017 18:26:20 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71IQK5j072218; Tue, 1 Aug 2017 18:26:20 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201708011826.v71IQK5j072218@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 1 Aug 2017 18:26:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321887 - in head: . share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: in head: . share/mk X-SVN-Commit-Revision: 321887 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 18:26:22 -0000 Author: bdrewery Date: Tue Aug 1 18:26:20 2017 New Revision: 321887 URL: https://svnweb.freebsd.org/changeset/base/321887 Log: CCACHE_BUILD: Follow-up r321880: Fix some PATH issues with buildworld. - bsd.compiler.mk: Must ensure that the CCACHE_WRAPPER_PATH comes first in PATH. - Makefile.inc1: Must prepend the CCACHE_WRAPPER_PATH into BPATH as it overrides the PATH set in bsd.compiler.mk in sub-makes. The PATH set in bsd.compiler.mk is not exported and doing so would cause it to then override the BPATH set from environment. The only sane solution is to prepend into BPATH as needed. CCACHE_PATH could possibly be used for some of this as well. Sponsored by: Dell EMC Isilon Modified: head/Makefile.inc1 head/share/mk/bsd.compiler.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Aug 1 18:25:04 2017 (r321886) +++ head/Makefile.inc1 Tue Aug 1 18:26:20 2017 (r321887) @@ -444,7 +444,7 @@ BUILD_ARCH!= uname -p .endif .endif WORLDTMP= ${OBJTREE}${.CURDIR}/tmp -BPATH= ${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/bin +BPATH= ${CCACHE_WRAPPER_PATH_PFX}${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/bin XPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin STRICTTMPPATH= ${BPATH}:${XPATH} TMPPATH= ${STRICTTMPPATH}:${PATH} Modified: head/share/mk/bsd.compiler.mk ============================================================================== --- head/share/mk/bsd.compiler.mk Tue Aug 1 18:25:04 2017 (r321886) +++ head/share/mk/bsd.compiler.mk Tue Aug 1 18:26:20 2017 (r321887) @@ -82,8 +82,11 @@ PATH:= ${PATH:C,:?${CCACHE_WRAPPER_PATH}(/world)?(:$)? ${var}:= ${CCACHE_BIN} ${${var}} .endif .endfor -.elif empty(PATH:M*${CCACHE_WRAPPER_PATH}*) +.else +# Need to ensure CCACHE_WRAPPER_PATH is the first in ${PATH} +PATH:= ${PATH:C,:?${CCACHE_WRAPPER_PATH}(/world)?(:$)?,,g} PATH:= ${CCACHE_WRAPPER_PATH}:${PATH} +CCACHE_WRAPPER_PATH_PFX= ${CCACHE_WRAPPER_PATH}: .endif # ${CCACHE_BUILD_TYPE} == "command" # GCC does not need the CCACHE_CPP2 hack enabled by default in devel/ccache. # The port enables it due to ccache passing preprocessed C to clang From owner-svn-src-all@freebsd.org Tue Aug 1 18:33:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39A28DB6709; Tue, 1 Aug 2017 18: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 mx1.freebsd.org (Postfix) with ESMTPS id 08DC164228; Tue, 1 Aug 2017 18:33:28 +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 v71IXSXc076315; Tue, 1 Aug 2017 18:33:28 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71IXSTT076314; Tue, 1 Aug 2017 18:33:28 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201708011833.v71IXSTT076314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 1 Aug 2017 18:33:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321888 - head/sys/modules/dtb/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/modules/dtb/allwinner X-SVN-Commit-Revision: 321888 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 18:33:29 -0000 Author: manu Date: Tue Aug 1 18:33:27 2017 New Revision: 321888 URL: https://svnweb.freebsd.org/changeset/base/321888 Log: Allwinner dtb: add link for NanoPi Neo Reported by: Richard Puga Tested by: Richard Puga , myself Modified: head/sys/modules/dtb/allwinner/Makefile Modified: head/sys/modules/dtb/allwinner/Makefile ============================================================================== --- head/sys/modules/dtb/allwinner/Makefile Tue Aug 1 18:26:20 2017 (r321887) +++ head/sys/modules/dtb/allwinner/Makefile Tue Aug 1 18:33:27 2017 (r321888) @@ -23,6 +23,7 @@ LINKS= \ ${DTBDIR}/sun7i-a20-bananapi.dtb ${DTBDIR}/bananapi.dtb \ ${DTBDIR}/sun7i-a20-cubieboard2.dtb ${DTBDIR}/cubieboard2.dtb \ ${DTBDIR}/sun7i-a20-olimex-som-evb.dtb ${DTBDIR}/olimex-a20-som-evb.dtb \ - ${DTBDIR}/sun7i-a20-pcduino3.dtb ${DTBDIR}/pcduino3.dtb + ${DTBDIR}/sun7i-a20-pcduino3.dtb ${DTBDIR}/pcduino3.dtb \ + ${DTBDIR}/nanopi-neo.dtb ${DTBDIR}/sun8i-h3-nanopi-neo.dtb .include From owner-svn-src-all@freebsd.org Tue Aug 1 18:46:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 397CCDB6A42; Tue, 1 Aug 2017 18:46:26 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 067E3649A6; Tue, 1 Aug 2017 18:46:25 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v71IkPLc081012; Tue, 1 Aug 2017 18:46:25 GMT (envelope-from emax@FreeBSD.org) Received: (from emax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71IkP8X081011; Tue, 1 Aug 2017 18:46:25 GMT (envelope-from emax@FreeBSD.org) Message-Id: <201708011846.v71IkP8X081011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emax set sender to emax@FreeBSD.org using -f From: Maksim Yevmenkin Date: Tue, 1 Aug 2017 18:46:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321889 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: emax X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321889 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 18:46:26 -0000 Author: emax Date: Tue Aug 1 18:46:24 2017 New Revision: 321889 URL: https://svnweb.freebsd.org/changeset/base/321889 Log: add myself Requested by: mckusick Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Tue Aug 1 18:33:27 2017 (r321888) +++ head/usr.bin/calendar/calendars/calendar.freebsd Tue Aug 1 18:46:24 2017 (r321889) @@ -326,6 +326,7 @@ 09/12 Benedict Christopher Reuschling born in Darmstadt, Germany, 1981 09/12 William C. Fumerola II born in Detroit, Michigan, United States, 1981 09/14 Matthew Seaman born in Bristol, United Kingdom, 1965 +09/16 Maksim Yevmenkin born in Taganrog, USSR, 1974 09/15 Aleksandr Rybalko born in Odessa, Ukraine, 1977 09/15 Dima Panov born in Khabarovsk, Russian Federation, 1978 09/17 Maxim Bolotin born in Rostov-on-Don, Russian Federation, 1976 From owner-svn-src-all@freebsd.org Tue Aug 1 18:48:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8302CDB6AE8; Tue, 1 Aug 2017 18:48:10 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D2EB64B3C; Tue, 1 Aug 2017 18:48:10 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v71Im9s9081109; Tue, 1 Aug 2017 18:48:09 GMT (envelope-from emax@FreeBSD.org) Received: (from emax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71Im91T081108; Tue, 1 Aug 2017 18:48:09 GMT (envelope-from emax@FreeBSD.org) Message-Id: <201708011848.v71Im91T081108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emax set sender to emax@FreeBSD.org using -f From: Maksim Yevmenkin Date: Tue, 1 Aug 2017 18:48:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321890 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: emax X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321890 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 18:48:10 -0000 Author: emax Date: Tue Aug 1 18:48:09 2017 New Revision: 321890 URL: https://svnweb.freebsd.org/changeset/base/321890 Log: fix sort order Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Tue Aug 1 18:46:24 2017 (r321889) +++ head/usr.bin/calendar/calendars/calendar.freebsd Tue Aug 1 18:48:09 2017 (r321890) @@ -326,9 +326,9 @@ 09/12 Benedict Christopher Reuschling born in Darmstadt, Germany, 1981 09/12 William C. Fumerola II born in Detroit, Michigan, United States, 1981 09/14 Matthew Seaman born in Bristol, United Kingdom, 1965 -09/16 Maksim Yevmenkin born in Taganrog, USSR, 1974 09/15 Aleksandr Rybalko born in Odessa, Ukraine, 1977 09/15 Dima Panov born in Khabarovsk, Russian Federation, 1978 +09/16 Maksim Yevmenkin born in Taganrog, USSR, 1974 09/17 Maxim Bolotin born in Rostov-on-Don, Russian Federation, 1976 09/18 Matthew Fleming born in Cleveland, Ohio, United States, 1975 09/20 Kevin Lo born in Taipei, Taiwan, Republic of China, 1972 From owner-svn-src-all@freebsd.org Tue Aug 1 19:22:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91E96DB7441; Tue, 1 Aug 2017 19:22:01 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F39C65CB4; Tue, 1 Aug 2017 19:22:01 +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 v71JM0GQ097470; Tue, 1 Aug 2017 19:22:00 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71JM0fn097469; Tue, 1 Aug 2017 19:22:00 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201708011922.v71JM0fn097469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 1 Aug 2017 19:22:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321891 - head/sys/boot/fdt/dts/arm X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/boot/fdt/dts/arm X-SVN-Commit-Revision: 321891 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 19:22:01 -0000 Author: manu Date: Tue Aug 1 19:22:00 2017 New Revision: 321891 URL: https://svnweb.freebsd.org/changeset/base/321891 Log: Alwinner: nanopi-neo: Remove r_i2c node from DTS as it isn't used on the board Modified: head/sys/boot/fdt/dts/arm/nanopi-neo.dts Modified: head/sys/boot/fdt/dts/arm/nanopi-neo.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/nanopi-neo.dts Tue Aug 1 18:48:09 2017 (r321890) +++ head/sys/boot/fdt/dts/arm/nanopi-neo.dts Tue Aug 1 19:22:00 2017 (r321891) @@ -46,10 +46,6 @@ }; }; -&r_i2c { - status = "okay"; -}; - &emac { phy = <&phy1>; phy-mode = "mii"; From owner-svn-src-all@freebsd.org Tue Aug 1 19:29:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4042DB77CF; Tue, 1 Aug 2017 19:29:17 +0000 (UTC) (envelope-from tcberner@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7DCD1660CF; Tue, 1 Aug 2017 19:29:17 +0000 (UTC) (envelope-from tcberner@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v71JTGAh097881; Tue, 1 Aug 2017 19:29:16 GMT (envelope-from tcberner@FreeBSD.org) Received: (from tcberner@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71JTGZt097880; Tue, 1 Aug 2017 19:29:16 GMT (envelope-from tcberner@FreeBSD.org) Message-Id: <201708011929.v71JTGZt097880@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tcberner set sender to tcberner@FreeBSD.org using -f From: "Tobias C. Berner" Date: Tue, 1 Aug 2017 19:29:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321892 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: tcberner X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321892 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 19:29:17 -0000 Author: tcberner (ports committer) Date: Tue Aug 1 19:29:16 2017 New Revision: 321892 URL: https://svnweb.freebsd.org/changeset/base/321892 Log: Add joneum to the calendar.freebsd Reported by: mckusick Submitted by: joneum Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Tue Aug 1 19:22:00 2017 (r321891) +++ head/usr.bin/calendar/calendars/calendar.freebsd Tue Aug 1 19:29:16 2017 (r321892) @@ -420,6 +420,7 @@ 12/22 Maxim Sobolev born in Dnepropetrovsk, Ukraine, 1976 12/23 Sean Chittenden born in Seattle, Washington, United States, 1979 12/23 Alejandro Pulver born in Buenos Aires, Argentina, 1989 +12/24 Jochen Neumeister born in Heidenheim, Germany, 1975 12/24 Guido Falsi born in Firenze, Italy, 1978 12/25 Niclas Zeising born in Stockholm, Sweden, 1986 12/28 Soren Schmidt born in Maribo, Denmark, 1960 From owner-svn-src-all@freebsd.org Tue Aug 1 20:16:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9243DBC484; Tue, 1 Aug 2017 20:16:01 +0000 (UTC) (envelope-from taras@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 760F167502; Tue, 1 Aug 2017 20:16:01 +0000 (UTC) (envelope-from taras@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v71KG0LU018020; Tue, 1 Aug 2017 20:16:00 GMT (envelope-from taras@FreeBSD.org) Received: (from taras@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71KG0dY018019; Tue, 1 Aug 2017 20:16:00 GMT (envelope-from taras@FreeBSD.org) Message-Id: <201708012016.v71KG0dY018019@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: taras set sender to taras@FreeBSD.org using -f From: Taras Korenko Date: Tue, 1 Aug 2017 20:16:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321893 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: taras X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321893 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 20:16:01 -0000 Author: taras (doc committer) Date: Tue Aug 1 20:16:00 2017 New Revision: 321893 URL: https://svnweb.freebsd.org/changeset/base/321893 Log: + Add myself to calendar.freebsd. Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Tue Aug 1 19:29:16 2017 (r321892) +++ head/usr.bin/calendar/calendars/calendar.freebsd Tue Aug 1 20:16:00 2017 (r321893) @@ -373,6 +373,7 @@ 10/26 Matthew Ahrens born in United States, 1979 10/26 Philip M. Gollucci born in Silver Spring, Maryland, United States, 1979 10/27 Takanori Watanabe born in Numazu, Shizuoka, Japan, 1972 +10/31 Taras Korenko born in Cherkasy region, Ukraine, 1980 11/05 M. Warner Losh born in Kansas City, Kansas, United States, 1966 11/06 Michael Zhilin born in Stary Oskol, USSR, 1985 11/08 Joseph R. Mingrone born in Charlottetown, Prince Edward Island, Canada, 1976 From owner-svn-src-all@freebsd.org Tue Aug 1 20:28:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84F13DBC6FE; Tue, 1 Aug 2017 20:28:12 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5275A67985; Tue, 1 Aug 2017 20:28:12 +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 v71KSB3j022507; Tue, 1 Aug 2017 20:28:11 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71KSBeC022506; Tue, 1 Aug 2017 20:28:11 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201708012028.v71KSBeC022506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 1 Aug 2017 20:28:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321894 - head/sys/modules/dtb/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/modules/dtb/allwinner X-SVN-Commit-Revision: 321894 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 20:28:12 -0000 Author: manu Date: Tue Aug 1 20:28:11 2017 New Revision: 321894 URL: https://svnweb.freebsd.org/changeset/base/321894 Log: Allwinner dtb: Add NanoPi M1 to the build It was tested on NanoPi M1 Plus. Modified: head/sys/modules/dtb/allwinner/Makefile Modified: head/sys/modules/dtb/allwinner/Makefile ============================================================================== --- head/sys/modules/dtb/allwinner/Makefile Tue Aug 1 20:16:00 2017 (r321893) +++ head/sys/modules/dtb/allwinner/Makefile Tue Aug 1 20:28:11 2017 (r321894) @@ -14,6 +14,7 @@ DTS= \ sun7i-a20-olimex-som-evb.dts \ sun7i-a20-pcduino3.dts \ sun8i-h2-plus-orangepi-zero.dts \ + sun8i-h3-nanopi-m1.dts \ sun8i-h3-orangepi-one.dts LINKS= \ From owner-svn-src-all@freebsd.org Tue Aug 1 21:41:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C4AADBDE72; Tue, 1 Aug 2017 21:41:15 +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 mx1.freebsd.org (Postfix) with ESMTPS id 66AAB6A2FE; Tue, 1 Aug 2017 21:41:15 +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 v71LfEhD054014; Tue, 1 Aug 2017 21:41:14 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71LfExB054013; Tue, 1 Aug 2017 21:41:14 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201708012141.v71LfExB054013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Tue, 1 Aug 2017 21:41:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321895 - stable/10/usr.sbin/tzsetup X-SVN-Group: stable-10 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: stable/10/usr.sbin/tzsetup X-SVN-Commit-Revision: 321895 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 21:41:15 -0000 Author: marius Date: Tue Aug 1 21:41:14 2017 New Revision: 321895 URL: https://svnweb.freebsd.org/changeset/base/321895 Log: MFC: r281733, r298033, r301131 - Remove set but unused variable. - Use NULL instead of 0 for pointers. - Fix tzsetup not installing /etc/localtime for UTC. Modified: stable/10/usr.sbin/tzsetup/tzsetup.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- stable/10/usr.sbin/tzsetup/tzsetup.c Tue Aug 1 20:28:11 2017 (r321894) +++ stable/10/usr.sbin/tzsetup/tzsetup.c Tue Aug 1 21:41:14 2017 (r321895) @@ -198,6 +198,7 @@ static char *chrootenv = NULL; static void usage(void); static int confirm_zone(const char *filename); static int continent_country_menu(dialogMenuItem *); +static int install_zoneinfo(const char *zoneinfo); static int install_zoneinfo_file(const char *zoneinfo_file); static int set_zone_multi(dialogMenuItem *); static int set_zone_whole_country(dialogMenuItem *); @@ -343,7 +344,7 @@ read_iso3166_table(void) err(1, "%s", path_iso3166); lineno = 0; - while ((s = fgetln(fp, &len)) != 0) { + while ((s = fgetln(fp, &len)) != NULL) { lineno++; if (s[len - 1] != '\n') errx(1, "%s:%d: invalid format", path_iso3166, lineno); @@ -353,7 +354,7 @@ read_iso3166_table(void) /* Isolate the two-letter code. */ t = strsep(&s, "\t"); - if (t == 0 || strlen(t) != 2) + if (t == NULL || strlen(t) != 2) errx(1, "%s:%d: invalid format", path_iso3166, lineno); if (t[0] < 'A' || t[0] > 'Z' || t[1] < 'A' || t[1] > 'Z') errx(1, "%s:%d: invalid code `%s'", path_iso3166, @@ -361,10 +362,10 @@ read_iso3166_table(void) /* Now skip past the three-letter and numeric codes. */ name = strsep(&s, "\t"); /* 3-let */ - if (name == 0 || strlen(name) != 3) + if (name == NULL || strlen(name) != 3) errx(1, "%s:%d: invalid format", path_iso3166, lineno); name = strsep(&s, "\t"); /* numeric */ - if (name == 0 || strlen(name) != 3) + if (name == NULL || strlen(name) != 3) errx(1, "%s:%d: invalid format", path_iso3166, lineno); name = s; @@ -406,7 +407,7 @@ add_zone_to_country(int lineno, const char *tlc, const path_zonetab, lineno); zp = malloc(sizeof(*zp)); - if (zp == 0) + if (zp == NULL) errx(1, "malloc(%zu)", sizeof(*zp)); if (cp->nzones == 0) @@ -474,7 +475,7 @@ read_zones(void) FILE *fp; struct continent *cont; size_t len; - char *line, *tlc, *coord, *file, *descr, *p; + char *line, *tlc, *file, *descr, *p; int lineno; fp = fopen(path_zonetab, "r"); @@ -482,7 +483,7 @@ read_zones(void) err(1, "%s", path_zonetab); lineno = 0; - while ((line = fgetln(fp, &len)) != 0) { + while ((line = fgetln(fp, &len)) != NULL) { lineno++; if (line[len - 1] != '\n') errx(1, "%s:%d: invalid format", path_zonetab, lineno); @@ -494,10 +495,10 @@ read_zones(void) if (strlen(tlc) != 2) errx(1, "%s:%d: invalid country code `%s'", path_zonetab, lineno, tlc); - coord = strsep(&line, "\t"); /* Unused */ + /* coord = */ strsep(&line, "\t"); /* Unused */ file = strsep(&line, "\t"); p = strchr(file, '/'); - if (p == 0) + if (p == NULL) errx(1, "%s:%d: invalid zone name `%s'", path_zonetab, lineno, file); contbuf[0] = '\0'; @@ -557,7 +558,7 @@ make_menus(void) continent_names[i].continent->menu = malloc(sizeof(dialogMenuItem) * continent_names[i].continent->nitems); - if (continent_names[i].continent->menu == 0) + if (continent_names[i].continent->menu == NULL) errx(1, "malloc for continent menu"); continent_names[i].continent->nitems = 0; continents[i].prompt = continent_items[i].prompt; @@ -632,13 +633,13 @@ set_zone_menu(dialogMenuItem *dmi) return (DITEM_LEAVE_MENU); } -int +static int set_zone_utc(void) { if (!confirm_zone(NULL)) return (DITEM_FAILURE | DITEM_RECREATE); - return (install_zoneinfo_file(NULL)); + return (install_zoneinfo("UTC")); } static int From owner-svn-src-all@freebsd.org Tue Aug 1 23:14:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7D22DBFAF7; Tue, 1 Aug 2017 23:14:39 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 366036CCCD; Tue, 1 Aug 2017 23:14:39 +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 v71NEcQm091617; Tue, 1 Aug 2017 23:14:38 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v71NEcUj091616; Tue, 1 Aug 2017 23:14:38 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201708012314.v71NEcUj091616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 1 Aug 2017 23:14:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321896 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 321896 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.23 Precedence: list List-Id: "SVN commit messages 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, 01 Aug 2017 23:14:39 -0000 Author: markj Date: Tue Aug 1 23:14:38 2017 New Revision: 321896 URL: https://svnweb.freebsd.org/changeset/base/321896 Log: Amend r321884 to check the refcount and update the class with w_mtx held. Reviewed by: jhb X-MFC with: r321884 Modified: head/sys/kern/subr_witness.c Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Tue Aug 1 21:41:14 2017 (r321895) +++ head/sys/kern/subr_witness.c Tue Aug 1 23:14:38 2017 (r321896) @@ -1849,10 +1849,10 @@ enroll(const char *description, struct lock_class *loc return (w); found: w->w_refcount++; - mtx_unlock_spin(&w_mtx); if (w->w_refcount == 1) w->w_class = lock_class; - else if (lock_class != w->w_class) + mtx_unlock_spin(&w_mtx); + if (lock_class != w->w_class) kassert_panic( "lock (%s) %s does not match earlier (%s) lock", description, lock_class->lc_name, From owner-svn-src-all@freebsd.org Wed Aug 2 00:51:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCE6ADC15CB; Wed, 2 Aug 2017 00:51:57 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA4276F256; Wed, 2 Aug 2017 00:51:57 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v720puuP030901; Wed, 2 Aug 2017 00:51:56 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v720puu3030900; Wed, 2 Aug 2017 00:51:56 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201708020051.v720puu3030900@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 2 Aug 2017 00:51:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321897 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321897 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 00:51:58 -0000 Author: ngie Date: Wed Aug 2 00:51:56 2017 New Revision: 321897 URL: https://svnweb.freebsd.org/changeset/base/321897 Log: Revert accidental character conversion for pfg's entry, done in r321886 Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Tue Aug 1 23:14:38 2017 (r321896) +++ head/usr.bin/calendar/calendars/calendar.freebsd Wed Aug 2 00:51:56 2017 (r321897) @@ -359,7 +359,7 @@ 10/18 Vladimir Kondratyev born in Ryazan, USSR, 1975 10/19 Nicholas Souchu born in Suresnes, Hauts-de-Seine, France, 1972 10/19 Nick Barkas born in Longview, Washington, United States, 1981 -10/19 Pedro Giffuni born in Bogoto, Colombia, 1968 +10/19 Pedro Giffuni born in Bogotá, Colombia, 1968 10/20 Joel Dahl born in Bitterna, Skaraborg, Sweden, 1983 10/20 Dmitry Marakasov born in Moscow, Russian Federation, 1984 10/21 Ben Smithurst born in Sheffield, South Yorkshire, United Kingdom, 1981 From owner-svn-src-all@freebsd.org Wed Aug 2 01:43:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 569E3DC26EE; Wed, 2 Aug 2017 01:43:37 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 335F17090F; Wed, 2 Aug 2017 01:43:37 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v721haaD051973; Wed, 2 Aug 2017 01:43:36 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v721hZsr051968; Wed, 2 Aug 2017 01:43:35 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201708020143.v721hZsr051968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Wed, 2 Aug 2017 01:43:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321899 - in head/sys/amd64: amd64 include linux X-SVN-Group: head X-SVN-Commit-Author: truckman X-SVN-Commit-Paths: in head/sys/amd64: amd64 include linux X-SVN-Commit-Revision: 321899 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 01:43:37 -0000 Author: truckman Date: Wed Aug 2 01:43:35 2017 New Revision: 321899 URL: https://svnweb.freebsd.org/changeset/base/321899 Log: Lower the amd64 shared page, which contains the signal trampoline, from the top of user memory to one page lower on machines with the Ryzen (AMD Family 17h) CPU. This pushes ps_strings and the stack down by one page as well. On Ryzen there is some sort of interaction between code running at the top of user memory address space and interrupts that can cause FreeBSD to either hang or silently reset. This sounds similar to the problem found with DragonFly BSD that was fixed with this commit: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/b48dd28447fc8ef62fbc963accd301557fd9ac20 but our signal trampoline location was already lower than the address that DragonFly moved their signal trampoline to. It also does not appear to be related to SMT as described here: https://www.phoronix.com/forums/forum/hardware/processors-memory/955368-some-ryzen-linux-users-are-facing-issues-with-heavy-compilation-loads?p=955498#post955498 "Hi, Matt Dillon here. Yes, I did find what I believe to be a hardware issue with Ryzen related to concurrent operations. In a nutshell, for any given hyperthread pair, if one hyperthread is in a cpu-bound loop of any kind (can be in user mode), and the other hyperthread is returning from an interrupt via IRETQ, the hyperthread issuing the IRETQ can stall indefinitely until the other hyperthread with the cpu-bound loop pauses (aka HLT until next interrupt). After this situation occurs, the system appears to destabilize. The situation does not occur if the cpu-bound loop is on a different core than the core doing the IRETQ. The %rip the IRETQ returns to (e.g. userland %rip address) matters a *LOT*. The problem occurs more often with high %rip addresses such as near the top of the user stack, which is where DragonFly's signal trampoline traditionally resides. So a user program taking a signal on one thread while another thread is cpu-bound can cause this behavior. Changing the location of the signal trampoline makes it more difficult to reproduce the problem. I have not been because the able to completely mitigate it. When a cpu-thread stalls in this manner it appears to stall INSIDE the microcode for IRETQ. It doesn't make it to the return pc, and the cpu thread cannot take any IPIs or other hardware interrupts while in this state." since the system instability has been observed on FreeBSD with SMT disabled. Interrupts to appear to play a factor since running a signal-intensive process on the first CPU core, which handles most of the interrupts on my machine, is far more likely to trigger the problem than running such a process on any other core. Also lower sv_maxuser to prevent a malicious user from using mmap() to load and execute code in the top page of user memory that was made available when the shared page was moved down. Make the same changes to the 64-bit Linux emulator. PR: 219399 Reported by: nbe@renzel.net Reviewed by: kib Reviewed by: dchagin (previous version) Tested by: nbe@renzel.net (earlier version) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D11780 Modified: head/sys/amd64/amd64/elf_machdep.c head/sys/amd64/amd64/initcpu.c head/sys/amd64/include/md_var.h head/sys/amd64/linux/linux_sysvec.c Modified: head/sys/amd64/amd64/elf_machdep.c ============================================================================== --- head/sys/amd64/amd64/elf_machdep.c Wed Aug 2 01:23:17 2017 (r321898) +++ head/sys/amd64/amd64/elf_machdep.c Wed Aug 2 01:43:35 2017 (r321899) @@ -84,6 +84,25 @@ struct sysentvec elf64_freebsd_sysvec = { }; INIT_SYSENTVEC(elf64_sysvec, &elf64_freebsd_sysvec); +void +amd64_lower_shared_page(struct sysentvec *sv) +{ + if (hw_lower_amd64_sharedpage != 0) { + sv->sv_maxuser -= PAGE_SIZE; + sv->sv_shared_page_base -= PAGE_SIZE; + sv->sv_usrstack -= PAGE_SIZE; + sv->sv_psstrings -= PAGE_SIZE; + } +} + +/* + * Do this fixup before INIT_SYSENTVEC (SI_ORDER_ANY) because the latter + * uses the value of sv_shared_page_base. + */ +SYSINIT(elf64_sysvec_fixup, SI_SUB_EXEC, SI_ORDER_FIRST, + (sysinit_cfunc_t) amd64_lower_shared_page, + &elf64_freebsd_sysvec); + static Elf64_Brandinfo freebsd_brand_info = { .brand = ELFOSABI_FREEBSD, .machine = EM_X86_64, Modified: head/sys/amd64/amd64/initcpu.c ============================================================================== --- head/sys/amd64/amd64/initcpu.c Wed Aug 2 01:23:17 2017 (r321898) +++ head/sys/amd64/amd64/initcpu.c Wed Aug 2 01:43:35 2017 (r321899) @@ -48,6 +48,11 @@ __FBSDID("$FreeBSD$"); static int hw_instruction_sse; SYSCTL_INT(_hw, OID_AUTO, instruction_sse, CTLFLAG_RD, &hw_instruction_sse, 0, "SIMD/MMX2 instructions available in CPU"); +static int lower_sharedpage_init; +int hw_lower_amd64_sharedpage; +SYSCTL_INT(_hw, OID_AUTO, lower_amd64_sharedpage, CTLFLAG_RDTUN, + &hw_lower_amd64_sharedpage, 0, + "Lower sharedpage to work around Ryzen issue with executing code near the top of user memory"); /* * -1: automatic (default) * 0: keep enable CLFLUSH @@ -120,6 +125,28 @@ init_amd(void) msr = rdmsr(0xc0011020); msr |= (uint64_t)1 << 15; wrmsr(0xc0011020, msr); + } + } + + /* + * Work around a problem on Ryzen that is triggered by executing + * code near the top of user memory, in our case the signal + * trampoline code in the shared page on amd64. + * + * This function is executed once for the BSP before tunables take + * effect so the value determined here can be overridden by the + * tunable. This function is then executed again for each AP and + * also on resume. Set a flag the first time so that value set by + * the tunable is not overwritten. + * + * The stepping and/or microcode versions should be checked after + * this issue is fixed by AMD so that we don't use this mode if not + * needed. + */ + if (lower_sharedpage_init == 0) { + lower_sharedpage_init = 1; + if (CPUID_TO_FAMILY(cpu_id) == 0x17) { + hw_lower_amd64_sharedpage = 1; } } } Modified: head/sys/amd64/include/md_var.h ============================================================================== --- head/sys/amd64/include/md_var.h Wed Aug 2 01:23:17 2017 (r321898) +++ head/sys/amd64/include/md_var.h Wed Aug 2 01:43:35 2017 (r321899) @@ -34,11 +34,14 @@ #include -extern uint64_t *vm_page_dump; +extern uint64_t *vm_page_dump; +extern int hw_lower_amd64_sharedpage; struct savefpu; +struct sysentvec; void amd64_db_resume_dbreg(void); +void amd64_lower_shared_page(struct sysentvec *); void amd64_syscall(struct thread *td, int traced); void doreti_iret(void) __asm(__STRING(doreti_iret)); void doreti_iret_fault(void) __asm(__STRING(doreti_iret_fault)); Modified: head/sys/amd64/linux/linux_sysvec.c ============================================================================== --- head/sys/amd64/linux/linux_sysvec.c Wed Aug 2 01:23:17 2017 (r321898) +++ head/sys/amd64/linux/linux_sysvec.c Wed Aug 2 01:43:35 2017 (r321899) @@ -833,6 +833,8 @@ static void linux_vdso_install(void *param) { + amd64_lower_shared_page(&elf_linux_sysvec); + linux_szsigcode = (&_binary_linux_locore_o_end - &_binary_linux_locore_o_start); From owner-svn-src-all@freebsd.org Wed Aug 2 05:17:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D044DC6355; Wed, 2 Aug 2017 05:17:03 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DDEED75ED5; Wed, 2 Aug 2017 05:17:02 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v725H2gv037802; Wed, 2 Aug 2017 05:17:02 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v725H2QX037801; Wed, 2 Aug 2017 05:17:02 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201708020517.v725H2QX037801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 2 Aug 2017 05:17: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: r321904 - stable/11/sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/11/sys/sys X-SVN-Commit-Revision: 321904 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 05:17:03 -0000 Author: delphij Date: Wed Aug 2 05:17:01 2017 New Revision: 321904 URL: https://svnweb.freebsd.org/changeset/base/321904 Log: MFC r321713: Bump copyright year. Modified: stable/11/sys/sys/copyright.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/sys/copyright.h ============================================================================== --- stable/11/sys/sys/copyright.h Wed Aug 2 03:18:24 2017 (r321903) +++ stable/11/sys/sys/copyright.h Wed Aug 2 05:17:01 2017 (r321904) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 1992-2016 The FreeBSD Project. All rights reserved. + * Copyright (C) 1992-2017 The FreeBSD Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions From owner-svn-src-all@freebsd.org Wed Aug 2 05:17:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1606DC63CF; Wed, 2 Aug 2017 05:17:48 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 987BB76006; Wed, 2 Aug 2017 05:17:48 +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 v725HlG2037879; Wed, 2 Aug 2017 05:17:47 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v725HlLc037878; Wed, 2 Aug 2017 05:17:47 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201708020517.v725HlLc037878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 2 Aug 2017 05:17:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321905 - stable/10/sys/sys X-SVN-Group: stable-10 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/10/sys/sys X-SVN-Commit-Revision: 321905 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 05:17:48 -0000 Author: delphij Date: Wed Aug 2 05:17:47 2017 New Revision: 321905 URL: https://svnweb.freebsd.org/changeset/base/321905 Log: MFC r321713: Bump copyright year. Modified: stable/10/sys/sys/copyright.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/copyright.h ============================================================================== --- stable/10/sys/sys/copyright.h Wed Aug 2 05:17:01 2017 (r321904) +++ stable/10/sys/sys/copyright.h Wed Aug 2 05:17:47 2017 (r321905) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 1992-2016 The FreeBSD Project. All rights reserved. + * Copyright (C) 1992-2017 The FreeBSD Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions From owner-svn-src-all@freebsd.org Wed Aug 2 05:30:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80010DC682C; Wed, 2 Aug 2017 05:30:42 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3FD707653D; Wed, 2 Aug 2017 05:30:42 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v725UfUF043852; Wed, 2 Aug 2017 05:30:41 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v725UffE043835; Wed, 2 Aug 2017 05:30:41 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201708020530.v725UffE043835@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 2 Aug 2017 05:30: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: r321906 - stable/11/sbin/init X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/11/sbin/init X-SVN-Commit-Revision: 321906 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 05:30:42 -0000 Author: delphij Date: Wed Aug 2 05:30:41 2017 New Revision: 321906 URL: https://svnweb.freebsd.org/changeset/base/321906 Log: MFC r320761: - Use strlcat() instead of strncat(). - Use asprintf() and handle allocation errors. Modified: stable/11/sbin/init/init.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/init/init.c ============================================================================== --- stable/11/sbin/init/init.c Wed Aug 2 05:17:47 2017 (r321905) +++ stable/11/sbin/init/init.c Wed Aug 2 05:30:41 2017 (r321906) @@ -1271,8 +1271,8 @@ new_session(session_t *sprev, struct ttyent *typ) sp->se_flags |= SE_PRESENT; - sp->se_device = malloc(sizeof(_PATH_DEV) + strlen(typ->ty_name)); - sprintf(sp->se_device, "%s%s", _PATH_DEV, typ->ty_name); + if (asprintf(&sp->se_device, "%s%s", _PATH_DEV, typ->ty_name) < 0) + err(1, "asprintf"); /* * Attempt to open the device, if we get "device not configured" @@ -1315,8 +1315,8 @@ setupargv(session_t *sp, struct ttyent *typ) free(sp->se_getty_argv_space); free(sp->se_getty_argv); } - sp->se_getty = malloc(strlen(typ->ty_getty) + strlen(typ->ty_name) + 2); - sprintf(sp->se_getty, "%s %s", typ->ty_getty, typ->ty_name); + if (asprintf(&sp->se_getty, "%s %s", typ->ty_getty, typ->ty_name) < 0) + err(1, "asprintf"); sp->se_getty_argv_space = strdup(sp->se_getty); sp->se_getty_argv = construct_argv(sp->se_getty_argv_space); if (sp->se_getty_argv == NULL) { @@ -1429,7 +1429,7 @@ start_window_system(session_t *sp) if (sp->se_type) { /* Don't use malloc after fork */ strcpy(term, "TERM="); - strncat(term, sp->se_type, sizeof(term) - 6); + strlcat(term, sp->se_type, sizeof(term)); env[0] = term; env[1] = 0; } @@ -1493,7 +1493,7 @@ start_getty(session_t *sp) if (sp->se_type) { /* Don't use malloc after fork */ strcpy(term, "TERM="); - strncat(term, sp->se_type, sizeof(term) - 6); + strlcat(term, sp->se_type, sizeof(term)); env[0] = term; env[1] = 0; } else From owner-svn-src-all@freebsd.org Wed Aug 2 05:47:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 643D7DC6B69; Wed, 2 Aug 2017 05:47:27 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 261B576B9F; Wed, 2 Aug 2017 05:47:27 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v725lQQS050061; Wed, 2 Aug 2017 05:47:26 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v725lQ8G050060; Wed, 2 Aug 2017 05:47:26 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201708020547.v725lQ8G050060@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 2 Aug 2017 05:47:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321907 - stable/10/sbin/init X-SVN-Group: stable-10 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/10/sbin/init X-SVN-Commit-Revision: 321907 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 05:47:27 -0000 Author: delphij Date: Wed Aug 2 05:47:26 2017 New Revision: 321907 URL: https://svnweb.freebsd.org/changeset/base/321907 Log: MFC r320761: - Use strlcat() instead of strncat(). - Use asprintf() and handle allocation errors. Modified: stable/10/sbin/init/init.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/init/init.c ============================================================================== --- stable/10/sbin/init/init.c Wed Aug 2 05:30:41 2017 (r321906) +++ stable/10/sbin/init/init.c Wed Aug 2 05:47:26 2017 (r321907) @@ -1278,8 +1278,8 @@ new_session(session_t *sprev, int session_index, struc sp->se_index = session_index; sp->se_flags |= SE_PRESENT; - sp->se_device = malloc(sizeof(_PATH_DEV) + strlen(typ->ty_name)); - sprintf(sp->se_device, "%s%s", _PATH_DEV, typ->ty_name); + if (asprintf(&sp->se_device, "%s%s", _PATH_DEV, typ->ty_name) < 0) + err(1, "asprintf"); /* * Attempt to open the device, if we get "device not configured" @@ -1322,8 +1322,8 @@ setupargv(session_t *sp, struct ttyent *typ) free(sp->se_getty_argv_space); free(sp->se_getty_argv); } - sp->se_getty = malloc(strlen(typ->ty_getty) + strlen(typ->ty_name) + 2); - sprintf(sp->se_getty, "%s %s", typ->ty_getty, typ->ty_name); + if (asprintf(&sp->se_getty, "%s %s", typ->ty_getty, typ->ty_name) < 0) + err(1, "asprintf"); sp->se_getty_argv_space = strdup(sp->se_getty); sp->se_getty_argv = construct_argv(sp->se_getty_argv_space); if (sp->se_getty_argv == 0) { @@ -1437,7 +1437,7 @@ start_window_system(session_t *sp) if (sp->se_type) { /* Don't use malloc after fork */ strcpy(term, "TERM="); - strncat(term, sp->se_type, sizeof(term) - 6); + strlcat(term, sp->se_type, sizeof(term)); env[0] = term; env[1] = 0; } @@ -1501,7 +1501,7 @@ start_getty(session_t *sp) if (sp->se_type) { /* Don't use malloc after fork */ strcpy(term, "TERM="); - strncat(term, sp->se_type, sizeof(term) - 6); + strlcat(term, sp->se_type, sizeof(term)); env[0] = term; env[1] = 0; } else From owner-svn-src-all@freebsd.org Wed Aug 2 07:58:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A1F4DC8CAE; Wed, 2 Aug 2017 07:58:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD3967E140; Wed, 2 Aug 2017 07:58:37 +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 v727wblj002330; Wed, 2 Aug 2017 07:58:37 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v727wb4p002329; Wed, 2 Aug 2017 07:58:37 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708020758.v727wb4p002329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 2 Aug 2017 07:58:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321908 - stable/11/sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/sys X-SVN-Commit-Revision: 321908 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 07:58:38 -0000 Author: kib Date: Wed Aug 2 07:58:36 2017 New Revision: 321908 URL: https://svnweb.freebsd.org/changeset/base/321908 Log: MFC r321512: Mark name_PCTRIE_LOOKUP_LE() generated function unused. Modified: stable/11/sys/sys/pctrie.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/sys/pctrie.h ============================================================================== --- stable/11/sys/sys/pctrie.h Wed Aug 2 05:47:26 2017 (r321907) +++ stable/11/sys/sys/pctrie.h Wed Aug 2 07:58:36 2017 (r321908) @@ -76,7 +76,7 @@ name##_PCTRIE_LOOKUP(struct pctrie *ptree, uint64_t ke return name##_PCTRIE_VAL2PTR(pctrie_lookup(ptree, key)); \ } \ \ -static __inline struct type * \ +static __inline __unused struct type * \ name##_PCTRIE_LOOKUP_LE(struct pctrie *ptree, uint64_t key) \ { \ \ From owner-svn-src-all@freebsd.org Wed Aug 2 08:03:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA6B3DC914D; Wed, 2 Aug 2017 08:03:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 782907E63E; Wed, 2 Aug 2017 08:03:41 +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 v7283erC006187; Wed, 2 Aug 2017 08:03:40 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7283enl006186; Wed, 2 Aug 2017 08:03:40 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708020803.v7283enl006186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 2 Aug 2017 08:03:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321909 - stable/11/sys/fs/nfsclient X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/fs/nfsclient X-SVN-Commit-Revision: 321909 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 08:03:41 -0000 Author: kib Date: Wed Aug 2 08:03:40 2017 New Revision: 321909 URL: https://svnweb.freebsd.org/changeset/base/321909 Log: MFC r321580: Move rtvals initialization out of the region protected by NFS node lock. Modified: stable/11/sys/fs/nfsclient/nfs_clbio.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- stable/11/sys/fs/nfsclient/nfs_clbio.c Wed Aug 2 07:58:36 2017 (r321908) +++ stable/11/sys/fs/nfsclient/nfs_clbio.c Wed Aug 2 08:03:40 2017 (r321909) @@ -306,10 +306,6 @@ ncl_putpages(struct vop_putpages_args *ap) printf("ncl_putpages: called on noncache-able vnode\n"); mtx_lock(&np->n_mtx); } - - for (i = 0; i < npages; i++) - rtvals[i] = VM_PAGER_ERROR; - /* * When putting pages, do not extend file past EOF. */ @@ -319,6 +315,9 @@ ncl_putpages(struct vop_putpages_args *ap) count = 0; } mtx_unlock(&np->n_mtx); + + for (i = 0; i < npages; i++) + rtvals[i] = VM_PAGER_ERROR; PCPU_INC(cnt.v_vnodeout); PCPU_ADD(cnt.v_vnodepgsout, count); From owner-svn-src-all@freebsd.org Wed Aug 2 08:07:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A243DC9356; Wed, 2 Aug 2017 08:07:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 048A27E890; Wed, 2 Aug 2017 08:07:14 +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 v7287E2V006357; Wed, 2 Aug 2017 08:07:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7287DsY006353; Wed, 2 Aug 2017 08:07:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708020807.v7287DsY006353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 2 Aug 2017 08: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: r321910 - in stable/11/sys: fs/nfsclient fs/smbfs vm X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys: fs/nfsclient fs/smbfs vm X-SVN-Commit-Revision: 321910 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 08:07:15 -0000 Author: kib Date: Wed Aug 2 08:07:13 2017 New Revision: 321910 URL: https://svnweb.freebsd.org/changeset/base/321910 Log: MFC r321581: Mark pages after EOF as clean after pageout. Modified: stable/11/sys/fs/nfsclient/nfs_clbio.c stable/11/sys/fs/smbfs/smbfs_io.c stable/11/sys/vm/vnode_pager.c stable/11/sys/vm/vnode_pager.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- stable/11/sys/fs/nfsclient/nfs_clbio.c Wed Aug 2 08:03:40 2017 (r321909) +++ stable/11/sys/fs/nfsclient/nfs_clbio.c Wed Aug 2 08:07:13 2017 (r321910) @@ -336,8 +336,10 @@ ncl_putpages(struct vop_putpages_args *ap) cred); crfree(cred); - if (error == 0 || !nfs_keep_dirty_on_error) - vnode_pager_undirty_pages(pages, rtvals, count - uio.uio_resid); + if (error == 0 || !nfs_keep_dirty_on_error) { + vnode_pager_undirty_pages(pages, rtvals, count - uio.uio_resid, + np->n_size - offset, npages * PAGE_SIZE); + } return (rtvals[0]); } Modified: stable/11/sys/fs/smbfs/smbfs_io.c ============================================================================== --- stable/11/sys/fs/smbfs/smbfs_io.c Wed Aug 2 08:03:40 2017 (r321909) +++ stable/11/sys/fs/smbfs/smbfs_io.c Wed Aug 2 08:07:13 2017 (r321910) @@ -621,9 +621,11 @@ smbfs_putpages(ap) relpbuf(bp, &smbfs_pbuf_freecnt); - if (!error) - vnode_pager_undirty_pages(pages, rtvals, count - uio.uio_resid); - return rtvals[0]; + if (error == 0) { + vnode_pager_undirty_pages(pages, rtvals, count - uio.uio_resid, + npages * PAGE_SIZE, npages * PAGE_SIZE); + } + return (rtvals[0]); #endif /* SMBFS_RWGENERIC */ } Modified: stable/11/sys/vm/vnode_pager.c ============================================================================== --- stable/11/sys/vm/vnode_pager.c Wed Aug 2 08:03:40 2017 (r321909) +++ stable/11/sys/vm/vnode_pager.c Wed Aug 2 08:07:13 2017 (r321910) @@ -1276,13 +1276,24 @@ vnode_pager_putpages_ioflags(int pager_flags) return (ioflags); } +/* + * vnode_pager_undirty_pages(). + * + * A helper to mark pages as clean after pageout that was possibly + * done with a short write. The lpos argument specifies the page run + * length in bytes, and the written argument specifies how many bytes + * were actually written. eof is the offset past the last valid byte + * in the vnode using the absolute file position of the first byte in + * the run as the base from which it is computed. + */ void -vnode_pager_undirty_pages(vm_page_t *ma, int *rtvals, int written) +vnode_pager_undirty_pages(vm_page_t *ma, int *rtvals, int written, off_t eof, + int lpos) { vm_object_t obj; - int i, pos; + int i, pos, pos_devb; - if (written == 0) + if (written == 0 && eof >= lpos) return; obj = ma[0]->object; VM_OBJECT_WLOCK(obj); @@ -1296,6 +1307,37 @@ vnode_pager_undirty_pages(vm_page_t *ma, int *rtvals, vm_page_clear_dirty(ma[i], 0, written & PAGE_MASK); } } + if (eof >= lpos) /* avoid truncation */ + goto done; + for (pos = eof, i = OFF_TO_IDX(trunc_page(pos)); pos < lpos; i++) { + if (pos != trunc_page(pos)) { + /* + * The page contains the last valid byte in + * the vnode, mark the rest of the page as + * clean, potentially making the whole page + * clean. + */ + pos_devb = roundup2(pos & PAGE_MASK, DEV_BSIZE); + vm_page_clear_dirty(ma[i], pos_devb, PAGE_SIZE - + pos_devb); + + /* + * If the page was cleaned, report the pageout + * on it as successful. msync() no longer + * needs to write out the page, endlessly + * creating write requests and dirty buffers. + */ + if (ma[i]->dirty == 0) + rtvals[i] = VM_PAGER_OK; + + pos = round_page(pos); + } else { + /* vm_pageout_flush() clears dirty */ + rtvals[i] = VM_PAGER_BAD; + pos += PAGE_SIZE; + } + } +done: VM_OBJECT_WUNLOCK(obj); } Modified: stable/11/sys/vm/vnode_pager.h ============================================================================== --- stable/11/sys/vm/vnode_pager.h Wed Aug 2 08:03:40 2017 (r321909) +++ stable/11/sys/vm/vnode_pager.h Wed Aug 2 08:07:13 2017 (r321910) @@ -50,7 +50,8 @@ int vnode_pager_local_getpages_async(struct vop_getpag int vnode_pager_putpages_ioflags(int pager_flags); void vnode_pager_release_writecount(vm_object_t object, vm_offset_t start, vm_offset_t end); -void vnode_pager_undirty_pages(vm_page_t *ma, int *rtvals, int written); +void vnode_pager_undirty_pages(vm_page_t *ma, int *rtvals, int written, + off_t eof, int lpos); void vnode_pager_update_writecount(vm_object_t object, vm_offset_t start, vm_offset_t end); From owner-svn-src-all@freebsd.org Wed Aug 2 08:36:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35796DC9F30; Wed, 2 Aug 2017 08:36:01 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E08337FBC6; Wed, 2 Aug 2017 08:36:00 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v728a0Cx018681; Wed, 2 Aug 2017 08:36:00 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v728ZqGh018596; Wed, 2 Aug 2017 08:35:52 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201708020835.v728ZqGh018596@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 2 Aug 2017 08:35:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321912 - in head: bin/cat bin/date bin/dd bin/echo bin/expr bin/ln bin/ls bin/mv bin/pax bin/pkill bin/sh bin/sleep bin/test cddl cddl/lib cddl/sbin cddl/usr.bin cddl/usr.sbin contrib/... X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in head: bin/cat bin/date bin/dd bin/echo bin/expr bin/ln bin/ls bin/mv bin/pax bin/pkill bin/sh bin/sleep bin/test cddl cddl/lib cddl/sbin cddl/usr.bin cddl/usr.sbin contrib/ofed/usr.bin gnu lib/atf ... X-SVN-Commit-Revision: 321912 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 08:36:01 -0000 Author: ngie Date: Wed Aug 2 08:35:51 2017 New Revision: 321912 URL: https://svnweb.freebsd.org/changeset/base/321912 Log: Convert traditional ${MK_TESTS} conditional idiom for including test directories to SUBDIR.${MK_TESTS} idiom This is being done to pave the way for future work (and homogenity) in ^/projects/make-check-sandbox . No functional change intended. MFC after: 1 weeks Modified: head/bin/cat/Makefile head/bin/date/Makefile head/bin/dd/Makefile head/bin/echo/Makefile head/bin/expr/Makefile head/bin/ln/Makefile head/bin/ls/Makefile head/bin/mv/Makefile head/bin/pax/Makefile head/bin/pkill/Makefile head/bin/sh/Makefile head/bin/sleep/Makefile head/bin/test/Makefile head/cddl/Makefile head/cddl/lib/Makefile head/cddl/sbin/Makefile head/cddl/usr.bin/Makefile head/cddl/usr.sbin/Makefile head/contrib/ofed/usr.bin/Makefile head/gnu/Makefile head/lib/atf/Makefile head/lib/atf/libatf-c++/Makefile head/lib/atf/libatf-c/Makefile head/lib/libarchive/Makefile head/lib/libc/Makefile head/lib/libcasper/services/cap_dns/Makefile head/lib/libcasper/services/cap_grp/Makefile head/lib/libcasper/services/cap_pwd/Makefile head/lib/libcasper/services/cap_sysctl/Makefile head/lib/libcrypt/Makefile head/lib/libmp/Makefile head/lib/libnv/Makefile head/lib/libpathconv/Makefile head/lib/libproc/Makefile head/lib/librt/Makefile head/lib/libthr/Makefile head/lib/libutil/Makefile head/lib/libxo/Makefile head/lib/msun/Makefile head/libexec/atf/atf-check/Makefile head/libexec/atf/atf-sh/Makefile head/libexec/rtld-elf/Makefile head/sbin/devd/Makefile head/sbin/dhclient/Makefile head/sbin/growfs/Makefile head/sbin/ifconfig/Makefile head/sbin/mdconfig/Makefile head/sbin/pfctl/Makefile head/secure/Makefile head/secure/lib/Makefile head/secure/libexec/Makefile head/secure/usr.bin/Makefile head/secure/usr.sbin/Makefile head/share/Makefile head/share/examples/Makefile head/share/zoneinfo/Makefile head/usr.bin/apply/Makefile head/usr.bin/basename/Makefile head/usr.bin/bsdcat/Makefile head/usr.bin/calendar/Makefile head/usr.bin/cmp/Makefile head/usr.bin/col/Makefile head/usr.bin/comm/Makefile head/usr.bin/compress/Makefile head/usr.bin/cpio/Makefile head/usr.bin/csplit/Makefile head/usr.bin/cut/Makefile head/usr.bin/diff/Makefile head/usr.bin/diff3/Makefile head/usr.bin/dirname/Makefile head/usr.bin/file2c/Makefile head/usr.bin/getconf/Makefile head/usr.bin/grep/Makefile head/usr.bin/gzip/Makefile head/usr.bin/hexdump/Makefile head/usr.bin/ident/Makefile head/usr.bin/indent/Makefile head/usr.bin/join/Makefile head/usr.bin/jot/Makefile head/usr.bin/lastcomm/Makefile head/usr.bin/limits/Makefile head/usr.bin/m4/Makefile head/usr.bin/mkimg/Makefile head/usr.bin/ncal/Makefile head/usr.bin/pr/Makefile head/usr.bin/printf/Makefile head/usr.bin/procstat/Makefile head/usr.bin/sdiff/Makefile head/usr.bin/sed/Makefile head/usr.bin/soelim/Makefile head/usr.bin/tail/Makefile head/usr.bin/tar/Makefile head/usr.bin/timeout/Makefile head/usr.bin/tr/Makefile head/usr.bin/truncate/Makefile head/usr.bin/uniq/Makefile head/usr.bin/units/Makefile head/usr.bin/uudecode/Makefile head/usr.bin/uuencode/Makefile head/usr.bin/xargs/Makefile head/usr.bin/xinstall/Makefile head/usr.bin/xo/Makefile head/usr.bin/yacc/Makefile head/usr.sbin/chown/Makefile head/usr.sbin/etcupdate/Makefile head/usr.sbin/extattr/Makefile head/usr.sbin/fstyp/Makefile head/usr.sbin/makefs/Makefile head/usr.sbin/newsyslog/Makefile head/usr.sbin/nmtree/Makefile head/usr.sbin/pw/Makefile head/usr.sbin/rpcbind/Makefile head/usr.sbin/sa/Makefile Modified: head/bin/cat/Makefile ============================================================================== --- head/bin/cat/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/bin/cat/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -6,8 +6,6 @@ PACKAGE=runtime PROG= cat -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/bin/date/Makefile ============================================================================== --- head/bin/date/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/bin/date/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -7,8 +7,6 @@ PACKAGE=runtime PROG= date SRCS= date.c netdate.c vary.c -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/bin/dd/Makefile ============================================================================== --- head/bin/dd/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/bin/dd/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -38,8 +38,6 @@ test: ${PROG} gen @rm -f gen 1M_zeroes* obs_zeroes -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/bin/echo/Makefile ============================================================================== --- head/bin/echo/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/bin/echo/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -6,8 +6,6 @@ PACKAGE=runtime PROG= echo -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/bin/expr/Makefile ============================================================================== --- head/bin/expr/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/bin/expr/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -12,8 +12,6 @@ CFLAGS+= -fwrapv NO_WMISSING_VARIABLE_DECLARATIONS= -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/bin/ln/Makefile ============================================================================== --- head/bin/ln/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/bin/ln/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -10,8 +10,6 @@ MAN= ln.1 symlink.7 LINKS= ${BINDIR}/ln ${BINDIR}/link MLINKS= ln.1 link.1 -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/bin/ls/Makefile ============================================================================== --- head/bin/ls/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/bin/ls/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -14,8 +14,6 @@ CFLAGS+= -DCOLORLS LIBADD+= termcapw .endif -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/bin/mv/Makefile ============================================================================== --- head/bin/mv/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/bin/mv/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -6,8 +6,6 @@ PACKAGE=runtime PROG= mv -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/bin/pax/Makefile ============================================================================== --- head/bin/pax/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/bin/pax/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -33,8 +33,6 @@ SRCS= ar_io.c ar_subs.c buf_subs.c cache.c cpio.c file gen_subs.c getoldopt.c options.c pat_rep.c pax.c sel_subs.c \ tables.c tar.c tty_subs.c -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/bin/pkill/Makefile ============================================================================== --- head/bin/pkill/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/bin/pkill/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -19,8 +19,6 @@ MLINKS= pkill.1 pgrep.1 SYMLINKS= ../..${BINDIR}/pkill /usr/bin/pkill SYMLINKS+= ../..${BINDIR}/pgrep /usr/bin/pgrep -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/bin/sh/Makefile ============================================================================== --- head/bin/sh/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/bin/sh/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -64,8 +64,6 @@ syntax.c syntax.h: mksyntax token.h: mktokens sh ${.CURDIR}/mktokens -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/bin/sleep/Makefile ============================================================================== --- head/bin/sleep/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/bin/sleep/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -6,8 +6,6 @@ PACKAGE=runtime PROG= sleep -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/bin/test/Makefile ============================================================================== --- head/bin/test/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/bin/test/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -8,8 +8,6 @@ PROG= test LINKS= ${BINDIR}/test ${BINDIR}/[ MLINKS= test.1 [.1 -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/cddl/Makefile ============================================================================== --- head/cddl/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/cddl/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -5,9 +5,7 @@ SUBDIR= lib .WAIT \ sbin usr.bin usr.sbin -.if ${MK_TESTS} != "no" -SUBDIR+=tests -.endif +SUBDIR.${MK_TESTS}+= tests SUBDIR_PARALLEL= Modified: head/cddl/lib/Makefile ============================================================================== --- head/cddl/lib/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/cddl/lib/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -12,11 +12,8 @@ SUBDIR= ${_drti} \ ${_libzfs_core} \ ${_libzfs} \ ${_libzpool} \ - ${_tests} -.if ${MK_TESTS} != "no" -_tests= tests -.endif +SUBDIR.${MK_TESTS}+= tests .if ${MK_ZFS} != "no" _libzfs_core= libzfs_core Modified: head/cddl/sbin/Makefile ============================================================================== --- head/cddl/sbin/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/cddl/sbin/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -2,11 +2,9 @@ .include -SUBDIR= ${_tests} ${_zfs} ${_zpool} +SUBDIR= ${_zfs} ${_zpool} -.if ${MK_TESTS} != "no" -_tests= tests -.endif +SUBDIR.${MK_TESTS}+= tests .if ${MK_ZFS} != "no" _zfs= zfs Modified: head/cddl/usr.bin/Makefile ============================================================================== --- head/cddl/usr.bin/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/cddl/usr.bin/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -6,15 +6,12 @@ SUBDIR= \ ctfconvert \ ctfdump \ ctfmerge \ - ${_tests} \ ${_zinject} \ ${_zlook} \ ${_zstreamdump} \ ${_ztest} -.if ${MK_TESTS} != "no" -_tests= tests -.endif +SUBDIR.${MK_TESTS}+= tests .if ${MK_ZFS} != "no" _zinject= zinject Modified: head/cddl/usr.sbin/Makefile ============================================================================== --- head/cddl/usr.sbin/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/cddl/usr.sbin/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -5,14 +5,11 @@ SUBDIR= ${_dtrace} \ ${_lockstat} \ ${_plockstat} \ - ${_tests} \ ${_zdb} \ ${_zfsd} \ ${_zhack} -.if ${MK_TESTS} != "no" -_tests= tests -.endif +SUBDIR.${MK_TESTS}+= tests .if ${MK_ZFS} != "no" .if ${MK_LIBTHR} != "no" Modified: head/contrib/ofed/usr.bin/Makefile ============================================================================== --- head/contrib/ofed/usr.bin/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/contrib/ofed/usr.bin/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -4,9 +4,7 @@ SUBDIR= ibaddr ibnetdiscover ibping ibportstate ibrout ibsysstat ibtracert opensm perfquery saquery \ sminfo smpdump smpquery vendstat -.if ${MK_TESTS} != "no" -SUBDIR+= osmtest -.endif +SUBDIR.${MK_TESTS}+= tests SUBDIR_PARALLEL= Modified: head/gnu/Makefile ============================================================================== --- head/gnu/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/gnu/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -4,11 +4,9 @@ .include SUBDIR= lib .WAIT \ - ${_tests} usr.bin + usr.bin -.if ${MK_TESTS} != "no" -_tests= tests -.endif +SUBDIR.${MK_TESTS}+= tests SUBDIR_PARALLEL= Modified: head/lib/atf/Makefile ============================================================================== --- head/lib/atf/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/lib/atf/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -29,10 +29,7 @@ SUBDIR= libatf-c \ libatf-c++ \ - ${_tests} -.if ${MK_TESTS} != "no" -_tests= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/lib/atf/libatf-c++/Makefile ============================================================================== --- head/lib/atf/libatf-c++/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/lib/atf/libatf-c++/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -72,9 +72,7 @@ INCSDIR_atf-c++.hpp= ${INCLUDEDIR} MAN= atf-c++.3 MLINKS+= atf-c++.3 atf-c-api++.3 # Backwards compatibility. -.if ${MK_TESTS} != "no" -SUBDIR= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include "../common.mk" .include Modified: head/lib/atf/libatf-c/Makefile ============================================================================== --- head/lib/atf/libatf-c/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/lib/atf/libatf-c/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -97,9 +97,7 @@ INCSDIR_atf-c.h= ${INCLUDEDIR} MAN= atf-c.3 MLINKS+= atf-c.3 atf-c-api.3 # Backwards compatibility. -.if ${MK_TESTS} != "no" -SUBDIR= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include "../common.mk" .include Modified: head/lib/libarchive/Makefile ============================================================================== --- head/lib/libarchive/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/lib/libarchive/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -413,8 +413,6 @@ MLINKS+= archive_write_set_options.3 archive_write_set MLINKS+= archive_write_set_options.3 archive_write_set_option.3 MLINKS+= libarchive.3 archive.3 -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/lib/libc/Makefile ============================================================================== --- head/lib/libc/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/lib/libc/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -173,9 +173,7 @@ libkern.${LIBC_ARCH}:: ${KMSRCS} ${CP} ${.ALLSRC} ${DESTDIR}/sys/libkern/${LIBC_ARCH} .endif -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/lib/libcasper/services/cap_dns/Makefile ============================================================================== --- head/lib/libcasper/services/cap_dns/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/lib/libcasper/services/cap_dns/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -18,8 +18,6 @@ LIBADD= nv CFLAGS+=-I${.CURDIR} -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/lib/libcasper/services/cap_grp/Makefile ============================================================================== --- head/lib/libcasper/services/cap_grp/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/lib/libcasper/services/cap_grp/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -18,8 +18,6 @@ LIBADD= nv CFLAGS+=-I${.CURDIR} -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/lib/libcasper/services/cap_pwd/Makefile ============================================================================== --- head/lib/libcasper/services/cap_pwd/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/lib/libcasper/services/cap_pwd/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -18,8 +18,6 @@ LIBADD= nv CFLAGS+=-I${.CURDIR} -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/lib/libcasper/services/cap_sysctl/Makefile ============================================================================== --- head/lib/libcasper/services/cap_sysctl/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/lib/libcasper/services/cap_sysctl/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -18,8 +18,6 @@ LIBADD= nv CFLAGS+=-I${.CURDIR} -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/lib/libcrypt/Makefile ============================================================================== --- head/lib/libcrypt/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/lib/libcrypt/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -43,9 +43,7 @@ WARNS?= 2 PRECIOUSLIB= -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include .include Modified: head/lib/libmp/Makefile ============================================================================== --- head/lib/libmp/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/lib/libmp/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -15,8 +15,6 @@ CFLAGS+= -I${SRCTOP}/crypto VERSION_DEF= ${SRCTOP}/lib/libc/Versions.def SYMBOL_MAPS= ${.CURDIR}/Symbol.map -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/lib/libnv/Makefile ============================================================================== --- head/lib/libnv/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/lib/libnv/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -17,8 +17,6 @@ SRCS+= msgio.c SRCS+= nvlist.c SRCS+= nvpair.c -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/lib/libpathconv/Makefile ============================================================================== --- head/lib/libpathconv/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/lib/libpathconv/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -13,8 +13,6 @@ SRCS= abs2rel.c rel2abs.c #VERSION_DEF= ${SRCTOP/lib/libc/Versions.def #SYMBOL_MAPS= ${.CURDIR}/Symbol.map -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/lib/libproc/Makefile ============================================================================== --- head/lib/libproc/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/lib/libproc/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -41,8 +41,6 @@ SHLIB_MAJOR= 4 MAN= -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/lib/librt/Makefile ============================================================================== --- head/lib/librt/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/lib/librt/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -21,8 +21,6 @@ PRECIOUSLIB= VERSION_DEF=${SRCTOP}/lib/libc/Versions.def SYMBOL_MAPS=${.CURDIR}/Symbol.map -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/lib/libthr/Makefile ============================================================================== --- head/lib/libthr/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/lib/libthr/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -69,8 +69,6 @@ SYMLINKS+=lib${LIB}.so ${LIBDIR}/libpthread.so SYMLINKS+=lib${LIB}_p.a ${LIBDIR}/libpthread_p.a .endif -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/lib/libutil/Makefile ============================================================================== --- head/lib/libutil/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/lib/libutil/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -84,8 +84,6 @@ MLINKS+=pw_util.3 pw_copy.3 \ pw_util.3 pw_tempname.3 \ pw_util.3 pw_tmp.3 -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/lib/libxo/Makefile ============================================================================== --- head/lib/libxo/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/lib/libxo/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -110,8 +110,6 @@ MLINKS= xo_attr.3 xo_attr_h.3 \ xo_syslog.3 xo_set_logmask.3 \ xo_syslog.3 xo_vsyslog.3 -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/lib/msun/Makefile ============================================================================== --- head/lib/msun/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/lib/msun/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -228,8 +228,6 @@ MLINKS+=trunc.3 truncf.3 trunc.3 truncl.3 .include -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/libexec/atf/atf-check/Makefile ============================================================================== --- head/libexec/atf/atf-check/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/libexec/atf/atf-check/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -40,8 +40,6 @@ CFLAGS+= -DATF_SHELL='"/bin/sh"' LIBADD= atf_cxx -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/libexec/atf/atf-sh/Makefile ============================================================================== --- head/libexec/atf/atf-sh/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/libexec/atf/atf-sh/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -72,9 +72,7 @@ FILESGROUPS= SUBR SUBRDIR= ${SHAREDIR}/atf SUBR= libatf-sh.subr -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include "../../../lib/atf/common.mk" .include Modified: head/libexec/rtld-elf/Makefile ============================================================================== --- head/libexec/rtld-elf/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/libexec/rtld-elf/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -85,9 +85,7 @@ beforeinstall: .PATH: ${.CURDIR}/${RTLD_ARCH} -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include ${PROG_FULL}: ${VERSION_MAP} Modified: head/sbin/devd/Makefile ============================================================================== --- head/sbin/devd/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/sbin/devd/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -18,8 +18,6 @@ CFLAGS+=-I. -I${.CURDIR} CLEANFILES= y.output -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/sbin/dhclient/Makefile ============================================================================== --- head/sbin/dhclient/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/sbin/dhclient/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -46,8 +46,6 @@ LIBADD= util WARNS?= 2 -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/sbin/growfs/Makefile ============================================================================== --- head/sbin/growfs/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/sbin/growfs/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -22,8 +22,6 @@ NO_WCAST_ALIGN= yes LIBADD= util -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/sbin/ifconfig/Makefile ============================================================================== --- head/sbin/ifconfig/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/sbin/ifconfig/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -67,8 +67,6 @@ MAN= ifconfig.8 CFLAGS+= -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wnested-externs WARNS?= 2 -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/sbin/mdconfig/Makefile ============================================================================== --- head/sbin/mdconfig/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/sbin/mdconfig/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -8,8 +8,6 @@ MAN= mdconfig.8 LIBADD= util geom -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/sbin/pfctl/Makefile ============================================================================== --- head/sbin/pfctl/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/sbin/pfctl/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -31,8 +31,6 @@ YFLAGS= LIBADD= m md -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/secure/Makefile ============================================================================== --- head/secure/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/secure/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -3,12 +3,10 @@ .include SUBDIR= lib .WAIT \ - libexec ${_tests} usr.bin usr.sbin + libexec usr.bin usr.sbin SUBDIR_PARALLEL= -.if ${MK_TESTS} != "no" -_tests= tests -.endif +SUBDIR.${MK_TESTS}+= tests # These are the programs which depend on crypto, but not Kerberos. SPROGS= lib/libfetch lib/libpam lib/libradius lib/libtelnet \ Modified: head/secure/lib/Makefile ============================================================================== --- head/secure/lib/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/secure/lib/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -10,8 +10,6 @@ SUBDIR+=libssh .endif .endif -.if ${MK_TESTS} != "no" -SUBDIR+=tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/secure/libexec/Makefile ============================================================================== --- head/secure/libexec/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/secure/libexec/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -7,9 +7,7 @@ SUBDIR= SUBDIR+=sftp-server ssh-keysign ssh-pkcs11-helper .endif -.if ${MK_TESTS} != "no" -SUBDIR+=tests -.endif +SUBDIR.${MK_TESTS}+= tests SUBDIR_PARALLEL= Modified: head/secure/usr.bin/Makefile ============================================================================== --- head/secure/usr.bin/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/secure/usr.bin/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -10,9 +10,7 @@ SUBDIR+=scp sftp ssh ssh-add ssh-agent ssh-keygen ssh- .endif .endif -.if ${MK_TESTS} != "no" -SUBDIR+=tests -.endif +SUBDIR.${MK_TESTS}+= tests SUBDIR_PARALLEL= Modified: head/secure/usr.sbin/Makefile ============================================================================== --- head/secure/usr.sbin/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/secure/usr.sbin/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -7,9 +7,7 @@ SUBDIR= SUBDIR+=sshd .endif -.if ${MK_TESTS} != "no" -SUBDIR+=tests -.endif +SUBDIR.${MK_TESTS}+= tests SUBDIR_PARALLEL= Modified: head/share/Makefile ============================================================================== --- head/share/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/share/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -26,7 +26,6 @@ SUBDIR= ${_colldef} \ ${_syscons} \ tabset \ termcap \ - ${_tests} \ ${_timedef} \ ${_vt} \ ${_zoneinfo} @@ -82,9 +81,7 @@ _doc= doc _syscons= syscons .endif -.if ${MK_TESTS} != "no" -_tests= tests -.endif +SUBDIR.${MK_TESTS}+= tests .if ${MK_VT} != "no" _vt= vt Modified: head/share/examples/Makefile ============================================================================== --- head/share/examples/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/share/examples/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -266,9 +266,7 @@ SUBDIR+=pf .endif .endif -.if ${MK_TESTS} != "no" -SUBDIR+=tests -.endif +SUBDIR.${MK_TESTS}+= tests SUBDIR_PARALLEL= Modified: head/share/zoneinfo/Makefile ============================================================================== --- head/share/zoneinfo/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/share/zoneinfo/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -131,8 +131,6 @@ afterinstall: echo "Run tzsetup(8) manually to update /etc/localtime."; \ fi -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/usr.bin/apply/Makefile ============================================================================== --- head/usr.bin/apply/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/usr.bin/apply/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -7,8 +7,6 @@ PROG= apply LIBADD= sbuf -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/usr.bin/basename/Makefile ============================================================================== --- head/usr.bin/basename/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/usr.bin/basename/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -6,8 +6,6 @@ PROG= basename MLINKS= basename.1 dirname.1 -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/usr.bin/bsdcat/Makefile ============================================================================== --- head/usr.bin/bsdcat/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/usr.bin/bsdcat/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -24,8 +24,6 @@ LIBADD= archive CFLAGS+= -DHAVE_ICONV=1 -DHAVE_ICONV_H=1 -DICONV_CONST=const .endif -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/usr.bin/calendar/Makefile ============================================================================== --- head/usr.bin/calendar/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/usr.bin/calendar/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -33,8 +33,6 @@ beforeinstall: ${DESTDIR}${SHAREDIR}/calendar/${link} .endfor -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/usr.bin/cmp/Makefile ============================================================================== --- head/usr.bin/cmp/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/usr.bin/cmp/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -6,8 +6,6 @@ PROG= cmp SRCS= cmp.c link.c misc.c regular.c special.c -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/usr.bin/col/Makefile ============================================================================== --- head/usr.bin/col/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/usr.bin/col/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -5,8 +5,6 @@ PROG= col -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/usr.bin/comm/Makefile ============================================================================== --- head/usr.bin/comm/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/usr.bin/comm/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -5,8 +5,6 @@ PROG= comm -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/usr.bin/compress/Makefile ============================================================================== --- head/usr.bin/compress/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/usr.bin/compress/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -11,8 +11,6 @@ MLINKS= compress.1 uncompress.1 # XXX zopen is not part of libc # MAN=zopen.3 -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/usr.bin/cpio/Makefile ============================================================================== --- head/usr.bin/cpio/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/usr.bin/cpio/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -32,8 +32,6 @@ CFLAGS+= -DHAVE_ICONV=1 -DHAVE_ICONV_H=1 -DICONV_CONST SYMLINKS=bsdcpio ${BINDIR}/cpio MLINKS= bsdcpio.1 cpio.1 -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/usr.bin/csplit/Makefile ============================================================================== --- head/usr.bin/csplit/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/usr.bin/csplit/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -4,8 +4,6 @@ PROG= csplit -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/usr.bin/cut/Makefile ============================================================================== --- head/usr.bin/cut/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/usr.bin/cut/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -5,8 +5,6 @@ PROG= cut -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/usr.bin/diff/Makefile ============================================================================== --- head/usr.bin/diff/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/usr.bin/diff/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -5,8 +5,6 @@ PROG= diff SRCS= diff.c diffdir.c diffreg.c xmalloc.c -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/usr.bin/diff3/Makefile ============================================================================== --- head/usr.bin/diff3/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/usr.bin/diff3/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -4,8 +4,6 @@ PROG= diff3 -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/usr.bin/dirname/Makefile ============================================================================== --- head/usr.bin/dirname/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/usr.bin/dirname/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -6,8 +6,6 @@ PROG= dirname MAN= -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/usr.bin/file2c/Makefile ============================================================================== --- head/usr.bin/file2c/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/usr.bin/file2c/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -4,8 +4,6 @@ PROG= file2c -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/usr.bin/getconf/Makefile ============================================================================== --- head/usr.bin/getconf/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/usr.bin/getconf/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -37,8 +37,6 @@ conflicting.names: confstr.names limits.names sysconf. unique.names: conflicting.names LC_ALL=C sort -u ${.ALLSRC} >${.TARGET} -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/usr.bin/grep/Makefile ============================================================================== --- head/usr.bin/grep/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/usr.bin/grep/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -92,8 +92,6 @@ LIBADD+= gnuregex CFLAGS+= -DWITHOUT_NLS .endif -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/usr.bin/gzip/Makefile ============================================================================== --- head/usr.bin/gzip/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/usr.bin/gzip/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -27,8 +27,6 @@ LINKS+= ${BINDIR}/gzip ${BINDIR}/gunzip \ ${BINDIR}/gzip ${BINDIR}/zcat \ ${BINDIR}/zdiff ${BINDIR}/zcmp -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/usr.bin/hexdump/Makefile ============================================================================== --- head/usr.bin/hexdump/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/usr.bin/hexdump/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -10,8 +10,6 @@ MLINKS= hexdump.1 hd.1 LINKS= ${BINDIR}/hexdump ${BINDIR}/od LINKS+= ${BINDIR}/hexdump ${BINDIR}/hd -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/usr.bin/ident/Makefile ============================================================================== --- head/usr.bin/ident/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/usr.bin/ident/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -6,8 +6,6 @@ PROG= ident LIBADD= sbuf -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/usr.bin/indent/Makefile ============================================================================== --- head/usr.bin/indent/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/usr.bin/indent/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -8,8 +8,6 @@ SRCS= indent.c io.c lexi.c parse.c pr_comment.c args.c NO_WMISSING_VARIABLE_DECLARATIONS= -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/usr.bin/join/Makefile ============================================================================== --- head/usr.bin/join/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/usr.bin/join/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -5,8 +5,6 @@ PROG= join -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include Modified: head/usr.bin/jot/Makefile ============================================================================== --- head/usr.bin/jot/Makefile Wed Aug 2 08:14:06 2017 (r321911) +++ head/usr.bin/jot/Makefile Wed Aug 2 08:35:51 2017 (r321912) @@ -5,8 +5,6 @@ PROG= jot -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_TESTS}+= tests .include *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Aug 2 08:54:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABE6EDCA7F6; Wed, 2 Aug 2017 08:54:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6EABD80A60; Wed, 2 Aug 2017 08:54:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v728sITL026980; Wed, 2 Aug 2017 08:54:18 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v728sIJ6026979; Wed, 2 Aug 2017 08:54:18 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201708020854.v728sIJ6026979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 2 Aug 2017 08:54:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321915 - head/lib/libcrypt X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/lib/libcrypt X-SVN-Commit-Revision: 321915 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 08:54:19 -0000 Author: ngie Date: Wed Aug 2 08:54:18 2017 New Revision: 321915 URL: https://svnweb.freebsd.org/changeset/base/321915 Log: Remove bogus bsd.subdir.mk .include bsd.subdir.mk is included from bsd.obj.mk, which is included via bsd.lib.mk. MFC after: 3 days Modified: head/lib/libcrypt/Makefile Modified: head/lib/libcrypt/Makefile ============================================================================== --- head/lib/libcrypt/Makefile Wed Aug 2 08:50:42 2017 (r321914) +++ head/lib/libcrypt/Makefile Wed Aug 2 08:54:18 2017 (r321915) @@ -46,4 +46,3 @@ PRECIOUSLIB= SUBDIR.${MK_TESTS}+= tests .include -.include From owner-svn-src-all@freebsd.org Wed Aug 2 09:00:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF837DCAB51; Wed, 2 Aug 2017 09:00:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9EB6780E92; Wed, 2 Aug 2017 09:00:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7290IIB027501; Wed, 2 Aug 2017 09:00:18 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7290Ix6027500; Wed, 2 Aug 2017 09:00:18 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201708020900.v7290Ix6027500@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 2 Aug 2017 09:00:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321916 - head/contrib/ofed/usr.bin X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/contrib/ofed/usr.bin X-SVN-Commit-Revision: 321916 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 09:00:19 -0000 Author: ngie Date: Wed Aug 2 09:00:18 2017 New Revision: 321916 URL: https://svnweb.freebsd.org/changeset/base/321916 Log: Fix accidental misconversion done in r321912 SUBDIR.${MK_TESTS} should append osmtest, not tests MFC after: 1 week MFC with: r321912 Modified: head/contrib/ofed/usr.bin/Makefile Modified: head/contrib/ofed/usr.bin/Makefile ============================================================================== --- head/contrib/ofed/usr.bin/Makefile Wed Aug 2 08:54:18 2017 (r321915) +++ head/contrib/ofed/usr.bin/Makefile Wed Aug 2 09:00:18 2017 (r321916) @@ -4,7 +4,7 @@ SUBDIR= ibaddr ibnetdiscover ibping ibportstate ibrout ibsysstat ibtracert opensm perfquery saquery \ sminfo smpdump smpquery vendstat -SUBDIR.${MK_TESTS}+= tests +SUBDIR.${MK_TESTS}+= osmtest SUBDIR_PARALLEL= From owner-svn-src-all@freebsd.org Wed Aug 2 09:49:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76169DCB6A8; Wed, 2 Aug 2017 09:49:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 439FA8266F; Wed, 2 Aug 2017 09:49:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v729nf1h048704; Wed, 2 Aug 2017 09:49:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v729nf26048703; Wed, 2 Aug 2017 09:49:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201708020949.v729nf26048703@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 2 Aug 2017 09:49:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321918 - head/tests/sys/aio X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/tests/sys/aio X-SVN-Commit-Revision: 321918 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 09:49:42 -0000 Author: ngie Date: Wed Aug 2 09:49:41 2017 New Revision: 321918 URL: https://svnweb.freebsd.org/changeset/base/321918 Log: Fix cosmetic issue with error message Add missing space in error message related to PR noted. MFC after: 2 weeks PR: 220398 Modified: head/tests/sys/aio/lio_test.c Modified: head/tests/sys/aio/lio_test.c ============================================================================== --- head/tests/sys/aio/lio_test.c Wed Aug 2 09:00:59 2017 (r321917) +++ head/tests/sys/aio/lio_test.c Wed Aug 2 09:49:41 2017 (r321918) @@ -99,7 +99,7 @@ ATF_TC_BODY(lio_listio_empty_nowait_signal, tc) struct sigevent sev; atf_tc_expect_timeout("Bug 220398 - lio_listio(2) never sends" - "asynchronous notification if nent==0"); + " asynchronous notification if nent==0"); ATF_REQUIRE_EQ(0, sem_init(&completions, false, 0)); sev.sigev_notify = SIGEV_SIGNAL; sev.sigev_signo = SIGUSR1; @@ -120,7 +120,7 @@ ATF_TC_BODY(lio_listio_empty_nowait_thread, tc) struct sigevent sev; atf_tc_expect_timeout("Bug 220398 - lio_listio(2) never sends" - "asynchronous notification if nent==0"); + " asynchronous notification if nent==0"); ATF_REQUIRE_EQ(0, sem_init(&completions, false, 0)); bzero(&sev, sizeof(sev)); sev.sigev_notify = SIGEV_THREAD; From owner-svn-src-all@freebsd.org Wed Aug 2 10:12:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01FD1DCBF10; Wed, 2 Aug 2017 10:12:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C3F4183458; Wed, 2 Aug 2017 10:12:11 +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 v72ACASF060914; Wed, 2 Aug 2017 10:12:10 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v72ACAZX060912; Wed, 2 Aug 2017 10:12:10 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708021012.v72ACAZX060912@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 2 Aug 2017 10:12:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321919 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 321919 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 10:12:12 -0000 Author: kib Date: Wed Aug 2 10:12:10 2017 New Revision: 321919 URL: https://svnweb.freebsd.org/changeset/base/321919 Log: Do not call trapsignal() after handling usermode fault or interrupt, when a signal is not intended to be sent. The variable holding the signal number to send is left uninitialized, which sometimes triggers invalid signal checks. For NMI, a return to usermode without ast processing is done. On the other hand, for spurious dtrace probe interrupt it is usermode which triggered the interrupt, so handle it through userret() as any other fault. Reported by: Nils Beyer PR: 221151 Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/trap.c head/sys/i386/i386/trap.c Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Wed Aug 2 09:49:41 2017 (r321918) +++ head/sys/amd64/amd64/trap.c Wed Aug 2 10:12:10 2017 (r321919) @@ -370,7 +370,7 @@ trap(struct trapframe *frame) #ifdef DEV_ISA case T_NMI: nmi_handle_intr(type, frame); - break; + goto out; #endif /* DEV_ISA */ case T_OFLOW: /* integer overflow fault */ @@ -408,7 +408,7 @@ trap(struct trapframe *frame) if (dtrace_return_probe_ptr != NULL && dtrace_return_probe_ptr(®s) == 0) goto out; - break; + goto userout; #endif } } else { Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Wed Aug 2 09:49:41 2017 (r321918) +++ head/sys/i386/i386/trap.c Wed Aug 2 10:12:10 2017 (r321919) @@ -455,7 +455,7 @@ user_trctrap_out: goto userout; #else /* !POWERFAIL_NMI */ nmi_handle_intr(type, frame); - break; + goto out; #endif /* POWERFAIL_NMI */ #endif /* DEV_ISA */ @@ -499,7 +499,7 @@ user_trctrap_out: if (dtrace_return_probe_ptr != NULL && dtrace_return_probe_ptr(®s) == 0) goto out; - break; + goto userout; #endif } } else { From owner-svn-src-all@freebsd.org Wed Aug 2 10:14:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 222CDDCC038; Wed, 2 Aug 2017 10:14:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DAE2A83708; Wed, 2 Aug 2017 10:14:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v72AEH9F061038; Wed, 2 Aug 2017 10:14:17 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v72AEHEk061037; Wed, 2 Aug 2017 10:14:17 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708021014.v72AEHEk061037@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 2 Aug 2017 10:14:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321920 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 321920 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 10:14:19 -0000 Author: kib Date: Wed Aug 2 10:14:17 2017 New Revision: 321920 URL: https://svnweb.freebsd.org/changeset/base/321920 Log: Change major()/minor() to work with 64bit dev_t. Since traditional types for the macros values are int, remove the cookie trick and just split the dev_t at the word boundary. Reported by: Victor Stinner PR: 221048 Sponsored by: The FreeBSD Foundation Modified: head/sys/sys/types.h Modified: head/sys/sys/types.h ============================================================================== --- head/sys/sys/types.h Wed Aug 2 10:12:10 2017 (r321919) +++ head/sys/sys/types.h Wed Aug 2 10:14:17 2017 (r321920) @@ -364,14 +364,9 @@ __bitcount64(__uint64_t _x) #include -/* - * minor() gives a cookie instead of an index since we don't want to - * change the meanings of bits 0-15 or waste time and space shifting - * bits 16-31 for devices that don't use them. - */ -#define major(x) ((int)(((u_int)(x) >> 8)&0xff)) /* major number */ -#define minor(x) ((int)((x)&0xffff00ff)) /* minor number */ -#define makedev(x,y) ((dev_t)(((x) << 8) | (y))) /* create dev_t */ +#define major(x) ((int)((dev_t)(x) >> 32)) /* major number */ +#define minor(x) ((int)((x) & 0xffffffff)) /* minor number */ +#define makedev(x, y) (((dev_t)(x) << 32) | (y)) /* create dev_t */ /* * These declarations belong elsewhere, but are repeated here and in From owner-svn-src-all@freebsd.org Wed Aug 2 10:25:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9904FDCC492; Wed, 2 Aug 2017 10:25:36 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 60DD883D75; Wed, 2 Aug 2017 10:25:35 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 6BADA260179; Wed, 2 Aug 2017 12:25:33 +0200 (CEST) Subject: Re: svn commit: r321920 - head/sys/sys To: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201708021014.v72AEHEk061037@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <50d380b1-806a-6114-7324-e4cd3d6a2b2f@selasky.org> Date: Wed, 2 Aug 2017 12:23:22 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <201708021014.v72AEHEk061037@repo.freebsd.org> 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 10:25:36 -0000 On 08/02/17 12:14, Konstantin Belousov wrote: > Author: kib > Date: Wed Aug 2 10:14:17 2017 > New Revision: 321920 > URL: https://svnweb.freebsd.org/changeset/base/321920 > > Log: > Change major()/minor() to work with 64bit dev_t. > > Since traditional types for the macros values are int, remove the > cookie trick and just split the dev_t at the word boundary. > > Reported by: Victor Stinner > PR: 221048 > Sponsored by: The FreeBSD Foundation > > Modified: > head/sys/sys/types.h > > Modified: head/sys/sys/types.h > ============================================================================== > --- head/sys/sys/types.h Wed Aug 2 10:12:10 2017 (r321919) > +++ head/sys/sys/types.h Wed Aug 2 10:14:17 2017 (r321920) > @@ -364,14 +364,9 @@ __bitcount64(__uint64_t _x) > > #include > > -/* > - * minor() gives a cookie instead of an index since we don't want to > - * change the meanings of bits 0-15 or waste time and space shifting > - * bits 16-31 for devices that don't use them. > - */ > -#define major(x) ((int)(((u_int)(x) >> 8)&0xff)) /* major number */ > -#define minor(x) ((int)((x)&0xffff00ff)) /* minor number */ > -#define makedev(x,y) ((dev_t)(((x) << 8) | (y))) /* create dev_t */ > +#define major(x) ((int)((dev_t)(x) >> 32)) /* major number */ > +#define minor(x) ((int)((x) & 0xffffffff)) /* minor number */ > +#define makedev(x, y) (((dev_t)(x) << 32) | (y)) /* create dev_t */ > > /* > * These declarations belong elsewhere, but are repeated here and in Hi, This change looks like it affects user-space applications? Why is not the FreeBSD version number bumped? --HPS From owner-svn-src-all@freebsd.org Wed Aug 2 10:33:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2DE5DCC787; Wed, 2 Aug 2017 10:33:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6EBC984310; Wed, 2 Aug 2017 10:33:48 +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 v72AXlQU068916; Wed, 2 Aug 2017 10:33:47 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v72AXlbj068915; Wed, 2 Aug 2017 10:33:47 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201708021033.v72AXlbj068915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 2 Aug 2017 10:33:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321921 - head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Commit-Revision: 321921 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 10:33:48 -0000 Author: mav Date: Wed Aug 2 10:33:47 2017 New Revision: 321921 URL: https://svnweb.freebsd.org/changeset/base/321921 Log: Add compat shim part missed at r305197. This fixes compatibility between old kernel and new ZFS tools. It seems to be tradition to forget it. :( PR: 221112 MFC after: 3 days Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c Wed Aug 2 10:14:17 2017 (r321920) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c Wed Aug 2 10:33:47 2017 (r321921) @@ -74,6 +74,9 @@ zcmd_ioctl(int fd, int request, zfs_cmd_t *zc) if (zfs_ioctl_version >= ZFS_IOCVER_DEADMAN) { switch (zfs_ioctl_version) { + case ZFS_IOCVER_INLANES: + cflag = ZFS_CMD_COMPAT_INLANES; + break; case ZFS_IOCVER_RESUME: cflag = ZFS_CMD_COMPAT_RESUME; break; From owner-svn-src-all@freebsd.org Wed Aug 2 10:38:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE9F9DCC8F4; Wed, 2 Aug 2017 10:38:01 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6416F845EF; Wed, 2 Aug 2017 10:38:00 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id AF9F5260179; Wed, 2 Aug 2017 12:37:58 +0200 (CEST) Subject: Re: svn commit: r321920 - head/sys/sys To: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201708021014.v72AEHEk061037@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <7b1d274f-a531-f788-742a-a8375fe76763@selasky.org> Date: Wed, 2 Aug 2017 12:35:47 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <201708021014.v72AEHEk061037@repo.freebsd.org> 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 10:38:01 -0000 On 08/02/17 12:14, Konstantin Belousov wrote: > Author: kib > Date: Wed Aug 2 10:14:17 2017 > New Revision: 321920 > URL: https://svnweb.freebsd.org/changeset/base/321920 > > Log: > Change major()/minor() to work with 64bit dev_t. > > Since traditional types for the macros values are int, remove the > cookie trick and just split the dev_t at the word boundary. > > Reported by: Victor Stinner > PR: 221048 > Sponsored by: The FreeBSD Foundation > > Modified: > head/sys/sys/types.h > > Modified: head/sys/sys/types.h > ============================================================================== > --- head/sys/sys/types.h Wed Aug 2 10:12:10 2017 (r321919) > +++ head/sys/sys/types.h Wed Aug 2 10:14:17 2017 (r321920) > @@ -364,14 +364,9 @@ __bitcount64(__uint64_t _x) > > #include > > -/* > - * minor() gives a cookie instead of an index since we don't want to > - * change the meanings of bits 0-15 or waste time and space shifting > - * bits 16-31 for devices that don't use them. > - */ > -#define major(x) ((int)(((u_int)(x) >> 8)&0xff)) /* major number */ > -#define minor(x) ((int)((x)&0xffff00ff)) /* minor number */ > -#define makedev(x,y) ((dev_t)(((x) << 8) | (y))) /* create dev_t */ > +#define major(x) ((int)((dev_t)(x) >> 32)) /* major number */ > +#define minor(x) ((int)((x) & 0xffffffff)) /* minor number */ > +#define makedev(x, y) (((dev_t)(x) << 32) | (y)) /* create dev_t */ > > /* > * These declarations belong elsewhere, but are repeated here and in > Hi, This change breaks the LinuxKPI: > struct linux_cdev * > linux_find_cdev(const char *name, unsigned major, unsigned minor) > { > int unit = MKDEV(major, minor); > struct cdev *cdev; > > dev_lock(); > LIST_FOREACH(cdev, &linuxcdevsw.d_devs, si_list) { > struct linux_cdev *ldev = cdev->si_drv1; > if (dev2unit(cdev) == unit && > strcmp(kobject_name(&ldev->kobj), name) == 0) { > break; > } > } > dev_unlock(); > > return (cdev != NULL ? cdev->si_drv1 : NULL); > } You will also need to change cdev->si_drv0 to dev_t and fix the make_dev() functions too. > struct cdev { > void *si_spare0; > u_int si_flags; > #define SI_ETERNAL 0x0001 /* never destroyed */ > #define SI_ALIAS 0x0002 /* carrier of alias name */ > #define SI_NAMED 0x0004 /* make_dev{_alias} has been called */ > #define SI_CHEAPCLONE 0x0008 /* can be removed_dev'ed when vnode reclaims */ > #define SI_CHILD 0x0010 /* child of another struct cdev **/ > #define SI_DUMPDEV 0x0080 /* is kernel dumpdev */ > #define SI_CLONELIST 0x0200 /* on a clone list */ > #define SI_UNMAPPED 0x0400 /* can handle unmapped I/O */ > #define SI_NOSPLIT 0x0800 /* I/O should not be split up */ > struct timespec si_atime; > struct timespec si_ctime; > struct timespec si_mtime; > uid_t si_uid; > gid_t si_gid; > mode_t si_mode; > struct ucred *si_cred; /* cached clone-time credential */ > int si_drv0; Further this update assigns a 64-bit value to tfsid.val[0], which is 32-bit ?? > sys/sys/mount.h:typedef struct fsid { int32_t val[2]; } fsid_t; /* filesystem id type */ sys/kern/vfs_subr.c: tfsid.val[0] = makedev(255, And there are more places like this! Did you properly check all uses of makedev() in the kernel before making this change? --HPS From owner-svn-src-all@freebsd.org Wed Aug 2 10:55:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5A9DDCD028; Wed, 2 Aug 2017 10:55:52 +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 4D587141; Wed, 2 Aug 2017 10:55:52 +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 v72AtjsH013497 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 2 Aug 2017 13:55:46 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v72AtjsH013497 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v72AtjC2013491; Wed, 2 Aug 2017 13:55:45 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 2 Aug 2017 13:55:45 +0300 From: Konstantin Belousov To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r321920 - head/sys/sys Message-ID: <20170802105545.GB1700@kib.kiev.ua> References: <201708021014.v72AEHEk061037@repo.freebsd.org> <50d380b1-806a-6114-7324-e4cd3d6a2b2f@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <50d380b1-806a-6114-7324-e4cd3d6a2b2f@selasky.org> User-Agent: Mutt/1.8.3 (2017-05-23) 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 10:55:52 -0000 On Wed, Aug 02, 2017 at 12:23:22PM +0200, Hans Petter Selasky wrote: > On 08/02/17 12:14, Konstantin Belousov wrote: > > Author: kib > > Date: Wed Aug 2 10:14:17 2017 > > New Revision: 321920 > > URL: https://svnweb.freebsd.org/changeset/base/321920 > > > > Log: > > Change major()/minor() to work with 64bit dev_t. > > > > Since traditional types for the macros values are int, remove the > > cookie trick and just split the dev_t at the word boundary. > > > > Reported by: Victor Stinner > > PR: 221048 > > Sponsored by: The FreeBSD Foundation > > > > Modified: > > head/sys/sys/types.h > > > > Modified: head/sys/sys/types.h > > ============================================================================== > > --- head/sys/sys/types.h Wed Aug 2 10:12:10 2017 (r321919) > > +++ head/sys/sys/types.h Wed Aug 2 10:14:17 2017 (r321920) > > @@ -364,14 +364,9 @@ __bitcount64(__uint64_t _x) > > > > #include > > > > -/* > > - * minor() gives a cookie instead of an index since we don't want to > > - * change the meanings of bits 0-15 or waste time and space shifting > > - * bits 16-31 for devices that don't use them. > > - */ > > -#define major(x) ((int)(((u_int)(x) >> 8)&0xff)) /* major number */ > > -#define minor(x) ((int)((x)&0xffff00ff)) /* minor number */ > > -#define makedev(x,y) ((dev_t)(((x) << 8) | (y))) /* create dev_t */ > > +#define major(x) ((int)((dev_t)(x) >> 32)) /* major number */ > > +#define minor(x) ((int)((x) & 0xffffffff)) /* minor number */ > > +#define makedev(x, y) (((dev_t)(x) << 32) | (y)) /* create dev_t */ > > > > /* > > * These declarations belong elsewhere, but are repeated here and in > > Hi, > > This change looks like it affects user-space applications? Why is not > the FreeBSD version number bumped? This change is the trailing fix for the ino64 commit. More details are following: main feature of major/minor is the deconstruction of the dev_t into components which can be used to reconstruct original dev_t with makedev(). In other words, if makedev(major(x), minor(x)) != x then the major/minor API is useless. And it was useless right after ino64 commit r318736 and up to the commit you replied to. The fact that nobody complained until the referenced PR, indicates that the API is not actively used (finally). I do not see a need to bump the __FreeBSD_version for this, we do not support older HEADs in any way. This means that we assume that HEAD users always use the latest HEAD. So no bump for such minor fix. From owner-svn-src-all@freebsd.org Wed Aug 2 11:06:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F4FEDCD3CA; Wed, 2 Aug 2017 11:06:17 +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 47A64925; Wed, 2 Aug 2017 11:06:17 +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 v72B67Ap015859 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 2 Aug 2017 14:06:07 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v72B67Ap015859 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v72B67KD015858; Wed, 2 Aug 2017 14:06:07 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 2 Aug 2017 14:06:07 +0300 From: Konstantin Belousov To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r321920 - head/sys/sys Message-ID: <20170802110607.GC1700@kib.kiev.ua> References: <201708021014.v72AEHEk061037@repo.freebsd.org> <7b1d274f-a531-f788-742a-a8375fe76763@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7b1d274f-a531-f788-742a-a8375fe76763@selasky.org> User-Agent: Mutt/1.8.3 (2017-05-23) 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 11:06:17 -0000 On Wed, Aug 02, 2017 at 12:35:47PM +0200, Hans Petter Selasky wrote: > On 08/02/17 12:14, Konstantin Belousov wrote: > > Author: kib > > Date: Wed Aug 2 10:14:17 2017 > > New Revision: 321920 > > URL: https://svnweb.freebsd.org/changeset/base/321920 > > > > Log: > > Change major()/minor() to work with 64bit dev_t. > > > > Since traditional types for the macros values are int, remove the > > cookie trick and just split the dev_t at the word boundary. > > > > Reported by: Victor Stinner > > PR: 221048 > > Sponsored by: The FreeBSD Foundation > > > > Modified: > > head/sys/sys/types.h > > > > Modified: head/sys/sys/types.h > > ============================================================================== > > --- head/sys/sys/types.h Wed Aug 2 10:12:10 2017 (r321919) > > +++ head/sys/sys/types.h Wed Aug 2 10:14:17 2017 (r321920) > > @@ -364,14 +364,9 @@ __bitcount64(__uint64_t _x) > > > > #include > > > > -/* > > - * minor() gives a cookie instead of an index since we don't want to > > - * change the meanings of bits 0-15 or waste time and space shifting > > - * bits 16-31 for devices that don't use them. > > - */ > > -#define major(x) ((int)(((u_int)(x) >> 8)&0xff)) /* major number */ > > -#define minor(x) ((int)((x)&0xffff00ff)) /* minor number */ > > -#define makedev(x,y) ((dev_t)(((x) << 8) | (y))) /* create dev_t */ > > +#define major(x) ((int)((dev_t)(x) >> 32)) /* major number */ > > +#define minor(x) ((int)((x) & 0xffffffff)) /* minor number */ > > +#define makedev(x, y) (((dev_t)(x) << 32) | (y)) /* create dev_t */ > > > > /* > > * These declarations belong elsewhere, but are repeated here and in > > > > Hi, > > This change breaks the LinuxKPI: > > > struct linux_cdev * > > linux_find_cdev(const char *name, unsigned major, unsigned minor) > > { > > int unit = MKDEV(major, minor); > > struct cdev *cdev; > > > > dev_lock(); > > LIST_FOREACH(cdev, &linuxcdevsw.d_devs, si_list) { > > struct linux_cdev *ldev = cdev->si_drv1; > > if (dev2unit(cdev) == unit && > > strcmp(kobject_name(&ldev->kobj), name) == 0) { > > break; > > } > > } > > dev_unlock(); > > > > return (cdev != NULL ? cdev->si_drv1 : NULL); > > } So linuxkpi was broken before this commit as well, as I noted in my other reply ? > > You will also need to change cdev->si_drv0 to dev_t and fix the > make_dev() functions too. Why do you think that si_drv0 needs to be changes ? > > > struct cdev { > > void *si_spare0; > > u_int si_flags; > > #define SI_ETERNAL 0x0001 /* never destroyed */ > > #define SI_ALIAS 0x0002 /* carrier of alias name */ > > #define SI_NAMED 0x0004 /* make_dev{_alias} has been called */ > > #define SI_CHEAPCLONE 0x0008 /* can be removed_dev'ed when vnode reclaims */ > > #define SI_CHILD 0x0010 /* child of another struct cdev **/ > > #define SI_DUMPDEV 0x0080 /* is kernel dumpdev */ > > #define SI_CLONELIST 0x0200 /* on a clone list */ > > #define SI_UNMAPPED 0x0400 /* can handle unmapped I/O */ > > #define SI_NOSPLIT 0x0800 /* I/O should not be split up */ > > struct timespec si_atime; > > struct timespec si_ctime; > > struct timespec si_mtime; > > uid_t si_uid; > > gid_t si_gid; > > mode_t si_mode; > > struct ucred *si_cred; /* cached clone-time credential */ > > int si_drv0; > > > Further this update assigns a 64-bit value to tfsid.val[0], which is > 32-bit ?? > > > sys/sys/mount.h:typedef struct fsid { int32_t val[2]; } fsid_t; /* > filesystem id type */ > > sys/kern/vfs_subr.c: tfsid.val[0] = makedev(255, >From my reading if the vfs_getnewfsid() code, it is fine. It ignores the 255-major value, which does not add much sense to the returned value, just that byte 1 is not zero and not 0xff. > > And there are more places like this! I see the use of makedev() in nfsserver, where the change seemingly improve the situation by initializing na_rdev to the full 64 bit value, and in fdescfs, which does not care. > > Did you properly check all uses of makedev() in the kernel before making > this change? > > --HPS From owner-svn-src-all@freebsd.org Wed Aug 2 11:14:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 089D2DCD8BB; Wed, 2 Aug 2017 11:14:02 +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 C7225EAF; Wed, 2 Aug 2017 11:14:01 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id D9837260179; Wed, 2 Aug 2017 13:13:58 +0200 (CEST) Subject: Re: svn commit: r321920 - head/sys/sys To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201708021014.v72AEHEk061037@repo.freebsd.org> <7b1d274f-a531-f788-742a-a8375fe76763@selasky.org> <20170802110607.GC1700@kib.kiev.ua> From: Hans Petter Selasky Message-ID: <760e0077-499e-fffb-a86b-979e410b35e1@selasky.org> Date: Wed, 2 Aug 2017 13:11:48 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20170802110607.GC1700@kib.kiev.ua> 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 11:14:02 -0000 On 08/02/17 13:06, Konstantin Belousov wrote: > So linuxkpi was broken before this commit as well, as I noted in my > other reply ? Hi, The LinuxKPI uses minor/major/makedev internally. y = makedev(z,t) Then the LinuxKPI assumes z and t can be retrieved through minor and major: minor(y) == z and major(y) == t If "y" is an "int" and it is assigned a 64-bit value, it is obvious that this code no longer holds true. Same might be in userspace/ports. So yes, this change breaks the LinuxKPI, at least some parts of it. --HPS From owner-svn-src-all@freebsd.org Wed Aug 2 11:17:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEA4BDCDA13; Wed, 2 Aug 2017 11:17:57 +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 64DD61061; Wed, 2 Aug 2017 11:17:57 +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 v72BHqng018098 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 2 Aug 2017 14:17:53 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v72BHqng018098 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v72BHq53018097; Wed, 2 Aug 2017 14:17:52 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 2 Aug 2017 14:17:52 +0300 From: Konstantin Belousov To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r321920 - head/sys/sys Message-ID: <20170802111752.GD1700@kib.kiev.ua> References: <201708021014.v72AEHEk061037@repo.freebsd.org> <7b1d274f-a531-f788-742a-a8375fe76763@selasky.org> <20170802110607.GC1700@kib.kiev.ua> <760e0077-499e-fffb-a86b-979e410b35e1@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <760e0077-499e-fffb-a86b-979e410b35e1@selasky.org> User-Agent: Mutt/1.8.3 (2017-05-23) 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 11:17:57 -0000 On Wed, Aug 02, 2017 at 01:11:48PM +0200, Hans Petter Selasky wrote: > On 08/02/17 13:06, Konstantin Belousov wrote: > > So linuxkpi was broken before this commit as well, as I noted in my > > other reply ? > > Hi, > > The LinuxKPI uses minor/major/makedev internally. > > y = makedev(z,t) > > Then the LinuxKPI assumes z and t can be retrieved through minor and > major: minor(y) == z and major(y) == t > > If "y" is an "int" and it is assigned a 64-bit value, it is obvious that > this code no longer holds true. Same might be in userspace/ports. But y must be dev_t. > > So yes, this change breaks the LinuxKPI, at least some parts of it. > > --HPS From owner-svn-src-all@freebsd.org Wed Aug 2 11:25:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4695EDCDCC8; Wed, 2 Aug 2017 11:25:39 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 12C4A1588; Wed, 2 Aug 2017 11:25:39 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v72BPcF0089543; Wed, 2 Aug 2017 11:25:38 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v72BPcB0089542; Wed, 2 Aug 2017 11:25:38 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201708021125.v72BPcB0089542@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 2 Aug 2017 11:25:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321922 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 321922 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 11:25:39 -0000 Author: mjg Date: Wed Aug 2 11:25:38 2017 New Revision: 321922 URL: https://svnweb.freebsd.org/changeset/base/321922 Log: amd64: annotate the syscall return address check with __predict_false before: 0xffffffff80b03ebb <+2059>: mov 0x460(%r14),%rax 0xffffffff80b03ec2 <+2066>: mov 0x98(%rax),%rax 0xffffffff80b03ec9 <+2073>: shr $0x2f,%rax 0xffffffff80b03ecd <+2077>: je 0xffffffff80b03edd 0xffffffff80b03ecf <+2079>: mov 0x3f8(%r14),%rax 0xffffffff80b03ed6 <+2086>: orl $0x1,0xc8(%rax) 0xffffffff80b03edd <+2093>: add $0xf8,%rsp after: 0xffffffff80b03ebb <+2059>: mov 0x460(%r14),%rax 0xffffffff80b03ec2 <+2066>: mov 0x98(%rax),%rax 0xffffffff80b03ec9 <+2073>: shr $0x2f,%rax 0xffffffff80b03ecd <+2077>: jne 0xffffffff80b03eef 0xffffffff80b03ecf <+2079>: add $0xf8,%rsp Reviewed by: kib MFC after: 1 week Modified: head/sys/amd64/amd64/trap.c Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Wed Aug 2 10:33:47 2017 (r321921) +++ head/sys/amd64/amd64/trap.c Wed Aug 2 11:25:38 2017 (r321922) @@ -935,6 +935,6 @@ amd64_syscall(struct thread *td, int traced) * not be safe. Instead, use the full return path which * catches the problem safely. */ - if (td->td_frame->tf_rip >= VM_MAXUSER_ADDRESS) + if (__predict_false(td->td_frame->tf_rip >= VM_MAXUSER_ADDRESS)) set_pcb_flags(td->td_pcb, PCB_FULL_IRET); } From owner-svn-src-all@freebsd.org Wed Aug 2 11:30:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18818DCDD9A; Wed, 2 Aug 2017 11:30:03 +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 D6369173B; Wed, 2 Aug 2017 11:30:02 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 2F9A8260179; Wed, 2 Aug 2017 13:30:01 +0200 (CEST) Subject: Re: svn commit: r321920 - head/sys/sys To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201708021014.v72AEHEk061037@repo.freebsd.org> <7b1d274f-a531-f788-742a-a8375fe76763@selasky.org> <20170802110607.GC1700@kib.kiev.ua> <760e0077-499e-fffb-a86b-979e410b35e1@selasky.org> <20170802111752.GD1700@kib.kiev.ua> From: Hans Petter Selasky Message-ID: <912d42d0-ea07-82ec-e754-f6b6d2b4cc94@selasky.org> Date: Wed, 2 Aug 2017 13:27:50 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20170802111752.GD1700@kib.kiev.ua> 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 11:30:03 -0000 On 08/02/17 13:17, Konstantin Belousov wrote: > But y must be dev_t. Sure, but "struct cdev" 's si_drv0 is only "int" . How can it contain dev_t ? --HPS From owner-svn-src-all@freebsd.org Wed Aug 2 11:43:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EBC8DCE273; Wed, 2 Aug 2017 11:43:08 +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 A337C2065; Wed, 2 Aug 2017 11:43:07 +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 v72Bh3u6023624 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 2 Aug 2017 14:43:03 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v72Bh3u6023624 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v72Bh3L4023623; Wed, 2 Aug 2017 14:43:03 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 2 Aug 2017 14:43:03 +0300 From: Konstantin Belousov To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r321920 - head/sys/sys Message-ID: <20170802114303.GE1700@kib.kiev.ua> References: <201708021014.v72AEHEk061037@repo.freebsd.org> <7b1d274f-a531-f788-742a-a8375fe76763@selasky.org> <20170802110607.GC1700@kib.kiev.ua> <760e0077-499e-fffb-a86b-979e410b35e1@selasky.org> <20170802111752.GD1700@kib.kiev.ua> <912d42d0-ea07-82ec-e754-f6b6d2b4cc94@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <912d42d0-ea07-82ec-e754-f6b6d2b4cc94@selasky.org> User-Agent: Mutt/1.8.3 (2017-05-23) 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 11:43:08 -0000 On Wed, Aug 02, 2017 at 01:27:50PM +0200, Hans Petter Selasky wrote: > On 08/02/17 13:17, Konstantin Belousov wrote: > > But y must be dev_t. > > Sure, but "struct cdev" 's si_drv0 is only "int" . How can it contain > dev_t ? Why should it contain dev_t ? Linux KPI abused that field it seems. Lets change the focus of the discussion. You cited the struct linux_cdev * linux_find_cdev(const char *name, unsigned major, unsigned minor) function which finds cdev (or some mockup of the native cdev) by major/minor. Where does these major/minor numbers come from ? I mean that if they are contructed as major(struct stat.st_rdev) and minor(struct stat.st_rdev), then even the original code looks wrong without the ino64 addition. Since devfs reports the internal inode number into st_rdev, which formally is not accessible outside the devfs filesystem. So should the code for linux_find_cdev() changed to match cdevs against inode number ? cdp_inode is serially generated so on real machine it is really a small number for any /dev node. You can watch that by ls -l /dev. From owner-svn-src-all@freebsd.org Wed Aug 2 12:29:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65BB1DCFA76; Wed, 2 Aug 2017 12:29:00 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2AA8E365A; Wed, 2 Aug 2017 12:28:59 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 43164260179; Wed, 2 Aug 2017 14:28:57 +0200 (CEST) Subject: Re: svn commit: r321920 - head/sys/sys To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201708021014.v72AEHEk061037@repo.freebsd.org> <7b1d274f-a531-f788-742a-a8375fe76763@selasky.org> <20170802110607.GC1700@kib.kiev.ua> <760e0077-499e-fffb-a86b-979e410b35e1@selasky.org> <20170802111752.GD1700@kib.kiev.ua> <912d42d0-ea07-82ec-e754-f6b6d2b4cc94@selasky.org> <20170802114303.GE1700@kib.kiev.ua> From: Hans Petter Selasky Message-ID: Date: Wed, 2 Aug 2017 14:26:46 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20170802114303.GE1700@kib.kiev.ua> 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 12:29:00 -0000 On 08/02/17 13:43, Konstantin Belousov wrote: > On Wed, Aug 02, 2017 at 01:27:50PM +0200, Hans Petter Selasky wrote: >> On 08/02/17 13:17, Konstantin Belousov wrote: >>> But y must be dev_t. >> >> Sure, but "struct cdev" 's si_drv0 is only "int" . How can it contain >> dev_t ? > > Why should it contain dev_t ? > Linux KPI abused that field it seems. > Hi, The LinuxKPI uses si_drv0 to contain the output from mkdev(). Before the mkdev() function would fit into 32-bits. Now it is 64-bits. I can fix the LinuxKPI bits this time. We can store this information in si_drv1->xxx instead of using si_drv0 and dev2unit(). > Lets change the focus of the discussion. > You cited the > struct linux_cdev * > linux_find_cdev(const char *name, unsigned major, unsigned minor) > function which finds cdev (or some mockup of the native cdev) by major/minor. > Where does these major/minor numbers come from ? The major number is in the range 0..255 and decides the type of device. The minor number is in the range 0..255 aswell typically and defines a unique number for each LinuxKPI created character device. > I mean that if they are contructed as major(struct stat.st_rdev) and > minor(struct stat.st_rdev), then even the original code looks wrong > without the ino64 addition. Since devfs reports the internal inode > number into st_rdev, which formally is not accessible outside the devfs > filesystem. So should the code for linux_find_cdev() changed to match > cdevs against inode number ? These numbers do not come from any user-visible files. They are just used internally in the kernel to pass around information. > cdp_inode is serially generated so on real machine it is really a small > number for any /dev node. You can watch that by ls -l /dev. Sure. > While at it, I found that contrib/mknod/pack_dev.c, still has hardcoded references to the old makedev(): > contrib/mknod/pack_dev.c:#define makedev_freebsd(x,y) ((portdev_t)((((x) << 8) & 0x0000ff00) | \ > contrib/mknod/pack_dev.c: dev = makedev_freebsd(numbers[0], numbers[1]); Same goes for: contrib/libarchive/libarchive/archive_pack_dev.c And if you "grep -r makedev /usr/src" you'll find more. --HPS From owner-svn-src-all@freebsd.org Wed Aug 2 12:31:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F2D3DCFB02; Wed, 2 Aug 2017 12:31:05 +0000 (UTC) (envelope-from dru@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E33C83811; Wed, 2 Aug 2017 12:31:04 +0000 (UTC) (envelope-from dru@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v72CV42x014555; Wed, 2 Aug 2017 12:31:04 GMT (envelope-from dru@FreeBSD.org) Received: (from dru@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v72CV4jG014554; Wed, 2 Aug 2017 12:31:04 GMT (envelope-from dru@FreeBSD.org) Message-Id: <201708021231.v72CV4jG014554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dru set sender to dru@FreeBSD.org using -f From: Dru Lavigne Date: Wed, 2 Aug 2017 12:31:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321923 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: dru X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 321923 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 12:31:05 -0000 Author: dru (doc committer) Date: Wed Aug 2 12:31:03 2017 New Revision: 321923 URL: https://svnweb.freebsd.org/changeset/base/321923 Log: Update my entry in marketing. Modified: head/share/misc/organization.dot Modified: head/share/misc/organization.dot ============================================================================== --- head/share/misc/organization.dot Wed Aug 2 11:25:38 2017 (r321922) +++ head/share/misc/organization.dot Wed Aug 2 12:31:03 2017 (r321923) @@ -57,7 +57,7 @@ webmaster [label="Webmaster Team\nwebmaster@FreeBSD.or # Misc hats go here alphabetically sorted donations [label="Donations Team\ndonations@FreeBSD.org\nwilko, gahr, pgolluci,\nobrien, trhodes, ds,\nrwatson"] -marketing [label="Marketing Team\nmarketing@FreeBSD.org\nSteven Beedle, Denise Ebery, deb,\njkoshy, Dru Lavigne, mwlucas, imp,\nKris Moore, murray, mattt,\nJeremy C. Reed, rwatson"] +marketing [label="Marketing Team\nmarketing@FreeBSD.org\nSteven Beedle, Denise Ebery, deb,\njkoshy, dru, mwlucas, imp,\nKris Moore, murray, mattt,\nJeremy C. Reed, rwatson"] vendorrelations [label="Vendor Relations\nvendor-relations@FreeBSD.org\ncore, FreeBSD Foundation"] # Here are the team relationships. From owner-svn-src-all@freebsd.org Wed Aug 2 12:37:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30BA4DCFFAF; Wed, 2 Aug 2017 12:37: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 B462A3FD7; Wed, 2 Aug 2017 12:37: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 v72CbXtE035837 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 2 Aug 2017 15:37:33 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v72CbXtE035837 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v72CbX4G035836; Wed, 2 Aug 2017 15:37:33 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 2 Aug 2017 15:37:33 +0300 From: Konstantin Belousov To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r321920 - head/sys/sys Message-ID: <20170802123733.GF1700@kib.kiev.ua> References: <201708021014.v72AEHEk061037@repo.freebsd.org> <7b1d274f-a531-f788-742a-a8375fe76763@selasky.org> <20170802110607.GC1700@kib.kiev.ua> <760e0077-499e-fffb-a86b-979e410b35e1@selasky.org> <20170802111752.GD1700@kib.kiev.ua> <912d42d0-ea07-82ec-e754-f6b6d2b4cc94@selasky.org> <20170802114303.GE1700@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.3 (2017-05-23) 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 12:37:43 -0000 On Wed, Aug 02, 2017 at 02:26:46PM +0200, Hans Petter Selasky wrote: > On 08/02/17 13:43, Konstantin Belousov wrote: > > On Wed, Aug 02, 2017 at 01:27:50PM +0200, Hans Petter Selasky wrote: > >> On 08/02/17 13:17, Konstantin Belousov wrote: > >>> But y must be dev_t. > >> > >> Sure, but "struct cdev" 's si_drv0 is only "int" . How can it contain > >> dev_t ? > > > > Why should it contain dev_t ? > > Linux KPI abused that field it seems. > > > > Hi, > > The LinuxKPI uses si_drv0 to contain the output from mkdev(). Before the > mkdev() function would fit into 32-bits. Now it is 64-bits. > > I can fix the LinuxKPI bits this time. We can store this information in > si_drv1->xxx instead of using si_drv0 and dev2unit(). si_drv1 is 32bit on 32bit platforms. > > > Lets change the focus of the discussion. > > You cited the > > struct linux_cdev * > > linux_find_cdev(const char *name, unsigned major, unsigned minor) > > function which finds cdev (or some mockup of the native cdev) by major/minor. > > Where does these major/minor numbers come from ? > > The major number is in the range 0..255 and decides the type of device. > The minor number is in the range 0..255 aswell typically and defines a > unique number for each LinuxKPI created character device. > > > I mean that if they are contructed as major(struct stat.st_rdev) and > > minor(struct stat.st_rdev), then even the original code looks wrong > > without the ino64 addition. Since devfs reports the internal inode > > number into st_rdev, which formally is not accessible outside the devfs > > filesystem. So should the code for linux_find_cdev() changed to match > > cdevs against inode number ? > > These numbers do not come from any user-visible files. They are just > used internally in the kernel to pass around information. > > > cdp_inode is serially generated so on real machine it is really a small > > number for any /dev node. You can watch that by ls -l /dev. > > Sure. > > > > > While at it, I found that contrib/mknod/pack_dev.c, still has hardcoded > references to the old makedev(): > > > contrib/mknod/pack_dev.c:#define makedev_freebsd(x,y) ((portdev_t)((((x) << 8) & 0x0000ff00) | \ > > contrib/mknod/pack_dev.c: dev = makedev_freebsd(numbers[0], numbers[1]); > > Same goes for: contrib/libarchive/libarchive/archive_pack_dev.c I do not see how pack_dev.c can be used for anything non-broken on FreeBSD, at least in connection with devfs. For non-devfs filesystems it can be streamlined, of course. I will look at this later. > > And if you "grep -r makedev /usr/src" you'll find more. > > --HPS From owner-svn-src-all@freebsd.org Wed Aug 2 12:38:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4E62DD0018; Wed, 2 Aug 2017 12:38:27 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C8CC633D1; Wed, 2 Aug 2017 12:38:26 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 0A098260179; Wed, 2 Aug 2017 14:38:24 +0200 (CEST) Subject: Re: svn commit: r321920 - head/sys/sys To: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201708021014.v72AEHEk061037@repo.freebsd.org> From: Hans Petter Selasky Message-ID: Date: Wed, 2 Aug 2017 14:36:14 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <201708021014.v72AEHEk061037@repo.freebsd.org> 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 12:38:27 -0000 On 08/02/17 12:14, Konstantin Belousov wrote: > +#define major(x) ((int)((dev_t)(x) >> 32)) /* major number */ > +#define minor(x) ((int)((x) & 0xffffffff)) /* minor number */ > +#define makedev(x, y) (((dev_t)(x) << 32) | (y)) /* create dev_t */ One more comment on this issue: I think makedev(x, y) should be declared like this, to avoid issues when "y" is negative: #define makedev(x, y) (((dev_t)(x) << 32) | (unsigned int)(y)) /* create dev_t */ ??? --HPS From owner-svn-src-all@freebsd.org Wed Aug 2 12:39:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9235DD0115; Wed, 2 Aug 2017 12:39:46 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B1C2635EA; Wed, 2 Aug 2017 12:39:46 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id AE912260179; Wed, 2 Aug 2017 14:39:43 +0200 (CEST) Subject: Re: svn commit: r321920 - head/sys/sys To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201708021014.v72AEHEk061037@repo.freebsd.org> <7b1d274f-a531-f788-742a-a8375fe76763@selasky.org> <20170802110607.GC1700@kib.kiev.ua> <760e0077-499e-fffb-a86b-979e410b35e1@selasky.org> <20170802111752.GD1700@kib.kiev.ua> <912d42d0-ea07-82ec-e754-f6b6d2b4cc94@selasky.org> <20170802114303.GE1700@kib.kiev.ua> <20170802123733.GF1700@kib.kiev.ua> From: Hans Petter Selasky Message-ID: Date: Wed, 2 Aug 2017 14:37:32 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20170802123733.GF1700@kib.kiev.ua> 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 12:39:46 -0000 On 08/02/17 14:37, Konstantin Belousov wrote: >> si_drv1->xxx instead of using si_drv0 and dev2unit(). > si_drv1 is 32bit on 32bit platforms. > I mean the LinuxKPI structure pointed to by si_drv1, not si_drv1 itself. --HPS From owner-svn-src-all@freebsd.org Wed Aug 2 12:41:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22E62DD01B5; Wed, 2 Aug 2017 12:41:04 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DEB506379C; Wed, 2 Aug 2017 12:41:03 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id D1A81260179; Wed, 2 Aug 2017 14:41:01 +0200 (CEST) Subject: Re: svn commit: r321920 - head/sys/sys From: Hans Petter Selasky To: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201708021014.v72AEHEk061037@repo.freebsd.org> Message-ID: <37abc595-c80e-a8da-04a8-815f42c634de@selasky.org> Date: Wed, 2 Aug 2017 14:38:50 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 12:41:04 -0000 On 08/02/17 14:36, Hans Petter Selasky wrote: > On 08/02/17 12:14, Konstantin Belousov wrote: >> +#define major(x) ((int)((dev_t)(x) >> 32)) /* major number */ >> +#define minor(x) ((int)((x) & 0xffffffff)) /* minor number */ >> +#define makedev(x, y) (((dev_t)(x) << 32) | (y)) /* create >> dev_t */ > > One more comment on this issue: > > I think makedev(x, y) should be declared like this, to avoid issues when > "y" is negative: > > #define makedev(x, y) (((dev_t)(x) << 32) | (unsigned int)(y)) > /* create dev_t */ > > ??? > > --HPS > > And you'll probably want a final wrapping dev_t cast aswell. 128-bit numbers are not yet there. #define makedev(x, y) ((dev_t)(((dev_t)(x) << 32) | (unsigned int)(y))) > /* create dev_t */ --HPS From owner-svn-src-all@freebsd.org Wed Aug 2 13:08:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6E65DD09C5; Wed, 2 Aug 2017 13:08:11 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 811DD64546; Wed, 2 Aug 2017 13:08:11 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v72D8At6030521; Wed, 2 Aug 2017 13:08:10 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v72D8ApT030520; Wed, 2 Aug 2017 13:08:10 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201708021308.v72D8ApT030520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Wed, 2 Aug 2017 13:08:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321924 - head/sys/amd64/cloudabi64 X-SVN-Group: head X-SVN-Commit-Author: ed X-SVN-Commit-Paths: head/sys/amd64/cloudabi64 X-SVN-Commit-Revision: 321924 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 13:08:11 -0000 Author: ed Date: Wed Aug 2 13:08:10 2017 New Revision: 321924 URL: https://svnweb.freebsd.org/changeset/base/321924 Log: Keep top page on CloudABI to work around AMD Ryzen stability issues. Similar to r321899, reduce sv_maxuser by one page inside of CloudABI. This ensures that the stack, the vDSO and any allocations cannot touch the top page of user virtual memory. Considering that CloudABI userspace is completely oblivious to virtual memory layout, don't bother making this conditional based on the CPU of the running system. Reviewed by: kib, truckman Differential Revision: https://reviews.freebsd.org/D11808 Modified: head/sys/amd64/cloudabi64/cloudabi64_sysvec.c Modified: head/sys/amd64/cloudabi64/cloudabi64_sysvec.c ============================================================================== --- head/sys/amd64/cloudabi64/cloudabi64_sysvec.c Wed Aug 2 12:31:03 2017 (r321923) +++ head/sys/amd64/cloudabi64/cloudabi64_sysvec.c Wed Aug 2 13:08:10 2017 (r321924) @@ -199,7 +199,8 @@ static struct sysentvec cloudabi64_elf_sysvec = { .sv_coredump = elf64_coredump, .sv_pagesize = PAGE_SIZE, .sv_minuser = VM_MIN_ADDRESS, - .sv_maxuser = VM_MAXUSER_ADDRESS, + /* Keep top page reserved to work around AMD Ryzen stability issues. */ + .sv_maxuser = VM_MAXUSER_ADDRESS - PAGE_SIZE, .sv_stackprot = VM_PROT_READ | VM_PROT_WRITE, .sv_copyout_strings = cloudabi64_copyout_strings, .sv_setregs = cloudabi64_proc_setregs, From owner-svn-src-all@freebsd.org Wed Aug 2 13:55:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 210B4DD15D1; Wed, 2 Aug 2017 13:55:02 +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 AB593658AF; Wed, 2 Aug 2017 13:55:01 +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 v72Dstw4052414 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 2 Aug 2017 16:54:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v72Dstw4052414 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v72DstPa052413; Wed, 2 Aug 2017 16:54:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 2 Aug 2017 16:54:55 +0300 From: Konstantin Belousov To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r321920 - head/sys/sys Message-ID: <20170802135455.GG1700@kib.kiev.ua> References: <201708021014.v72AEHEk061037@repo.freebsd.org> <37abc595-c80e-a8da-04a8-815f42c634de@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <37abc595-c80e-a8da-04a8-815f42c634de@selasky.org> User-Agent: Mutt/1.8.3 (2017-05-23) 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 13:55:02 -0000 On Wed, Aug 02, 2017 at 02:38:50PM +0200, Hans Petter Selasky wrote: > On 08/02/17 14:36, Hans Petter Selasky wrote: > > On 08/02/17 12:14, Konstantin Belousov wrote: > >> +#define major(x) ((int)((dev_t)(x) >> 32)) /* major number */ > >> +#define minor(x) ((int)((x) & 0xffffffff)) /* minor number */ > >> +#define makedev(x, y) (((dev_t)(x) << 32) | (y)) /* create > >> dev_t */ > > > > One more comment on this issue: > > > > I think makedev(x, y) should be declared like this, to avoid issues when > > "y" is negative: > > > > #define makedev(x, y) (((dev_t)(x) << 32) | (unsigned int)(y)) > > /* create dev_t */ > > > > ??? > > > > --HPS > > > > > > And you'll probably want a final wrapping dev_t cast aswell. 128-bit > numbers are not yet there. > > #define makedev(x, y) ((dev_t)(((dev_t)(x) << 32) | (unsigned > int)(y))) > > /* create dev_t */ I agree with the usefulness of the y cast to unsigned type, but I am not sure what is the use of final dev_t cast. By the usual arithmetic conversion rules, the final type of the '|' is the highest rank type of the operands. Something unusual can only happen if int is wider than dev_t. So I am going to commit the following update. diff --git a/sys/sys/types.h b/sys/sys/types.h index fce57e412ed..30a08724443 100644 --- a/sys/sys/types.h +++ b/sys/sys/types.h @@ -366,7 +366,7 @@ __bitcount64(__uint64_t _x) #define major(x) ((int)((dev_t)(x) >> 32)) /* major number */ #define minor(x) ((int)((x) & 0xffffffff)) /* minor number */ -#define makedev(x, y) (((dev_t)(x) << 32) | (y)) /* create dev_t */ +#define makedev(x, y) (((dev_t)(x) << 32) | (unsigned)(y)) /* create dev_t */ /* * These declarations belong elsewhere, but are repeated here and in From owner-svn-src-all@freebsd.org Wed Aug 2 14:10:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D890FDD19A8; Wed, 2 Aug 2017 14:10:39 +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 A364D6616C; Wed, 2 Aug 2017 14:10:39 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id A475F260179; Wed, 2 Aug 2017 16:10:37 +0200 (CEST) Subject: Re: svn commit: r321920 - head/sys/sys To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201708021014.v72AEHEk061037@repo.freebsd.org> <37abc595-c80e-a8da-04a8-815f42c634de@selasky.org> <20170802135455.GG1700@kib.kiev.ua> From: Hans Petter Selasky Message-ID: Date: Wed, 2 Aug 2017 16:08:26 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20170802135455.GG1700@kib.kiev.ua> 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 14:10:39 -0000 On 08/02/17 15:54, Konstantin Belousov wrote: > I agree with the usefulness of the y cast to unsigned type, but I am not sure > what is the use of final dev_t cast. By the usual arithmetic conversion > rules, the final type of the '|' is the highest rank type of the operands. > Something unusual can only happen if int is wider than dev_t. > > So I am going to commit the following update. OK, Looks good! --HPS From owner-svn-src-all@freebsd.org Wed Aug 2 14:12:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEE43DD1B44; Wed, 2 Aug 2017 14:12:48 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5ABC366503; Wed, 2 Aug 2017 14:12:48 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v72EClI7058842; Wed, 2 Aug 2017 14:12:47 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v72EClpq058841; Wed, 2 Aug 2017 14:12:47 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201708021412.v72EClpq058841@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 2 Aug 2017 14:12:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321925 - head/sys/arm/arm X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm/arm X-SVN-Commit-Revision: 321925 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 14:12:49 -0000 Author: andrew Date: Wed Aug 2 14:12:47 2017 New Revision: 321925 URL: https://svnweb.freebsd.org/changeset/base/321925 Log: Fix the return type for get_cntxc(). The register is 64-bit on both arm and arm64 so move any truncation to the caller. Submitted by: Mihai Carabas X-Differential Revision: https://reviews.freebsd.org/D10213 Modified: head/sys/arm/arm/generic_timer.c Modified: head/sys/arm/arm/generic_timer.c ============================================================================== --- head/sys/arm/arm/generic_timer.c Wed Aug 2 13:08:10 2017 (r321924) +++ head/sys/arm/arm/generic_timer.c Wed Aug 2 14:12:47 2017 (r321925) @@ -138,7 +138,7 @@ get_freq(void) return (get_el0(cntfrq)); } -static long +static uint64_t get_cntxct(bool physical) { uint64_t val; From owner-svn-src-all@freebsd.org Wed Aug 2 14:27:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FD1ADD1E3E; Wed, 2 Aug 2017 14:27:29 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0BBCE66C13; Wed, 2 Aug 2017 14:27:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v72ERSeT063146; Wed, 2 Aug 2017 14:27:28 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v72ERR18063142; Wed, 2 Aug 2017 14:27:27 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708021427.v72ERR18063142@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Aug 2017 14:27:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321926 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 321926 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 14:27:29 -0000 Author: hselasky Date: Wed Aug 2 14:27:27 2017 New Revision: 321926 URL: https://svnweb.freebsd.org/changeset/base/321926 Log: Fix LinuxKPI regression after r321920. The mda_unit and si_drv0 fields are not wide enough to hold the full 64-bit dev_t. Instead use the "dev" field in the "linux_cdev" structure to store and lookup this value. While at it remove superfluous use of parenthesis inside the MAJOR(), MINOR() and MKDEV() macros in the LinuxKPI. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/cdev.h head/sys/compat/linuxkpi/common/include/linux/fs.h head/sys/compat/linuxkpi/common/include/linux/kdev_t.h head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/include/linux/cdev.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/cdev.h Wed Aug 2 14:12:47 2017 (r321925) +++ head/sys/compat/linuxkpi/common/include/linux/cdev.h Wed Aug 2 14:27:27 2017 (r321926) @@ -95,7 +95,6 @@ cdev_add(struct linux_cdev *cdev, dev_t dev, unsigned args.mda_gid = 0; args.mda_mode = 0700; args.mda_si_drv1 = cdev; - args.mda_unit = dev; error = make_dev_s(&args, &cdev->cdev, "%s", kobject_name(&cdev->kobj)); @@ -121,7 +120,6 @@ cdev_add_ext(struct linux_cdev *cdev, dev_t dev, uid_t args.mda_gid = gid; args.mda_mode = mode; args.mda_si_drv1 = cdev; - args.mda_unit = dev; error = make_dev_s(&args, &cdev->cdev, "%s/%d", kobject_name(&cdev->kobj), MINOR(dev)); Modified: head/sys/compat/linuxkpi/common/include/linux/fs.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/fs.h Wed Aug 2 14:12:47 2017 (r321925) +++ head/sys/compat/linuxkpi/common/include/linux/fs.h Wed Aug 2 14:27:27 2017 (r321926) @@ -229,12 +229,8 @@ nonseekable_open(struct inode *inode, struct file *fil return 0; } -static inline dev_t -iminor(struct inode *inode) -{ - - return (minor(dev2unit(inode->v_rdev))); -} +extern unsigned int linux_iminor(struct inode *); +#define iminor(...) linux_iminor(__VA_ARGS__) static inline struct linux_file * get_file(struct linux_file *f) Modified: head/sys/compat/linuxkpi/common/include/linux/kdev_t.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/kdev_t.h Wed Aug 2 14:12:47 2017 (r321925) +++ head/sys/compat/linuxkpi/common/include/linux/kdev_t.h Wed Aug 2 14:27:27 2017 (r321926) @@ -33,9 +33,9 @@ #include -#define MAJOR(dev) major((dev)) -#define MINOR(dev) minor((dev)) -#define MKDEV(ma, mi) makedev((ma), (mi)) +#define MAJOR(dev) major(dev) +#define MINOR(dev) minor(dev) +#define MKDEV(ma, mi) makedev(ma, mi) static inline uint16_t old_encode_dev(dev_t dev) Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Wed Aug 2 14:12:47 2017 (r321925) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Wed Aug 2 14:27:27 2017 (r321926) @@ -1417,6 +1417,21 @@ linux_file_fill_kinfo(struct file *fp, struct kinfo_fi return (0); } +unsigned int +linux_iminor(struct inode *inode) +{ + struct linux_cdev *ldev; + + if (inode == NULL || inode->v_rdev == NULL || + inode->v_rdev->si_devsw != &linuxcdevsw) + return (-1U); + ldev = inode->v_rdev->si_drv1; + if (ldev == NULL) + return (-1U); + + return (minor(ldev->dev)); +} + struct fileops linuxfileops = { .fo_read = linux_file_read, .fo_write = invfo_rdwr, @@ -1975,13 +1990,13 @@ linux_in_atomic(void) struct linux_cdev * linux_find_cdev(const char *name, unsigned major, unsigned minor) { - int unit = MKDEV(major, minor); + dev_t dev = MKDEV(major, minor); struct cdev *cdev; dev_lock(); LIST_FOREACH(cdev, &linuxcdevsw.d_devs, si_list) { struct linux_cdev *ldev = cdev->si_drv1; - if (dev2unit(cdev) == unit && + if (ldev->dev == dev && strcmp(kobject_name(&ldev->kobj), name) == 0) { break; } From owner-svn-src-all@freebsd.org Wed Aug 2 14:43:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32CB4DD24D8; Wed, 2 Aug 2017 14:43:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0CDF5675D7; Wed, 2 Aug 2017 14:43: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 v72EhDjk071431; Wed, 2 Aug 2017 14:43:13 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v72EhDFe071429; Wed, 2 Aug 2017 14:43:13 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201708021443.v72EhDFe071429@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 2 Aug 2017 14:43: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: r321927 - stable/11/usr.sbin/diskinfo X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/usr.sbin/diskinfo X-SVN-Commit-Revision: 321927 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 14:43:14 -0000 Author: mav Date: Wed Aug 2 14:43:12 2017 New Revision: 321927 URL: https://svnweb.freebsd.org/changeset/base/321927 Log: MFC r320555, r320576 (by allanjude): Add -s (serial) and -p (physpath) to diskinfo Return the bare requested information, intended for scripting. The serial number of a SAS/SCSI device can be returned with 'camcontrol inquiry disk -S', but there is no similar switch for SATA. This provides a way to get this information from both SAS and SATA disks the -s and -p flags are mutually exclusive, and cannot be used with any other flags. Modified: stable/11/usr.sbin/diskinfo/diskinfo.8 stable/11/usr.sbin/diskinfo/diskinfo.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/diskinfo/diskinfo.8 ============================================================================== --- stable/11/usr.sbin/diskinfo/diskinfo.8 Wed Aug 2 14:27:27 2017 (r321926) +++ stable/11/usr.sbin/diskinfo/diskinfo.8 Wed Aug 2 14:43:12 2017 (r321927) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 22, 2016 +.Dd July 1, 2017 .Dt DISKINFO 8 .Os .Sh NAME @@ -38,6 +38,12 @@ .Nm .Op Fl citv .Ar disk ... +.Nm +.Op Fl p +.Ar disk ... +.Nm +.Op Fl s +.Ar disk ... .Sh DESCRIPTION The .Nm @@ -52,6 +58,12 @@ Print fields one per line with a descriptive comment. Perform a simple measurement of the I/O read command overhead. .It Fl i Perform a simple IOPS benchmark. +.It Fl p +Return the physical path of the disk. +This is a string that identifies the physical path to the disk in the +storage enclosure. +.It Fl s +Return the disk serial number .It Fl t Perform a simple and rather naive benchmark of the disks seek and transfer performance. @@ -62,6 +74,13 @@ with the following fields: device name, sectorsize, me media size in sectors, stripe size, stripe offset, firmware cylinders, firmware heads, and firmware sectors. The last three fields are only present if the information is available. +.It Fl i +Return the disk ident, usually the serial number. +.It Fl p +Return the physical path of the disk. +This is a string that identifies the physical path to the disk in the +storage enclosure. +.El .Sh HISTORY The .Nm Modified: stable/11/usr.sbin/diskinfo/diskinfo.c ============================================================================== --- stable/11/usr.sbin/diskinfo/diskinfo.c Wed Aug 2 14:27:27 2017 (r321926) +++ stable/11/usr.sbin/diskinfo/diskinfo.c Wed Aug 2 14:43:12 2017 (r321927) @@ -55,7 +55,7 @@ usage(void) exit (1); } -static int opt_c, opt_i, opt_t, opt_v; +static int opt_c, opt_i, opt_p, opt_s, opt_t, opt_v; static void speeddisk(int fd, off_t mediasize, u_int sectorsize); static void commandtime(int fd, off_t mediasize, u_int sectorsize); @@ -74,7 +74,7 @@ main(int argc, char **argv) u_int sectorsize, fwsectors, fwheads, zoned = 0; uint32_t zone_mode; - while ((ch = getopt(argc, argv, "citv")) != -1) { + while ((ch = getopt(argc, argv, "cipstv")) != -1) { switch (ch) { case 'c': opt_c = 1; @@ -84,6 +84,12 @@ main(int argc, char **argv) opt_i = 1; opt_v = 1; break; + case 'p': + opt_p = 1; + break; + case 's': + opt_s = 1; + break; case 't': opt_t = 1; opt_v = 1; @@ -101,6 +107,11 @@ main(int argc, char **argv) if (argc < 1) usage(); + if ((opt_p && opt_s) || ((opt_p || opt_s) && (opt_c || opt_i || opt_t || opt_v))) { + warnx("-p or -s cannot be used with other options"); + usage(); + } + for (i = 0; i < argc; i++) { fd = open(argv[i], O_RDONLY | O_DIRECT); if (fd < 0 && errno == ENOENT && *argv[i] != '/') { @@ -124,7 +135,27 @@ main(int argc, char **argv) fwheads = 0; stripesize = sb.st_blksize; stripeoffset = 0; + if (opt_p || opt_s) { + warnx("-p and -s only operate on physical devices: %s", argv[i]); + goto out; + } } else { + if (opt_p) { + if (ioctl(fd, DIOCGPHYSPATH, physpath) == 0) { + printf("%s\n", physpath); + } else { + warnx("Failed to determine physpath for: %s", argv[i]); + } + goto out; + } + if (opt_s) { + if (ioctl(fd, DIOCGIDENT, ident) == 0) { + printf("%s\n", ident); + } else { + warnx("Failed to determine serial number for: %s", argv[i]); + } + goto out; + } error = ioctl(fd, DIOCGMEDIASIZE, &mediasize); if (error) { warnx("%s: ioctl(DIOCGMEDIASIZE) failed, probably not a disk.", argv[i]); From owner-svn-src-all@freebsd.org Wed Aug 2 14:45:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDD19DD25A7; Wed, 2 Aug 2017 14:45:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA8C167736; Wed, 2 Aug 2017 14:45:23 +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 v72EjMtt071579; Wed, 2 Aug 2017 14:45:22 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v72EjMJf071577; Wed, 2 Aug 2017 14:45:22 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201708021445.v72EjMJf071577@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 2 Aug 2017 14:45: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: r321928 - stable/11/usr.sbin/diskinfo X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/usr.sbin/diskinfo X-SVN-Commit-Revision: 321928 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 14:45:24 -0000 Author: mav Date: Wed Aug 2 14:45:22 2017 New Revision: 321928 URL: https://svnweb.freebsd.org/changeset/base/321928 Log: MFC r320683: Add naive benchmark for SSDs in ZFS SLOG role. ZFS SLOGs have very specific access pattern with many cache flushes, which none of benchmarks I know can simulate. Since SSD vendors rarely specify cache flush time, this measurement can be useful to explain why some ZFS pools are slower then expected. This test writes data chunks of different size followed by cache flush, alike to what ZFS SLOG does, and measures average time. To illustrate, here is result for 6 years old SATA Intel 710 Series SSD: Synchronous random writes: 0.5 kbytes: 138.3 usec/IO = 3.5 Mbytes/s 1 kbytes: 137.7 usec/IO = 7.1 Mbytes/s 2 kbytes: 151.1 usec/IO = 12.9 Mbytes/s 4 kbytes: 158.2 usec/IO = 24.7 Mbytes/s 8 kbytes: 175.6 usec/IO = 44.5 Mbytes/s 16 kbytes: 210.1 usec/IO = 74.4 Mbytes/s 32 kbytes: 274.2 usec/IO = 114.0 Mbytes/s 64 kbytes: 416.5 usec/IO = 150.1 Mbytes/s 128 kbytes: 776.6 usec/IO = 161.0 Mbytes/s 256 kbytes: 1503.1 usec/IO = 166.3 Mbytes/s 512 kbytes: 2968.7 usec/IO = 168.4 Mbytes/s 1024 kbytes: 5866.8 usec/IO = 170.5 Mbytes/s 2048 kbytes: 11696.6 usec/IO = 171.0 Mbytes/s 4096 kbytes: 23329.6 usec/IO = 171.5 Mbytes/s 8192 kbytes: 46779.5 usec/IO = 171.0 Mbytes/s , and much newer and supposedly much faster NVMe Samsung 950 PRO SSD: Synchronous random writes: 0.5 kbytes: 2092.9 usec/IO = 0.2 Mbytes/s 1 kbytes: 2013.1 usec/IO = 0.5 Mbytes/s 2 kbytes: 2014.8 usec/IO = 1.0 Mbytes/s 4 kbytes: 2090.7 usec/IO = 1.9 Mbytes/s 8 kbytes: 2044.5 usec/IO = 3.8 Mbytes/s 16 kbytes: 2084.8 usec/IO = 7.5 Mbytes/s 32 kbytes: 2137.1 usec/IO = 14.6 Mbytes/s 64 kbytes: 2173.4 usec/IO = 28.8 Mbytes/s 128 kbytes: 2923.9 usec/IO = 42.8 Mbytes/s 256 kbytes: 3085.3 usec/IO = 81.0 Mbytes/s 512 kbytes: 3112.2 usec/IO = 160.7 Mbytes/s 1024 kbytes: 2430.6 usec/IO = 411.4 Mbytes/s 2048 kbytes: 3788.9 usec/IO = 527.9 Mbytes/s 4096 kbytes: 6198.0 usec/IO = 645.4 Mbytes/s 8192 kbytes: 10764.9 usec/IO = 743.2 Mbytes/s While the first one obviously has maximal throughput limitations, the second one has so high cache flush latency (about 2 millisecond), that it makes one almost useless in SLOG role, despite of its good throughput numbers. Power loss protection is out of scope of this test, but I suspect it can be related. Modified: stable/11/usr.sbin/diskinfo/diskinfo.8 stable/11/usr.sbin/diskinfo/diskinfo.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/diskinfo/diskinfo.8 ============================================================================== --- stable/11/usr.sbin/diskinfo/diskinfo.8 Wed Aug 2 14:43:12 2017 (r321927) +++ stable/11/usr.sbin/diskinfo/diskinfo.8 Wed Aug 2 14:45:22 2017 (r321928) @@ -1,5 +1,6 @@ .\" .\" Copyright (c) 2003 Poul-Henning Kamp +.\" Copyright (c) 2017 Alexander Motin .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -28,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 1, 2017 +.Dd July 4, 2017 .Dt DISKINFO 8 .Os .Sh NAME @@ -36,7 +37,7 @@ .Nd get information about disk device .Sh SYNOPSIS .Nm -.Op Fl citv +.Op Fl citSvw .Ar disk ... .Nm .Op Fl p @@ -64,9 +65,16 @@ This is a string that identifies the physical path to storage enclosure. .It Fl s Return the disk serial number +.It Fl S +Perform synchronous random write test (ZFS SLOG test), +measuring time required to write data blocks of different size and +flush disk cache. +Blocks of more then 128KB are written with multiple parallel operations. .It Fl t Perform a simple and rather naive benchmark of the disks seek and transfer performance. +.It Fl w +Allow disruptive write tests. .El .Pp If given no arguments, the output will be a single line per specified device Modified: stable/11/usr.sbin/diskinfo/diskinfo.c ============================================================================== --- stable/11/usr.sbin/diskinfo/diskinfo.c Wed Aug 2 14:43:12 2017 (r321927) +++ stable/11/usr.sbin/diskinfo/diskinfo.c Wed Aug 2 14:45:22 2017 (r321928) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2003 Poul-Henning Kamp * Copyright (c) 2015 Spectra Logic Corporation + * Copyright (c) 2017 Alexander Motin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -40,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -51,15 +53,16 @@ static void usage(void) { - fprintf(stderr, "usage: diskinfo [-citv] disk ...\n"); + fprintf(stderr, "usage: diskinfo [-cipsStvw] disk ...\n"); exit (1); } -static int opt_c, opt_i, opt_p, opt_s, opt_t, opt_v; +static int opt_c, opt_i, opt_p, opt_s, opt_S, opt_t, opt_v, opt_w; static void speeddisk(int fd, off_t mediasize, u_int sectorsize); static void commandtime(int fd, off_t mediasize, u_int sectorsize); static void iopsbench(int fd, off_t mediasize, u_int sectorsize); +static void slogbench(int fd, int isreg, off_t mediasize, u_int sectorsize); static int zonecheck(int fd, uint32_t *zone_mode, char *zone_str, size_t zone_str_len); @@ -71,10 +74,10 @@ main(int argc, char **argv) char buf[BUFSIZ], ident[DISK_IDENT_SIZE], physpath[MAXPATHLEN]; char zone_desc[64]; off_t mediasize, stripesize, stripeoffset; - u_int sectorsize, fwsectors, fwheads, zoned = 0; + u_int sectorsize, fwsectors, fwheads, zoned = 0, isreg; uint32_t zone_mode; - while ((ch = getopt(argc, argv, "cipstv")) != -1) { + while ((ch = getopt(argc, argv, "cipsStvw")) != -1) { switch (ch) { case 'c': opt_c = 1; @@ -90,6 +93,10 @@ main(int argc, char **argv) case 's': opt_s = 1; break; + case 'S': + opt_S = 1; + opt_v = 1; + break; case 't': opt_t = 1; opt_v = 1; @@ -97,6 +104,9 @@ main(int argc, char **argv) case 'v': opt_v = 1; break; + case 'w': + opt_w = 1; + break; default: usage(); } @@ -112,8 +122,13 @@ main(int argc, char **argv) usage(); } + if (opt_S && !opt_w) { + warnx("-S require also -w"); + usage(); + } + for (i = 0; i < argc; i++) { - fd = open(argv[i], O_RDONLY | O_DIRECT); + fd = open(argv[i], (opt_w ? O_RDWR : O_RDONLY) | O_DIRECT); if (fd < 0 && errno == ENOENT && *argv[i] != '/') { snprintf(buf, BUFSIZ, "%s%s", _PATH_DEV, argv[i]); fd = open(buf, O_RDONLY); @@ -128,7 +143,8 @@ main(int argc, char **argv) exitval = 1; goto out; } - if (S_ISREG(sb.st_mode)) { + isreg = S_ISREG(sb.st_mode); + if (isreg) { mediasize = sb.st_size; sectorsize = S_BLKSIZE; fwsectors = 0; @@ -228,16 +244,18 @@ main(int argc, char **argv) speeddisk(fd, mediasize, sectorsize); if (opt_i) iopsbench(fd, mediasize, sectorsize); + if (opt_S) + slogbench(fd, isreg, mediasize, sectorsize); out: close(fd); } exit (exitval); } +#define MAXTX (8*1024*1024) +#define MEGATX (1024*1024) +static uint8_t buf[MAXTX]; -static char sector[65536]; -static char mega[1024 * 1024]; - static void rdsect(int fd, off_t blockno, u_int sectorsize) { @@ -245,7 +263,7 @@ rdsect(int fd, off_t blockno, u_int sectorsize) if (lseek(fd, (off_t)blockno * sectorsize, SEEK_SET) == -1) err(1, "lseek"); - error = read(fd, sector, sectorsize); + error = read(fd, buf, sectorsize); if (error == -1) err(1, "read"); if (error != (int)sectorsize) @@ -257,10 +275,10 @@ rdmega(int fd) { int error; - error = read(fd, mega, sizeof(mega)); + error = read(fd, buf, MEGATX); if (error == -1) err(1, "read"); - if (error != sizeof(mega)) + if (error != MEGATX) errx(1, "disk too small for test."); } @@ -321,6 +339,16 @@ TI(double count) } static void +TS(u_int size, int count) +{ + double dt; + + dt = delta_t(); + printf("%8.1f usec/IO = %8.1f Mbytes/s\n", + dt * 1000000.0 / count, size * count / dt / (1024 * 1024)); +} + +static void speeddisk(int fd, off_t mediasize, u_int sectorsize) { int bulk, i; @@ -555,6 +583,69 @@ iopsbench(int fd, off_t mediasize, u_int sectorsize) iops(fd, mediasize, 128 * 1024); printf("\n"); +} + +#define MAXIO (128*1024) +#define MAXIOS (MAXTX / MAXIO) + +static void +parwrite(int fd, size_t size, off_t off) +{ + struct aiocb aios[MAXIOS]; + off_t o; + size_t s; + int n, error; + struct aiocb *aiop; + + for (n = 0, o = 0; size > MAXIO; n++, size -= s, o += s) { + s = (size >= MAXIO) ? MAXIO : size; + aiop = &aios[n]; + bzero(aiop, sizeof(*aiop)); + aiop->aio_buf = &buf[o]; + aiop->aio_fildes = fd; + aiop->aio_offset = off + o; + aiop->aio_nbytes = s; + error = aio_write(aiop); + if (error != 0) + err(EX_IOERR, "AIO write submit error"); + } + error = pwrite(fd, &buf[o], size, off + o); + if (error < 0) + err(EX_IOERR, "Sync write error"); + for (; n > 0; n--) { + error = aio_waitcomplete(&aiop, NULL); + if (error < 0) + err(EX_IOERR, "AIO write wait error"); + } +} + +static void +slogbench(int fd, int isreg, off_t mediasize, u_int sectorsize) +{ + off_t off; + u_int size; + int error, n, N; + + printf("Synchronous random writes:\n"); + for (size = sectorsize; size <= MAXTX; size *= 2) { + printf("\t%4.4g kbytes: ", (double)size / 1024); + N = 0; + T0(); + do { + for (n = 0; n < 250; n++) { + off = random() % (mediasize / size); + parwrite(fd, size, off * size); + if (isreg) + error = fsync(fd); + else + error = ioctl(fd, DIOCGFLUSH); + if (error < 0) + err(EX_IOERR, "Flush error"); + } + N += 250; + } while (delta_t() < 1.0); + TS(size, N); + } } static int From owner-svn-src-all@freebsd.org Wed Aug 2 14:45:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C983DD260D; Wed, 2 Aug 2017 14:45:59 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C02D6786F; Wed, 2 Aug 2017 14:45:59 +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 v72EjwkD071656; Wed, 2 Aug 2017 14:45:58 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v72Ejw0o071655; Wed, 2 Aug 2017 14:45:58 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201708021445.v72Ejw0o071655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 2 Aug 2017 14:45: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: r321929 - stable/11/usr.sbin/diskinfo X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/usr.sbin/diskinfo X-SVN-Commit-Revision: 321929 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 14:45:59 -0000 Author: mav Date: Wed Aug 2 14:45:58 2017 New Revision: 321929 URL: https://svnweb.freebsd.org/changeset/base/321929 Log: MFC r320730: Report device descr in addition to ident. Serial number without device model is somewhat less useful. Modified: stable/11/usr.sbin/diskinfo/diskinfo.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/diskinfo/diskinfo.c ============================================================================== --- stable/11/usr.sbin/diskinfo/diskinfo.c Wed Aug 2 14:45:22 2017 (r321928) +++ stable/11/usr.sbin/diskinfo/diskinfo.c Wed Aug 2 14:45:58 2017 (r321929) @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -73,6 +74,7 @@ main(int argc, char **argv) int i, ch, fd, error, exitval = 0; char buf[BUFSIZ], ident[DISK_IDENT_SIZE], physpath[MAXPATHLEN]; char zone_desc[64]; + struct diocgattr_arg arg; off_t mediasize, stripesize, stripeoffset; u_int sectorsize, fwsectors, fwheads, zoned = 0, isreg; uint32_t zone_mode; @@ -230,6 +232,10 @@ main(int argc, char **argv) printf("\t%-12u\t# Heads according to firmware.\n", fwheads); printf("\t%-12u\t# Sectors according to firmware.\n", fwsectors); } + strlcpy(arg.name, "GEOM::descr", sizeof(arg.name)); + arg.len = sizeof(arg.value.str); + if (ioctl(fd, DIOCGATTR, &arg) == 0) + printf("\t%-12s\t# Disk descr.\n", arg.value.str); if (ioctl(fd, DIOCGIDENT, ident) == 0) printf("\t%-12s\t# Disk ident.\n", ident); if (ioctl(fd, DIOCGPHYSPATH, physpath) == 0) From owner-svn-src-all@freebsd.org Wed Aug 2 14:54:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37F5BDD2995; Wed, 2 Aug 2017 14:54:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0776A67DE9; Wed, 2 Aug 2017 14:54:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v72Estrr075495; Wed, 2 Aug 2017 14:54:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v72EstOB075494; Wed, 2 Aug 2017 14:54:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708021454.v72EstOB075494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 2 Aug 2017 14:54:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321930 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 321930 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 14:54:56 -0000 Author: kib Date: Wed Aug 2 14:54:54 2017 New Revision: 321930 URL: https://svnweb.freebsd.org/changeset/base/321930 Log: For makedev(), cast the minor argument to unsigned type explicitely, avoiding possible sign propagation. Submitted by: hselasky Modified: head/sys/sys/types.h Modified: head/sys/sys/types.h ============================================================================== --- head/sys/sys/types.h Wed Aug 2 14:45:58 2017 (r321929) +++ head/sys/sys/types.h Wed Aug 2 14:54:54 2017 (r321930) @@ -366,7 +366,7 @@ __bitcount64(__uint64_t _x) #define major(x) ((int)((dev_t)(x) >> 32)) /* major number */ #define minor(x) ((int)((x) & 0xffffffff)) /* minor number */ -#define makedev(x, y) (((dev_t)(x) << 32) | (y)) /* create dev_t */ +#define makedev(x, y) (((dev_t)(x) << 32) | (unsigned)(y)) /* create dev_t */ /* * These declarations belong elsewhere, but are repeated here and in From owner-svn-src-all@freebsd.org Wed Aug 2 15:11:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D55DEDD2CF9; Wed, 2 Aug 2017 15:11:07 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE94F686FC; Wed, 2 Aug 2017 15:11:07 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v72FB6Jc080137; Wed, 2 Aug 2017 15:11:06 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v72FB665080136; Wed, 2 Aug 2017 15:11:06 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201708021511.v72FB665080136@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Wed, 2 Aug 2017 15:11: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: r321931 - stable/11/sys/dev/ichsmb X-SVN-Group: stable-11 X-SVN-Commit-Author: gavin X-SVN-Commit-Paths: stable/11/sys/dev/ichsmb X-SVN-Commit-Revision: 321931 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 15:11:07 -0000 Author: gavin Date: Wed Aug 2 15:11:06 2017 New Revision: 321931 URL: https://svnweb.freebsd.org/changeset/base/321931 Log: Merge r316113,316184,316413 from head: - Remove #define PCIS_SERIALBUS_SMBUS_PROGIF, unused since r200091 - Switch device_probe() from large case statement to a lookup table - Add several missing SMBus controllers Modified: stable/11/sys/dev/ichsmb/ichsmb_pci.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ichsmb/ichsmb_pci.c ============================================================================== --- stable/11/sys/dev/ichsmb/ichsmb_pci.c Wed Aug 2 14:54:54 2017 (r321930) +++ stable/11/sys/dev/ichsmb/ichsmb_pci.c Wed Aug 2 15:11:06 2017 (r321931) @@ -67,35 +67,89 @@ __FBSDID("$FreeBSD$"); #include /* PCI unique identifiers */ -#define ID_82801AA 0x24138086 -#define ID_82801AB 0x24238086 -#define ID_82801BA 0x24438086 -#define ID_82801CA 0x24838086 -#define ID_82801DC 0x24C38086 -#define ID_82801EB 0x24D38086 -#define ID_82801FB 0x266A8086 -#define ID_82801GB 0x27da8086 -#define ID_82801H 0x283e8086 -#define ID_82801I 0x29308086 -#define ID_82801JI 0x3a308086 -#define ID_PCH 0x3b308086 -#define ID_6300ESB 0x25a48086 -#define ID_631xESB 0x269b8086 -#define ID_DH89XXCC 0x23308086 -#define ID_PATSBURG 0x1d228086 -#define ID_CPT 0x1c228086 -#define ID_PPT 0x1e228086 -#define ID_AVOTON 0x1f3c8086 -#define ID_COLETOCRK 0x23B08086 -#define ID_LPT 0x8c228086 -#define ID_LPTLP 0x9c228086 -#define ID_WCPT 0x8ca28086 -#define ID_WCPTLP 0x9ca28086 -#define ID_WELLSBURG 0x8d228086 -#define ID_SRPT 0xa1238086 -#define ID_SRPTLP 0x9d238086 +#define PCI_VENDOR_INTEL 0x8086 +#define ID_82801AA 0x2413 +#define ID_82801AB 0x2423 +#define ID_82801BA 0x2443 +#define ID_82801CA 0x2483 +#define ID_82801DC 0x24C3 +#define ID_82801EB 0x24D3 +#define ID_82801FB 0x266A +#define ID_82801GB 0x27da +#define ID_82801H 0x283e +#define ID_82801I 0x2930 +#define ID_EP80579 0x5032 +#define ID_82801JI 0x3a30 +#define ID_82801JD 0x3a60 +#define ID_PCH 0x3b30 +#define ID_6300ESB 0x25a4 +#define ID_631xESB 0x269b +#define ID_DH89XXCC 0x2330 +#define ID_PATSBURG 0x1d22 +#define ID_CPT 0x1c22 +#define ID_PPT 0x1e22 +#define ID_AVOTON 0x1f3c +#define ID_COLETOCRK 0x23B0 +#define ID_LPT 0x8c22 +#define ID_LPTLP 0x9c22 +#define ID_WCPT 0x8ca2 +#define ID_WCPTLP 0x9ca2 +#define ID_BAYTRAIL 0x0f12 +#define ID_BRASWELL 0x2292 +#define ID_WELLSBURG 0x8d22 +#define ID_SRPT 0xa123 +#define ID_SRPTLP 0x9d23 +#define ID_DENVERTON 0x19df +#define ID_BROXTON 0x5ad4 +#define ID_LEWISBURG 0xa1a3 +#define ID_LEWISBURG2 0xa223 +#define ID_KABYLAKE 0xa2a3 -#define PCIS_SERIALBUS_SMBUS_PROGIF 0x00 +static const struct ichsmb_device { + uint16_t id; + const char *name; +} ichsmb_devices[] = { + { ID_82801AA, "Intel 82801AA (ICH) SMBus controller" }, + { ID_82801AB, "Intel 82801AB (ICH0) SMBus controller" }, + { ID_82801BA, "Intel 82801BA (ICH2) SMBus controller" }, + { ID_82801CA, "Intel 82801CA (ICH3) SMBus controller" }, + { ID_82801DC, "Intel 82801DC (ICH4) SMBus controller" }, + { ID_82801EB, "Intel 82801EB (ICH5) SMBus controller" }, + { ID_82801FB, "Intel 82801FB (ICH6) SMBus controller" }, + { ID_82801GB, "Intel 82801GB (ICH7) SMBus controller" }, + { ID_82801H, "Intel 82801H (ICH8) SMBus controller" }, + { ID_82801I, "Intel 82801I (ICH9) SMBus controller" }, + { ID_82801GB, "Intel 82801GB (ICH7) SMBus controller" }, + { ID_82801H, "Intel 82801H (ICH8) SMBus controller" }, + { ID_82801I, "Intel 82801I (ICH9) SMBus controller" }, + { ID_EP80579, "Intel EP80579 SMBus controller" }, + { ID_82801JI, "Intel 82801JI (ICH10) SMBus controller" }, + { ID_82801JD, "Intel 82801JD (ICH10) SMBus controller" }, + { ID_PCH, "Intel PCH SMBus controller" }, + { ID_6300ESB, "Intel 6300ESB (ICH) SMBus controller" }, + { ID_631xESB, "Intel 631xESB/6321ESB (ESB2) SMBus controller" }, + { ID_DH89XXCC, "Intel DH89xxCC SMBus controller" }, + { ID_PATSBURG, "Intel Patsburg SMBus controller" }, + { ID_CPT, "Intel Cougar Point SMBus controller" }, + { ID_PPT, "Intel Panther Point SMBus controller" }, + { ID_AVOTON, "Intel Avoton SMBus controller" }, + { ID_LPT, "Intel Lynx Point SMBus controller" }, + { ID_LPTLP, "Intel Lynx Point-LP SMBus controller" }, + { ID_WCPT, "Intel Wildcat Point SMBus controller" }, + { ID_WCPTLP, "Intel Wildcat Point-LP SMBus controller" }, + { ID_BAYTRAIL, "Intel Baytrail SMBus controller" }, + { ID_BRASWELL, "Intel Braswell SMBus controller" }, + { ID_COLETOCRK, "Intel Coleto Creek SMBus controller" }, + { ID_WELLSBURG, "Intel Wellsburg SMBus controller" }, + { ID_SRPT, "Intel Sunrise Point-H SMBus controller" }, + { ID_SRPTLP, "Intel Sunrise Point-LP SMBus controller" }, + { ID_DENVERTON, "Intel Denverton SMBus controller" }, + { ID_BROXTON, "Intel Broxton SMBus controller" }, + { ID_LEWISBURG, "Intel Lewisburg SMBus controller" }, + { ID_LEWISBURG2,"Intel Lewisburg SMBus controller" }, + { ID_KABYLAKE, "Intel Kaby Lake SMBus controller" }, + { 0, NULL }, +}; /* Internal functions */ static int ichsmb_pci_probe(device_t dev); @@ -141,95 +195,19 @@ DRIVER_MODULE(ichsmb, pci, ichsmb_pci_driver, ichsmb_p static int ichsmb_pci_probe(device_t dev) { - /* Check PCI identifier */ - switch (pci_get_devid(dev)) { - case ID_82801AA: - device_set_desc(dev, "Intel 82801AA (ICH) SMBus controller"); - break; - case ID_82801AB: - device_set_desc(dev, "Intel 82801AB (ICH0) SMBus controller"); - break; - case ID_82801BA: - device_set_desc(dev, "Intel 82801BA (ICH2) SMBus controller"); - break; - case ID_82801CA: - device_set_desc(dev, "Intel 82801CA (ICH3) SMBus controller"); - break; - case ID_82801DC: - device_set_desc(dev, "Intel 82801DC (ICH4) SMBus controller"); - break; - case ID_82801EB: - device_set_desc(dev, "Intel 82801EB (ICH5) SMBus controller"); - break; - case ID_82801FB: - device_set_desc(dev, "Intel 82801FB (ICH6) SMBus controller"); - break; - case ID_82801GB: - device_set_desc(dev, "Intel 82801GB (ICH7) SMBus controller"); - break; - case ID_82801H: - device_set_desc(dev, "Intel 82801H (ICH8) SMBus controller"); - break; - case ID_82801I: - device_set_desc(dev, "Intel 82801I (ICH9) SMBus controller"); - break; - case ID_82801JI: - device_set_desc(dev, "Intel 82801JI (ICH10) SMBus controller"); - break; - case ID_PCH: - device_set_desc(dev, "Intel PCH SMBus controller"); - break; - case ID_6300ESB: - device_set_desc(dev, "Intel 6300ESB (ICH) SMBus controller"); - break; - case ID_631xESB: - device_set_desc(dev, "Intel 631xESB/6321ESB (ESB2) SMBus controller"); - break; - case ID_DH89XXCC: - device_set_desc(dev, "Intel DH89xxCC SMBus controller"); - break; - case ID_PATSBURG: - device_set_desc(dev, "Intel Patsburg SMBus controller"); - break; - case ID_CPT: - device_set_desc(dev, "Intel Cougar Point SMBus controller"); - break; - case ID_PPT: - device_set_desc(dev, "Intel Panther Point SMBus controller"); - break; - case ID_AVOTON: - device_set_desc(dev, "Intel Avoton SMBus controller"); - break; - case ID_LPT: - device_set_desc(dev, "Intel Lynx Point SMBus controller"); - break; - case ID_LPTLP: - device_set_desc(dev, "Intel Lynx Point-LP SMBus controller"); - break; - case ID_WCPT: - device_set_desc(dev, "Intel Wildcat Point SMBus controller"); - break; - case ID_WCPTLP: - device_set_desc(dev, "Intel Wildcat Point-LP SMBus controller"); - break; - case ID_COLETOCRK: - device_set_desc(dev, "Intel Coleto Creek SMBus controller"); - break; - case ID_WELLSBURG: - device_set_desc(dev, "Intel Wellsburg SMBus controller"); - break; - case ID_SRPT: - device_set_desc(dev, "Intel Sunrise Point-H SMBus controller"); - break; - case ID_SRPTLP: - device_set_desc(dev, "Intel Sunrise Point-LP SMBus controller"); - break; - default: + const struct ichsmb_device *device; + + if (pci_get_vendor(dev) != PCI_VENDOR_INTEL) return (ENXIO); + + for (device = ichsmb_devices; device->name != NULL; device++) { + if (pci_get_device(dev) == device->id) { + device_set_desc(dev, device->name); + return (ichsmb_probe(dev)); + } } - /* Done */ - return (ichsmb_probe(dev)); + return (ENXIO); } static int From owner-svn-src-all@freebsd.org Wed Aug 2 15:13:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDF27DD2E7C; Wed, 2 Aug 2017 15:13:14 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 65EDA68931; Wed, 2 Aug 2017 15:13:14 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v72FDDkp083977; Wed, 2 Aug 2017 15:13:13 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v72FDDPa083976; Wed, 2 Aug 2017 15:13:13 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201708021513.v72FDDPa083976@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Wed, 2 Aug 2017 15:13:13 +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: r321932 - stable/10/sys/dev/ichsmb X-SVN-Group: stable-10 X-SVN-Commit-Author: gavin X-SVN-Commit-Paths: stable/10/sys/dev/ichsmb X-SVN-Commit-Revision: 321932 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 15:13:14 -0000 Author: gavin Date: Wed Aug 2 15:13:13 2017 New Revision: 321932 URL: https://svnweb.freebsd.org/changeset/base/321932 Log: Merge r316113,316184,316413 from head: - Remove #define PCIS_SERIALBUS_SMBUS_PROGIF, unused since r200091 - Switch device_probe() from large case statement to a lookup table - Add several missing SMBus controllers Modified: stable/10/sys/dev/ichsmb/ichsmb_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ichsmb/ichsmb_pci.c ============================================================================== --- stable/10/sys/dev/ichsmb/ichsmb_pci.c Wed Aug 2 15:11:06 2017 (r321931) +++ stable/10/sys/dev/ichsmb/ichsmb_pci.c Wed Aug 2 15:13:13 2017 (r321932) @@ -67,35 +67,89 @@ __FBSDID("$FreeBSD$"); #include /* PCI unique identifiers */ -#define ID_82801AA 0x24138086 -#define ID_82801AB 0x24238086 -#define ID_82801BA 0x24438086 -#define ID_82801CA 0x24838086 -#define ID_82801DC 0x24C38086 -#define ID_82801EB 0x24D38086 -#define ID_82801FB 0x266A8086 -#define ID_82801GB 0x27da8086 -#define ID_82801H 0x283e8086 -#define ID_82801I 0x29308086 -#define ID_82801JI 0x3a308086 -#define ID_PCH 0x3b308086 -#define ID_6300ESB 0x25a48086 -#define ID_631xESB 0x269b8086 -#define ID_DH89XXCC 0x23308086 -#define ID_PATSBURG 0x1d228086 -#define ID_CPT 0x1c228086 -#define ID_PPT 0x1e228086 -#define ID_AVOTON 0x1f3c8086 -#define ID_COLETOCRK 0x23B08086 -#define ID_LPT 0x8c228086 -#define ID_LPTLP 0x9c228086 -#define ID_WCPT 0x8ca28086 -#define ID_WCPTLP 0x9ca28086 -#define ID_WELLSBURG 0x8d228086 -#define ID_SRPT 0xa1238086 -#define ID_SRPTLP 0x9d238086 +#define PCI_VENDOR_INTEL 0x8086 +#define ID_82801AA 0x2413 +#define ID_82801AB 0x2423 +#define ID_82801BA 0x2443 +#define ID_82801CA 0x2483 +#define ID_82801DC 0x24C3 +#define ID_82801EB 0x24D3 +#define ID_82801FB 0x266A +#define ID_82801GB 0x27da +#define ID_82801H 0x283e +#define ID_82801I 0x2930 +#define ID_EP80579 0x5032 +#define ID_82801JI 0x3a30 +#define ID_82801JD 0x3a60 +#define ID_PCH 0x3b30 +#define ID_6300ESB 0x25a4 +#define ID_631xESB 0x269b +#define ID_DH89XXCC 0x2330 +#define ID_PATSBURG 0x1d22 +#define ID_CPT 0x1c22 +#define ID_PPT 0x1e22 +#define ID_AVOTON 0x1f3c +#define ID_COLETOCRK 0x23B0 +#define ID_LPT 0x8c22 +#define ID_LPTLP 0x9c22 +#define ID_WCPT 0x8ca2 +#define ID_WCPTLP 0x9ca2 +#define ID_BAYTRAIL 0x0f12 +#define ID_BRASWELL 0x2292 +#define ID_WELLSBURG 0x8d22 +#define ID_SRPT 0xa123 +#define ID_SRPTLP 0x9d23 +#define ID_DENVERTON 0x19df +#define ID_BROXTON 0x5ad4 +#define ID_LEWISBURG 0xa1a3 +#define ID_LEWISBURG2 0xa223 +#define ID_KABYLAKE 0xa2a3 -#define PCIS_SERIALBUS_SMBUS_PROGIF 0x00 +static const struct ichsmb_device { + uint16_t id; + const char *name; +} ichsmb_devices[] = { + { ID_82801AA, "Intel 82801AA (ICH) SMBus controller" }, + { ID_82801AB, "Intel 82801AB (ICH0) SMBus controller" }, + { ID_82801BA, "Intel 82801BA (ICH2) SMBus controller" }, + { ID_82801CA, "Intel 82801CA (ICH3) SMBus controller" }, + { ID_82801DC, "Intel 82801DC (ICH4) SMBus controller" }, + { ID_82801EB, "Intel 82801EB (ICH5) SMBus controller" }, + { ID_82801FB, "Intel 82801FB (ICH6) SMBus controller" }, + { ID_82801GB, "Intel 82801GB (ICH7) SMBus controller" }, + { ID_82801H, "Intel 82801H (ICH8) SMBus controller" }, + { ID_82801I, "Intel 82801I (ICH9) SMBus controller" }, + { ID_82801GB, "Intel 82801GB (ICH7) SMBus controller" }, + { ID_82801H, "Intel 82801H (ICH8) SMBus controller" }, + { ID_82801I, "Intel 82801I (ICH9) SMBus controller" }, + { ID_EP80579, "Intel EP80579 SMBus controller" }, + { ID_82801JI, "Intel 82801JI (ICH10) SMBus controller" }, + { ID_82801JD, "Intel 82801JD (ICH10) SMBus controller" }, + { ID_PCH, "Intel PCH SMBus controller" }, + { ID_6300ESB, "Intel 6300ESB (ICH) SMBus controller" }, + { ID_631xESB, "Intel 631xESB/6321ESB (ESB2) SMBus controller" }, + { ID_DH89XXCC, "Intel DH89xxCC SMBus controller" }, + { ID_PATSBURG, "Intel Patsburg SMBus controller" }, + { ID_CPT, "Intel Cougar Point SMBus controller" }, + { ID_PPT, "Intel Panther Point SMBus controller" }, + { ID_AVOTON, "Intel Avoton SMBus controller" }, + { ID_LPT, "Intel Lynx Point SMBus controller" }, + { ID_LPTLP, "Intel Lynx Point-LP SMBus controller" }, + { ID_WCPT, "Intel Wildcat Point SMBus controller" }, + { ID_WCPTLP, "Intel Wildcat Point-LP SMBus controller" }, + { ID_BAYTRAIL, "Intel Baytrail SMBus controller" }, + { ID_BRASWELL, "Intel Braswell SMBus controller" }, + { ID_COLETOCRK, "Intel Coleto Creek SMBus controller" }, + { ID_WELLSBURG, "Intel Wellsburg SMBus controller" }, + { ID_SRPT, "Intel Sunrise Point-H SMBus controller" }, + { ID_SRPTLP, "Intel Sunrise Point-LP SMBus controller" }, + { ID_DENVERTON, "Intel Denverton SMBus controller" }, + { ID_BROXTON, "Intel Broxton SMBus controller" }, + { ID_LEWISBURG, "Intel Lewisburg SMBus controller" }, + { ID_LEWISBURG2,"Intel Lewisburg SMBus controller" }, + { ID_KABYLAKE, "Intel Kaby Lake SMBus controller" }, + { 0, NULL }, +}; /* Internal functions */ static int ichsmb_pci_probe(device_t dev); @@ -141,95 +195,19 @@ DRIVER_MODULE(ichsmb, pci, ichsmb_pci_driver, ichsmb_p static int ichsmb_pci_probe(device_t dev) { - /* Check PCI identifier */ - switch (pci_get_devid(dev)) { - case ID_82801AA: - device_set_desc(dev, "Intel 82801AA (ICH) SMBus controller"); - break; - case ID_82801AB: - device_set_desc(dev, "Intel 82801AB (ICH0) SMBus controller"); - break; - case ID_82801BA: - device_set_desc(dev, "Intel 82801BA (ICH2) SMBus controller"); - break; - case ID_82801CA: - device_set_desc(dev, "Intel 82801CA (ICH3) SMBus controller"); - break; - case ID_82801DC: - device_set_desc(dev, "Intel 82801DC (ICH4) SMBus controller"); - break; - case ID_82801EB: - device_set_desc(dev, "Intel 82801EB (ICH5) SMBus controller"); - break; - case ID_82801FB: - device_set_desc(dev, "Intel 82801FB (ICH6) SMBus controller"); - break; - case ID_82801GB: - device_set_desc(dev, "Intel 82801GB (ICH7) SMBus controller"); - break; - case ID_82801H: - device_set_desc(dev, "Intel 82801H (ICH8) SMBus controller"); - break; - case ID_82801I: - device_set_desc(dev, "Intel 82801I (ICH9) SMBus controller"); - break; - case ID_82801JI: - device_set_desc(dev, "Intel 82801JI (ICH10) SMBus controller"); - break; - case ID_PCH: - device_set_desc(dev, "Intel PCH SMBus controller"); - break; - case ID_6300ESB: - device_set_desc(dev, "Intel 6300ESB (ICH) SMBus controller"); - break; - case ID_631xESB: - device_set_desc(dev, "Intel 631xESB/6321ESB (ESB2) SMBus controller"); - break; - case ID_DH89XXCC: - device_set_desc(dev, "Intel DH89xxCC SMBus controller"); - break; - case ID_PATSBURG: - device_set_desc(dev, "Intel Patsburg SMBus controller"); - break; - case ID_CPT: - device_set_desc(dev, "Intel Cougar Point SMBus controller"); - break; - case ID_PPT: - device_set_desc(dev, "Intel Panther Point SMBus controller"); - break; - case ID_AVOTON: - device_set_desc(dev, "Intel Avoton SMBus controller"); - break; - case ID_LPT: - device_set_desc(dev, "Intel Lynx Point SMBus controller"); - break; - case ID_LPTLP: - device_set_desc(dev, "Intel Lynx Point-LP SMBus controller"); - break; - case ID_WCPT: - device_set_desc(dev, "Intel Wildcat Point SMBus controller"); - break; - case ID_WCPTLP: - device_set_desc(dev, "Intel Wildcat Point-LP SMBus controller"); - break; - case ID_COLETOCRK: - device_set_desc(dev, "Intel Coleto Creek SMBus controller"); - break; - case ID_WELLSBURG: - device_set_desc(dev, "Intel Wellsburg SMBus controller"); - break; - case ID_SRPT: - device_set_desc(dev, "Intel Sunrise Point-H SMBus controller"); - break; - case ID_SRPTLP: - device_set_desc(dev, "Intel Sunrise Point-LP SMBus controller"); - break; - default: + const struct ichsmb_device *device; + + if (pci_get_vendor(dev) != PCI_VENDOR_INTEL) return (ENXIO); + + for (device = ichsmb_devices; device->name != NULL; device++) { + if (pci_get_device(dev) == device->id) { + device_set_desc(dev, device->name); + return (ichsmb_probe(dev)); + } } - /* Done */ - return (ichsmb_probe(dev)); + return (ENXIO); } static int From owner-svn-src-all@freebsd.org Wed Aug 2 15:15:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6425FDD2FA8; Wed, 2 Aug 2017 15:15:19 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3294A68B52; Wed, 2 Aug 2017 15:15:19 +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 v72FFIkP084089; Wed, 2 Aug 2017 15:15:18 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v72FFIAD084086; Wed, 2 Aug 2017 15:15:18 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201708021515.v72FFIAD084086@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 2 Aug 2017 15:15:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321933 - head/sys/arm/freescale/imx X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/freescale/imx X-SVN-Commit-Revision: 321933 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 15:15:19 -0000 Author: ian Date: Wed Aug 2 15:15:18 2017 New Revision: 321933 URL: https://svnweb.freebsd.org/changeset/base/321933 Log: The imx6_snvs driver is not strictly required for the system to run, so change it from standard to optional and add a device statement for it so that it's included unless someone uses nodevice to eliminate it. Modified: head/sys/arm/freescale/imx/files.imx6 head/sys/arm/freescale/imx/std.imx6 Modified: head/sys/arm/freescale/imx/files.imx6 ============================================================================== --- head/sys/arm/freescale/imx/files.imx6 Wed Aug 2 15:13:13 2017 (r321932) +++ head/sys/arm/freescale/imx/files.imx6 Wed Aug 2 15:15:18 2017 (r321933) @@ -14,7 +14,7 @@ arm/freescale/imx/imx6_ccm.c standard arm/freescale/imx/imx6_machdep.c standard arm/freescale/imx/imx6_mp.c optional smp arm/freescale/imx/imx6_pl310.c standard -arm/freescale/imx/imx6_snvs.c standard +arm/freescale/imx/imx6_snvs.c optional imx6_snvs arm/freescale/imx/imx6_src.c standard arm/freescale/imx/imx_epit.c standard arm/freescale/imx/imx_iomux.c standard Modified: head/sys/arm/freescale/imx/std.imx6 ============================================================================== --- head/sys/arm/freescale/imx/std.imx6 Wed Aug 2 15:13:13 2017 (r321932) +++ head/sys/arm/freescale/imx/std.imx6 Wed Aug 2 15:15:18 2017 (r321933) @@ -9,7 +9,8 @@ makeoptions KERNVIRTADDR = 0xc2000000 options IPI_IRQ_START=0 options IPI_IRQ_END=15 -device fdt_pinctrl +device fdt_pinctrl +device imx6_snvs files "../freescale/imx/files.imx6" From owner-svn-src-all@freebsd.org Wed Aug 2 15:16:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2AFA7DD3039; Wed, 2 Aug 2017 15:16:42 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E99CC68CCA; Wed, 2 Aug 2017 15:16:41 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v72FGe5X084178; Wed, 2 Aug 2017 15:16:40 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v72FGeYH084175; Wed, 2 Aug 2017 15:16:40 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201708021516.v72FGeYH084175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 2 Aug 2017 15:16:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321934 - in head/sys/modules/i2c: ds1307 ds3231 isl12xx X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys/modules/i2c: ds1307 ds3231 isl12xx X-SVN-Commit-Revision: 321934 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 15:16:42 -0000 Author: ian Date: Wed Aug 2 15:16:40 2017 New Revision: 321934 URL: https://svnweb.freebsd.org/changeset/base/321934 Log: Add missing ofw_bus_if.h src file. Modified: head/sys/modules/i2c/ds1307/Makefile head/sys/modules/i2c/ds3231/Makefile head/sys/modules/i2c/isl12xx/Makefile Modified: head/sys/modules/i2c/ds1307/Makefile ============================================================================== --- head/sys/modules/i2c/ds1307/Makefile Wed Aug 2 15:15:18 2017 (r321933) +++ head/sys/modules/i2c/ds1307/Makefile Wed Aug 2 15:16:40 2017 (r321934) @@ -2,6 +2,6 @@ .PATH: ${SRCTOP}/sys/dev/iicbus KMOD = ds1307 -SRCS = ds1307.c bus_if.h clock_if.h device_if.h iicbus_if.h +SRCS = ds1307.c bus_if.h clock_if.h device_if.h iicbus_if.h ofw_bus_if.h .include Modified: head/sys/modules/i2c/ds3231/Makefile ============================================================================== --- head/sys/modules/i2c/ds3231/Makefile Wed Aug 2 15:15:18 2017 (r321933) +++ head/sys/modules/i2c/ds3231/Makefile Wed Aug 2 15:16:40 2017 (r321934) @@ -2,6 +2,6 @@ .PATH: ${SRCTOP}/sys/dev/iicbus KMOD = ds3231 -SRCS = ds3231.c bus_if.h clock_if.h device_if.h iicbus_if.h +SRCS = ds3231.c bus_if.h clock_if.h device_if.h iicbus_if.h ofw_bus_if.h .include Modified: head/sys/modules/i2c/isl12xx/Makefile ============================================================================== --- head/sys/modules/i2c/isl12xx/Makefile Wed Aug 2 15:15:18 2017 (r321933) +++ head/sys/modules/i2c/isl12xx/Makefile Wed Aug 2 15:16:40 2017 (r321934) @@ -2,6 +2,6 @@ .PATH: ${SRCTOP}/sys/dev/iicbus KMOD = isl12xx -SRCS = isl12xx.c bus_if.h clock_if.h device_if.h iicbus_if.h +SRCS = isl12xx.c bus_if.h clock_if.h device_if.h iicbus_if.h ofw_bus_if.h .include From owner-svn-src-all@freebsd.org Wed Aug 2 15:59:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63EF4DD3EFD; Wed, 2 Aug 2017 15:59:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E31F6A6FE; Wed, 2 Aug 2017 15:59:03 +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 v72Fx27c001271; Wed, 2 Aug 2017 15:59:02 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v72Fx2Xa001270; Wed, 2 Aug 2017 15:59:02 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708021559.v72Fx2Xa001270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Aug 2017 15:59:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r321935 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 321935 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 15:59:03 -0000 Author: hselasky Date: Wed Aug 2 15:59:02 2017 New Revision: 321935 URL: https://svnweb.freebsd.org/changeset/base/321935 Log: Add myself to import new OFED user-space into projects/bsd_rdma_4_9. Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf ============================================================================== --- svnadmin/conf/sizelimit.conf Wed Aug 2 15:16:40 2017 (r321934) +++ svnadmin/conf/sizelimit.conf Wed Aug 2 15:59:02 2017 (r321935) @@ -19,6 +19,7 @@ bapt brooks davidcs dim +hselasky 2000000 imp jb jeff From owner-svn-src-all@freebsd.org Wed Aug 2 16:01:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC2E6DD40C3; Wed, 2 Aug 2017 16:01:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B93786AB26; Wed, 2 Aug 2017 16:01:53 +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 v72G1qAo004360; Wed, 2 Aug 2017 16:01:52 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v72G1qVX004359; Wed, 2 Aug 2017 16:01:52 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708021601.v72G1qVX004359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 2 Aug 2017 16:01:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r321937 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 321937 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 16:01:54 -0000 Author: hselasky Date: Wed Aug 2 16:01:52 2017 New Revision: 321937 URL: https://svnweb.freebsd.org/changeset/base/321937 Log: Remove myself. Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf ============================================================================== --- svnadmin/conf/sizelimit.conf Wed Aug 2 16:00:30 2017 (r321936) +++ svnadmin/conf/sizelimit.conf Wed Aug 2 16:01:52 2017 (r321937) @@ -19,7 +19,6 @@ bapt brooks davidcs dim -hselasky 2000000 imp jb jeff From owner-svn-src-all@freebsd.org Wed Aug 2 18:28:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B065DB02E3; Wed, 2 Aug 2017 18:28:07 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 568C670BDB; Wed, 2 Aug 2017 18:28:07 +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 v72IS61Q065081; Wed, 2 Aug 2017 18:28:06 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v72IS6gT065079; Wed, 2 Aug 2017 18:28:06 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201708021828.v72IS6gT065079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 2 Aug 2017 18:28:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321938 - head/sys/arm/freescale/imx X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/freescale/imx X-SVN-Commit-Revision: 321938 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 18:28:07 -0000 Author: ian Date: Wed Aug 2 18:28:06 2017 New Revision: 321938 URL: https://svnweb.freebsd.org/changeset/base/321938 Log: Fix the interface to imx_iomux_gpr_get/set(). The functions were defined as taking a register number, and that would get multiplied by 4 to make a register address. But the header file that consumers have to reference this stuff publishes register addresses, not numbers. So now everything works in terms of register addresses. Note that the HDMI init code was writing into the wrong register before this change. Apparently whatever it wrote to was harmless, and apparently HDMI was working because uboot had set up the right bits. Modified: head/sys/arm/freescale/imx/imx_iomux.c head/sys/arm/freescale/imx/imx_iomuxvar.h Modified: head/sys/arm/freescale/imx/imx_iomux.c ============================================================================== --- head/sys/arm/freescale/imx/imx_iomux.c Wed Aug 2 16:01:52 2017 (r321937) +++ head/sys/arm/freescale/imx/imx_iomux.c Wed Aug 2 18:28:06 2017 (r321938) @@ -70,7 +70,7 @@ struct iomux_softc { device_t dev; struct resource *mem_res; - u_int last_gpreg; + u_int last_gpregaddr; }; static struct iomux_softc *iomux_sc; @@ -213,19 +213,19 @@ iomux_attach(device_t dev) switch (imx_soc_type()) { case IMXSOC_51: - sc->last_gpreg = 1; + sc->last_gpregaddr = 1 * sizeof(uint32_t); break; case IMXSOC_53: - sc->last_gpreg = 2; + sc->last_gpregaddr = 2 * sizeof(uint32_t); break; case IMXSOC_6DL: case IMXSOC_6S: case IMXSOC_6SL: case IMXSOC_6Q: - sc->last_gpreg = 13; + sc->last_gpregaddr = 13 * sizeof(uint32_t); break; case IMXSOC_6UL: - sc->last_gpreg = 14; + sc->last_gpregaddr = 14 * sizeof(uint32_t); break; default: device_printf(dev, "Unknown SoC type\n"); @@ -261,45 +261,48 @@ iomux_attach(device_t dev) } uint32_t -imx_iomux_gpr_get(u_int regnum) +imx_iomux_gpr_get(u_int regaddr) { struct iomux_softc * sc; sc = iomux_sc; KASSERT(sc != NULL, ("%s called before attach", __FUNCTION__)); - KASSERT(regnum >= 0 && regnum <= sc->last_gpreg, - ("%s bad regnum %u, max %u", __FUNCTION__, regnum, sc->last_gpreg)); + KASSERT(regaddr >= 0 && regaddr <= sc->last_gpregaddr, + ("%s bad regaddr %u, max %u", __FUNCTION__, regaddr, + sc->last_gpregaddr)); - return (RD4(iomux_sc, regnum * 4)); + return (RD4(iomux_sc, regaddr)); } void -imx_iomux_gpr_set(u_int regnum, uint32_t val) +imx_iomux_gpr_set(u_int regaddr, uint32_t val) { struct iomux_softc * sc; sc = iomux_sc; KASSERT(sc != NULL, ("%s called before attach", __FUNCTION__)); - KASSERT(regnum >= 0 && regnum <= sc->last_gpreg, - ("%s bad regnum %u, max %u", __FUNCTION__, regnum, sc->last_gpreg)); + KASSERT(regaddr >= 0 && regaddr <= sc->last_gpregaddr, + ("%s bad regaddr %u, max %u", __FUNCTION__, regaddr, + sc->last_gpregaddr)); - WR4(iomux_sc, regnum * 4, val); + WR4(iomux_sc, regaddr, val); } void -imx_iomux_gpr_set_masked(u_int regnum, uint32_t clrbits, uint32_t setbits) +imx_iomux_gpr_set_masked(u_int regaddr, uint32_t clrbits, uint32_t setbits) { struct iomux_softc * sc; uint32_t val; sc = iomux_sc; KASSERT(sc != NULL, ("%s called before attach", __FUNCTION__)); - KASSERT(regnum >= 0 && regnum <= sc->last_gpreg, - ("%s bad regnum %u, max %u", __FUNCTION__, regnum, sc->last_gpreg)); + KASSERT(regaddr >= 0 && regaddr <= sc->last_gpregaddr, + ("%s bad regaddr %u, max %u", __FUNCTION__, regaddr, + sc->last_gpregaddr)); - val = RD4(iomux_sc, regnum * 4); + val = RD4(iomux_sc, regaddr * 4); val = (val & ~clrbits) | setbits; - WR4(iomux_sc, regnum * 4, val); + WR4(iomux_sc, regaddr, val); } static device_method_t imx_iomux_methods[] = { Modified: head/sys/arm/freescale/imx/imx_iomuxvar.h ============================================================================== --- head/sys/arm/freescale/imx/imx_iomuxvar.h Wed Aug 2 16:01:52 2017 (r321937) +++ head/sys/arm/freescale/imx/imx_iomuxvar.h Wed Aug 2 18:28:06 2017 (r321938) @@ -42,8 +42,8 @@ u_int iomux_get_pad_config(u_int pin); * with IO pin assignments or pad control. These functions let other soc level * code manipulate these values. */ -uint32_t imx_iomux_gpr_get(u_int regnum); -void imx_iomux_gpr_set(u_int regnum, uint32_t val); -void imx_iomux_gpr_set_masked(u_int regnum, uint32_t clrbits, uint32_t setbits); +uint32_t imx_iomux_gpr_get(u_int regaddr); +void imx_iomux_gpr_set(u_int regaddr, uint32_t val); +void imx_iomux_gpr_set_masked(u_int regaddr, uint32_t clrbits, uint32_t setbits); #endif From owner-svn-src-all@freebsd.org Wed Aug 2 19:45:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F4ACDB2AFC; Wed, 2 Aug 2017 19:45:10 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2DA5674F7A; Wed, 2 Aug 2017 19:45:10 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v72Jj9MA002770; Wed, 2 Aug 2017 19:45:09 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v72Jj98V002769; Wed, 2 Aug 2017 19:45:09 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201708021945.v72Jj98V002769@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Wed, 2 Aug 2017 19:45:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321939 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: rstone X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321939 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 19:45:10 -0000 Author: rstone Date: Wed Aug 2 19:45:09 2017 New Revision: 321939 URL: https://svnweb.freebsd.org/changeset/base/321939 Log: Add my birthdate to the calendar Requested by: mckusick Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Wed Aug 2 18:28:06 2017 (r321938) +++ head/usr.bin/calendar/calendars/calendar.freebsd Wed Aug 2 19:45:09 2017 (r321939) @@ -374,6 +374,7 @@ 10/26 Philip M. Gollucci born in Silver Spring, Maryland, United States, 1979 10/27 Takanori Watanabe born in Numazu, Shizuoka, Japan, 1972 10/31 Taras Korenko born in Cherkasy region, Ukraine, 1980 +11/03 Ryan Stone born in Ottawa, Ontario, Canada, 1985 11/05 M. Warner Losh born in Kansas City, Kansas, United States, 1966 11/06 Michael Zhilin born in Stary Oskol, USSR, 1985 11/08 Joseph R. Mingrone born in Charlottetown, Prince Edward Island, Canada, 1976 From owner-svn-src-all@freebsd.org Wed Aug 2 20:17:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEE13DB3749; Wed, 2 Aug 2017 20:17:05 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BCD5E75F00; Wed, 2 Aug 2017 20:17:05 +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 v72KH4uO014899; Wed, 2 Aug 2017 20:17:04 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v72KH4dH014898; Wed, 2 Aug 2017 20:17:04 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201708022017.v72KH4dH014898@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 2 Aug 2017 20:17:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321941 - head/sys/arm/allwinner/clk X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner/clk X-SVN-Commit-Revision: 321941 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 20:17:06 -0000 Author: manu Date: Wed Aug 2 20:17:04 2017 New Revision: 321941 URL: https://svnweb.freebsd.org/changeset/base/321941 Log: allwiner: modclk: Do not try to enable parent clock if it doesn't exist Modified: head/sys/arm/allwinner/clk/aw_modclk.c Modified: head/sys/arm/allwinner/clk/aw_modclk.c ============================================================================== --- head/sys/arm/allwinner/clk/aw_modclk.c Wed Aug 2 19:53:43 2017 (r321940) +++ head/sys/arm/allwinner/clk/aw_modclk.c Wed Aug 2 20:17:04 2017 (r321941) @@ -89,7 +89,10 @@ aw_modclk_init(struct clknode *clk, device_t dev) index = (val & CLK_SRC_SEL) >> CLK_SRC_SEL_SHIFT; - clknode_init_parent_idx(clk, index); + if (index <= clknode_get_parents_num(clk)) + clknode_init_parent_idx(clk, index); + else + clknode_init_parent_idx(clk, 0); return (0); } From owner-svn-src-all@freebsd.org Wed Aug 2 20:19:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 201B7DB37EE; Wed, 2 Aug 2017 20:19:21 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE8777608F; Wed, 2 Aug 2017 20:19:20 +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 v72KJKwO015023; Wed, 2 Aug 2017 20:19:20 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v72KJJHl015017; Wed, 2 Aug 2017 20:19:19 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201708022019.v72KJJHl015017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 2 Aug 2017 20:19:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321942 - in head/sys: arm/allwinner arm/allwinner/clkng arm64/conf conf X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: arm/allwinner arm/allwinner/clkng arm64/conf conf X-SVN-Commit-Revision: 321942 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 20:19:21 -0000 Author: manu Date: Wed Aug 2 20:19:19 2017 New Revision: 321942 URL: https://svnweb.freebsd.org/changeset/base/321942 Log: arm64: Add Allwinner H5 SoC Allwinner H5 is an H3 (arm32) with Cortex A53 cores. Add support for it and enable it in GENERIC kernel config Tested on: OrangePi PC2 Modified: head/sys/arm/allwinner/aw_ccu.c head/sys/arm/allwinner/clkng/aw_ccung.c head/sys/arm64/conf/GENERIC head/sys/conf/files.arm64 head/sys/conf/options.arm64 Modified: head/sys/arm/allwinner/aw_ccu.c ============================================================================== --- head/sys/arm/allwinner/aw_ccu.c Wed Aug 2 20:17:04 2017 (r321941) +++ head/sys/arm/allwinner/aw_ccu.c Wed Aug 2 20:19:19 2017 (r321942) @@ -80,6 +80,7 @@ static struct ofw_compat_data compat_data[] = { { "allwinner,sun6i-a31", CLOCK_CCU }, { "allwinner,sun6i-a31s", CLOCK_CCU }, { "allwinner,sun50i-a64", CLOCK_CCU }, + { "allwinner,sun50i-h5", CLOCK_CCU }, { "allwinner,sun8i-a33", CLOCK_CCU }, { "allwinner,sun8i-a83t", CLOCK_CCU|CLOCK_PRCM|CLOCK_SYSCTRL }, { "allwinner,sun8i-h2-plus", CLOCK_CCU|CLOCK_PRCM }, Modified: head/sys/arm/allwinner/clkng/aw_ccung.c ============================================================================== --- head/sys/arm/allwinner/clkng/aw_ccung.c Wed Aug 2 20:17:04 2017 (r321941) +++ head/sys/arm/allwinner/clkng/aw_ccung.c Wed Aug 2 20:19:19 2017 (r321942) @@ -66,7 +66,7 @@ __FBSDID("$FreeBSD$"); #include #endif -#if defined(SOC_ALLWINNER_H3) +#if defined(SOC_ALLWINNER_H3) || defined(SOC_ALLWINNER_H5) #include #endif @@ -78,7 +78,7 @@ static struct resource_spec aw_ccung_spec[] = { { -1, 0 } }; -#if defined(SOC_ALLWINNER_H3) +#if defined(SOC_ALLWINNER_H3) || defined(SOC_ALLWINNER_H5) #define H3_CCU 1 #endif @@ -91,7 +91,7 @@ static struct resource_spec aw_ccung_spec[] = { #endif static struct ofw_compat_data compat_data[] = { -#if defined(SOC_ALLWINNER_H3) +#if defined(SOC_ALLWINNER_H3) || defined(SOC_ALLWINNER_H5) { "allwinner,sun8i-h3-ccu", H3_CCU }, #endif #if defined(SOC_ALLWINNER_A31) @@ -316,7 +316,7 @@ aw_ccung_attach(device_t dev) panic("Cannot create clkdom\n"); switch (sc->type) { -#if defined(SOC_ALLWINNER_H3) +#if defined(SOC_ALLWINNER_H3) || defined(SOC_ALLWINNER_H5) case H3_CCU: ccu_h3_register_clocks(sc); break; Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Wed Aug 2 20:17:04 2017 (r321941) +++ head/sys/arm64/conf/GENERIC Wed Aug 2 20:19:19 2017 (r321942) @@ -89,6 +89,7 @@ options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) # SoC support options SOC_ALLWINNER_A64 +options SOC_ALLWINNER_H5 options SOC_CAVM_THUNDERX options SOC_HISI_HI6220 options SOC_BRCM_BCM2837 Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Wed Aug 2 20:17:04 2017 (r321941) +++ head/sys/conf/files.arm64 Wed Aug 2 20:19:19 2017 (r321942) @@ -42,6 +42,7 @@ arm/allwinner/clkng/aw_clk_nkmp.c optional aw_ccu fdt arm/allwinner/clkng/aw_clk_nm.c optional aw_ccu fdt arm/allwinner/clkng/aw_clk_prediv_mux.c optional aw_ccu fdt arm/allwinner/clkng/ccu_a64.c optional aw_ccu fdt +arm/allwinner/clkng/ccu_h3.c optional aw_ccu fdt arm/allwinner/if_awg.c optional awg fdt arm/annapurna/alpine/alpine_ccu.c optional al_ccu fdt Modified: head/sys/conf/options.arm64 ============================================================================== --- head/sys/conf/options.arm64 Wed Aug 2 20:17:04 2017 (r321941) +++ head/sys/conf/options.arm64 Wed Aug 2 20:19:19 2017 (r321942) @@ -11,6 +11,7 @@ DEV_PSCI opt_platform.h # SoC Support SOC_ALLWINNER_A64 opt_soc.h +SOC_ALLWINNER_H5 opt_soc.h SOC_BRCM_BCM2837 opt_soc.h SOC_CAVM_THUNDERX opt_soc.h SOC_HISI_HI6220 opt_soc.h From owner-svn-src-all@freebsd.org Wed Aug 2 20:24:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1AFFDB3B75; Wed, 2 Aug 2017 20:24:27 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A567C76696; Wed, 2 Aug 2017 20:24:27 +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 v72KOQeK019033; Wed, 2 Aug 2017 20:24:26 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v72KOQoT019032; Wed, 2 Aug 2017 20:24:26 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201708022024.v72KOQoT019032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Wed, 2 Aug 2017 20:24:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321944 - stable/11/sys/dev/isp X-SVN-Group: stable-11 X-SVN-Commit-Author: ken X-SVN-Commit-Paths: stable/11/sys/dev/isp X-SVN-Commit-Revision: 321944 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 20:24:28 -0000 Author: ken Date: Wed Aug 2 20:24:26 2017 New Revision: 321944 URL: https://svnweb.freebsd.org/changeset/base/321944 Log: MFC r321622, r321623: ------------------------------------------------------------------------ r321622 | ken | 2017-07-27 09:33:57 -0600 (Thu, 27 Jul 2017) | 44 lines Fix probing FC targets with hard addressing turned on. This largely reverts FreeBSD SVN change 289937 from October 25th, 2015. The intent of that change was to keep loop IDs persistent across chip reinits. The problem is that the change turned on the PREVLOOP / PREV_ADDRESS bit (bit 7 in Firmware Options 2), which tells the Qlogic chip to not participate in the loop if it can't get the requested loop address. It also turned off soft addressing on 2400 (4Gb) and newer controllers. The isp(4) driver defaults to loop address 0, and the tape drives I have tested default to loop address 0 if hard addressing is turned on. So when hard loop addressing is turned on on the drive, the isp(4) driver just refuses to participate in the loop. The solution is to largely revert that change. I left some elements in place that are related to virtual ports, since they were new. This does work with IBM tape drives with hard and soft addressing turned on. I have tested it with 4Gb, 8Gb, and 16Gb controllers. sys/dev/isp.c: Largely revert FreeBSD SVN change 289937. I left the ispmbox.h changes in place. Don't use the PREV_ADDRESS bit on initialization. It tells the chip to not participate if it can't get the requested loop ID. Do use soft addressing on 2400 and newer chips. Use hard addressing when the user has requested a specific initiator ID. (hint.isp.X.iid=N in /boot/loader.conf) Leave some of the virtual port options from that change in place, but don't turn on the PREV_ADDRESS bit. Reviewed by: mav Sponsored by: Spectra Logic ------------------------------------------------------------------------ r321623 | ken | 2017-07-27 09:51:56 -0600 (Thu, 27 Jul 2017) | 6 lines Remove duplicate assignments from r321622. Submitted by: mav Sponsored by: Spectra Logic ------------------------------------------------------------------------ Modified: stable/11/sys/dev/isp/isp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/isp/isp.c ============================================================================== --- stable/11/sys/dev/isp/isp.c Wed Aug 2 20:23:25 2017 (r321943) +++ stable/11/sys/dev/isp/isp.c Wed Aug 2 20:24:26 2017 (r321944) @@ -1631,6 +1631,7 @@ isp_fibre_init(ispsoftc_t *isp) fcparam *fcp; isp_icb_t local, *icbp = &local; mbreg_t mbs; + int ownloopid; /* * We only support one channel on non-24XX cards @@ -1709,15 +1710,22 @@ isp_fibre_init(ispsoftc_t *isp) } icbp->icb_retry_delay = fcp->isp_retry_delay; icbp->icb_retry_count = fcp->isp_retry_count; - if (fcp->isp_loopid < LOCAL_LOOP_LIM) { - icbp->icb_hardaddr = fcp->isp_loopid; - if (isp->isp_confopts & ISP_CFG_OWNLOOPID) - icbp->icb_fwoptions |= ICBOPT_HARD_ADDRESS; - else - icbp->icb_fwoptions |= ICBOPT_PREV_ADDRESS; + icbp->icb_hardaddr = fcp->isp_loopid; + ownloopid = (isp->isp_confopts & ISP_CFG_OWNLOOPID) != 0; + if (icbp->icb_hardaddr >= LOCAL_LOOP_LIM) { + icbp->icb_hardaddr = 0; + ownloopid = 0; } /* + * Our life seems so much better with 2200s and later with + * the latest f/w if we set Hard Address. + */ + if (ownloopid || ISP_FW_NEWER_THAN(isp, 2, 2, 5)) { + icbp->icb_fwoptions |= ICBOPT_HARD_ADDRESS; + } + + /* * Right now we just set extended options to prefer point-to-point * over loop based upon some soft config options. * @@ -1951,6 +1959,7 @@ isp_fibre_init_2400(ispsoftc_t *isp) isp_icb_2400_t local, *icbp = &local; mbreg_t mbs; int chan; + int ownloopid = 0; /* * Check to see whether all channels have *some* kind of role @@ -2023,14 +2032,17 @@ isp_fibre_init_2400(ispsoftc_t *isp) icbp->icb_xchgcnt >>= 1; } - if (fcp->isp_loopid < LOCAL_LOOP_LIM) { - icbp->icb_hardaddr = fcp->isp_loopid; - if (isp->isp_confopts & ISP_CFG_OWNLOOPID) - icbp->icb_fwoptions1 |= ICB2400_OPT1_HARD_ADDRESS; - else - icbp->icb_fwoptions1 |= ICB2400_OPT1_PREV_ADDRESS; + + ownloopid = (isp->isp_confopts & ISP_CFG_OWNLOOPID) != 0; + icbp->icb_hardaddr = fcp->isp_loopid; + if (icbp->icb_hardaddr >= LOCAL_LOOP_LIM) { + icbp->icb_hardaddr = 0; + ownloopid = 0; } + if (ownloopid) + icbp->icb_fwoptions1 |= ICB2400_OPT1_HARD_ADDRESS; + if (isp->isp_confopts & ISP_CFG_NOFCTAPE) { icbp->icb_fwoptions2 &= ~ICB2400_OPT2_FCTAPE; } @@ -2132,6 +2144,9 @@ isp_fibre_init_2400(ispsoftc_t *isp) break; } } + if (ownloopid == 0) { + icbp->icb_fwoptions3 |= ICB2400_OPT3_SOFTID; + } icbp->icb_logintime = ICB_LOGIN_TOV; if (fcp->isp_wwnn && fcp->isp_wwpn) { @@ -2244,14 +2259,13 @@ isp_fibre_init_2400(ispsoftc_t *isp) pi.vp_port_options |= ICB2400_VPOPT_INI_ENABLE; if ((fcp2->role & ISP_ROLE_TARGET) == 0) pi.vp_port_options |= ICB2400_VPOPT_TGT_DISABLE; + if (fcp2->isp_loopid < LOCAL_LOOP_LIM) { + pi.vp_port_loopid = fcp2->isp_loopid; + if (isp->isp_confopts & ISP_CFG_OWNLOOPID) + pi.vp_port_options |= ICB2400_VPOPT_HARD_ADDRESS; + } + } - if (fcp2->isp_loopid < LOCAL_LOOP_LIM) { - pi.vp_port_loopid = fcp2->isp_loopid; - if (isp->isp_confopts & ISP_CFG_OWNLOOPID) - pi.vp_port_options |= ICB2400_VPOPT_HARD_ADDRESS; - else - pi.vp_port_options |= ICB2400_VPOPT_PREV_ADDRESS; - } MAKE_NODE_NAME_FROM_WWN(pi.vp_port_portname, fcp2->isp_wwpn); MAKE_NODE_NAME_FROM_WWN(pi.vp_port_nodename, fcp2->isp_wwnn); off = fcp->isp_scratch; @@ -2329,8 +2343,6 @@ isp_fc_enable_vp(ispsoftc_t *isp, int chan) vp.vp_mod_ports[0].loopid = fcp->isp_loopid; if (isp->isp_confopts & ISP_CFG_OWNLOOPID) vp.vp_mod_ports[0].options |= ICB2400_VPOPT_HARD_ADDRESS; - else - vp.vp_mod_ports[0].options |= ICB2400_VPOPT_PREV_ADDRESS; } MAKE_NODE_NAME_FROM_WWN(vp.vp_mod_ports[0].wwpn, fcp->isp_wwpn); MAKE_NODE_NAME_FROM_WWN(vp.vp_mod_ports[0].wwnn, fcp->isp_wwnn); From owner-svn-src-all@freebsd.org Wed Aug 2 20:24:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E422DB3B7D; Wed, 2 Aug 2017 20:24:29 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A50676697; Wed, 2 Aug 2017 20:24:29 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v72KOS9m019078; Wed, 2 Aug 2017 20:24:28 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v72KOSbT019077; Wed, 2 Aug 2017 20:24:28 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201708022024.v72KOSbT019077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Wed, 2 Aug 2017 20:24:28 +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: r321945 - stable/10/sys/dev/isp X-SVN-Group: stable-10 X-SVN-Commit-Author: ken X-SVN-Commit-Paths: stable/10/sys/dev/isp X-SVN-Commit-Revision: 321945 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 20:24:29 -0000 Author: ken Date: Wed Aug 2 20:24:28 2017 New Revision: 321945 URL: https://svnweb.freebsd.org/changeset/base/321945 Log: MFC r321622, r321623: ------------------------------------------------------------------------ r321622 | ken | 2017-07-27 09:33:57 -0600 (Thu, 27 Jul 2017) | 44 lines Fix probing FC targets with hard addressing turned on. This largely reverts FreeBSD SVN change 289937 from October 25th, 2015. The intent of that change was to keep loop IDs persistent across chip reinits. The problem is that the change turned on the PREVLOOP / PREV_ADDRESS bit (bit 7 in Firmware Options 2), which tells the Qlogic chip to not participate in the loop if it can't get the requested loop address. It also turned off soft addressing on 2400 (4Gb) and newer controllers. The isp(4) driver defaults to loop address 0, and the tape drives I have tested default to loop address 0 if hard addressing is turned on. So when hard loop addressing is turned on on the drive, the isp(4) driver just refuses to participate in the loop. The solution is to largely revert that change. I left some elements in place that are related to virtual ports, since they were new. This does work with IBM tape drives with hard and soft addressing turned on. I have tested it with 4Gb, 8Gb, and 16Gb controllers. sys/dev/isp.c: Largely revert FreeBSD SVN change 289937. I left the ispmbox.h changes in place. Don't use the PREV_ADDRESS bit on initialization. It tells the chip to not participate if it can't get the requested loop ID. Do use soft addressing on 2400 and newer chips. Use hard addressing when the user has requested a specific initiator ID. (hint.isp.X.iid=N in /boot/loader.conf) Leave some of the virtual port options from that change in place, but don't turn on the PREV_ADDRESS bit. Reviewed by: mav Sponsored by: Spectra Logic ------------------------------------------------------------------------ r321623 | ken | 2017-07-27 09:51:56 -0600 (Thu, 27 Jul 2017) | 6 lines Remove duplicate assignments from r321622. Submitted by: mav Sponsored by: Spectra Logic ------------------------------------------------------------------------ Modified: stable/10/sys/dev/isp/isp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Wed Aug 2 20:24:26 2017 (r321944) +++ stable/10/sys/dev/isp/isp.c Wed Aug 2 20:24:28 2017 (r321945) @@ -1632,6 +1632,7 @@ isp_fibre_init(ispsoftc_t *isp) fcparam *fcp; isp_icb_t local, *icbp = &local; mbreg_t mbs; + int ownloopid; /* * We only support one channel on non-24XX cards @@ -1710,15 +1711,22 @@ isp_fibre_init(ispsoftc_t *isp) } icbp->icb_retry_delay = fcp->isp_retry_delay; icbp->icb_retry_count = fcp->isp_retry_count; - if (fcp->isp_loopid < LOCAL_LOOP_LIM) { - icbp->icb_hardaddr = fcp->isp_loopid; - if (isp->isp_confopts & ISP_CFG_OWNLOOPID) - icbp->icb_fwoptions |= ICBOPT_HARD_ADDRESS; - else - icbp->icb_fwoptions |= ICBOPT_PREV_ADDRESS; + icbp->icb_hardaddr = fcp->isp_loopid; + ownloopid = (isp->isp_confopts & ISP_CFG_OWNLOOPID) != 0; + if (icbp->icb_hardaddr >= LOCAL_LOOP_LIM) { + icbp->icb_hardaddr = 0; + ownloopid = 0; } /* + * Our life seems so much better with 2200s and later with + * the latest f/w if we set Hard Address. + */ + if (ownloopid || ISP_FW_NEWER_THAN(isp, 2, 2, 5)) { + icbp->icb_fwoptions |= ICBOPT_HARD_ADDRESS; + } + + /* * Right now we just set extended options to prefer point-to-point * over loop based upon some soft config options. * @@ -1952,6 +1960,7 @@ isp_fibre_init_2400(ispsoftc_t *isp) isp_icb_2400_t local, *icbp = &local; mbreg_t mbs; int chan; + int ownloopid = 0; /* * Check to see whether all channels have *some* kind of role @@ -2024,14 +2033,17 @@ isp_fibre_init_2400(ispsoftc_t *isp) icbp->icb_xchgcnt >>= 1; } - if (fcp->isp_loopid < LOCAL_LOOP_LIM) { - icbp->icb_hardaddr = fcp->isp_loopid; - if (isp->isp_confopts & ISP_CFG_OWNLOOPID) - icbp->icb_fwoptions1 |= ICB2400_OPT1_HARD_ADDRESS; - else - icbp->icb_fwoptions1 |= ICB2400_OPT1_PREV_ADDRESS; + + ownloopid = (isp->isp_confopts & ISP_CFG_OWNLOOPID) != 0; + icbp->icb_hardaddr = fcp->isp_loopid; + if (icbp->icb_hardaddr >= LOCAL_LOOP_LIM) { + icbp->icb_hardaddr = 0; + ownloopid = 0; } + if (ownloopid) + icbp->icb_fwoptions1 |= ICB2400_OPT1_HARD_ADDRESS; + if (isp->isp_confopts & ISP_CFG_NOFCTAPE) { icbp->icb_fwoptions2 &= ~ICB2400_OPT2_FCTAPE; } @@ -2133,6 +2145,9 @@ isp_fibre_init_2400(ispsoftc_t *isp) break; } } + if (ownloopid == 0) { + icbp->icb_fwoptions3 |= ICB2400_OPT3_SOFTID; + } icbp->icb_logintime = ICB_LOGIN_TOV; if (fcp->isp_wwnn && fcp->isp_wwpn) { @@ -2245,14 +2260,13 @@ isp_fibre_init_2400(ispsoftc_t *isp) pi.vp_port_options |= ICB2400_VPOPT_INI_ENABLE; if ((fcp2->role & ISP_ROLE_TARGET) == 0) pi.vp_port_options |= ICB2400_VPOPT_TGT_DISABLE; + if (fcp2->isp_loopid < LOCAL_LOOP_LIM) { + pi.vp_port_loopid = fcp2->isp_loopid; + if (isp->isp_confopts & ISP_CFG_OWNLOOPID) + pi.vp_port_options |= ICB2400_VPOPT_HARD_ADDRESS; + } + } - if (fcp2->isp_loopid < LOCAL_LOOP_LIM) { - pi.vp_port_loopid = fcp2->isp_loopid; - if (isp->isp_confopts & ISP_CFG_OWNLOOPID) - pi.vp_port_options |= ICB2400_VPOPT_HARD_ADDRESS; - else - pi.vp_port_options |= ICB2400_VPOPT_PREV_ADDRESS; - } MAKE_NODE_NAME_FROM_WWN(pi.vp_port_portname, fcp2->isp_wwpn); MAKE_NODE_NAME_FROM_WWN(pi.vp_port_nodename, fcp2->isp_wwnn); off = fcp->isp_scratch; @@ -2330,8 +2344,6 @@ isp_fc_enable_vp(ispsoftc_t *isp, int chan) vp.vp_mod_ports[0].loopid = fcp->isp_loopid; if (isp->isp_confopts & ISP_CFG_OWNLOOPID) vp.vp_mod_ports[0].options |= ICB2400_VPOPT_HARD_ADDRESS; - else - vp.vp_mod_ports[0].options |= ICB2400_VPOPT_PREV_ADDRESS; } MAKE_NODE_NAME_FROM_WWN(vp.vp_mod_ports[0].wwpn, fcp->isp_wwpn); MAKE_NODE_NAME_FROM_WWN(vp.vp_mod_ports[0].wwnn, fcp->isp_wwnn); From owner-svn-src-all@freebsd.org Wed Aug 2 20:27:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D3CFDB3CE1; Wed, 2 Aug 2017 20:27:32 +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 mx1.freebsd.org (Postfix) with ESMTPS id 068C376933; Wed, 2 Aug 2017 20:27:31 +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 v72KRVuL019223; Wed, 2 Aug 2017 20:27:31 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v72KRU9F019219; Wed, 2 Aug 2017 20:27:30 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201708022027.v72KRU9F019219@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Wed, 2 Aug 2017 20:27:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321946 - in stable/10/sys: arm/freescale/imx conf powerpc/mpc85xx X-SVN-Group: stable-10 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: in stable/10/sys: arm/freescale/imx conf powerpc/mpc85xx X-SVN-Commit-Revision: 321946 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 20:27:32 -0000 Author: marius Date: Wed Aug 2 20:27:30 2017 New Revision: 321946 URL: https://svnweb.freebsd.org/changeset/base/321946 Log: Apply the other half of merges to sdhci_imx(4) and sdhci_fsl(4) that somehow stayed local when committing r318198, probably due to the associated tree conflicts. While at it, register the dependency of sdhci_fsl(4) on sdhci(4) and allow the former to be built. Modified: stable/10/sys/arm/freescale/imx/imx_sdhci.c stable/10/sys/conf/files.powerpc stable/10/sys/powerpc/mpc85xx/fsl_sdhc.c stable/10/sys/powerpc/mpc85xx/fsl_sdhc.h Modified: stable/10/sys/arm/freescale/imx/imx_sdhci.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx_sdhci.c Wed Aug 2 20:24:28 2017 (r321945) +++ stable/10/sys/arm/freescale/imx/imx_sdhci.c Wed Aug 2 20:27:30 2017 (r321946) @@ -59,10 +59,10 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include + +#include "mmcbr_if.h" #include "sdhci_if.h" struct imx_sdhci_softc { @@ -803,7 +803,6 @@ static device_method_t imx_sdhci_methods[] = { /* Bus interface */ DEVMETHOD(bus_read_ivar, sdhci_generic_read_ivar), DEVMETHOD(bus_write_ivar, sdhci_generic_write_ivar), - DEVMETHOD(bus_print_child, bus_generic_print_child), /* MMC bridge interface */ DEVMETHOD(mmcbr_update_ios, sdhci_generic_update_ios), @@ -822,7 +821,7 @@ static device_method_t imx_sdhci_methods[] = { DEVMETHOD(sdhci_write_4, imx_sdhci_write_4), DEVMETHOD(sdhci_write_multi_4, imx_sdhci_write_multi_4), - { 0, 0 } + DEVMETHOD_END }; static devclass_t imx_sdhci_devclass; @@ -833,7 +832,7 @@ static driver_t imx_sdhci_driver = { sizeof(struct imx_sdhci_softc), }; -DRIVER_MODULE(sdhci_imx, simplebus, imx_sdhci_driver, imx_sdhci_devclass, 0, 0); +DRIVER_MODULE(sdhci_imx, simplebus, imx_sdhci_driver, imx_sdhci_devclass, + NULL, NULL); MODULE_DEPEND(sdhci_imx, sdhci, 1, 1, 1); -DRIVER_MODULE(mmc, sdhci_imx, mmc_driver, mmc_devclass, NULL, NULL); -MODULE_DEPEND(sdhci_imx, mmc, 1, 1, 1); +MMC_DECLARE_BRIDGE(sdhci_imx); Modified: stable/10/sys/conf/files.powerpc ============================================================================== --- stable/10/sys/conf/files.powerpc Wed Aug 2 20:24:28 2017 (r321945) +++ stable/10/sys/conf/files.powerpc Wed Aug 2 20:27:30 2017 (r321946) @@ -131,6 +131,7 @@ powerpc/mpc85xx/ds1553_bus_fdt.c optional ds1553 fdt powerpc/mpc85xx/ds1553_core.c optional ds1553 powerpc/mpc85xx/i2c.c optional iicbus fdt powerpc/mpc85xx/isa.c optional mpc85xx isa +powerpc/mpc85xx/fsl_sdhc.c optional mpc85xx sdhci powerpc/mpc85xx/lbc.c optional mpc85xx powerpc/mpc85xx/mpc85xx.c optional mpc85xx powerpc/mpc85xx/platform_mpc85xx.c optional mpc85xx Modified: stable/10/sys/powerpc/mpc85xx/fsl_sdhc.c ============================================================================== --- stable/10/sys/powerpc/mpc85xx/fsl_sdhc.c Wed Aug 2 20:24:28 2017 (r321945) +++ stable/10/sys/powerpc/mpc85xx/fsl_sdhc.c Wed Aug 2 20:27:30 2017 (r321946) @@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -112,7 +111,7 @@ static device_method_t fsl_sdhc_methods[] = { DEVMETHOD(mmcbr_acquire_host, fsl_sdhc_acquire_host), DEVMETHOD(mmcbr_release_host, fsl_sdhc_release_host), - {0, 0}, + DEVMETHOD_END }; /* kobj_class definition */ @@ -124,9 +123,9 @@ static driver_t fsl_sdhc_driver = { static devclass_t fsl_sdhc_devclass; -DRIVER_MODULE(sdhci, simplebus, fsl_sdhc_driver, fsl_sdhc_devclass, 0, 0); -DRIVER_MODULE(mmc, sdhci_fsl, mmc_driver, mmc_devclass, NULL, NULL); -MODULE_DEPEND(sdhci_fsl, mmc, 1, 1, 1); +DRIVER_MODULE(sdhci, simplebus, fsl_sdhc_driver, fsl_sdhc_devclass, NULL, NULL); +MODULE_DEPEND(sdhci_fsl, sdhci, 1, 1, 1); +MMC_DECLARE_BRIDGE(sdhci_fsl); /***************************************************************************** * Private methods Modified: stable/10/sys/powerpc/mpc85xx/fsl_sdhc.h ============================================================================== --- stable/10/sys/powerpc/mpc85xx/fsl_sdhc.h Wed Aug 2 20:24:28 2017 (r321945) +++ stable/10/sys/powerpc/mpc85xx/fsl_sdhc.h Wed Aug 2 20:27:30 2017 (r321946) @@ -46,12 +46,8 @@ #include #include -#include #include -#include "mmcbr_if.h" - - /***************************************************************************** * Private defines *****************************************************************************/ @@ -112,7 +108,6 @@ struct fsl_sdhc_softc { #define FSL_SDHC_DMA_SEGMENT_SIZE (1024) #define FSL_SDHC_DMA_ALIGNMENT (4) #define FSL_SDHC_DMA_BLOCK_SIZE FSL_SDHC_MAX_BLOCK_SIZE - /* * Offsets of SD HC registers From owner-svn-src-all@freebsd.org Wed Aug 2 20:42:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30882DB45E2; Wed, 2 Aug 2017 20:42:41 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F05507724E; Wed, 2 Aug 2017 20:42:40 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v72KgeSB027128; Wed, 2 Aug 2017 20:42:40 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v72KgeNj027127; Wed, 2 Aug 2017 20:42:40 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201708022042.v72KgeNj027127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 2 Aug 2017 20:42:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321947 - head/usr.sbin/makefs/tests X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/usr.sbin/makefs/tests X-SVN-Commit-Revision: 321947 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 20:42:41 -0000 Author: ngie Date: Wed Aug 2 20:42:39 2017 New Revision: 321947 URL: https://svnweb.freebsd.org/changeset/base/321947 Log: Require strings(1) with :o_flag_preparer and :o_flag_publisher strings(1) might not be installed on the system, e.g., if MK_TOOLCHAIN == no MFC after: 1 week Modified: head/usr.sbin/makefs/tests/makefs_cd9660_tests.sh Modified: head/usr.sbin/makefs/tests/makefs_cd9660_tests.sh ============================================================================== --- head/usr.sbin/makefs/tests/makefs_cd9660_tests.sh Wed Aug 2 20:27:30 2017 (r321946) +++ head/usr.sbin/makefs/tests/makefs_cd9660_tests.sh Wed Aug 2 20:42:39 2017 (r321947) @@ -277,6 +277,10 @@ o_flag_isolevel_3_cleanup() } atf_test_case o_flag_preparer +o_flag_preparer_head() +{ + atf_set "require.progs" "strings" +} o_flag_preparer_body() { create_test_dirs @@ -292,6 +296,10 @@ o_flag_preparer_body() } atf_test_case o_flag_publisher +o_flag_publisher_head() +{ + atf_set "require.progs" "strings" +} o_flag_publisher_body() { create_test_dirs From owner-svn-src-all@freebsd.org Wed Aug 2 20:43:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 435A0DB4640; Wed, 2 Aug 2017 20:43:22 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x22c.google.com (mail-pg0-x22c.google.com [IPv6:2607:f8b0:400e:c05::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 0C6037738D; Wed, 2 Aug 2017 20:43:22 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x22c.google.com with SMTP id l64so25500360pge.5; Wed, 02 Aug 2017 13:43:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=l/XfYYMttiUGoq4YGghKRNUePTkZ+V1iINoXJ1Pnsy8=; b=hd7fZeeWb+vI6pw/I696H5ykHORQZZLB/6Jp7XUQM5W/3x53E7fxLYELNlAC6FSYy5 Lo/BkerhM0FL3KCtLJkybffEyeAqUa9djH8nClZH7EuzQj8TxelsaNPVNU67vvCc4zSY FXmOBbkMa8GOG2AbZpb0TUFB3T0l5DAetb5epnH7bzZQfT06CLH10qusCx60dhlTlMOq GXpjqUQ+R70DFeWTKlzHObXicVXmrO1RJ6FqaXyLPQFMDCdG2JdWgr/pON0KMX5ysnli 4NOLqMMStU1hO6kAfe7ZpDsukwwftSlbve8QpjYInRwgj4MGNJ3AS/34ea8DtdbH0DPy oayQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=l/XfYYMttiUGoq4YGghKRNUePTkZ+V1iINoXJ1Pnsy8=; b=lHsZyOjLNG1NpzKiwH1KGTXUQiWvacPoht/SUMKycxGc+8UBoG1F8C5pKOwOe8s+ii vBBLd8EPcqcgEwy/MBGj4q6UyhB7T2Uu2qlssQm0+o8KIkc5Ja/UJXLHIh8bBP7Yi7ge 7hycgvF2M/ywMAXYIyO2wcm64ZwifQJvdvVQJZNxQE3DxG4SL8f50f2IcpoiLdoB3SKf ZJmoJZqttlkO0b63vfmctGSMPkHYvhvkJCFSTIRi/0F2lqo9XINc5dFChCL2lbyqT+9r rlqYR5iwOK/2tPAr3XiGQU17mC8f/nCEk9f+qjT9EUZg4ZVpgfpbB2JrlnJyNOAZ+vy8 yTtQ== X-Gm-Message-State: AIVw113CToRPt+Ej1s6V2JUNVM0fIGsz6/bFMOK1xnRnKxlUhb5JU6ZV A+P+z7W08vIPwabFmw4= X-Received: by 10.98.58.210 with SMTP id v79mr24281916pfj.162.1501706600929; Wed, 02 Aug 2017 13:43:20 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id i133sm27545656pgc.0.2017.08.02.13.43.19 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Aug 2017 13:43:20 -0700 (PDT) Subject: Re: svn commit: r321093 - in stable/10: bin/ln bin/ln/tests etc/mtree Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_7A6671DF-83BA-4A91-9B05-F6BEE593163B"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: Date: Wed, 2 Aug 2017 13:43:18 -0700 Cc: Ngie Cooper , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Message-Id: References: <201707172112.v6HLC2In057796@repo.freebsd.org> To: Alan Somers X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 20:43:22 -0000 --Apple-Mail=_7A6671DF-83BA-4A91-9B05-F6BEE593163B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jul 31, 2017, at 14:34, Alan Somers wrote: >=20 > On Mon, Jul 17, 2017 at 3:12 PM, Ngie Cooper wrote: >> Author: ngie >> Date: Mon Jul 17 21:12:02 2017 >> New Revision: 321093 >> URL: https://svnweb.freebsd.org/changeset/base/321093 >>=20 >> Log: >> MFC r319857: >>=20 >> ln(1): wordsmith -F option description >>=20 >> Added: >> stable/10/bin/ln/tests/ >> - copied from r319714, head/bin/ln/tests/ >> Modified: >> stable/10/bin/ln/Makefile >> stable/10/etc/mtree/BSD.tests.dist >> Directory Properties: >> stable/10/ (props changed) >=20 > It looks like the commit message for this one was wrong, though the > merge tracking info is correct. The commit message should've read: >=20 > MFC r319714: >=20 > Add tests for ln(1) >=20 > * Verify that when creating a hard link to a symbolic link, '-L' = option > creates a hard link to the target of the symbolic link > * Verify that when creating a hard link to a symbolic link, '-P' = option > creates a hard link to the symbolic link itself > * Verify that if the target file already exists, '-f' option unlinks = it so > that link may occur > * Verify that if the target file or directory is a symbolic link, = '-shf' > option prevents following the link > * Verify that if the target file or directory is a symbolic link, = '-snf' > option prevents following the link > * Verify that '-s' option creates a symbolic link > * Verify that '-w' option produces a warning if the source of a = symbolic > link does not currently exist >=20 > Submitted by: shivansh > Reviewed by: asomers, ngie > MFC after: 1 month > Sponsored by: Google, Inc (GSoC 2017) > Differential Revision: https://reviews.freebsd.org/D11084 Whoops =E2=80=94 yeah, I might have screwed that up by accident = :(. Thanks for the clarification! -Ngie --Apple-Mail=_7A6671DF-83BA-4A91-9B05-F6BEE593163B Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZgjlnAAoJEPWDqSZpMIYVCvsQANTKrLzPfDuQD7D4mK/15WFA tRTn3S728KCy61WX1XBVhd26GCB5VKLlJOG3IxnmeVrjNfah/1E2NPW5OBTAAwm0 V360DzTs8VkJejqHsiRLv6lSSCtQfbDamH5JtyLN5p14Gu8NyUfYteJQxyKHvQUt KkAW3H/5OgqlDEua/Dg+UQa+D5pTELz1KGqYNBh7nOMPZHBDb4rL+VKrnRYuETEg udLPsuRx1rb5uQ2V9x99W8dlFhFzUa7DRIfRYrGYBlo5PW72o7GXOsle5r5nnvJD Hk6q2yeS1i7fkpNmcGdhw5cgk+sjiuDHLYeRTxwqebhGTOgX76iraN+ZRKKK4Hqb 689QB2ySZduKQc5FYi8UzWboU/811zEDJiORT2FLZD6q+TWl0wS8Nn7YlDEaA+JC qKkzZri0keDXPik8yt7PeB9azOHkU3QSgbneEFGvqnqPXvTWC06Vsi72ox4QyjxY lx+BNjfe7qGs7UQ2LtriU1Pa15WX48mJRmrM2Fz7uvfv8jx57ToFwUTdWvyBxoVM WnRBEqxup8tYNzbVanFEESThq274OnkIrOIEE2hfd77fUSd0KnlM90nVrqcXd9p5 6Fs2r4d5vY6/uK1oQ407UL59Q0t3Lr88Iue+zfWtTASBGlD5eIUmmEQ6OX3AB28H qTT60oi5ZD/xZ2wejf8K =e8C0 -----END PGP SIGNATURE----- --Apple-Mail=_7A6671DF-83BA-4A91-9B05-F6BEE593163B-- From owner-svn-src-all@freebsd.org Wed Aug 2 21:11:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 328B1DB4FA8; Wed, 2 Aug 2017 21:11:53 +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 mx1.freebsd.org (Postfix) with ESMTPS id F41417C2B5; Wed, 2 Aug 2017 21:11:52 +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 v72LBqsc039460; Wed, 2 Aug 2017 21:11:52 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v72LBpRE039454; Wed, 2 Aug 2017 21:11:51 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201708022111.v72LBpRE039454@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Wed, 2 Aug 2017 21:11:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321948 - head/sys/dev/mmc X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/dev/mmc X-SVN-Commit-Revision: 321948 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 21:11:53 -0000 Author: marius Date: Wed Aug 2 21:11:51 2017 New Revision: 321948 URL: https://svnweb.freebsd.org/changeset/base/321948 Log: - Correct the remainder of confusing and error prone mix-ups between "br" or "bridge" where - according to the terminology outlined in comments of bridge.h and mmcbr_if.m around since their addition in r163516 - the bus is meant and used instead. Some of these instances are also rather old, while those in e. g. mmc_subr.c are as new as r315430 and were caused by choosing mmc_wait_for_request(), i. e. the one pre-r315430 outliner existing in mmc.c, as template for function parameters in mmc_subr.c inadvertently. This correction translates to renaming "brdev" to "busdev" and "mmcbr" to "mmcbus" respectively as appropriate. While at it, also rename "reqdev" to just "dev" in mmc_subr.[c,h] for consistency with was already used in mmm.c pre-r315430, again modulo mmc_wait_for_request() that is. - Remove comment lines from bridge.h incorrectly suggesting that there would be a MMC bridge base class driver. - Update comments in bridge.h regarding the star topology of SD and SDIO; since version 3.00 of the SDHCI specification, for eSD and eSDIO bus topologies are actually possible in form of so called "shared buses" (in some subcontext later on renamed to "embedded" buses). Modified: head/sys/dev/mmc/bridge.h head/sys/dev/mmc/mmc_subr.c head/sys/dev/mmc/mmc_subr.h head/sys/dev/mmc/mmcbus_if.m head/sys/dev/mmc/mmcsd.c Modified: head/sys/dev/mmc/bridge.h ============================================================================== --- head/sys/dev/mmc/bridge.h Wed Aug 2 20:42:39 2017 (r321947) +++ head/sys/dev/mmc/bridge.h Wed Aug 2 21:11:51 2017 (r321948) @@ -65,12 +65,10 @@ * linux/mmc/host.h file. * * A mmc bridge is a chipset that can have one or more mmc and/or sd - * cards attached to it. mmc cards are attached on a bus topology, - * while sd and sdio cards are attached using a star topology (meaning - * in practice each sd card has its own, independent slot). Each - * mmcbr is assumed to be derived from the mmcbr. This is done to - * allow for easier addition of bridges (as each bridge does not need - * to be added to the mmcbus file). + * cards attached to it. mmc devices are attached on a bus topology, + * while sd and sdio cards usually are attached using a star topology + * (meaning in practice each sd card has its own, independent slot). + * Since SDHCI v3.00, buses for esd and esdio are possible, though. * * Attached to the mmc bridge is an mmcbus. The mmcbus is described * in dev/mmc/mmcbus_if.m. Modified: head/sys/dev/mmc/mmc_subr.c ============================================================================== --- head/sys/dev/mmc/mmc_subr.c Wed Aug 2 20:42:39 2017 (r321947) +++ head/sys/dev/mmc/mmc_subr.c Wed Aug 2 21:11:51 2017 (r321948) @@ -72,7 +72,7 @@ __FBSDID("$FreeBSD$"); #define LOG_PPS 5 /* Log no more than 5 errors per second. */ int -mmc_wait_for_cmd(device_t brdev, device_t reqdev, struct mmc_command *cmd, +mmc_wait_for_cmd(device_t busdev, device_t dev, struct mmc_command *cmd, int retries) { struct mmc_request mreq; @@ -87,14 +87,14 @@ mmc_wait_for_cmd(device_t brdev, device_t reqdev, stru if (cmd->data != NULL) cmd->data->mrq = &mreq; mreq.cmd = cmd; - if (MMCBUS_WAIT_FOR_REQUEST(brdev, reqdev, &mreq) != 0) + if (MMCBUS_WAIT_FOR_REQUEST(busdev, dev, &mreq) != 0) err = MMC_ERR_FAILED; else err = cmd->error; } while (err != MMC_ERR_NONE && retries-- > 0); - if (err != MMC_ERR_NONE && brdev == reqdev) { - sc = device_get_softc(brdev); + if (err != MMC_ERR_NONE && busdev == dev) { + sc = device_get_softc(busdev); if (sc->squelched == 0 && ppsratecheck(&sc->log_time, &sc->log_count, LOG_PPS)) { device_printf(sc->dev, "CMD%d failed, RESULT: %d\n", @@ -106,14 +106,14 @@ mmc_wait_for_cmd(device_t brdev, device_t reqdev, stru } int -mmc_wait_for_app_cmd(device_t brdev, device_t reqdev, uint16_t rca, +mmc_wait_for_app_cmd(device_t busdev, device_t dev, uint16_t rca, struct mmc_command *cmd, int retries) { struct mmc_command appcmd; struct mmc_softc *sc; int err; - sc = device_get_softc(brdev); + sc = device_get_softc(busdev); /* Squelch error reporting at lower levels, we report below. */ sc->squelched++; @@ -122,14 +122,14 @@ mmc_wait_for_app_cmd(device_t brdev, device_t reqdev, appcmd.opcode = MMC_APP_CMD; appcmd.arg = (uint32_t)rca << 16; appcmd.flags = MMC_RSP_R1 | MMC_CMD_AC; - if (mmc_wait_for_cmd(brdev, reqdev, &appcmd, 0) != 0) + if (mmc_wait_for_cmd(busdev, dev, &appcmd, 0) != 0) err = MMC_ERR_FAILED; else err = appcmd.error; if (err == MMC_ERR_NONE) { if (!(appcmd.resp[0] & R1_APP_CMD)) err = MMC_ERR_FAILED; - else if (mmc_wait_for_cmd(brdev, reqdev, cmd, 0) != 0) + else if (mmc_wait_for_cmd(busdev, dev, cmd, 0) != 0) err = MMC_ERR_FAILED; else err = cmd->error; @@ -137,7 +137,7 @@ mmc_wait_for_app_cmd(device_t brdev, device_t reqdev, } while (err != MMC_ERR_NONE && retries-- > 0); sc->squelched--; - if (err != MMC_ERR_NONE && brdev == reqdev) { + if (err != MMC_ERR_NONE && busdev == dev) { if (sc->squelched == 0 && ppsratecheck(&sc->log_time, &sc->log_count, LOG_PPS)) { device_printf(sc->dev, "ACMD%d failed, RESULT: %d\n", @@ -149,7 +149,7 @@ mmc_wait_for_app_cmd(device_t brdev, device_t reqdev, } int -mmc_switch(device_t brdev, device_t reqdev, uint16_t rca, uint8_t set, +mmc_switch(device_t busdev, device_t dev, uint16_t rca, uint8_t set, uint8_t index, uint8_t value, u_int timeout, bool status) { struct mmc_command cmd; @@ -158,7 +158,7 @@ mmc_switch(device_t brdev, device_t reqdev, uint16_t r KASSERT(timeout != 0, ("%s: no timeout", __func__)); - sc = device_get_softc(brdev); + sc = device_get_softc(busdev); memset(&cmd, 0, sizeof(cmd)); cmd.opcode = MMC_SWITCH_FUNC; @@ -169,8 +169,8 @@ mmc_switch(device_t brdev, device_t reqdev, uint16_t r * exceeds the maximum host timeout, use a R1 instead of a R1B * response in order to keep the hardware from timing out. */ - if (mmcbr_get_caps(brdev) & MMC_CAP_WAIT_WHILE_BUSY && - timeout > mmcbr_get_max_busy_timeout(brdev)) + if (mmcbr_get_caps(busdev) & MMC_CAP_WAIT_WHILE_BUSY && + timeout > mmcbr_get_max_busy_timeout(busdev)) cmd.flags = MMC_RSP_R1 | MMC_CMD_AC; else cmd.flags = MMC_RSP_R1B | MMC_CMD_AC; @@ -180,17 +180,17 @@ mmc_switch(device_t brdev, device_t reqdev, uint16_t r * than to a tuning command that may have snuck in between. */ sc->retune_paused++; - err = mmc_wait_for_cmd(brdev, reqdev, &cmd, CMD_RETRIES); + err = mmc_wait_for_cmd(busdev, dev, &cmd, CMD_RETRIES); if (err != MMC_ERR_NONE || status == false) goto out; - err = mmc_switch_status(brdev, reqdev, rca, timeout); + err = mmc_switch_status(busdev, dev, rca, timeout); out: sc->retune_paused--; return (err); } int -mmc_switch_status(device_t brdev, device_t reqdev, uint16_t rca, u_int timeout) +mmc_switch_status(device_t busdev, device_t dev, uint16_t rca, u_int timeout) { struct timeval cur, end; int err; @@ -205,7 +205,7 @@ mmc_switch_status(device_t brdev, device_t reqdev, uin */ end.tv_sec = end.tv_usec = 0; for (;;) { - err = mmc_send_status(brdev, reqdev, rca, &status); + err = mmc_send_status(busdev, dev, rca, &status); if (err != MMC_ERR_NONE) break; if (R1_CURRENT_STATE(status) == R1_STATE_TRAN) @@ -226,7 +226,7 @@ mmc_switch_status(device_t brdev, device_t reqdev, uin } int -mmc_send_ext_csd(device_t brdev, device_t reqdev, uint8_t *rawextcsd) +mmc_send_ext_csd(device_t busdev, device_t dev, uint8_t *rawextcsd) { struct mmc_command cmd; struct mmc_data data; @@ -244,12 +244,12 @@ mmc_send_ext_csd(device_t brdev, device_t reqdev, uint data.len = MMC_EXTCSD_SIZE; data.flags = MMC_DATA_READ; - err = mmc_wait_for_cmd(brdev, reqdev, &cmd, CMD_RETRIES); + err = mmc_wait_for_cmd(busdev, dev, &cmd, CMD_RETRIES); return (err); } int -mmc_send_status(device_t brdev, device_t reqdev, uint16_t rca, uint32_t *status) +mmc_send_status(device_t busdev, device_t dev, uint16_t rca, uint32_t *status) { struct mmc_command cmd; int err; @@ -258,7 +258,7 @@ mmc_send_status(device_t brdev, device_t reqdev, uint1 cmd.opcode = MMC_SEND_STATUS; cmd.arg = (uint32_t)rca << 16; cmd.flags = MMC_RSP_R1 | MMC_CMD_AC; - err = mmc_wait_for_cmd(brdev, reqdev, &cmd, CMD_RETRIES); + err = mmc_wait_for_cmd(busdev, dev, &cmd, CMD_RETRIES); *status = cmd.resp[0]; return (err); } Modified: head/sys/dev/mmc/mmc_subr.h ============================================================================== --- head/sys/dev/mmc/mmc_subr.h Wed Aug 2 20:42:39 2017 (r321947) +++ head/sys/dev/mmc/mmc_subr.h Wed Aug 2 21:11:51 2017 (r321948) @@ -57,16 +57,16 @@ struct mmc_command; -int mmc_send_ext_csd(device_t brdev, device_t reqdev, uint8_t *rawextcsd); -int mmc_send_status(device_t brdev, device_t reqdev, uint16_t rca, +int mmc_send_ext_csd(device_t busdev, device_t dev, uint8_t *rawextcsd); +int mmc_send_status(device_t busdev, device_t dev, uint16_t rca, uint32_t *status); -int mmc_switch(device_t brdev, device_t reqdev, uint16_t rca, uint8_t set, +int mmc_switch(device_t busdev, device_t dev, uint16_t rca, uint8_t set, uint8_t index, uint8_t value, u_int timeout, bool send_status); -int mmc_switch_status(device_t brdev, device_t reqdev, uint16_t rca, +int mmc_switch_status(device_t busdev, device_t dev, uint16_t rca, u_int timeout); -int mmc_wait_for_app_cmd(device_t brdev, device_t reqdev, uint16_t rca, +int mmc_wait_for_app_cmd(device_t busdev, device_t dev, uint16_t rca, struct mmc_command *cmd, int retries); -int mmc_wait_for_cmd(device_t brdev, device_t reqdev, struct mmc_command *cmd, +int mmc_wait_for_cmd(device_t busdev, device_t dev, struct mmc_command *cmd, int retries); #endif /* DEV_MMC_SUBR_H */ Modified: head/sys/dev/mmc/mmcbus_if.m ============================================================================== --- head/sys/dev/mmc/mmcbus_if.m Wed Aug 2 20:42:39 2017 (r321947) +++ head/sys/dev/mmc/mmcbus_if.m Wed Aug 2 21:11:51 2017 (r321948) @@ -68,7 +68,7 @@ INTERFACE mmcbus; # the bus to be claimed. # METHOD void retune_pause { - device_t brdev; + device_t busdev; device_t reqdev; bool retune; }; @@ -77,7 +77,7 @@ METHOD void retune_pause { # Unpause re-tuning. Requires the bus to be claimed. # METHOD void retune_unpause { - device_t brdev; + device_t busdev; device_t reqdev; }; @@ -85,7 +85,7 @@ METHOD void retune_unpause { # Queue and wait for a request. Requires the bus to be claimed. # METHOD int wait_for_request { - device_t brdev; + device_t busdev; device_t reqdev; struct mmc_request *req; }; @@ -95,7 +95,7 @@ METHOD int wait_for_request { # longer busy. # METHOD int acquire_bus { - device_t brdev; + device_t busdev; device_t reqdev; }; @@ -103,6 +103,6 @@ METHOD int acquire_bus { # Release the current bus. # METHOD int release_bus { - device_t brdev; + device_t busdev; device_t reqdev; }; Modified: head/sys/dev/mmc/mmcsd.c ============================================================================== --- head/sys/dev/mmc/mmcsd.c Wed Aug 2 20:42:39 2017 (r321947) +++ head/sys/dev/mmc/mmcsd.c Wed Aug 2 21:11:51 2017 (r321948) @@ -117,7 +117,7 @@ struct mmcsd_part { struct mmcsd_softc { device_t dev; - device_t mmcbr; + device_t mmcbus; struct mmcsd_part *part[MMC_PART_MAX]; enum mmc_card_mode mode; u_int max_data; /* Maximum data size [blocks] */ @@ -215,7 +215,7 @@ mmcsd_probe(device_t dev) static int mmcsd_attach(device_t dev) { - device_t mmcbr; + device_t mmcbus; struct mmcsd_softc *sc; const uint8_t *ext_csd; off_t erase_size, sector_size, size, wp_size; @@ -227,8 +227,8 @@ mmcsd_attach(device_t dev) sc = device_get_softc(dev); sc->dev = dev; - sc->mmcbr = mmcbr = device_get_parent(dev); - sc->mode = mmcbr_get_mode(mmcbr); + sc->mmcbus = mmcbus = device_get_parent(dev); + sc->mode = mmcbr_get_mode(mmcbus); /* * Note that in principle with an SDHCI-like re-tuning implementation, * the maximum data size can change at runtime due to a device removal/ @@ -245,9 +245,9 @@ mmcsd_attach(device_t dev) /* Only MMC >= 4.x devices support EXT_CSD. */ if (mmc_get_spec_vers(dev) >= 4) { - MMCBUS_ACQUIRE_BUS(mmcbr, dev); - err = mmc_send_ext_csd(mmcbr, dev, sc->ext_csd); - MMCBUS_RELEASE_BUS(mmcbr, dev); + MMCBUS_ACQUIRE_BUS(mmcbus, dev); + err = mmc_send_ext_csd(mmcbus, dev, sc->ext_csd); + MMCBUS_RELEASE_BUS(mmcbus, dev); if (err != MMC_ERR_NONE) bzero(sc->ext_csd, sizeof(sc->ext_csd)); } @@ -330,7 +330,7 @@ mmcsd_attach(device_t dev) /* Add boot partitions, which are of a fixed multiple of 128 KB. */ size = ext_csd[EXT_CSD_BOOT_SIZE_MULT] * MMC_BOOT_RPMB_BLOCK_SIZE; - if (size > 0 && (mmcbr_get_caps(mmcbr) & MMC_CAP_BOOT_NOACC) == 0) { + if (size > 0 && (mmcbr_get_caps(mmcbus) & MMC_CAP_BOOT_NOACC) == 0) { mmcsd_add_part(sc, EXT_CSD_PART_CONFIG_ACC_BOOT0, MMCSD_FMT_BOOT, 0, size, MMC_BOOT_RPMB_BLOCK_SIZE, ro | ((ext_csd[EXT_CSD_BOOT_WP_STATUS] & @@ -422,7 +422,7 @@ mmcsd_add_part(struct mmcsd_softc *sc, u_int type, con off_t media_size, off_t erase_size, bool ro) { struct make_dev_args args; - device_t dev, mmcbr; + device_t dev, mmcbus; const char *ext; const uint8_t *ext_csd; struct mmcsd_part *part; @@ -435,7 +435,7 @@ mmcsd_add_part(struct mmcsd_softc *sc, u_int type, con char unit[2]; dev = sc->dev; - mmcbr = sc->mmcbr; + mmcbus = sc->mmcbus; part = sc->part[type] = malloc(sizeof(*part), M_DEVBUF, M_WAITOK | M_ZERO); part->sc = sc; @@ -502,10 +502,10 @@ mmcsd_add_part(struct mmcsd_softc *sc, u_int type, con bytes = mmcsd_pretty_size(media_size, unit); if (type == EXT_CSD_PART_CONFIG_ACC_DEFAULT) { - speed = mmcbr_get_clock(mmcbr); + speed = mmcbr_get_clock(mmcbus); printf("%s%d: %ju%sB <%s>%s at %s %d.%01dMHz/%dbit/%d-block\n", part->name, cnt, bytes, unit, mmc_get_card_id_string(dev), - ro ? " (read-only)" : "", device_get_nameunit(mmcbr), + ro ? " (read-only)" : "", device_get_nameunit(mmcbus), speed / 1000000, (speed / 100000) % 10, mmcsd_bus_bit_width(dev), sc->max_data); } else if (type == EXT_CSD_PART_CONFIG_ACC_RPMB) { @@ -802,7 +802,7 @@ mmcsd_ioctl_cmd(struct mmcsd_part *part, struct mmc_io struct mmc_command cmd; struct mmc_data data; struct mmcsd_softc *sc; - device_t dev, mmcbr; + device_t dev, mmcbus; void *dp; u_long len; int err, retries; @@ -885,9 +885,9 @@ mmcsd_ioctl_cmd(struct mmcsd_part *part, struct mmc_io } } dev = sc->dev; - mmcbr = sc->mmcbr; - MMCBUS_ACQUIRE_BUS(mmcbr, dev); - err = mmcsd_switch_part(mmcbr, dev, rca, part->type); + mmcbus = sc->mmcbus; + MMCBUS_ACQUIRE_BUS(mmcbus, dev); + err = mmcsd_switch_part(mmcbus, dev, rca, part->type); if (err != MMC_ERR_NONE) goto release; if (part->type == EXT_CSD_PART_CONFIG_ACC_RPMB) { @@ -897,9 +897,9 @@ mmcsd_ioctl_cmd(struct mmcsd_part *part, struct mmc_io goto switch_back; } if (mic->is_acmd != 0) - (void)mmc_wait_for_app_cmd(mmcbr, dev, rca, &cmd, 0); + (void)mmc_wait_for_app_cmd(mmcbus, dev, rca, &cmd, 0); else - (void)mmc_wait_for_cmd(mmcbr, dev, &cmd, 0); + (void)mmc_wait_for_cmd(mmcbus, dev, &cmd, 0); if (part->type == EXT_CSD_PART_CONFIG_ACC_RPMB) { /* * If the request went to the RPMB partition, try to ensure @@ -907,7 +907,7 @@ mmcsd_ioctl_cmd(struct mmcsd_part *part, struct mmc_io */ retries = MMCSD_CMD_RETRIES; do { - err = mmc_send_status(mmcbr, dev, rca, &status); + err = mmc_send_status(mmcbus, dev, rca, &status); if (err != MMC_ERR_NONE) break; if (R1_STATUS(status) == 0 && @@ -918,7 +918,7 @@ mmcsd_ioctl_cmd(struct mmcsd_part *part, struct mmc_io switch_back: /* ... and always switch back to the default partition. */ - err = mmcsd_switch_part(mmcbr, dev, rca, + err = mmcsd_switch_part(mmcbus, dev, rca, EXT_CSD_PART_CONFIG_ACC_DEFAULT); if (err != MMC_ERR_NONE) goto release; @@ -929,11 +929,11 @@ switch_back: * so retrieve EXT_CSD again. */ if (cmd.opcode == MMC_SWITCH_FUNC) { - err = mmc_send_ext_csd(mmcbr, dev, sc->ext_csd); + err = mmc_send_ext_csd(mmcbus, dev, sc->ext_csd); if (err != MMC_ERR_NONE) goto release; } - MMCBUS_RELEASE_BUS(mmcbr, dev); + MMCBUS_RELEASE_BUS(mmcbus, dev); if (cmd.error != MMC_ERR_NONE) { switch (cmd.error) { case MMC_ERR_TIMEOUT: @@ -963,7 +963,7 @@ switch_back: goto out; release: - MMCBUS_RELEASE_BUS(mmcbr, dev); + MMCBUS_RELEASE_BUS(mmcbus, dev); err = EIO; out: @@ -1009,7 +1009,7 @@ mmcsd_set_blockcount(struct mmcsd_softc *sc, u_int cou if (reliable) cmd.arg |= 1 << 31; cmd.flags = MMC_RSP_R1 | MMC_CMD_AC; - MMCBUS_WAIT_FOR_REQUEST(sc->mmcbr, sc->dev, &req); + MMCBUS_WAIT_FOR_REQUEST(sc->mmcbus, sc->dev, &req); return (cmd.error); } @@ -1036,7 +1036,7 @@ mmcsd_switch_part(device_t bus, device_t dev, uint16_t * anew. */ if (part == EXT_CSD_PART_CONFIG_ACC_RPMB) - MMCBUS_RETUNE_PAUSE(sc->mmcbr, sc->dev, true); + MMCBUS_RETUNE_PAUSE(sc->mmcbus, sc->dev, true); if (sc->part_curr == part) return (MMC_ERR_NONE); @@ -1048,13 +1048,13 @@ mmcsd_switch_part(device_t bus, device_t dev, uint16_t EXT_CSD_PART_CONFIG, value, sc->part_time, true); if (err != MMC_ERR_NONE) { if (part == EXT_CSD_PART_CONFIG_ACC_RPMB) - MMCBUS_RETUNE_UNPAUSE(sc->mmcbr, sc->dev); + MMCBUS_RETUNE_UNPAUSE(sc->mmcbus, sc->dev); return (err); } sc->ext_csd[EXT_CSD_PART_CONFIG] = value; if (sc->part_curr == EXT_CSD_PART_CONFIG_ACC_RPMB) - MMCBUS_RETUNE_UNPAUSE(sc->mmcbr, sc->dev); + MMCBUS_RETUNE_UNPAUSE(sc->mmcbus, sc->dev); sc->part_curr = part; return (MMC_ERR_NONE); } @@ -1077,13 +1077,13 @@ mmcsd_rw(struct mmcsd_part *part, struct bio *bp) struct mmc_request req; struct mmc_data data; struct mmcsd_softc *sc; - device_t dev, mmcbr; + device_t dev, mmcbus; u_int numblocks, sz; char *vaddr; sc = part->sc; dev = sc->dev; - mmcbr = sc->mmcbr; + mmcbus = sc->mmcbus; block = bp->bio_pblkno; sz = part->disk->d_sectorsize; @@ -1128,7 +1128,7 @@ mmcsd_rw(struct mmcsd_part *part, struct bio *bp) stop.mrq = &req; req.stop = &stop; } - MMCBUS_WAIT_FOR_REQUEST(mmcbr, dev, &req); + MMCBUS_WAIT_FOR_REQUEST(mmcbus, dev, &req); if (req.cmd->error != MMC_ERR_NONE) { if (ppsratecheck(&sc->log_time, &sc->log_count, LOG_PPS)) @@ -1149,12 +1149,12 @@ mmcsd_delete(struct mmcsd_part *part, struct bio *bp) struct mmc_command cmd; struct mmc_request req; struct mmcsd_softc *sc; - device_t dev, mmcbr; + device_t dev, mmcbus; u_int erase_sector, sz; sc = part->sc; dev = sc->dev; - mmcbr = sc->mmcbr; + mmcbus = sc->mmcbus; block = bp->bio_pblkno; sz = part->disk->d_sectorsize; @@ -1182,7 +1182,7 @@ mmcsd_delete(struct mmcsd_part *part, struct bio *bp) * commands. Note that these latter don't use the data lines, so * re-tuning shouldn't actually become necessary during erase. */ - MMCBUS_RETUNE_PAUSE(mmcbr, dev, false); + MMCBUS_RETUNE_PAUSE(mmcbus, dev, false); /* Set erase start position. */ memset(&req, 0, sizeof(req)); memset(&cmd, 0, sizeof(cmd)); @@ -1196,7 +1196,7 @@ mmcsd_delete(struct mmcsd_part *part, struct bio *bp) if (sc->high_cap == 0) cmd.arg <<= 9; cmd.flags = MMC_RSP_R1 | MMC_CMD_AC; - MMCBUS_WAIT_FOR_REQUEST(mmcbr, dev, &req); + MMCBUS_WAIT_FOR_REQUEST(mmcbus, dev, &req); if (req.cmd->error != MMC_ERR_NONE) { device_printf(dev, "Setting erase start position failed %d\n", req.cmd->error); @@ -1216,7 +1216,7 @@ mmcsd_delete(struct mmcsd_part *part, struct bio *bp) cmd.arg <<= 9; cmd.arg--; cmd.flags = MMC_RSP_R1 | MMC_CMD_AC; - MMCBUS_WAIT_FOR_REQUEST(mmcbr, dev, &req); + MMCBUS_WAIT_FOR_REQUEST(mmcbus, dev, &req); if (req.cmd->error != MMC_ERR_NONE) { device_printf(dev, "Setting erase stop position failed %d\n", req.cmd->error); @@ -1230,7 +1230,7 @@ mmcsd_delete(struct mmcsd_part *part, struct bio *bp) cmd.opcode = MMC_ERASE; cmd.arg = 0; cmd.flags = MMC_RSP_R1B | MMC_CMD_AC; - MMCBUS_WAIT_FOR_REQUEST(mmcbr, dev, &req); + MMCBUS_WAIT_FOR_REQUEST(mmcbus, dev, &req); if (req.cmd->error != MMC_ERR_NONE) { device_printf(dev, "erase err3: %d\n", req.cmd->error); device_printf(dev, "Issuing erase command failed %d\n", @@ -1248,7 +1248,7 @@ mmcsd_delete(struct mmcsd_part *part, struct bio *bp) } block = end; unpause: - MMCBUS_RETUNE_UNPAUSE(mmcbr, dev); + MMCBUS_RETUNE_UNPAUSE(mmcbus, dev); return (block); } @@ -1261,7 +1261,7 @@ mmcsd_dump(void *arg, void *virtual, vm_offset_t physi struct disk *disk; struct mmcsd_softc *sc; struct mmcsd_part *part; - device_t dev, mmcbr; + device_t dev, mmcbus; int err; /* length zero is special and really means flush buffers to media */ @@ -1272,7 +1272,7 @@ mmcsd_dump(void *arg, void *virtual, vm_offset_t physi part = disk->d_drv1; sc = part->sc; dev = sc->dev; - mmcbr = sc->mmcbr; + mmcbus = sc->mmcbus; g_reset_bio(&bp); bp.bio_disk = disk; @@ -1281,16 +1281,16 @@ mmcsd_dump(void *arg, void *virtual, vm_offset_t physi bp.bio_data = virtual; bp.bio_cmd = BIO_WRITE; end = bp.bio_pblkno + bp.bio_bcount / disk->d_sectorsize; - MMCBUS_ACQUIRE_BUS(mmcbr, dev); - err = mmcsd_switch_part(mmcbr, dev, sc->rca, part->type); + MMCBUS_ACQUIRE_BUS(mmcbus, dev); + err = mmcsd_switch_part(mmcbus, dev, sc->rca, part->type); if (err != MMC_ERR_NONE) { if (ppsratecheck(&sc->log_time, &sc->log_count, LOG_PPS)) device_printf(dev, "Partition switch error\n"); - MMCBUS_RELEASE_BUS(mmcbr, dev); + MMCBUS_RELEASE_BUS(mmcbus, dev); return (EIO); } block = mmcsd_rw(part, &bp); - MMCBUS_RELEASE_BUS(mmcbr, dev); + MMCBUS_RELEASE_BUS(mmcbus, dev); return ((end < block) ? EIO : 0); } @@ -1301,13 +1301,13 @@ mmcsd_task(void *arg) struct mmcsd_part *part; struct mmcsd_softc *sc; struct bio *bp; - device_t dev, mmcbr; + device_t dev, mmcbus; int err, sz; part = arg; sc = part->sc; dev = sc->dev; - mmcbr = sc->mmcbr; + mmcbus = sc->mmcbus; while (1) { MMCSD_DISK_LOCK(part); @@ -1327,11 +1327,11 @@ mmcsd_task(void *arg) biodone(bp); continue; } - MMCBUS_ACQUIRE_BUS(mmcbr, dev); + MMCBUS_ACQUIRE_BUS(mmcbus, dev); sz = part->disk->d_sectorsize; block = bp->bio_pblkno; end = bp->bio_pblkno + (bp->bio_bcount / sz); - err = mmcsd_switch_part(mmcbr, dev, sc->rca, part->type); + err = mmcsd_switch_part(mmcbus, dev, sc->rca, part->type); if (err != MMC_ERR_NONE) { if (ppsratecheck(&sc->log_time, &sc->log_count, LOG_PPS)) @@ -1347,7 +1347,7 @@ mmcsd_task(void *arg) block = mmcsd_delete(part, bp); } release: - MMCBUS_RELEASE_BUS(mmcbr, dev); + MMCBUS_RELEASE_BUS(mmcbus, dev); if (block < end) { bp->bio_error = EIO; bp->bio_resid = (end - block) * sz; From owner-svn-src-all@freebsd.org Wed Aug 2 21:18:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C0FBDB5089; Wed, 2 Aug 2017 21:18:56 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 146567C4F8; Wed, 2 Aug 2017 21:18:56 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v72LItLT039721; Wed, 2 Aug 2017 21:18:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v72LIt94039720; Wed, 2 Aug 2017 21:18:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201708022118.v72LIt94039720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 2 Aug 2017 21:18:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321949 - head/bin/chmod/tests X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/bin/chmod/tests X-SVN-Commit-Revision: 321949 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 21:18:56 -0000 Author: ngie Date: Wed Aug 2 21:18:54 2017 New Revision: 321949 URL: https://svnweb.freebsd.org/changeset/base/321949 Log: Add expected failures for ZFS - :f_flag fails on ZFS because UF_IMMUTABLE isn't supported [1]. - :v_flag fails on ZFS because the mode for foo is [always] updated unnecessarily. get_filesystem(..) (supporting function that was added to the test script) is based on equivalent logic in usr.bin/extattr/tests/extattr_test.sh . MFC after: 1 week PR: 221189 [1], 221188 [2] Modified: head/bin/chmod/tests/chmod_test.sh Modified: head/bin/chmod/tests/chmod_test.sh ============================================================================== --- head/bin/chmod/tests/chmod_test.sh Wed Aug 2 21:11:51 2017 (r321948) +++ head/bin/chmod/tests/chmod_test.sh Wed Aug 2 21:18:54 2017 (r321949) @@ -25,6 +25,11 @@ # # $FreeBSD$ +get_filesystem() +{ + df -T . | tail -n 1 | cut -wf 2 +} + atf_test_case RH_flag RH_flag_head() { @@ -94,6 +99,11 @@ f_flag_body() { atf_check truncate -s 0 foo bar atf_check chmod 0750 foo bar + case "$(get_filesystem .)" in + zfs) + atf_expect_fail "ZFS doesn't support UF_IMMUTABLE; returns EPERM - bug 221189" + ;; + esac atf_check chflags uchg foo atf_check -e not-empty -s not-exit:0 chmod 0700 foo bar atf_check -o inline:'100750\n100700\n' stat -f '%p' foo bar @@ -140,6 +150,11 @@ v_flag_body() atf_check truncate -s 0 foo bar atf_check chmod 0600 foo atf_check chmod 0750 bar + case "$(get_filesystem .)" in + zfs) + atf_expect_fail "ZFS updates mode for foo unnecessarily - bug 221188" + ;; + esac atf_check -o 'inline:bar\n' chmod -v 0600 foo bar atf_check chmod -v 0600 foo bar for f in foo bar; do From owner-svn-src-all@freebsd.org Wed Aug 2 21:20:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D7BDDB5207; Wed, 2 Aug 2017 21:20:51 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F12607C79F; Wed, 2 Aug 2017 21:20:50 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v72LKohu040602; Wed, 2 Aug 2017 21:20:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v72LKolK040601; Wed, 2 Aug 2017 21:20:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201708022120.v72LKolK040601@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 2 Aug 2017 21:20:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321950 - head/bin/chmod/tests X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/bin/chmod/tests X-SVN-Commit-Revision: 321950 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 21:20:51 -0000 Author: ngie Date: Wed Aug 2 21:20:49 2017 New Revision: 321950 URL: https://svnweb.freebsd.org/changeset/base/321950 Log: Always use first parameter passed to get_filesystem(..) instead of discarding it and using `.` instead. MFC after: 1 week MFC with: r321949 PR: 221189 [1], 221188 [2] Modified: head/bin/chmod/tests/chmod_test.sh Modified: head/bin/chmod/tests/chmod_test.sh ============================================================================== --- head/bin/chmod/tests/chmod_test.sh Wed Aug 2 21:18:54 2017 (r321949) +++ head/bin/chmod/tests/chmod_test.sh Wed Aug 2 21:20:49 2017 (r321950) @@ -27,7 +27,9 @@ get_filesystem() { - df -T . | tail -n 1 | cut -wf 2 + local mountpoint=$1 + + df -T $mountpoint | tail -n 1 | cut -wf 2 } atf_test_case RH_flag From owner-svn-src-all@freebsd.org Wed Aug 2 21:31:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2762DB5670; Wed, 2 Aug 2017 21:31:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 91AA47CF31; Wed, 2 Aug 2017 21:31:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v72LVk4E046558; Wed, 2 Aug 2017 21:31:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v72LVkeV046536; Wed, 2 Aug 2017 21:31:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201708022131.v72LVkeV046536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 2 Aug 2017 21:31:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321951 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 321951 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 21:31:47 -0000 Author: ngie Date: Wed Aug 2 21:31:46 2017 New Revision: 321951 URL: https://svnweb.freebsd.org/changeset/base/321951 Log: Some minor doc fixups - Tweak a sentence by placing the modifier before an adjective to make it flow better. - Fix a typo. MFC after: 3 days Modified: head/share/mk/bsd.opts.mk Modified: head/share/mk/bsd.opts.mk ============================================================================== --- head/share/mk/bsd.opts.mk Wed Aug 2 21:20:49 2017 (r321950) +++ head/share/mk/bsd.opts.mk Wed Aug 2 21:31:46 2017 (r321951) @@ -4,7 +4,7 @@ # # Users define WITH_FOO and WITHOUT_FOO on the command line or in /etc/src.conf # and /etc/make.conf files. These translate in the build system to MK_FOO={yes,no} -# with sensible (usually) defaults. +# with (usually) sensible defaults. # # Makefiles must include bsd.opts.mk after defining specific MK_FOO options that # are applicable for that Makefile (typically there are none, but sometimes there @@ -41,7 +41,7 @@ ____: # # Only these options are used by bsd.*.mk. KERBEROS and OPENSSH are -# unforutnately needed to support statically linking the entire +# unfortunately needed to support statically linking the entire # tree. su(1) wouldn't link since it depends on PAM which depends on # ssh libraries when building with OPENSSH, and likewise for KERBEROS. From owner-svn-src-all@freebsd.org Wed Aug 2 21:38:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCDBDDB5778; Wed, 2 Aug 2017 21:38:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8783D7D1A7; Wed, 2 Aug 2017 21:38:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v72LcFiN048041; Wed, 2 Aug 2017 21:38:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v72LcF97048040; Wed, 2 Aug 2017 21:38:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201708022138.v72LcF97048040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 2 Aug 2017 21:38:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321952 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 321952 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 21:38:16 -0000 Author: ngie Date: Wed Aug 2 21:38:15 2017 New Revision: 321952 URL: https://svnweb.freebsd.org/changeset/base/321952 Log: Allowing MK_NLS_CATALOGS to be enabled if MK_NLS == no doesn't make a whole lot of sense. Anchor MK_NLS_CATALOGS being enabled off of MK_NLS. MFC after: 1 month Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Wed Aug 2 21:31:46 2017 (r321951) +++ head/share/mk/src.opts.mk Wed Aug 2 21:38:15 2017 (r321952) @@ -376,6 +376,10 @@ MK_ATM:= no MK_BLUETOOTH:= no .endif +.if ${MK_NLS} == "no" +MK_NLS_CATALOGS:= no +.endif + .if ${MK_OPENSSL} == "no" MK_OPENSSH:= no MK_KERBEROS:= no From owner-svn-src-all@freebsd.org Wed Aug 2 21:40:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8021DB599D; Wed, 2 Aug 2017 21:40:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 952457D3C1; Wed, 2 Aug 2017 21:40:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v72LepMc048747; Wed, 2 Aug 2017 21:40:51 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v72LepSt048727; Wed, 2 Aug 2017 21:40:51 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201708022140.v72LepSt048727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 2 Aug 2017 21:40:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321953 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 321953 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 21:40:52 -0000 Author: ngie Date: Wed Aug 2 21:40:51 2017 New Revision: 321953 URL: https://svnweb.freebsd.org/changeset/base/321953 Log: Regenerate src.conf(5) per change made in r321952 Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Wed Aug 2 21:38:15 2017 (r321952) +++ head/share/man/man5/src.conf.5 Wed Aug 2 21:40:51 2017 (r321953) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd July 5, 2017 +.Dd August 2, 2017 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1156,6 +1156,12 @@ and remove entries. .It Va WITHOUT_NLS Set to not build NLS catalogs. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITHOUT_NLS_CATALOGS +.El .It Va WITHOUT_NLS_CATALOGS Set to not build NLS catalog support for .Xr csh 1 . From owner-svn-src-all@freebsd.org Wed Aug 2 21:49:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CCBADB5FCD; Wed, 2 Aug 2017 21:49:38 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3AEC77D923; Wed, 2 Aug 2017 21:49:38 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v72Lnb7F052233; Wed, 2 Aug 2017 21:49:37 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v72LnbGD052232; Wed, 2 Aug 2017 21:49:37 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201708022149.v72LnbGD052232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 2 Aug 2017 21:49:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321954 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 321954 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 21:49:38 -0000 Author: ngie Date: Wed Aug 2 21:49:37 2017 New Revision: 321954 URL: https://svnweb.freebsd.org/changeset/base/321954 Log: Delete comment above "__DEFAULT_DEPENDENT_OPTIONS" related to "meta mode options" src.conf(5) should document which knobs are which and the dependency between each; remove the comment so the variable can apply to non-"meta mode options". MFC after: 2 weeks Modified: head/share/mk/bsd.opts.mk Modified: head/share/mk/bsd.opts.mk ============================================================================== --- head/share/mk/bsd.opts.mk Wed Aug 2 21:40:51 2017 (r321953) +++ head/share/mk/bsd.opts.mk Wed Aug 2 21:49:37 2017 (r321954) @@ -72,7 +72,6 @@ __DEFAULT_NO_OPTIONS = \ INSTALL_AS_USER \ STALE_STAGED -# meta mode related __DEFAULT_DEPENDENT_OPTIONS = \ STAGING_MAN/STAGING \ STAGING_PROG/STAGING \ From owner-svn-src-all@freebsd.org Wed Aug 2 22:19:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABCECDB675F; Wed, 2 Aug 2017 22:19:46 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7972C7E861; Wed, 2 Aug 2017 22:19:46 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v72MJjYj064708; Wed, 2 Aug 2017 22:19:45 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v72MJjHe064707; Wed, 2 Aug 2017 22:19:45 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201708022219.v72MJjHe064707@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 2 Aug 2017 22:19:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321959 - head/tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/tests/sys/kern X-SVN-Commit-Revision: 321959 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.23 Precedence: list List-Id: "SVN commit messages 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, 02 Aug 2017 22:19:46 -0000 Author: ngie Date: Wed Aug 2 22:19:45 2017 New Revision: 321959 URL: https://svnweb.freebsd.org/changeset/base/321959 Log: Annotate tests that require root privileges appropriately This unbreaks running the tests with unprivileged users. MFC after: 1 week Modified: head/tests/sys/kern/ptrace_test.c Modified: head/tests/sys/kern/ptrace_test.c ============================================================================== --- head/tests/sys/kern/ptrace_test.c Wed Aug 2 22:08:49 2017 (r321958) +++ head/tests/sys/kern/ptrace_test.c Wed Aug 2 22:19:45 2017 (r321959) @@ -1868,7 +1868,12 @@ mask_usr1_thread(void *arg) * Verify that the SIGKILL from PT_KILL takes priority over other signals * and prevents spurious stops due to those other signals. */ -ATF_TC_WITHOUT_HEAD(ptrace__PT_KILL_competing_signal); +ATF_TC(ptrace__PT_KILL_competing_signal); +ATF_TC_HEAD(ptrace__PT_KILL_competing_signal, tc) +{ + + atf_tc_set_md_var(tc, "require.user", "root"); +} ATF_TC_BODY(ptrace__PT_KILL_competing_signal, tc) { pid_t fpid, wpid; @@ -1962,7 +1967,12 @@ ATF_TC_BODY(ptrace__PT_KILL_competing_signal, tc) * Verify that the SIGKILL from PT_KILL takes priority over other stop events * and prevents spurious stops caused by those events. */ -ATF_TC_WITHOUT_HEAD(ptrace__PT_KILL_competing_stop); +ATF_TC(ptrace__PT_KILL_competing_stop); +ATF_TC_HEAD(ptrace__PT_KILL_competing_stop, tc) +{ + + atf_tc_set_md_var(tc, "require.user", "root"); +} ATF_TC_BODY(ptrace__PT_KILL_competing_stop, tc) { pid_t fpid, wpid; @@ -2940,13 +2950,24 @@ terminate_with_pending_sigstop(bool sigstop_from_main_ * to the older thread (the second test). This behavior has changed in the * past, so make no assumption. */ -ATF_TC_WITHOUT_HEAD(ptrace__parent_terminate_with_pending_sigstop1); +ATF_TC(ptrace__parent_terminate_with_pending_sigstop1); +ATF_TC_HEAD(ptrace__parent_terminate_with_pending_sigstop1, tc) +{ + + atf_tc_set_md_var(tc, "require.user", "root"); +} ATF_TC_BODY(ptrace__parent_terminate_with_pending_sigstop1, tc) { terminate_with_pending_sigstop(true); } -ATF_TC_WITHOUT_HEAD(ptrace__parent_terminate_with_pending_sigstop2); + +ATF_TC(ptrace__parent_terminate_with_pending_sigstop2); +ATF_TC_HEAD(ptrace__parent_terminate_with_pending_sigstop2, tc) +{ + + atf_tc_set_md_var(tc, "require.user", "root"); +} ATF_TC_BODY(ptrace__parent_terminate_with_pending_sigstop2, tc) { From owner-svn-src-all@freebsd.org Thu Aug 3 00:38:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7DFFDBCAA1; Thu, 3 Aug 2017 00:38:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92FAA81D5A; Thu, 3 Aug 2017 00:38:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v730cDQO021865; Thu, 3 Aug 2017 00:38:13 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v730cD76021861; Thu, 3 Aug 2017 00:38:13 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201708030038.v730cD76021861@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 3 Aug 2017 00:38:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321963 - in head: . cddl/contrib/opensolaris/cmd/lockstat share/man/man4 sys/dev/ksyms sys/sys X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: . cddl/contrib/opensolaris/cmd/lockstat share/man/man4 sys/dev/ksyms sys/sys X-SVN-Commit-Revision: 321963 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 00:38:14 -0000 Author: markj Date: Thu Aug 3 00:38:13 2017 New Revision: 321963 URL: https://svnweb.freebsd.org/changeset/base/321963 Log: Rework and simplify the ksyms(4) implementation. - Store the symbol table contents in an anonymous swap-backed object. Have mmap(/dev/ksyms) map that object, and stop mapping the symbol table into the calling process in ksyms_open(). Previously we would cache a pointer to the pmap of the opening process, and mmap(/dev/ksyms) would create a mapping using the physical address found by a pmap lookup at the initial mapping address. However, this assumes that the cached pmap is valid, which may not be the case. [1] - Remove the ksyms ioctl interface. It appears to have been added to work around a limitation in libelf that no longer exists; see r321842. Moreover, the interface is difficult to support and isn't present in illumos. Since ksyms was added specifically to support lockstat(1), it is expected that this removal won't have any real impact. - Simplify ksyms_read() to avoid unnecessary copying. - Don't call the device handle destructor if we fail to capture a snapshot of the kernel's symbol table. devfs will do that for us. Reported by: Ilja van Sprundel [1] Reviewed by: kib (previous revision) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D11789 Deleted: head/sys/sys/ksyms.h Modified: head/ObsoleteFiles.inc head/cddl/contrib/opensolaris/cmd/lockstat/sym.c head/share/man/man4/ksyms.4 head/sys/dev/ksyms/ksyms.c Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Aug 3 00:35:35 2017 (r321962) +++ head/ObsoleteFiles.inc Thu Aug 3 00:38:13 2017 (r321963) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20170802: ksyms(4) ioctl interface was removed +OLD_FILES+=usr/include/sys/ksyms.h + # 20170722: new clang import which bumps version from 4.0.0 to 5.0.0. OLD_FILES+=usr/lib/clang/4.0.0/include/sanitizer/allocator_interface.h OLD_FILES+=usr/lib/clang/4.0.0/include/sanitizer/asan_interface.h Modified: head/cddl/contrib/opensolaris/cmd/lockstat/sym.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/lockstat/sym.c Thu Aug 3 00:35:35 2017 (r321962) +++ head/cddl/contrib/opensolaris/cmd/lockstat/sym.c Thu Aug 3 00:38:13 2017 (r321963) @@ -48,7 +48,6 @@ #include #else #include -#include #include #include #include Modified: head/share/man/man4/ksyms.4 ============================================================================== --- head/share/man/man4/ksyms.4 Thu Aug 3 00:35:35 2017 (r321962) +++ head/share/man/man4/ksyms.4 Thu Aug 3 00:38:13 2017 (r321963) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 5, 2009 +.Dd August 2, 2017 .Dt KSYMS 4 .Os .Sh NAME @@ -69,24 +69,6 @@ driver does not block the loading or unloading of modu while the .Pa /dev/ksyms file is open but may contain stale data. -.Sh IOCTLS -The -.Xr ioctl 2 -command codes below are defined in -.Aq Pa sys/ksyms.h . -.Pp -The (third) argument to the -.Xr ioctl 2 -should be a pointer to the type indicated. -.Bl -tag -width indent -offset indent -.It Dv KIOCGSIZE (size_t) -Returns the total size of the current symbol table. -This can be used when allocating a buffer to make a copy of -the kernel symbol table. -.It Dv KIOCGADDR (void *) -Returns the address of the kernel symbol table mapped in -the process memory. -.El .Sh FILES .Bl -tag -width /dev/ksymsX .It Pa /dev/ksyms @@ -112,7 +94,6 @@ This may occur if the kernel was in the process of loa unloading a module. .El .Sh SEE ALSO -.Xr ioctl 2 , .Xr nlist 3 , .Xr elf 5 , .Xr kldload 8 @@ -152,12 +133,3 @@ file once at a time. The process must close the .Pa /dev/ksyms before it is allowed to open it again. -.Pp -The -.Nm -driver uses the calling process' memory address space to store the snapshot. -.Xr ioctl 2 -can be used to get the memory address where the symbol table is stored to -save kernel memory. -.Xr mmap 2 -may also be used but it will map it to another address. Modified: head/sys/dev/ksyms/ksyms.c ============================================================================== --- head/sys/dev/ksyms/ksyms.c Thu Aug 3 00:35:35 2017 (r321962) +++ head/sys/dev/ksyms/ksyms.c Thu Aug 3 00:38:13 2017 (r321963) @@ -32,16 +32,15 @@ #include #include -#include #include #include #include #include -#include #include #include #include #include +#include #include #include @@ -49,7 +48,7 @@ #include #include #include -#include +#include #include "linker_if.h" @@ -68,18 +67,14 @@ static d_open_t ksyms_open; static d_read_t ksyms_read; -static d_close_t ksyms_close; -static d_ioctl_t ksyms_ioctl; -static d_mmap_t ksyms_mmap; +static d_mmap_single_t ksyms_mmap_single; static struct cdevsw ksyms_cdevsw = { .d_version = D_VERSION, .d_flags = D_TRACKCLOSE, .d_open = ksyms_open, - .d_close = ksyms_close, .d_read = ksyms_read, - .d_ioctl = ksyms_ioctl, - .d_mmap = ksyms_mmap, + .d_mmap_single = ksyms_mmap_single, .d_name = KSYMS_DNAME }; @@ -87,11 +82,12 @@ struct ksyms_softc { LIST_ENTRY(ksyms_softc) sc_list; vm_offset_t sc_uaddr; size_t sc_usize; - pmap_t sc_pmap; + vm_object_t sc_obj; + vm_size_t sc_objsz; struct proc *sc_proc; }; -static struct mtx ksyms_mtx; +static struct sx ksyms_mtx; static struct cdev *ksyms_dev; static LIST_HEAD(, ksyms_softc) ksyms_list = LIST_HEAD_INITIALIZER(ksyms_list); @@ -112,6 +108,7 @@ struct tsizes { }; struct toffsets { + struct ksyms_softc *to_sc; vm_offset_t to_symoff; vm_offset_t to_stroff; unsigned to_stridx; @@ -155,11 +152,25 @@ ksyms_size_calc(struct tsizes *ts) (void)linker_file_foreach(ksyms_size_permod, ts); } -#define KSYMS_EMIT(src, des, sz) do { \ - copyout(src, (void *)des, sz); \ - des += sz; \ -} while (0) +static int +ksyms_emit(struct ksyms_softc *sc, void *buf, off_t off, size_t sz) +{ + struct iovec iov; + struct uio uio; + iov.iov_base = buf; + iov.iov_len = sz; + uio.uio_iov = &iov; + uio.uio_iovcnt = 1; + uio.uio_offset = off; + uio.uio_resid = (ssize_t)sz; + uio.uio_segflg = UIO_SYSSPACE; + uio.uio_rw = UIO_WRITE; + uio.uio_td = curthread; + + return (uiomove_object(sc->sc_obj, sc->sc_objsz, &uio)); +} + #define SYMBLKSZ (256 * sizeof(Elf_Sym)) /* @@ -170,24 +181,24 @@ static int ksyms_add(linker_file_t lf, void *arg) { char *buf; + struct ksyms_softc *sc; struct toffsets *to; const Elf_Sym *symtab; Elf_Sym *symp; caddr_t strtab; - long symsz; - size_t strsz, numsyms; + size_t len, numsyms, strsz, symsz; linker_symval_t symval; - int i, nsyms, len; + int error, i, nsyms; + buf = malloc(SYMBLKSZ, M_KSYMS, M_WAITOK); to = arg; + sc = to->to_sc; MOD_SLOCK; numsyms = LINKER_SYMTAB_GET(lf, &symtab); strsz = LINKER_STRTAB_GET(lf, &strtab); symsz = numsyms * sizeof(Elf_Sym); - buf = malloc(SYMBLKSZ, M_KSYMS, M_WAITOK); - while (symsz > 0) { len = min(SYMBLKSZ, symsz); bcopy(symtab, buf, len); @@ -213,7 +224,13 @@ ksyms_add(linker_file_t lf, void *arg) return (ENXIO); } to->to_resid -= len; - KSYMS_EMIT(buf, to->to_symoff, len); + error = ksyms_emit(sc, buf, to->to_symoff, len); + to->to_symoff += len; + if (error != 0) { + MOD_SUNLOCK; + free(buf, M_KSYMS); + return (error); + } symtab += nsyms; symsz -= len; @@ -224,10 +241,11 @@ ksyms_add(linker_file_t lf, void *arg) if (strsz > to->to_resid) return (ENXIO); to->to_resid -= strsz; - KSYMS_EMIT(strtab, to->to_stroff, strsz); + error = ksyms_emit(sc, strtab, to->to_stroff, strsz); + to->to_stroff += strsz; to->to_stridx += strsz; - return (0); + return (error); } /* @@ -236,11 +254,11 @@ ksyms_add(linker_file_t lf, void *arg) * 0 on success, otherwise error. */ static int -ksyms_snapshot(struct tsizes *ts, vm_offset_t uaddr, size_t resid) +ksyms_snapshot(struct ksyms_softc *sc, struct tsizes *ts) { - struct ksyms_hdr *hdr; struct toffsets to; - int error = 0; + struct ksyms_hdr *hdr; + int error; hdr = malloc(sizeof(*hdr), M_KSYMS, M_WAITOK | M_ZERO); @@ -334,39 +352,41 @@ ksyms_snapshot(struct tsizes *ts, vm_offset_t uaddr, s /* Copy shstrtab into the header. */ bcopy(ksyms_shstrtab, hdr->kh_shstrtab, sizeof(ksyms_shstrtab)); - to.to_symoff = uaddr + hdr->kh_shdr[SHDR_SYMTAB].sh_offset; - to.to_stroff = uaddr + hdr->kh_shdr[SHDR_STRTAB].sh_offset; + to.to_sc = sc; + to.to_symoff = hdr->kh_shdr[SHDR_SYMTAB].sh_offset; + to.to_stroff = hdr->kh_shdr[SHDR_STRTAB].sh_offset; to.to_stridx = 0; - if (sizeof(struct ksyms_hdr) > resid) { - free(hdr, M_KSYMS); - return (ENXIO); - } - to.to_resid = resid - sizeof(struct ksyms_hdr); + to.to_resid = sc->sc_objsz - sizeof(struct ksyms_hdr); /* emit header */ - copyout(hdr, (void *)uaddr, sizeof(struct ksyms_hdr)); - + error = ksyms_emit(sc, hdr, 0, sizeof(*hdr)); free(hdr, M_KSYMS); + if (error != 0) + return (error); /* Add symbol and string tables for each kernel module. */ error = linker_file_foreach(ksyms_add, &to); - + if (error != 0) + return (error); if (to.to_resid != 0) return (ENXIO); - - return (error); + return (0); } static void ksyms_cdevpriv_dtr(void *data) { struct ksyms_softc *sc; + vm_object_t obj; sc = (struct ksyms_softc *)data; - mtx_lock(&ksyms_mtx); + sx_xlock(&ksyms_mtx); LIST_REMOVE(sc, sc_list); - mtx_unlock(&ksyms_mtx); + sx_xunlock(&ksyms_mtx); + obj = sc->sc_obj; + if (obj != NULL) + vm_object_deallocate(obj); free(sc, M_KSYMS); } @@ -375,34 +395,31 @@ ksyms_open(struct cdev *dev, int flags, int fmt __unus { struct tsizes ts; struct ksyms_softc *sc; - size_t total_elf_sz; + vm_size_t elfsz; int error, try; /* * Limit one open() per process. The process must close() * before open()'ing again. */ - mtx_lock(&ksyms_mtx); + sx_xlock(&ksyms_mtx); LIST_FOREACH(sc, &ksyms_list, sc_list) { if (sc->sc_proc == td->td_proc) { - mtx_unlock(&ksyms_mtx); + sx_xunlock(&ksyms_mtx); return (EBUSY); } } - sc = malloc(sizeof(*sc), M_KSYMS, M_NOWAIT | M_ZERO); - if (sc == NULL) { - mtx_unlock(&ksyms_mtx); - return (ENOMEM); - } + sc = malloc(sizeof(*sc), M_KSYMS, M_WAITOK | M_ZERO); sc->sc_proc = td->td_proc; - sc->sc_pmap = &td->td_proc->p_vmspace->vm_pmap; LIST_INSERT_HEAD(&ksyms_list, sc, sc_list); - mtx_unlock(&ksyms_mtx); + sx_xunlock(&ksyms_mtx); error = devfs_set_cdevpriv(sc, ksyms_cdevpriv_dtr); - if (error != 0) - goto failed; + if (error != 0) { + ksyms_cdevpriv_dtr(sc); + return (error); + } /* * MOD_SLOCK doesn't work here (because of a lock reversal with @@ -412,32 +429,20 @@ ksyms_open(struct cdev *dev, int flags, int fmt __unus * time. */ for (try = 0; try < 3; try++) { - /* - * Map a buffer in the calling process memory space and - * create a snapshot of the kernel symbol table in it. - */ - - /* Compute the size of buffer needed. */ ksyms_size_calc(&ts); - total_elf_sz = sizeof(struct ksyms_hdr) + ts.ts_symsz + - ts.ts_strsz; + elfsz = sizeof(struct ksyms_hdr) + ts.ts_symsz + ts.ts_strsz; - error = copyout_map(td, &sc->sc_uaddr, (vm_size_t)total_elf_sz); - if (error != 0) - break; - sc->sc_usize = total_elf_sz; + sc->sc_obj = vm_object_allocate(OBJT_DEFAULT, + OFF_TO_IDX(round_page(elfsz))); + sc->sc_objsz = elfsz; - error = ksyms_snapshot(&ts, sc->sc_uaddr, total_elf_sz); + error = ksyms_snapshot(sc, &ts); if (error == 0) - /* successful snapshot */ - return (0); + break; - /* Snapshot failed, unmap the memory and try again. */ - (void)copyout_unmap(td, sc->sc_uaddr, sc->sc_usize); + vm_object_deallocate(sc->sc_obj); + sc->sc_obj = NULL; } - -failed: - ksyms_cdevpriv_dtr(sc); return (error); } @@ -445,125 +450,38 @@ static int ksyms_read(struct cdev *dev, struct uio *uio, int flags __unused) { struct ksyms_softc *sc; - char *buf; - off_t off; - size_t len, sz; - vm_size_t ubase; int error; error = devfs_get_cdevpriv((void **)&sc); if (error != 0) return (error); - - off = uio->uio_offset; - len = uio->uio_resid; - - if (off < 0 || off > sc->sc_usize) - return (EFAULT); - - if (len > sc->sc_usize - off) - len = sc->sc_usize - off; - if (len == 0) - return (0); - - /* - * Since the snapshot buffer is in the user space we have to copy it - * in to the kernel and then back out. The extra copy saves valuable - * kernel memory. - */ - buf = malloc(PAGE_SIZE, M_KSYMS, M_WAITOK); - ubase = sc->sc_uaddr + off; - - while (len) { - sz = min(PAGE_SIZE, len); - if (copyin((void *)ubase, buf, sz) != 0) - error = EFAULT; - else - error = uiomove(buf, sz, uio); - if (error != 0) - break; - - len -= sz; - ubase += sz; - } - free(buf, M_KSYMS); - - return (error); + return (uiomove_object(sc->sc_obj, sc->sc_objsz, uio)); } static int -ksyms_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int32_t flag __unused, - struct thread *td __unused) +ksyms_mmap_single(struct cdev *dev, vm_ooffset_t *offset, vm_size_t size, + vm_object_t *objp, int nprot) { struct ksyms_softc *sc; + vm_object_t obj; int error; error = devfs_get_cdevpriv((void **)&sc); if (error != 0) return (error); - switch (cmd) { - case KIOCGSIZE: - /* - * Return the size (in bytes) of the symbol table - * snapshot. - */ - *(size_t *)data = sc->sc_usize; - break; - case KIOCGADDR: - /* - * Return the address of the symbol table snapshot. - * XXX - compat32 version of this? - */ - *(void **)data = (void *)sc->sc_uaddr; - break; - default: - error = ENOTTY; - break; - } + if (*offset < 0 || *offset >= round_page(sc->sc_objsz) || + size > round_page(sc->sc_objsz) - *offset || + (nprot & ~PROT_READ) != 0) + return (EINVAL); - return (error); -} - -static int -ksyms_mmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, - int prot __unused, vm_memattr_t *memattr __unused) -{ - struct ksyms_softc *sc; - int error; - - error = devfs_get_cdevpriv((void **)&sc); - if (error != 0) - return (error); - - /* - * XXX mmap() will actually map the symbol table into the process - * address space again. - */ - if (offset > round_page(sc->sc_usize) || - (*paddr = pmap_extract(sc->sc_pmap, - (vm_offset_t)sc->sc_uaddr + offset)) == 0) - return (-1); - + obj = sc->sc_obj; + vm_object_reference(obj); + *objp = obj; return (0); } static int -ksyms_close(struct cdev *dev, int flags __unused, int fmt __unused, - struct thread *td) -{ - struct ksyms_softc *sc; - int error; - - error = devfs_get_cdevpriv((void **)&sc); - if (error != 0) - return (error); - - /* Unmap the buffer from the process address space. */ - return (copyout_unmap(td, sc->sc_uaddr, sc->sc_usize)); -} - -static int ksyms_modevent(module_t mod __unused, int type, void *data __unused) { int error; @@ -571,7 +489,7 @@ ksyms_modevent(module_t mod __unused, int type, void * error = 0; switch (type) { case MOD_LOAD: - mtx_init(&ksyms_mtx, "KSyms mtx", NULL, MTX_DEF); + sx_init(&ksyms_mtx, "KSyms mtx"); ksyms_dev = make_dev(&ksyms_cdevsw, 0, UID_ROOT, GID_WHEEL, 0400, KSYMS_DNAME); break; @@ -579,7 +497,7 @@ ksyms_modevent(module_t mod __unused, int type, void * if (!LIST_EMPTY(&ksyms_list)) return (EBUSY); destroy_dev(ksyms_dev); - mtx_destroy(&ksyms_mtx); + sx_destroy(&ksyms_mtx); break; case MOD_SHUTDOWN: break; From owner-svn-src-all@freebsd.org Thu Aug 3 01:40:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18FABDBED5D; Thu, 3 Aug 2017 01:40:07 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB5A9E6; Thu, 3 Aug 2017 01:40:06 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v731e5tn047362; Thu, 3 Aug 2017 01:40:05 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v731e5fU047355; Thu, 3 Aug 2017 01:40:05 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201708030140.v731e5fU047355@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Thu, 3 Aug 2017 01:40:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321964 - in stable/10: contrib/bmake contrib/bmake/PSD.doc contrib/bmake/mk contrib/bmake/mk/sys contrib/bmake/unit-tests usr.bin/bmake X-SVN-Group: stable-10 X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: in stable/10: contrib/bmake contrib/bmake/PSD.doc contrib/bmake/mk contrib/bmake/mk/sys contrib/bmake/unit-tests usr.bin/bmake X-SVN-Commit-Revision: 321964 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 01:40:07 -0000 Author: sjg Date: Thu Aug 3 01:40:05 2017 New Revision: 321964 URL: https://svnweb.freebsd.org/changeset/base/321964 Log: MFC bmake-20170720 PR: 221023 Added: stable/10/contrib/bmake/mk/files.mk - copied unchanged from r318163, head/contrib/bmake/mk/files.mk stable/10/contrib/bmake/mk/sys.debug.mk - copied unchanged from r310304, head/contrib/bmake/mk/sys.debug.mk stable/10/contrib/bmake/mk/sys.vars.mk - copied, changed from r310304, head/contrib/bmake/mk/sys.vars.mk Modified: stable/10/contrib/bmake/ChangeLog stable/10/contrib/bmake/Makefile stable/10/contrib/bmake/PSD.doc/tutorial.ms stable/10/contrib/bmake/README stable/10/contrib/bmake/arch.c stable/10/contrib/bmake/bmake.1 stable/10/contrib/bmake/bmake.cat1 stable/10/contrib/bmake/boot-strap stable/10/contrib/bmake/buf.h stable/10/contrib/bmake/compat.c stable/10/contrib/bmake/cond.c stable/10/contrib/bmake/config.h.in stable/10/contrib/bmake/configure stable/10/contrib/bmake/configure.in stable/10/contrib/bmake/dir.c stable/10/contrib/bmake/dir.h stable/10/contrib/bmake/dirname.c stable/10/contrib/bmake/for.c stable/10/contrib/bmake/getopt.c stable/10/contrib/bmake/hash.h stable/10/contrib/bmake/job.c stable/10/contrib/bmake/main.c stable/10/contrib/bmake/make-bootstrap.sh.in stable/10/contrib/bmake/make.1 stable/10/contrib/bmake/make.c stable/10/contrib/bmake/make.h stable/10/contrib/bmake/make_malloc.c stable/10/contrib/bmake/meta.c stable/10/contrib/bmake/meta.h stable/10/contrib/bmake/mk/ChangeLog stable/10/contrib/bmake/mk/FILES stable/10/contrib/bmake/mk/auto.dep.mk stable/10/contrib/bmake/mk/auto.obj.mk stable/10/contrib/bmake/mk/autodep.mk stable/10/contrib/bmake/mk/dirdeps.mk stable/10/contrib/bmake/mk/doc.mk stable/10/contrib/bmake/mk/dpadd.mk stable/10/contrib/bmake/mk/final.mk stable/10/contrib/bmake/mk/gendirdeps.mk stable/10/contrib/bmake/mk/inc.mk stable/10/contrib/bmake/mk/init.mk stable/10/contrib/bmake/mk/install-mk stable/10/contrib/bmake/mk/lib.mk stable/10/contrib/bmake/mk/libnames.mk stable/10/contrib/bmake/mk/meta.autodep.mk stable/10/contrib/bmake/mk/meta.stage.mk stable/10/contrib/bmake/mk/meta.sys.mk stable/10/contrib/bmake/mk/meta2deps.py stable/10/contrib/bmake/mk/meta2deps.sh stable/10/contrib/bmake/mk/mkopt.sh stable/10/contrib/bmake/mk/nls.mk stable/10/contrib/bmake/mk/own.mk stable/10/contrib/bmake/mk/prog.mk stable/10/contrib/bmake/mk/scripts.mk stable/10/contrib/bmake/mk/subdir.mk stable/10/contrib/bmake/mk/sys.clean-env.mk stable/10/contrib/bmake/mk/sys.dependfile.mk stable/10/contrib/bmake/mk/sys.mk stable/10/contrib/bmake/mk/sys/AIX.mk stable/10/contrib/bmake/mk/sys/Darwin.mk stable/10/contrib/bmake/mk/sys/Generic.mk stable/10/contrib/bmake/mk/sys/HP-UX.mk stable/10/contrib/bmake/mk/sys/IRIX.mk stable/10/contrib/bmake/mk/sys/Linux.mk stable/10/contrib/bmake/mk/sys/NetBSD.mk stable/10/contrib/bmake/mk/sys/OSF1.mk stable/10/contrib/bmake/mk/sys/OpenBSD.mk stable/10/contrib/bmake/mk/sys/SunOS.mk stable/10/contrib/bmake/mk/sys/UnixWare.mk stable/10/contrib/bmake/mk/warnings.mk stable/10/contrib/bmake/nonints.h stable/10/contrib/bmake/os.sh stable/10/contrib/bmake/parse.c stable/10/contrib/bmake/sprite.h stable/10/contrib/bmake/str.c stable/10/contrib/bmake/suff.c stable/10/contrib/bmake/targ.c stable/10/contrib/bmake/unit-tests/export-env.exp stable/10/contrib/bmake/unit-tests/export-env.mk stable/10/contrib/bmake/unit-tests/modmatch.exp stable/10/contrib/bmake/unit-tests/modmatch.mk stable/10/contrib/bmake/unit-tests/modts.exp stable/10/contrib/bmake/unit-tests/modts.mk stable/10/contrib/bmake/unit-tests/varmisc.exp stable/10/contrib/bmake/unit-tests/varmisc.mk stable/10/contrib/bmake/var.c stable/10/usr.bin/bmake/Makefile stable/10/usr.bin/bmake/Makefile.inc stable/10/usr.bin/bmake/config.h Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bmake/ChangeLog ============================================================================== --- stable/10/contrib/bmake/ChangeLog Thu Aug 3 00:38:13 2017 (r321963) +++ stable/10/contrib/bmake/ChangeLog Thu Aug 3 01:40:05 2017 (r321964) @@ -1,3 +1,296 @@ +2017-07-20 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170720 + Merge with NetBSD make, pick up + o compat.c: pass SIGINT etc onto child and wait for it to exit + before we self-terminate. + +2017-07-11 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170711 + forgot to update after merge on 20170708 ;-) + o main.c: refactor to reduce size of main function. + add -v option to always fully expand values. + o meta.c: ensure command output in meta file has ending newline + even when filemon not being used. + When matching ${.MAKE.META.IGNORE_PATTERNS} do not use + pathname via ':L' since any ':' in pathname breaks that. + Instead set a '${.p.}' to pathname in the target context and + use that. + +2017-05-10 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170510 + Merge with NetBSD make, pick up + o main.c: Main_SetObjdir: ensure buf2 is in scope + +2017-05-08 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170505 + see mk/ChangeLog + +2017-05-05 Simon J. Gerraty + + * parse.c: not everyone has stdint.h + +2017-05-01 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170501 + see mk/ChangeLog + +2017-04-21 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170421 + Merge with NetBSD make, pick up + o str.c: Str_Match: fix closure tests for [^] and add unit-test. + +2017-04-20 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170420 + Merge with NetBSD make, pick up + o main.c: only use -C arg "as is" if it contains no + relative component. + +2017-04-18 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170418 + Merge with NetBSD make, pick up + o main.c: fix Main_SetObjdir() for relative paths (eg obj). + +2017-04-17 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170417 + Merge with NetBSD make, pick up + o fixes a number of coverity complaints + - check return value of fseek, fcntl + - plug memory leak in Dir_FindFile, Var_LoopExpand, + JobPrintCommand, ParseTraditionalInclude + - use bmake_malloc() where NULL is not tollerated + - use MAKE_ATTR_UNUSED rather that kludges like + return(unused ? 0 : 0) + - use purge_cached_realpaths() rather than abuse cached_realpath() + +2017-04-13 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170413 + Merge with NetBSD make, pick up + o main.c: when setting .OBJDIR ignore '$' in paths. + + * job.c: use MALLOC_OPTIONS to set malloc_options. + +2017-04-11 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170411 + Merge with NetBSD make, pick up + o str.c: Str_Match: allow [^a-z] to behave as expected. + +2017-03-26 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170326 + Merge with NetBSD make, pick up + o main.c: purge relative paths from realpath cache when .OBJDIR + is changed. + +2017-03-11 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170311 + Merge with NetBSD make, pick up + o main.c: only use -C arg "as is" if it starts with '/'. + +2017-03-01 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170301 + Merge with NetBSD make, pick up + o main.c: use -C arg "as is" rather than getcwd() + if they identify the same directory. + o parse.c: ensure loadfile buffer is \n terminated in non-mmap case + +2017-02-01 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170201 + Merge with NetBSD make, pick up + o var.c: allow :_=var and avoid use of special context. + +2017-01-30 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170130 + Merge with NetBSD make, pick up + o var.c: add :range and :_ + o main.c: partially initialize Dir_* before MainParseArgs() + can be called. + If -V, skip Main_ExportMAKEFLAGS() + +2017-01-14 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170114 + Merge with NetBSD make, pick up + o var.c: allow specifying the utc value used by :{gm,local}time + +2016-12-12 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20161212 + Merge with NetBSD make, pick up + o main.c: look for obj.${MACHINE}-${MACHINE_ARCH} too. + +2016-12-09 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20161209 + Merge with NetBSD make, pick up + o main.c: cleanup setting of .OBJDIR + o parse.c: avoid coredump from (var)=val + +2016-11-26 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20161126 + Merge with NetBSD make, pick up + o make.c: Make_OODate: report src node name if path not set + +2016-09-26 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160926 + Merge with NetBSD make, pick up + o support for .DELETE_ON_ERROR: (remove targets that fail) + +2016-09-26 Simon J. Gerraty + + * Makefile MAN: tweak .Dt to match ${PROG} + +2016-08-18 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160818 + its a neater number; pick up whitespace fixes to man page. + +2016-08-17 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160817 + Merge with NetBSD make, pick up + o meta.c: move handling of .MAKE.META.IGNORE_* to meta_ignore() + so we can call it before adding entries to missingFiles. + Thus we do not track files we have been told to ignore. + +2016-08-15 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160815 + Merge with NetBSD make, pick up + o meta_oodate: apply .MAKE.META.IGNORE_FILTER (if defined) to + pathnames, and skip if the expansion is empty. + Useful for dirdeps.mk when checking DIRDEPS_CACHE. + +2016-08-12 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160812 + Merge with NetBSD make, pick up + o meta.c: remove all missingFiles entries that match a deleted + dir. + o main.c: set .ERROR_CMD if possible. + +2016-06-06 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160606 + Merge with NetBSD make, pick up + o dir.c: extend mtimes cache to others via cached_stat() + +2016-06-04 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160604 + Merge with NetBSD make, pick up + o meta.c: missing filemon data is only relevant if we read a + meta file. + Also do not return oodate for a missing metafile if gn->path + points to .CURDIR + +2016-06-02 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160602 + Merge with NetBSD make, pick up + o cached_realpath(): avoid hitting filesystem more than necessary. + o meta.c: refactor need_meta decision, add knobs for + missing meta file and filemon data wrt out-of-datedness. + +2016-05-28 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160528 + + * boot-strap, make-bootstrap.sh.in: Makefile now uses _MAKE_VERSION + +2016-05-12 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160512 + Merge with NetBSD make, pick up + o meta.c: ignore paths that match .MAKE.META.IGNORE_PATTERNS + this is useful for gcov builds. + o propagate errors from filemon(4). + +2016-05-09 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160509 + Merge with NetBSD make, pick up + o remove use of non-standard types u_int etc. + o meta.c: apply realpath() before matching against metaIgnorePaths + +2016-04-04 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160404 + Merge with NetBSD make, pick up + o allow makefile to set .MAKE.JOBS + + * Makefile (PROG_NAME): use ${_MAKE_VERSION} + +2016-03-15 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160315 + Merge with NetBSD make, pick up + o fix handling of archive members + +2016-03-13 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): rename variable to avoid interference + with checks for ${MAKE_VERSION} + +2016-03-10 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20160310 + Merge with NetBSD make, pick up + o meta.c: treat missing Read file same as Write, incase we Delete it. + +2016-03-07 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20160307 + Merge with NetBSD make, pick up + o var.c: fix :ts\nnn to be octal by default. + o meta.c: meta_finish() to cleanup memory. + +2016-02-26 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20160226 + Merge with NetBSD make, pick up + o meta.c: allow meta file for makeDepend if makefiles want it. + +2016-02-19 Simon J. Gerraty + + * var.c: default .MAKE.SAVE_DOLLARS to FALSE + for backwards compatability. + + * Makefile (MAKE_VERSION): 20160220 + Merge with NetBSD make, pick up + o var.c: add knob to control handling of '$$' in := + +2016-02-18 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20160218 + Merge with NetBSD make, pick up + o var.c: add .export-literal allows us to fix sys.clean-env.mk + post the changes to Var_Subst. + Var_Subst now takes flags, and does not consume '$$' in := + +2016-02-17 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20160217 + Merge with NetBSD make, pick up + o var.c: preserve '$$' in := + o parse.c: add .dinclude for handling included + makefile like .depend + 2015-12-20 Simon J. Gerraty * Makefile (MAKE_VERSION): 20151220 Modified: stable/10/contrib/bmake/Makefile ============================================================================== --- stable/10/contrib/bmake/Makefile Thu Aug 3 00:38:13 2017 (r321963) +++ stable/10/contrib/bmake/Makefile Thu Aug 3 01:40:05 2017 (r321964) @@ -1,7 +1,7 @@ -# $Id: Makefile,v 1.49 2015/12/20 22:54:40 sjg Exp $ +# $Id: Makefile,v 1.95 2017/07/20 19:36:13 sjg Exp $ # Base version on src date -MAKE_VERSION= 20151220 +_MAKE_VERSION= 20170720 PROG= bmake @@ -76,7 +76,7 @@ CFLAGS+= ${CPPFLAGS} CFLAGS+= -D_PATH_DEFSYSPATH=\"${DEFAULT_SYS_PATH}\" CFLAGS+= -I. -I${srcdir} ${XDEFS} -DMAKE_NATIVE CFLAGS+= ${COPTS.${.ALLSRC:M*.c:T:u}} -COPTS.main.c+= "-DMAKE_VERSION=\"${MAKE_VERSION}\"" +COPTS.main.c+= "-DMAKE_VERSION=\"${_MAKE_VERSION}\"" # meta mode can be useful even without filemon FILEMON_H ?= /usr/include/dev/filemon/filemon.h @@ -131,9 +131,9 @@ OPTIONS_DEFAULT_NO+= \ .include .if ${MK_PROG_VERSION} == "yes" -PROG_NAME= ${PROG}-${MAKE_VERSION} +PROG_NAME= ${PROG}-${_MAKE_VERSION} .if ${MK_PROG_LINK} == "yes" -SYMLINKS+= ${PROG}-${MAKE_VERSION} ${BINDIR}/${PROG} +SYMLINKS+= ${PROG_NAME} ${BINDIR}/${PROG} .endif .endif @@ -156,7 +156,10 @@ my.history: ${MAKEFILE} .NOPATH: ${MAN} ${MAN}: make.1 my.history @echo making $@ - @sed -e 's/^.Nx/NetBSD/' -e '/^.Nm/s/make/${PROG}/' \ + @sed \ + -e '/^.Dt/s/MAKE/${PROG:tu}/' \ + -e 's/^.Nx/NetBSD/' \ + -e '/^.Nm/s/make/${PROG}/' \ -e '/^.Sh HISTORY/rmy.history' \ -e '/^.Sh HISTORY/,$$s,^.Nm,make,' ${srcdir}/make.1 > $@ Modified: stable/10/contrib/bmake/PSD.doc/tutorial.ms ============================================================================== --- stable/10/contrib/bmake/PSD.doc/tutorial.ms Thu Aug 3 00:38:13 2017 (r321963) +++ stable/10/contrib/bmake/PSD.doc/tutorial.ms Thu Aug 3 01:40:05 2017 (r321964) @@ -1,4 +1,4 @@ -.\" $NetBSD: tutorial.ms,v 1.12 2014/09/30 21:33:14 christos Exp $ +.\" $NetBSD: tutorial.ms,v 1.13 2017/03/01 13:05:11 kre Exp $ .\" Copyright (c) 1988, 1989, 1993 .\" The Regents of the University of California. All rights reserved. .\" @@ -117,6 +117,15 @@ .de No .br .ne 0.5i +.ie n \{\ +.nr g3 \w'NOTE ' +.po -\\n(g3u +.br +NOTE +.br +.po +\\n(g3u +.\} +.el \{\ .po -0.5i .br .mk @@ -148,12 +157,14 @@ .rt .ft \\n(g3 .ps \\n(g4 +.\} .. .de Bp .ie !\\n(.$ .IP \(bu 2 .el .IP "\&" 2 .. -.po +.3i +.ie n .po +\w'NOTE 'u +.el .po +.3i .TL PMake \*- A Tutorial .AU Modified: stable/10/contrib/bmake/README ============================================================================== --- stable/10/contrib/bmake/README Thu Aug 3 00:38:13 2017 (r321963) +++ stable/10/contrib/bmake/README Thu Aug 3 01:40:05 2017 (r321964) @@ -1,47 +1,52 @@ bmake + ***** -This directory contains a port of the BSD make tool (from NetBSD) -I have run it on SunOS,Solaris,HP-UX,AIX,IRIX,FreeBSD and Linux. +This directory contains a port of the BSD make tool (from NetBSD). +Since 1993 I have run it on AIX, BSDi, Darwin, FreeBSD, HP-UX, IRIX, +Linux, Minix, OSF, Solaris, SunOS and even UTS. +Others have run it on many more systems. -Version 3 was re-worked from scratch to better facilitate -importing newer make(1) versions from NetBSD. The original code base -was NetBSD-1.0, so version 3 was built by doing a fresh import of the -NetBSD-1.0 usr.bin/make, adding the autoconf and other portability -patches to sync it with bmake v2, and then NetBSD's make -of Feb 20, 2000 was imported and conflicts dealt with. -NetBSD's make was again imported on June 6 and December 15, 2000. +Currently each release is tested on NetBSD, FreeBSD, Solaris and Linux. -In 2003 bmake switched to a date based version (first was 20030714) +Since 2003 bmake switched to a date based version (first was 20030714) which generally represents the date it was last merged with NetBSD's make. Since then, NetBSD's make is imported within a week of any interesting changes, so that bmake tracks it very closely. -Building: +Building +======== -The preferred way to bootstrap bmake is: +The preferred way to bootstrap bmake is:: -./bmake/boot-strap + ./bmake/boot-strap there are a number of args - most of which get passed to configure, eg. +:: -./bmake/boot-strap --prefix=/opt + ./bmake/boot-strap --prefix=/opt see the boot-strap script for details. +For folk that hate to read anything, since 20121212 you can also use +the GNU standard process of:: + + ./configure; make; make install + To make much use of bmake you will need the bsd.*.mk macros or my -portable *.mk macros. See +portable *.mk macros which are included with bmake since 20121212 +and separately available from http://www.crufty.net/ftp/pub/sjg/mk.tar.gz which will be links to the latest versions. -On a non-BSD system, you would want to unpack mk[-YYYYmmdd].tar.gz in -the same directory as bmake (so ./mk and ./bmake exist), and -./bmake/boot-strap will do the rest. +Porting +======= -If you want to do it all by hand then read boot-strap first to get the -idea. +If you encounter a system that bmake does not build or work on *out of +the box*, I welcome patches. +If you can provide access to a suitable machine - even better. -Even if you have an earlier version of bmake installed, use boot-strap -to ensure that all goes well. +More info can be found at http://www.crufty.net/help/sjg/bmake.htm ---sjg +--sjg + Modified: stable/10/contrib/bmake/arch.c ============================================================================== --- stable/10/contrib/bmake/arch.c Thu Aug 3 00:38:13 2017 (r321963) +++ stable/10/contrib/bmake/arch.c Thu Aug 3 01:40:05 2017 (r321964) @@ -1,4 +1,4 @@ -/* $NetBSD: arch.c,v 1.64 2015/10/11 04:51:24 sjg Exp $ */ +/* $NetBSD: arch.c,v 1.70 2017/04/16 20:49:09 riastradh Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: arch.c,v 1.64 2015/10/11 04:51:24 sjg Exp $"; +static char rcsid[] = "$NetBSD: arch.c,v 1.70 2017/04/16 20:49:09 riastradh Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)arch.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: arch.c,v 1.64 2015/10/11 04:51:24 sjg Exp $"); +__RCSID("$NetBSD: arch.c,v 1.70 2017/04/16 20:49:09 riastradh Exp $"); #endif #endif /* not lint */ #endif @@ -136,7 +136,6 @@ __RCSID("$NetBSD: arch.c,v 1.64 2015/10/11 04:51:24 sj #include #include #include -#include #ifdef HAVE_AR_H #include #else @@ -156,7 +155,6 @@ struct ar_hdr { #if defined(HAVE_RANLIB_H) && !(defined(__ELF__) || defined(NO_RANLIB)) #include #endif -#include #include #include #ifdef HAVE_UTIME_H @@ -254,8 +252,7 @@ ArchFree(void *ap) free(Hash_GetValue(entry)); free(a->name); - if (a->fnametab) - free(a->fnametab); + free(a->fnametab); Hash_DeleteTable(&a->members); free(a); } @@ -310,9 +307,10 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode * void *freeIt; char *result; - result = Var_Parse(cp, ctxt, TRUE, TRUE, &length, &freeIt); - if (freeIt) - free(freeIt); + result = Var_Parse(cp, ctxt, VARF_UNDEFERR|VARF_WANTRES, + &length, &freeIt); + free(freeIt); + if (result == var_Error) { return(FAILURE); } else { @@ -325,7 +323,7 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode * *cp++ = '\0'; if (subLibName) { - libName = Var_Subst(NULL, libName, ctxt, TRUE, TRUE); + libName = Var_Subst(NULL, libName, ctxt, VARF_UNDEFERR|VARF_WANTRES); } @@ -351,9 +349,10 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode * void *freeIt; char *result; - result = Var_Parse(cp, ctxt, TRUE, TRUE, &length, &freeIt); - if (freeIt) - free(freeIt); + result = Var_Parse(cp, ctxt, VARF_UNDEFERR|VARF_WANTRES, + &length, &freeIt); + free(freeIt); + if (result == var_Error) { return(FAILURE); } else { @@ -404,7 +403,8 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode * char *oldMemName = memName; size_t sz; - memName = Var_Subst(NULL, memName, ctxt, TRUE, TRUE); + memName = Var_Subst(NULL, memName, ctxt, + VARF_UNDEFERR|VARF_WANTRES); /* * Now form an archive spec and recurse to deal with nested @@ -726,7 +726,8 @@ ArchStatMember(char *archive, char *member, Boolean ha if (fread(memName, elen, 1, arch) != 1) goto badarch; memName[elen] = '\0'; - fseek(arch, -elen, SEEK_CUR); + if (fseek(arch, -elen, SEEK_CUR) != 0) + goto badarch; if (DEBUG(ARCH) || DEBUG(MAKE)) { fprintf(debug_file, "ArchStat: Extended format entry for %s\n", memName); } @@ -737,7 +738,8 @@ ArchStatMember(char *archive, char *member, Boolean ha Hash_SetValue(he, bmake_malloc(sizeof(struct ar_hdr))); memcpy(Hash_GetValue(he), &arh, sizeof(struct ar_hdr)); } - fseek(arch, (size + 1) & ~1, SEEK_CUR); + if (fseek(arch, (size + 1) & ~1, SEEK_CUR) != 0) + goto badarch; } fclose(arch); @@ -759,8 +761,7 @@ ArchStatMember(char *archive, char *member, Boolean ha badarch: fclose(arch); Hash_DeleteTable(&ar->members); - if (ar->fnametab) - free(ar->fnametab); + free(ar->fnametab); free(ar); return NULL; } @@ -833,7 +834,7 @@ ArchSVR4Entry(Arch *ar, char *name, size_t size, FILE } if (DEBUG(ARCH)) { fprintf(debug_file, "Found svr4 archive name table with %lu entries\n", - (u_long)entry); + (unsigned long)entry); } return 0; } @@ -851,7 +852,7 @@ ArchSVR4Entry(Arch *ar, char *name, size_t size, FILE if (entry >= ar->fnamesize) { if (DEBUG(ARCH)) { fprintf(debug_file, "SVR4 entry offset %s is greater than %lu\n", - name, (u_long)ar->fnamesize); + name, (unsigned long)ar->fnamesize); } return 2; } @@ -957,7 +958,10 @@ ArchFindMember(char *archive, char *member, struct ar_ * the file at the actual member, rather than its header, but * not here... */ - fseek(arch, -sizeof(struct ar_hdr), SEEK_CUR); + if (fseek(arch, -sizeof(struct ar_hdr), SEEK_CUR) != 0) { + fclose(arch); + return NULL; + } return (arch); } } else @@ -987,10 +991,17 @@ ArchFindMember(char *archive, char *member, struct ar_ } if (strncmp(ename, member, len) == 0) { /* Found as extended name */ - fseek(arch, -sizeof(struct ar_hdr) - elen, SEEK_CUR); + if (fseek(arch, -sizeof(struct ar_hdr) - elen, + SEEK_CUR) != 0) { + fclose(arch); + return NULL; + } return (arch); } - fseek(arch, -elen, SEEK_CUR); + if (fseek(arch, -elen, SEEK_CUR) != 0) { + fclose(arch); + return NULL; + } goto skip; } else #endif @@ -1003,9 +1014,12 @@ skip: * extract the size of the file from the 'size' field of the * header and round it up during the seek. */ - arhPtr->ar_size[sizeof(arhPtr->AR_SIZE)-1] = '\0'; + arhPtr->AR_SIZE[sizeof(arhPtr->AR_SIZE)-1] = '\0'; size = (int)strtol(arhPtr->AR_SIZE, NULL, 10); - fseek(arch, (size + 1) & ~1, SEEK_CUR); + if (fseek(arch, (size + 1) & ~1, SEEK_CUR) != 0) { + fclose(arch); + return NULL; + } } } @@ -1045,10 +1059,10 @@ Arch_Touch(GNode *gn) arch = ArchFindMember(Var_Value(ARCHIVE, gn, &p1), Var_Value(MEMBER, gn, &p2), &arh, "r+"); - if (p1) - free(p1); - if (p2) - free(p2); + + free(p1); + free(p2); + snprintf(arh.AR_DATE, sizeof(arh.AR_DATE), "%-12ld", (long) now); if (arch != NULL) { @@ -1127,10 +1141,9 @@ Arch_MTime(GNode *gn) arhPtr = ArchStatMember(Var_Value(ARCHIVE, gn, &p1), Var_Value(MEMBER, gn, &p2), TRUE); - if (p1) - free(p1); - if (p2) - free(p2); + + free(p1); + free(p2); if (arhPtr != NULL) { modTime = (time_t)strtol(arhPtr->AR_DATE, NULL, 10); Modified: stable/10/contrib/bmake/bmake.1 ============================================================================== --- stable/10/contrib/bmake/bmake.1 Thu Aug 3 00:38:13 2017 (r321963) +++ stable/10/contrib/bmake/bmake.1 Thu Aug 3 01:40:05 2017 (r321964) @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.249 2015/06/05 07:33:40 wiz Exp $ +.\" $NetBSD: make.1,v 1.271 2017/07/03 21:34:20 wiz Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,8 +29,8 @@ .\" .\" from: @(#)make.1 8.4 (Berkeley) 3/19/94 .\" -.Dd June 4, 2015 -.Dt MAKE 1 +.Dd June 22, 2017 +.Dt BMAKE 1 .Os .Sh NAME .Nm bmake @@ -48,6 +48,7 @@ .Op Fl m Ar directory .Op Fl T Ar file .Op Fl V Ar variable +.Op Fl v Ar variable .Op Ar variable=value .Op Ar target ... .Sh DESCRIPTION @@ -206,7 +207,9 @@ Print debugging information about target list maintena .It Ar V Force the .Fl V -option to print raw values of variables. +option to print raw values of variables, overriding the default behavior +set via +.Va .MAKE.EXPAND_VARIABLES . .It Ar v Print debugging information about variable assignment. .It Ar x @@ -293,7 +296,7 @@ then will search for the specified file or directory named in the remaining part of the argument string. The search starts with the current directory of -the Makefile and then works upward towards the root of the filesystem. +the Makefile and then works upward towards the root of the file system. If the search is successful, then the resulting directory replaces the .Qq \&.../ specification in the @@ -334,20 +337,39 @@ for each job started and completed. Rather than re-building a target as specified in the makefile, create it or update its modification time to make it appear up-to-date. .It Fl V Ar variable -Print -.Nm Ns 's -idea of the value of -.Ar variable , -in the global context. +Print the value of +.Ar variable . Do not build any targets. Multiple instances of this option may be specified; the variables will be printed one per line, with a blank line for each null or undefined variable. +The value printed is extracted from the global context after all +makefiles have been read. +By default, the raw variable contents (which may +include additional unexpanded variable references) are shown. If .Ar variable contains a .Ql \&$ -then the value will be expanded before printing. +then the value will be recursively expanded to its complete resultant +text before printing. +The expanded value will also be printed if +.Va .MAKE.EXPAND_VARIABLES +is set to true and +the +.Fl dV +option has not been used to override it. +Note that loop-local and target-local variables, as well as values +taken temporarily by global variables during makefile processing, are +not accessible via this option. +The +.Fl dv +debug mode can be used to see these at the cost of generating +substantial extraneous output. +.It Fl v Ar variable +Like +.Fl V +but the variable is always expanded to its complete value. .It Fl W Treat any warnings during makefile parsing as errors. .It Fl w @@ -657,7 +679,7 @@ The seven local variables are as follows: .Bl -tag -width ".ARCHIVE" -offset indent .It Va .ALLSRC The list of all sources for this target; also known as -.Ql Va \&\*[Gt] . +.Ql Va \&> . .It Va .ARCHIVE The name of the archive file; also known as .Ql Va \&! . @@ -666,7 +688,7 @@ In suffix-transformation rules, the name/path of the s target is to be transformed (the .Dq implied source); also known as -.Ql Va \&\*[Lt] . +.Ql Va \&< . It is not defined in explicit rules. .It Va .MEMBER The name of the archive member; also known as @@ -685,12 +707,15 @@ or it will not be recognized. .It Va .TARGET The name of the target; also known as .Ql Va @ . +For compatibility with other makes this is an alias for +.Ic .ARCHIVE +in archive member rules. .El .Pp The shorter forms -.Ql ( Va \*[Gt] , +.Ql ( Va > , .Ql Va \&! , -.Ql Va \*[Lt] , +.Ql Va < , .Ql Va % , .Ql Va \&? , .Ql Va * , @@ -773,6 +798,10 @@ from which generated dependencies are read. A boolean that controls the default behavior of the .Fl V option. +If true, variable values printed with +.Fl V +are fully expanded; if false, the raw variable contents (which may +include additional unexpanded variable references) are shown. .It Va .MAKE.EXPORTED The list of variables exported by .Nm . @@ -843,7 +872,7 @@ Can affect the mode that .Nm runs in. It can contain a number of keywords: -.Bl -hang -width ignore-cmd +.Bl -hang -width missing-filemon=bf. .It Pa compat Like .Fl B , @@ -867,8 +896,19 @@ will not create .meta files in This can be overridden by setting .Va bf to a value which represents True. +.It Pa missing-meta= Ar bf +If +.Va bf +is True, then a missing .meta file makes the target out-of-date. +.It Pa missing-filemon= Ar bf +If +.Va bf +is True, then missing filemon data makes the target out-of-date. +.It Pa nofilemon +Do not use +.Xr filemon 4 . .It Pa env -For debugging, it can be useful to inlcude the environment +For debugging, it can be useful to include the environment in the .meta file. .It Pa verbose If in "meta" mode, print a clue about the target being built. @@ -910,6 +950,12 @@ Provides a list of path prefixes that should be ignore because the contents are expected to change over time. The default list includes: .Ql Pa /dev /etc /proc /tmp /var/run /var/tmp +.It Va .MAKE.META.IGNORE_PATTERNS +Provides a list of patterns to match against pathnames. +Ignore any that match. +.It Va .MAKE.META.IGNORE_FILTER +Provides a list of variable modifiers to apply to each pathname. +Ignore if the expansion is an empty string. .It Va .MAKE.META.PREFIX Defines the message printed for each meta file updated in "meta verbose" mode. The default value is: @@ -918,7 +964,7 @@ The default value is: This variable is used to record the names of variables assigned to on the command line, so that they may be exported as part of .Ql Ev MAKEFLAGS . -This behaviour can be disabled by assigning an empty value to +This behavior can be disabled by assigning an empty value to .Ql Va .MAKEOVERRIDES within a makefile. Extra variables can be exported from a makefile @@ -941,10 +987,35 @@ The process-id of .It Va .MAKE.PPID The parent process-id of .Nm . +.It Va .MAKE.SAVE_DOLLARS +value should be a boolean that controls whether +.Ql $$ +are preserved when doing +.Ql := +assignments. +The default is false, for backwards compatibility. +Set to true for compatability with other makes. +If set to false, +.Ql $$ +becomes +.Ql $ +per normal evaluation rules. .It Va MAKE_PRINT_VAR_ON_ERROR When .Nm -stops due to an error, it prints its name and the value of +stops due to an error, it sets +.Ql Va .ERROR_TARGET +to the name of the target that failed, +.Ql Va .ERROR_CMD +to the commands of the failed target, +and in "meta" mode, it also sets +.Ql Va .ERROR_CWD +to the +.Xr getcwd 3 , +and +.Ql Va .ERROR_META_FILE +to the path of the meta file (if any) describing the failed target. +It then prints its name and the value of .Ql Va .CURDIR as well as the value of any variables named in .Ql Va MAKE_PRINT_VAR_ON_ERROR . @@ -1044,7 +1115,7 @@ sets to the value of .Ql Ev PWD instead. -This behaviour is disabled if +This behavior is disabled if .Ql Ev MAKEOBJDIRPREFIX is set or .Ql Ev MAKEOBJDIR @@ -1114,7 +1185,7 @@ The wildcard characters may be escaped with a backslas As a consequence of the way values are split into words, matched, and then joined, a construct like .Dl ${VAR:M*} -will normalise the inter-word spacing, removing all leading and +will normalize the inter-word spacing, removing all leading and trailing space, and converting multiple consecutive spaces to single spaces. . @@ -1134,7 +1205,7 @@ Randomize words in variable. The results will be different each time you are referring to the modified variable; use the assignment with expansion .Pq Ql Cm \&:= -to prevent such behaviour. +to prevent such behavior. For example, .Bd -literal -offset indent LIST= uno due tre quattro @@ -1160,18 +1231,28 @@ safely through recursive invocations of .Nm . .It Cm \&:R Replaces each word in the variable with everything but its suffix. -.It Cm \&:gmtime +.It Cm \&:range[=count] +The value is an integer sequence representing the words of the original +value, or the supplied +.Va count . +.It Cm \&:gmtime[=utc] The value is a format string for .Xr strftime 3 , -using the current +using .Xr gmtime 3 . +If a +.Va utc +value is not provided or is 0, the current time is used. .It Cm \&:hash -Compute a 32bit hash of the value and encode it as hex digits. -.It Cm \&:localtime +Compute a 32-bit hash of the value and encode it as hex digits. +.It Cm \&:localtime[=utc] The value is a format string for .Xr strftime 3 , -using the current +using .Xr localtime 3 . +If a +.Va utc +value is not provided or is 0, the current time is used. .It Cm \&:tA Attempt to convert variable to an absolute path using .Xr realpath 3 , @@ -1232,7 +1313,7 @@ it is anchored at the end of each word. Inside .Ar new_string , an ampersand -.Pq Ql \*[Am] +.Pq Ql & is replaced by .Ar old_string (without any @@ -1371,6 +1452,27 @@ For example. .Pp However a single character variable is often more readable: .Dl ${MAKE_PRINT_VAR_ON_ERROR:@v@$v='${$v}'${.newline}@} +.It Cm \&:_[=var] +Save the current variable value in +.Ql $_ +or the named +.Va var +for later reference. +Example usage: +.Bd -literal -offset indent +M_cmpv.units = 1 1000 1000000 +M_cmpv = S,., ,g:_:range:@i@+ $${_:[-$$i]} \&\\ +\\* $${M_cmpv.units:[$$i]}@:S,^,expr 0 ,1:sh + +.Dv .if ${VERSION:${M_cmpv}} < ${3.1.12:L:${M_cmpv}} *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Aug 3 01:44:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEDCCDBF2FB; Thu, 3 Aug 2017 01:44:42 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 99155990; Thu, 3 Aug 2017 01:44:42 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v731ifts051306; Thu, 3 Aug 2017 01:44:41 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v731if3E051305; Thu, 3 Aug 2017 01:44:41 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201708030144.v731if3E051305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 3 Aug 2017 01:44:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321965 - head/sys/dev/hyperv/utilities X-SVN-Group: head X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: head/sys/dev/hyperv/utilities X-SVN-Commit-Revision: 321965 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 01:44:42 -0000 Author: sephe Date: Thu Aug 3 01:44:40 2017 New Revision: 321965 URL: https://svnweb.freebsd.org/changeset/base/321965 Log: hyperv/kvp: Use proper size macro for adapter id. Submitted by: Christopher Ertl MFC after: 3 days Sponsored by: Microsoft Modified: head/sys/dev/hyperv/utilities/hv_kvp.c Modified: head/sys/dev/hyperv/utilities/hv_kvp.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_kvp.c Thu Aug 3 01:40:05 2017 (r321964) +++ head/sys/dev/hyperv/utilities/hv_kvp.c Thu Aug 3 01:44:40 2017 (r321965) @@ -253,7 +253,7 @@ hv_kvp_convert_utf8_ipinfo_to_utf16(struct hv_kvp_msg UNUSED_FLAG, &err_dns); utf8_to_utf16((uint16_t *)host_ip_msg->kvp_ip_val.adapter_id, - MAX_IP_ADDR_SIZE, + MAX_ADAPTER_ID_SIZE, (char *)umsg->body.kvp_ip_val.adapter_id, strlen((char *)umsg->body.kvp_ip_val.adapter_id), UNUSED_FLAG, From owner-svn-src-all@freebsd.org Thu Aug 3 02:08:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B45ADC0BD0; Thu, 3 Aug 2017 02:08:02 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 487E21C20; Thu, 3 Aug 2017 02:08:02 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v73281IB059464; Thu, 3 Aug 2017 02:08:01 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73281mf059463; Thu, 3 Aug 2017 02:08:01 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201708030208.v73281mf059463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Thu, 3 Aug 2017 02:08:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321966 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321966 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 02:08:02 -0000 Author: rmacklem Date: Thu Aug 3 02:08:01 2017 New Revision: 321966 URL: https://svnweb.freebsd.org/changeset/base/321966 Log: Added entry as requested by Kirk. Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Thu Aug 3 01:44:40 2017 (r321965) +++ head/usr.bin/calendar/calendars/calendar.freebsd Thu Aug 3 02:08:01 2017 (r321966) @@ -350,6 +350,7 @@ 10/05 Hiroki Sato born in Yamagata, Japan, 1977 10/05 Chris Costello born in Houston, Texas, United States, 1985 10/09 Stefan Walter born in Werne, Nordrhein-Westfalen, Germany, 1978 +10/11 Rick Macklem born in Ontario, Canada, 1955 10/12 Pawel Jakub Dawidek born in Radzyn Podlaski, Poland, 1980 10/15 Maxim Konovalov born in Khabarovsk, USSR, 1973 10/15 Eugene Grosbein born in Novokuznetsk, Russian Republic, USSR, 1976 From owner-svn-src-all@freebsd.org Thu Aug 3 03:43:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3756DC69A2; Thu, 3 Aug 2017 03:43:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B156464ACC; Thu, 3 Aug 2017 03:43:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v733hfLP000492; Thu, 3 Aug 2017 03:43:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v733hfvg000491; Thu, 3 Aug 2017 03:43:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201708030343.v733hfvg000491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 3 Aug 2017 03:43:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321967 - head/tests/sys/fs/tmpfs X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/tests/sys/fs/tmpfs X-SVN-Commit-Revision: 321967 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 03:43:43 -0000 Author: ngie Date: Thu Aug 3 03:43:41 2017 New Revision: 321967 URL: https://svnweb.freebsd.org/changeset/base/321967 Log: Chase r321920 and r321930 (dev_t being widened) The layout of st_rdev has changed after this commit, and assumptions made in the NetBSD tests are no longer valid. Change the hardcoded assumed values to account for the fact that major/minor are now represented by 64 bits as opposed to the less precise legacy precision of 16 bits. PR: 221048 Relnotes: st_rdev layout changed; warning about impact of r321920 to downstream consumers Modified: head/tests/sys/fs/tmpfs/Makefile Modified: head/tests/sys/fs/tmpfs/Makefile ============================================================================== --- head/tests/sys/fs/tmpfs/Makefile Thu Aug 3 02:08:01 2017 (r321966) +++ head/tests/sys/fs/tmpfs/Makefile Thu Aug 3 03:43:41 2017 (r321967) @@ -41,7 +41,13 @@ ${PACKAGE}FILESDIR= ${TESTSDIR} PROGS+= h_tools BINDIR.h_tools= ${TESTSDIR} +# NOTE: dev_t is represented by 64-bits after r321920 (it was 16-bits +# previously). +# +# The old hardcoded values assume the 16-bit layout for .st_rdev . ATF_TESTS_SH_SED_mknod_test= \ + -e '/$${st_rdev} -eq 512/s/512/8589934592/g' \ + -e '/$${st_rdev} -eq 514/s/514/8589934594/g' \ -e 's,mknod pipe p,mkfifo pipe,g' \ -e 's,mknod dir/pipe p,mkfifo dir/pipe,g' From owner-svn-src-all@freebsd.org Thu Aug 3 03:53:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AED64DC6FDC; Thu, 3 Aug 2017 03:53:20 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 4421A650AA; Thu, 3 Aug 2017 03:53:19 +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 mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 2CEFD107834; Thu, 3 Aug 2017 13:21:57 +1000 (AEST) Date: Thu, 3 Aug 2017 13:21:56 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r321920 - head/sys/sys In-Reply-To: <20170802135455.GG1700@kib.kiev.ua> Message-ID: <20170803122015.Q1093@besplex.bde.org> References: <201708021014.v72AEHEk061037@repo.freebsd.org> <37abc595-c80e-a8da-04a8-815f42c634de@selasky.org> <20170802135455.GG1700@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=KeqiiUQD c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=DIZZVqnLoRRTIwBj3f8A:9 a=JUE4OAOBgtXzTOa8:21 a=zo0XxFwiP1CiXz7P:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 03:53:20 -0000 On Wed, 2 Aug 2017, Konstantin Belousov wrote: > On Wed, Aug 02, 2017 at 02:38:50PM +0200, Hans Petter Selasky wrote: >> On 08/02/17 14:36, Hans Petter Selasky wrote: >>> On 08/02/17 12:14, Konstantin Belousov wrote: >>>> +#define major(x) ((int)((dev_t)(x) >> 32)) /* major number */ >>>> +#define minor(x) ((int)((x) & 0xffffffff)) /* minor number */ >>>> +#define makedev(x, y) (((dev_t)(x) << 32) | (y)) /* create >>>> dev_t */ >>> >>> One more comment on this issue: >>> >>> I think makedev(x, y) should be declared like this, to avoid issues when >>> "y" is negative: >>> >>> #define makedev(x, y) (((dev_t)(x) << 32) | (unsigned int)(y)) >>> /* create dev_t */ I think this has a lot of style bugs: - long line constructed by blind expansion - verbose spelling of 'unsigned' in the expansion to make the long line longer - banal comment to make the long line. The comment on this line is not quite as banal as the ones on the preceding 2 line -- those do less than echo the code. >> And you'll probably want a final wrapping dev_t cast aswell. 128-bit >> numbers are not yet there. >> >> #define makedev(x, y) ((dev_t)(((dev_t)(x) << 32) | (unsigned >> int)(y))) >> > /* create dev_t */ You mean 128-bit ints. > I agree with the usefulness of the y cast to unsigned type, but I am not sure > what is the use of final dev_t cast. By the usual arithmetic conversion > rules, the final type of the '|' is the highest rank type of the operands. > Something unusual can only happen if int is wider than dev_t. So it happens with 128 ints (or 65-bit ints) if dev_t remains 64 bits. > So I am going to commit the following update. Almost OK. The necessary casts and parentheses are already ugly enough. This is the implementation, so it can assume that int is 32 bits and dev_t is 64 bits and not have the complexity to support the general case. Ints are probably assumed to be 32 bits in a few thousand similar definitions and a few million lines of code just in FreeBSD sources. > diff --git a/sys/sys/types.h b/sys/sys/types.h > index fce57e412ed..30a08724443 100644 > --- a/sys/sys/types.h > +++ b/sys/sys/types.h > @@ -366,7 +366,7 @@ __bitcount64(__uint64_t _x) > > #define major(x) ((int)((dev_t)(x) >> 32)) /* major number */ > #define minor(x) ((int)((x) & 0xffffffff)) /* minor number */ > -#define makedev(x, y) (((dev_t)(x) << 32) | (y)) /* create dev_t */ > +#define makedev(x, y) (((dev_t)(x) << 32) | (unsigned)(y)) /* create dev_t */ > > /* > * These declarations belong elsewhere, but are repeated here and in You fixed the long line by not spelling 'unsigned' verbosely and not aligning the comments uniformly. It would be better to remove the comments. makedev() actually has a man page (a FreeBSD addition makedev(3)). This could have been better, and is now out of date. The largest error is that major() is still documented to return a value between 0 and 255. This reduction prevented makedev() being the inverse of major()+minor() on arbitrary args. The man page doesn't claim that it is, and barely gives a hint that makedev() can be used to synthesize a dev_t from (x, y) provided 0 <= x <= 255. Bruce From owner-svn-src-all@freebsd.org Thu Aug 3 05:27:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2C89DCAD3C; Thu, 3 Aug 2017 05:27:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC65F675DD; Thu, 3 Aug 2017 05:27:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v735R5Lw041049; Thu, 3 Aug 2017 05:27:05 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v735R5dg041043; Thu, 3 Aug 2017 05:27:05 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201708030527.v735R5dg041043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 3 Aug 2017 05:27:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321969 - in head/sys/boot: arm/at91/libat91 arm/ixp425/boot2 i386/boot2 X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in head/sys/boot: arm/at91/libat91 arm/ixp425/boot2 i386/boot2 X-SVN-Commit-Revision: 321969 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 05:27:07 -0000 Author: ngie Date: Thu Aug 3 05:27:05 2017 New Revision: 321969 URL: https://svnweb.freebsd.org/changeset/base/321969 Log: Fix the return types for printf and putchar to match their libc and POSIX equivalents Both printf and putchar return int, not void. This will allow code that leverages the libcalls and checks/rely on the return type to interchangeably between loader code and non-loader code. MFC after: 1 month Modified: head/sys/boot/arm/at91/libat91/lib.h head/sys/boot/arm/at91/libat91/printf.c head/sys/boot/arm/at91/libat91/putchar.c head/sys/boot/arm/ixp425/boot2/ixp425_board.c head/sys/boot/arm/ixp425/boot2/lib.h head/sys/boot/i386/boot2/boot2.c Modified: head/sys/boot/arm/at91/libat91/lib.h ============================================================================== --- head/sys/boot/arm/at91/libat91/lib.h Thu Aug 3 03:45:48 2017 (r321968) +++ head/sys/boot/arm/at91/libat91/lib.h Thu Aug 3 05:27:05 2017 (r321969) @@ -28,9 +28,9 @@ #define ARM_BOOT_LIB_H int getc(int); -void putchar(int); -void xputchar(int); -void printf(const char *fmt,...); +int putchar(int); +int xputchar(int); +int printf(const char *fmt,...); /* The following function write eeprom at ee_addr using data */ /* from data_add for size bytes. */ Modified: head/sys/boot/arm/at91/libat91/printf.c ============================================================================== --- head/sys/boot/arm/at91/libat91/printf.c Thu Aug 3 03:45:48 2017 (r321968) +++ head/sys/boot/arm/at91/libat91/printf.c Thu Aug 3 05:27:05 2017 (r321969) @@ -20,12 +20,13 @@ #include #include "lib.h" -void +int printf(const char *fmt,...) { va_list ap; const char *hex = "0123456789abcdef"; char buf[10]; + const char *fmt_orig = fmt; char *s; unsigned u; int c; @@ -66,5 +67,5 @@ printf(const char *fmt,...) } va_end(ap); - return; + return (int)(fmt - fmt_orig); } Modified: head/sys/boot/arm/at91/libat91/putchar.c ============================================================================== --- head/sys/boot/arm/at91/libat91/putchar.c Thu Aug 3 03:45:48 2017 (r321968) +++ head/sys/boot/arm/at91/libat91/putchar.c Thu Aug 3 05:27:05 2017 (r321969) @@ -39,11 +39,11 @@ #include "lib.h" /* - * void putchar(int ch) + * int putchar(int ch) * Writes a character to the DBGU port. It assumes that DBGU has * already been initialized. */ -void +int putchar(int ch) { AT91PS_USART pUSART = (AT91PS_USART)AT91C_BASE_DBGU; @@ -51,12 +51,14 @@ putchar(int ch) while (!(pUSART->US_CSR & AT91C_US_TXRDY)) continue; pUSART->US_THR = (ch & 0xFF); + return (1); } -void +int xputchar(int ch) { - if (ch == '\n') - putchar('\r'); - putchar(ch); + if (ch == '\n') + putchar('\r'); + putchar(ch); + return (ch == '\n' ? 2 : 1); } Modified: head/sys/boot/arm/ixp425/boot2/ixp425_board.c ============================================================================== --- head/sys/boot/arm/ixp425/boot2/ixp425_board.c Thu Aug 3 03:45:48 2017 (r321968) +++ head/sys/boot/arm/ixp425/boot2/ixp425_board.c Thu Aug 3 05:27:05 2017 (r321969) @@ -165,7 +165,7 @@ getc(int seconds) return c; } -void +int putchar(int ch) { int delay, limit; @@ -179,14 +179,16 @@ putchar(int ch) limit = 40; while ((uart_getreg(ubase, REG_LSR) & LSR_TEMT) == 0 && --limit) DELAY(delay); + return (1); } -void +int xputchar(int ch) { if (ch == '\n') putchar('\r'); putchar(ch); + return (ch == '\n' ? 2 : 1); } void Modified: head/sys/boot/arm/ixp425/boot2/lib.h ============================================================================== --- head/sys/boot/arm/ixp425/boot2/lib.h Thu Aug 3 03:45:48 2017 (r321968) +++ head/sys/boot/arm/ixp425/boot2/lib.h Thu Aug 3 05:27:05 2017 (r321969) @@ -35,12 +35,12 @@ int main(void); void DELAY(int); int getc(int); -void putchar(int); -void xputchar(int); +int putchar(int); +int xputchar(int); void putstr(const char *); void puthex8(u_int8_t); void puthexlist(const u_int8_t *, int); -void printf(const char *fmt,...); +int printf(const char *fmt,...); void bzero(void *, size_t); char *strcpy(char *to, const char *from); Modified: head/sys/boot/i386/boot2/boot2.c ============================================================================== --- head/sys/boot/i386/boot2/boot2.c Thu Aug 3 03:45:48 2017 (r321968) +++ head/sys/boot/i386/boot2/boot2.c Thu Aug 3 05:27:05 2017 (r321969) @@ -114,8 +114,8 @@ void exit(int); static void load(void); static int parse(void); static int dskread(void *, unsigned, unsigned); -static void printf(const char *,...); -static void putchar(int); +static int printf(const char *,...); +static int putchar(int); static int drvread(void *, unsigned, unsigned); static int keyhit(unsigned); static int xputc(int); @@ -521,11 +521,12 @@ error: return -1; } -static void +static int printf(const char *fmt,...) { va_list ap; static char buf[10]; + const char *fmt_orig = fmt; char *s; unsigned u; int c; @@ -556,15 +557,16 @@ printf(const char *fmt,...) putchar(c); } va_end(ap); - return; + return (int)(fmt - fmt_orig); } -static void +static int putchar(int c) { if (c == '\n') xputc('\r'); xputc(c); + return (c == '\n' ? 2 : 1); } static int From owner-svn-src-all@freebsd.org Thu Aug 3 05:55:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89582DCB911; Thu, 3 Aug 2017 05:55:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 538A66856C; Thu, 3 Aug 2017 05:55:02 +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 v735t1w5053160; Thu, 3 Aug 2017 05:55:01 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v735t1hC053159; Thu, 3 Aug 2017 05:55:01 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201708030555.v735t1hC053159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 3 Aug 2017 05:55:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321973 - head/sys/dev/ksyms X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/ksyms X-SVN-Commit-Revision: 321973 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 05:55:02 -0000 Author: markj Date: Thu Aug 3 05:55:01 2017 New Revision: 321973 URL: https://svnweb.freebsd.org/changeset/base/321973 Log: Remove D_TRACKCLOSE now that ksyms no longer has a close method. Reported by: jhb X-MFC with: r321963 Modified: head/sys/dev/ksyms/ksyms.c Modified: head/sys/dev/ksyms/ksyms.c ============================================================================== --- head/sys/dev/ksyms/ksyms.c Thu Aug 3 05:32:27 2017 (r321972) +++ head/sys/dev/ksyms/ksyms.c Thu Aug 3 05:55:01 2017 (r321973) @@ -71,7 +71,7 @@ static d_mmap_single_t ksyms_mmap_single; static struct cdevsw ksyms_cdevsw = { .d_version = D_VERSION, - .d_flags = D_TRACKCLOSE, + .d_flags = 0, .d_open = ksyms_open, .d_read = ksyms_read, .d_mmap_single = ksyms_mmap_single, From owner-svn-src-all@freebsd.org Thu Aug 3 07:00:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E698DCD9A3; Thu, 3 Aug 2017 07:00:56 +0000 (UTC) (envelope-from ak@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C0216A044; Thu, 3 Aug 2017 07:00:56 +0000 (UTC) (envelope-from ak@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7370tQj077818; Thu, 3 Aug 2017 07:00:55 GMT (envelope-from ak@FreeBSD.org) Received: (from ak@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7370tJl077817; Thu, 3 Aug 2017 07:00:55 GMT (envelope-from ak@FreeBSD.org) Message-Id: <201708030700.v7370tJl077817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ak set sender to ak@FreeBSD.org using -f From: Alex Kozlov Date: Thu, 3 Aug 2017 07:00:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321974 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: ak X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321974 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 07:00:56 -0000 Author: ak (ports committer) Date: Thu Aug 3 07:00:55 2017 New Revision: 321974 URL: https://svnweb.freebsd.org/changeset/base/321974 Log: Add entry to the calendar Requested by: mckusick Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Thu Aug 3 05:55:01 2017 (r321973) +++ head/usr.bin/calendar/calendars/calendar.freebsd Thu Aug 3 07:00:55 2017 (r321974) @@ -332,6 +332,7 @@ 09/17 Maxim Bolotin born in Rostov-on-Don, Russian Federation, 1976 09/18 Matthew Fleming born in Cleveland, Ohio, United States, 1975 09/20 Kevin Lo born in Taipei, Taiwan, Republic of China, 1972 +09/21 Alex Kozlov born in Bila Tserkva, Ukraine, 1970 09/21 Gleb Kurtsou born in Minsk, Belarus, 1984 09/22 Alan Somers born in San Antonio, Texas, United States, 1982 09/22 Bryan Drewery born in San Diego, California, United States, 1984 From owner-svn-src-all@freebsd.org Thu Aug 3 07:17:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0825DDCE03A; Thu, 3 Aug 2017 07:17:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C607C6A846; Thu, 3 Aug 2017 07:17:42 +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 v737HfQU085755; Thu, 3 Aug 2017 07:17:41 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v737HfxK085754; Thu, 3 Aug 2017 07:17:41 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201708030717.v737HfxK085754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 3 Aug 2017 07:17: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: r321975 - stable/11/usr.bin/w X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/usr.bin/w X-SVN-Commit-Revision: 321975 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 07:17:43 -0000 Author: mav Date: Thu Aug 3 07:17:41 2017 New Revision: 321975 URL: https://svnweb.freebsd.org/changeset/base/321975 Log: MFC r321620: Fix singular/plural "users" output. It was broken during libxo'fication. PR: 221039 Submitted by: timur@ Modified: stable/11/usr.bin/w/w.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/w/w.c ============================================================================== --- stable/11/usr.bin/w/w.c Thu Aug 3 07:00:55 2017 (r321974) +++ stable/11/usr.bin/w/w.c Thu Aug 3 07:17:41 2017 (r321975) @@ -511,7 +511,7 @@ pr_header(time_t *nowp, int nusers) } /* Print number of users logged in to system */ - xo_emit(" {:users/%d} {N:user%s}", nusers, nusers == 1 ? "" : "s"); + xo_emit(" {:users/%d} {Np:user,users}", nusers); /* * Print 1, 5, and 15 minute load averages. From owner-svn-src-all@freebsd.org Thu Aug 3 07:20:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96FD6DCE200; Thu, 3 Aug 2017 07:20:20 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 619DA6A9E0; Thu, 3 Aug 2017 07:20:20 +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 v737KJXp085939; Thu, 3 Aug 2017 07:20:19 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v737KJEE085938; Thu, 3 Aug 2017 07:20:19 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201708030720.v737KJEE085938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 3 Aug 2017 07:20: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: r321976 - stable/11/sys/cam/ata X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/cam/ata X-SVN-Commit-Revision: 321976 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 07:20:20 -0000 Author: mav Date: Thu Aug 3 07:20:19 2017 New Revision: 321976 URL: https://svnweb.freebsd.org/changeset/base/321976 Log: MFC r321606: adaasync(): Set ADA_STATE_WCACHE based on ADA_FLAG_CAN_WCACHE The attached patch lets adaasync() set ADA_STATE_WCACHE based on ADA_FLAG_CAN_WCACHE instead of ADA_FLAG_CAN_RAHEAD. This fixes a regression introduced in r300207 which changed the flag names. PR: 220948 Submitted by: Fabian Keil Obtained from: ElectroBSD Modified: stable/11/sys/cam/ata/ata_da.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ata/ata_da.c ============================================================================== --- stable/11/sys/cam/ata/ata_da.c Thu Aug 3 07:17:41 2017 (r321975) +++ stable/11/sys/cam/ata/ata_da.c Thu Aug 3 07:20:19 2017 (r321976) @@ -1288,7 +1288,7 @@ adaasync(void *callback_arg, u_int32_t code, xpt_action((union ccb *)&cgd); if (ADA_RA >= 0 && softc->flags & ADA_FLAG_CAN_RAHEAD) softc->state = ADA_STATE_RAHEAD; - else if (ADA_WC >= 0 && softc->flags & ADA_FLAG_CAN_RAHEAD) + else if (ADA_WC >= 0 && softc->flags & ADA_FLAG_CAN_WCACHE) softc->state = ADA_STATE_WCACHE; else if ((softc->flags & ADA_FLAG_CAN_LOG) && (softc->zone_mode != ADA_ZONE_NONE)) From owner-svn-src-all@freebsd.org Thu Aug 3 07:28:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2644DCE627; Thu, 3 Aug 2017 07:28:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6BD1F6AEA3; Thu, 3 Aug 2017 07:28:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v737SsCT090215; Thu, 3 Aug 2017 07:28:54 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v737SsZd090213; Thu, 3 Aug 2017 07:28:54 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708030728.v737SsZd090213@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 3 Aug 2017 07:28: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: r321977 - in stable/11/sys: kern sys X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys: kern sys X-SVN-Commit-Revision: 321977 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 07:28:55 -0000 Author: kib Date: Thu Aug 3 07:28:54 2017 New Revision: 321977 URL: https://svnweb.freebsd.org/changeset/base/321977 Log: MFC r321625: Make the number of children for pctrie node available outside subr_pctrie.c. Modified: stable/11/sys/kern/subr_pctrie.c stable/11/sys/sys/pctrie.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/subr_pctrie.c ============================================================================== --- stable/11/sys/kern/subr_pctrie.c Thu Aug 3 07:20:19 2017 (r321976) +++ stable/11/sys/kern/subr_pctrie.c Thu Aug 3 07:28:54 2017 (r321977) @@ -58,18 +58,6 @@ __FBSDID("$FreeBSD$"); #include #endif -/* - * These widths should allow the pointers to a node's children to fit within - * a single cache line. The extra levels from a narrow width should not be - * a problem thanks to path compression. - */ -#ifdef __LP64__ -#define PCTRIE_WIDTH 4 -#else -#define PCTRIE_WIDTH 3 -#endif - -#define PCTRIE_COUNT (1 << PCTRIE_WIDTH) #define PCTRIE_MASK (PCTRIE_COUNT - 1) #define PCTRIE_LIMIT (howmany(sizeof(uint64_t) * NBBY, PCTRIE_WIDTH) - 1) Modified: stable/11/sys/sys/pctrie.h ============================================================================== --- stable/11/sys/sys/pctrie.h Thu Aug 3 07:20:19 2017 (r321976) +++ stable/11/sys/sys/pctrie.h Thu Aug 3 07:28:54 2017 (r321977) @@ -133,5 +133,18 @@ pctrie_is_empty(struct pctrie *ptree) return (ptree->pt_root == 0); } +/* + * These widths should allow the pointers to a node's children to fit within + * a single cache line. The extra levels from a narrow width should not be + * a problem thanks to path compression. + */ +#ifdef __LP64__ +#define PCTRIE_WIDTH 4 +#else +#define PCTRIE_WIDTH 3 +#endif + +#define PCTRIE_COUNT (1 << PCTRIE_WIDTH) + #endif /* _KERNEL */ #endif /* !_SYS_PCTRIE_H_ */ From owner-svn-src-all@freebsd.org Thu Aug 3 07:30:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4AFCFDCE734; Thu, 3 Aug 2017 07:30:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1833E6B02A; Thu, 3 Aug 2017 07:30:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v737UZEo091004; Thu, 3 Aug 2017 07:30:35 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v737UZ7N091003; Thu, 3 Aug 2017 07:30:35 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708030730.v737UZ7N091003@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 3 Aug 2017 07:30: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: r321978 - 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: 321978 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 07:30:36 -0000 Author: kib Date: Thu Aug 3 07:30:35 2017 New Revision: 321978 URL: https://svnweb.freebsd.org/changeset/base/321978 Log: MFC r321627: Make it possible to request nosys logging to console. Modified: stable/11/sys/kern/kern_sig.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_sig.c ============================================================================== --- stable/11/sys/kern/kern_sig.c Thu Aug 3 07:28:54 2017 (r321977) +++ stable/11/sys/kern/kern_sig.c Thu Aug 3 07:30:35 2017 (r321978) @@ -3595,9 +3595,14 @@ nosys(td, args) PROC_LOCK(p); tdsignal(td, SIGSYS); PROC_UNLOCK(p); - if (kern_lognosys) + if (kern_lognosys == 1 || kern_lognosys == 3) { uprintf("pid %d comm %s: nosys %d\n", p->p_pid, p->p_comm, td->td_sa.code); + } + if (kern_lognosys == 2 || kern_lognosys == 3) { + printf("pid %d comm %s: nosys %d\n", p->p_pid, p->p_comm, + td->td_sa.code); + } return (ENOSYS); } From owner-svn-src-all@freebsd.org Thu Aug 3 07:42:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 491D9DCED1D; Thu, 3 Aug 2017 07:42:09 +0000 (UTC) (envelope-from remko@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18A5E6B5A3; Thu, 3 Aug 2017 07:42:09 +0000 (UTC) (envelope-from remko@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v737g8sf095836; Thu, 3 Aug 2017 07:42:08 GMT (envelope-from remko@FreeBSD.org) Received: (from remko@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v737g8KJ095835; Thu, 3 Aug 2017 07:42:08 GMT (envelope-from remko@FreeBSD.org) Message-Id: <201708030742.v737g8KJ095835@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: remko set sender to remko@FreeBSD.org using -f From: Remko Lodder Date: Thu, 3 Aug 2017 07:42:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321979 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: remko X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 321979 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 07:42:09 -0000 Author: remko Date: Thu Aug 3 07:42:08 2017 New Revision: 321979 URL: https://svnweb.freebsd.org/changeset/base/321979 Log: Update the entry for postmaster@ Reviewed by: dhw Modified: head/share/misc/organization.dot Modified: head/share/misc/organization.dot ============================================================================== --- head/share/misc/organization.dot Thu Aug 3 07:30:35 2017 (r321978) +++ head/share/misc/organization.dot Thu Aug 3 07:42:08 2017 (r321979) @@ -50,7 +50,7 @@ dnsadm [label="DNS Administrators\ndnsadm@FreeBSD.org\ mirroradmin [label="FTP/WWW Mirror Site Coordinators\nmirror-admin@FreeBSD.org\nkuriyama, kensmith"] ncvs [label="CVS src Repository Managers\nncvs@FreeBSD.org\njoe, kuriyama, markm,\nsimon, peter"] perforceadmin [label="Perforce Repository Administrators\nperforce-admin@FreeBSD.org\nscottl, kensmith, gordon,\nrwatson, peter, dhw"] -postmaster [label="Postmaster Team\npostmaster@FreeBSD.org\njmb, brd, sahil, dhw"] +postmaster [label="Postmaster Team\npostmaster@FreeBSD.org\ndhw, ler, pi, rea, remko, zi"] refadm [label="Reference Systems Administrators\nrefadm@FreeBSD.org\njake, billf, markm, simon,\nobrien, ps, kensmith,\npeter, dhw"] webmaster [label="Webmaster Team\nwebmaster@FreeBSD.org\ngjb, wblock, blackend,\ngabor, hrs, wosch"] From owner-svn-src-all@freebsd.org Thu Aug 3 07:50:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67E64DCF168; Thu, 3 Aug 2017 07:50:47 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 42ABE6BAF0; Thu, 3 Aug 2017 07:50:47 +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 v737ok9Z098303; Thu, 3 Aug 2017 07:50:46 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v737okWI098302; Thu, 3 Aug 2017 07:50:46 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708030750.v737okWI098302@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Aug 2017 07:50:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321980 - stable/11/sys/dev/usb/wlan X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/usb/wlan X-SVN-Commit-Revision: 321980 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 07:50:47 -0000 Author: hselasky Date: Thu Aug 3 07:50:46 2017 New Revision: 321980 URL: https://svnweb.freebsd.org/changeset/base/321980 Log: MFC r321722: Properly range check length of parsed information elements in RSU driver. Found by: Ilja van Sprundel Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/usb/wlan/if_rsu.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- stable/11/sys/dev/usb/wlan/if_rsu.c Thu Aug 3 07:42:08 2017 (r321979) +++ stable/11/sys/dev/usb/wlan/if_rsu.c Thu Aug 3 07:50:46 2017 (r321980) @@ -1481,6 +1481,8 @@ rsu_hwrssi_to_rssi(struct rsu_softc *sc, int hw_rssi) return (v); } +CTASSERT(MCLBYTES > sizeof(struct ieee80211_frame)); + static void rsu_event_survey(struct rsu_softc *sc, uint8_t *buf, int len) { @@ -1489,28 +1491,31 @@ rsu_event_survey(struct rsu_softc *sc, uint8_t *buf, i struct ndis_wlan_bssid_ex *bss; struct ieee80211_rx_stats rxs; struct mbuf *m; - int pktlen; + uint32_t ieslen; + uint32_t pktlen; if (__predict_false(len < sizeof(*bss))) return; bss = (struct ndis_wlan_bssid_ex *)buf; - if (__predict_false(len < sizeof(*bss) + le32toh(bss->ieslen))) + ieslen = le32toh(bss->ieslen); + /* range check length of information element */ + if (__predict_false(ieslen > (uint32_t)(len - sizeof(*bss)))) return; RSU_DPRINTF(sc, RSU_DEBUG_SCAN, "%s: found BSS %s: len=%d chan=%d inframode=%d " "networktype=%d privacy=%d, RSSI=%d\n", __func__, - ether_sprintf(bss->macaddr), le32toh(bss->len), + ether_sprintf(bss->macaddr), ieslen, le32toh(bss->config.dsconfig), le32toh(bss->inframode), le32toh(bss->networktype), le32toh(bss->privacy), le32toh(bss->rssi)); /* Build a fake beacon frame to let net80211 do all the parsing. */ /* XXX TODO: just call the new scan API methods! */ - pktlen = sizeof(*wh) + le32toh(bss->ieslen); - if (__predict_false(pktlen > MCLBYTES)) + if (__predict_false(ieslen > (size_t)(MCLBYTES - sizeof(*wh)))) return; + pktlen = sizeof(*wh) + ieslen; m = m_get2(pktlen, M_NOWAIT, MT_DATA, M_PKTHDR); if (__predict_false(m == NULL)) return; @@ -1523,7 +1528,7 @@ rsu_event_survey(struct rsu_softc *sc, uint8_t *buf, i IEEE80211_ADDR_COPY(wh->i_addr2, bss->macaddr); IEEE80211_ADDR_COPY(wh->i_addr3, bss->macaddr); *(uint16_t *)wh->i_seq = 0; - memcpy(&wh[1], (uint8_t *)&bss[1], le32toh(bss->ieslen)); + memcpy(&wh[1], (uint8_t *)&bss[1], ieslen); /* Finalize mbuf. */ m->m_pkthdr.len = m->m_len = pktlen; @@ -2621,6 +2626,8 @@ rsu_fw_loadsection(struct rsu_softc *sc, const uint8_t return (0); } +CTASSERT(sizeof(size_t) >= sizeof(uint32_t)); + static int rsu_load_firmware(struct rsu_softc *sc) { @@ -2628,7 +2635,7 @@ rsu_load_firmware(struct rsu_softc *sc) struct r92s_fw_priv *dmem; struct ieee80211com *ic = &sc->sc_ic; const uint8_t *imem, *emem; - int imemsz, ememsz; + uint32_t imemsz, ememsz; const struct firmware *fw; size_t size; uint32_t reg; @@ -2679,7 +2686,8 @@ rsu_load_firmware(struct rsu_softc *sc) imemsz = le32toh(hdr->imemsz); ememsz = le32toh(hdr->sramsz); /* Check that all FW sections fit in image. */ - if (size < sizeof(*hdr) + imemsz + ememsz) { + if (imemsz > (size_t)(size - sizeof(*hdr)) || + ememsz > (size_t)(size - sizeof(*hdr) - imemsz)) { device_printf(sc->sc_dev, "firmware too short\n"); error = EINVAL; goto fail; From owner-svn-src-all@freebsd.org Thu Aug 3 07:56:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 618A6DCF576; Thu, 3 Aug 2017 07:56:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C01E6BEC7; Thu, 3 Aug 2017 07:56:40 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v737udQW002192; Thu, 3 Aug 2017 07:56:39 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v737udi4002191; Thu, 3 Aug 2017 07:56:39 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708030756.v737udi4002191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Aug 2017 07:56:39 +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: r321981 - stable/10/sys/dev/usb/wlan X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/dev/usb/wlan X-SVN-Commit-Revision: 321981 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 07:56:40 -0000 Author: hselasky Date: Thu Aug 3 07:56:39 2017 New Revision: 321981 URL: https://svnweb.freebsd.org/changeset/base/321981 Log: MFC r321722: Properly range check length of parsed information elements in RSU driver. Found by: Ilja van Sprundel Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/usb/wlan/if_rsu.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_rsu.c Thu Aug 3 07:50:46 2017 (r321980) +++ stable/10/sys/dev/usb/wlan/if_rsu.c Thu Aug 3 07:56:39 2017 (r321981) @@ -1126,6 +1126,8 @@ rsu_disconnect(struct rsu_softc *sc) return (rsu_fw_cmd(sc, R92S_CMD_DISCONNECT, &zero, sizeof(zero))); } +CTASSERT(MCLBYTES > sizeof(struct ieee80211_frame)); + static void rsu_event_survey(struct rsu_softc *sc, uint8_t *buf, int len) { @@ -1135,34 +1137,30 @@ rsu_event_survey(struct rsu_softc *sc, uint8_t *buf, i struct ieee80211_channel *c; struct ndis_wlan_bssid_ex *bss; struct mbuf *m; - int pktlen; + uint32_t ieslen; + uint32_t pktlen; if (__predict_false(len < sizeof(*bss))) return; bss = (struct ndis_wlan_bssid_ex *)buf; - if (__predict_false(len < sizeof(*bss) + le32toh(bss->ieslen))) + ieslen = le32toh(bss->ieslen); + /* range check length of information element */ + if (__predict_false(ieslen > (uint32_t)(len - sizeof(*bss)))) return; DPRINTFN(2, "found BSS %s: len=%d chan=%d inframode=%d " "networktype=%d privacy=%d\n", - ether_sprintf(bss->macaddr), le32toh(bss->len), + ether_sprintf(bss->macaddr), ieslen, le32toh(bss->config.dsconfig), le32toh(bss->inframode), le32toh(bss->networktype), le32toh(bss->privacy)); /* Build a fake beacon frame to let net80211 do all the parsing. */ - pktlen = sizeof(*wh) + le32toh(bss->ieslen); - if (__predict_false(pktlen > MCLBYTES)) + if (__predict_false(ieslen > (size_t)(MCLBYTES - sizeof(*wh)))) return; - MGETHDR(m, M_NOWAIT, MT_DATA); + pktlen = sizeof(*wh) + ieslen; + m = m_get2(pktlen, M_NOWAIT, MT_DATA, M_PKTHDR); if (__predict_false(m == NULL)) return; - if (pktlen > MHLEN) { - MCLGET(m, M_NOWAIT); - if (!(m->m_flags & M_EXT)) { - m_free(m); - return; - } - } wh = mtod(m, struct ieee80211_frame *); wh->i_fc[0] = IEEE80211_FC0_VERSION_0 | IEEE80211_FC0_TYPE_MGT | IEEE80211_FC0_SUBTYPE_BEACON; @@ -1172,7 +1170,7 @@ rsu_event_survey(struct rsu_softc *sc, uint8_t *buf, i IEEE80211_ADDR_COPY(wh->i_addr2, bss->macaddr); IEEE80211_ADDR_COPY(wh->i_addr3, bss->macaddr); *(uint16_t *)wh->i_seq = 0; - memcpy(&wh[1], (uint8_t *)&bss[1], le32toh(bss->ieslen)); + memcpy(&wh[1], (uint8_t *)&bss[1], ieslen); /* Finalize mbuf. */ m->m_pkthdr.len = m->m_len = pktlen; @@ -2123,13 +2121,15 @@ rsu_fw_loadsection(struct rsu_softc *sc, const uint8_t return (0); } +CTASSERT(sizeof(size_t) >= sizeof(uint32_t)); + static int rsu_load_firmware(struct rsu_softc *sc) { const struct r92s_fw_hdr *hdr; struct r92s_fw_priv *dmem; const uint8_t *imem, *emem; - int imemsz, ememsz; + uint32_t imemsz, ememsz; const struct firmware *fw; size_t size; uint32_t reg; @@ -2178,7 +2178,8 @@ rsu_load_firmware(struct rsu_softc *sc) imemsz = le32toh(hdr->imemsz); ememsz = le32toh(hdr->sramsz); /* Check that all FW sections fit in image. */ - if (size < sizeof(*hdr) + imemsz + ememsz) { + if (imemsz > (size_t)(size - sizeof(*hdr)) || + ememsz > (size_t)(size - sizeof(*hdr) - imemsz)) { device_printf(sc->sc_dev, "firmware too short\n"); error = EINVAL; goto fail; From owner-svn-src-all@freebsd.org Thu Aug 3 07:57:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 802CEDCF6A7; Thu, 3 Aug 2017 07:57:54 +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 23F896C01C; Thu, 3 Aug 2017 07:57:53 +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 v737vmOh094754 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 3 Aug 2017 10:57:48 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v737vmOh094754 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v737vlGd094752; Thu, 3 Aug 2017 10:57:47 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 3 Aug 2017 10:57:47 +0300 From: Konstantin Belousov To: Bruce Evans Cc: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r321920 - head/sys/sys Message-ID: <20170803075747.GJ1700@kib.kiev.ua> References: <201708021014.v72AEHEk061037@repo.freebsd.org> <37abc595-c80e-a8da-04a8-815f42c634de@selasky.org> <20170802135455.GG1700@kib.kiev.ua> <20170803122015.Q1093@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170803122015.Q1093@besplex.bde.org> User-Agent: Mutt/1.8.3 (2017-05-23) 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 07:57:54 -0000 On Thu, Aug 03, 2017 at 01:21:56PM +1000, Bruce Evans wrote: > It would be better to remove the comments. > > makedev() actually has a man page (a FreeBSD addition makedev(3)). > This could have been better, and is now out of date. The largest error > is that major() is still documented to return a value between 0 and > 255. This reduction prevented makedev() being the inverse of > major()+minor() on arbitrary args. The man page doesn't claim that > it is, and barely gives a hint that makedev() can be used to synthesize > a dev_t from (x, y) provided 0 <= x <= 255. See below. diff --git a/share/man/man3/makedev.3 b/share/man/man3/makedev.3 index 87ca953dc79..a54d0590bc5 100644 --- a/share/man/man3/makedev.3 +++ b/share/man/man3/makedev.3 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 28, 2008 +.Dd August 3, 2017 .Dt MAKEDEV 3 .Os .Sh NAME @@ -54,11 +54,18 @@ and .Fn minor macros can be used to obtain the original numbers from the device number .Fa dev . +In other words, for a value +.Va dev +of the type +.Vt dev_t , +the assertion +.Dl dev == makedev(major(dev), minor(dev)) +is valid. .Pp In previous implementations of .Fx all block and character devices were uniquely identified by a pair of -major and minor numbers. +stable major and minor numbers. The major number referred to a certain device class (e.g. disks, TTYs) while the minor number identified an instance within the device class. Later versions of @@ -66,7 +73,8 @@ Later versions of automatically generate a unique device number for each character device visible in .Pa /dev/ . -These numbers are not divided in device classes. +These numbers are not divided in device classes and are not guaranteed +to be stable upon reboot or driver reload. .Pp On .Fx @@ -78,11 +86,9 @@ conventional way. .Sh RETURN VALUES The .Fn major -macro returns a device major number that has a value between 0 and 255. -The +and .Fn minor -macro returns a device minor number whose value can span the complete -range of an +macros return numbers whose value can span the complete range of an .Vt int . .Sh SEE ALSO .Xr mknod 2 , diff --git a/sys/sys/types.h b/sys/sys/types.h index 30a08724443..8ea6e146e08 100644 --- a/sys/sys/types.h +++ b/sys/sys/types.h @@ -364,9 +364,9 @@ __bitcount64(__uint64_t _x) #include -#define major(x) ((int)((dev_t)(x) >> 32)) /* major number */ -#define minor(x) ((int)((x) & 0xffffffff)) /* minor number */ -#define makedev(x, y) (((dev_t)(x) << 32) | (unsigned)(y)) /* create dev_t */ +#define major(x) ((int)((dev_t)(x) >> 32)) +#define minor(x) ((int)((x) & 0xffffffff)) +#define makedev(x, y) (((dev_t)(x) << 32) | (unsigned)(y)) /* * These declarations belong elsewhere, but are repeated here and in From owner-svn-src-all@freebsd.org Thu Aug 3 08:03:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF16ADCFCDC; Thu, 3 Aug 2017 08:03:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9DBD66C5AC; Thu, 3 Aug 2017 08:03:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7383M6g006505; Thu, 3 Aug 2017 08:03:22 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7383M5g006504; Thu, 3 Aug 2017 08:03:22 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708030803.v7383M5g006504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Aug 2017 08:03:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321982 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321982 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 08:03:23 -0000 Author: hselasky Date: Thu Aug 3 08:03:22 2017 New Revision: 321982 URL: https://svnweb.freebsd.org/changeset/base/321982 Log: Add myself to the calendar. Requested by: mckusick Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Thu Aug 3 07:56:39 2017 (r321981) +++ head/usr.bin/calendar/calendars/calendar.freebsd Thu Aug 3 08:03:22 2017 (r321982) @@ -176,6 +176,7 @@ 05/14 Tatsumi Hosokawa born in Tokyo, Japan, 1968 05/14 Shigeyuku Fukushima born in Osaka, Japan, 1974 05/14 Bruce Cran born in Cambridge, United Kingdom, 1981 +05/15 Hans Petter Selasky born in Flekkefjord, Norway, 1982 05/16 Johann Kois born in Wolfsberg, Austria, 1975 05/16 Marcus Alves Grando born in Florianopolis, Santa Catarina, Brazil, 1979 05/17 Thomas Abthorpe born in Port Arthur, Ontario, Canada, 1968 From owner-svn-src-all@freebsd.org Thu Aug 3 08:05:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79839DCFE27; Thu, 3 Aug 2017 08:05:02 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3EDCE6C71C; Thu, 3 Aug 2017 08:05:01 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 40543260616; Thu, 3 Aug 2017 10:04:59 +0200 (CEST) Subject: Re: svn commit: r321920 - head/sys/sys To: Konstantin Belousov , Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201708021014.v72AEHEk061037@repo.freebsd.org> <37abc595-c80e-a8da-04a8-815f42c634de@selasky.org> <20170802135455.GG1700@kib.kiev.ua> <20170803122015.Q1093@besplex.bde.org> <20170803075747.GJ1700@kib.kiev.ua> From: Hans Petter Selasky Message-ID: Date: Thu, 3 Aug 2017 10:02:48 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20170803075747.GJ1700@kib.kiev.ua> 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 08:05:02 -0000 On 08/03/17 09:57, Konstantin Belousov wrote: > .Xr mknod 2 , Should mknod be removed from base or stubbed in light of the more recent devfs ? --HPS From owner-svn-src-all@freebsd.org Thu Aug 3 08:13:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39DADDD0253; Thu, 3 Aug 2017 08:13:33 +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 C1FB76CB66; Thu, 3 Aug 2017 08:13:32 +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 v738DS1R098118 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 3 Aug 2017 11:13:28 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v738DS1R098118 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v738DSEZ098117; Thu, 3 Aug 2017 11:13:28 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 3 Aug 2017 11:13:28 +0300 From: Konstantin Belousov To: Hans Petter Selasky Cc: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r321920 - head/sys/sys Message-ID: <20170803081328.GL1700@kib.kiev.ua> References: <201708021014.v72AEHEk061037@repo.freebsd.org> <37abc595-c80e-a8da-04a8-815f42c634de@selasky.org> <20170802135455.GG1700@kib.kiev.ua> <20170803122015.Q1093@besplex.bde.org> <20170803075747.GJ1700@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.3 (2017-05-23) 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 08:13:33 -0000 On Thu, Aug 03, 2017 at 10:02:48AM +0200, Hans Petter Selasky wrote: > On 08/03/17 09:57, Konstantin Belousov wrote: > > .Xr mknod 2 , > > Should mknod be removed from base or stubbed in light of the more recent > devfs ? mknod is used on devfs as a way to 'undelete' devfs node. You may do rm /dev/node and then mknod /dev/node ... would restore it. Also, for UFS or other filesystems which are exported by NFS, mknod is useful to provide device nodes for non-FreeBSD clients. From owner-svn-src-all@freebsd.org Thu Aug 3 08:24:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BC24DD08D7; Thu, 3 Aug 2017 08:24:44 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 63FB86D099; Thu, 3 Aug 2017 08:24:44 +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 mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 3DE7842A7FA; Thu, 3 Aug 2017 17:53:45 +1000 (AEST) Date: Thu, 3 Aug 2017 17:53:43 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ngie Cooper cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r321969 - in head/sys/boot: arm/at91/libat91 arm/ixp425/boot2 i386/boot2 In-Reply-To: <201708030527.v735R5dg041043@repo.freebsd.org> Message-ID: <20170803173421.C2203@besplex.bde.org> References: <201708030527.v735R5dg041043@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=KeqiiUQD c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=WiSNjSlbGeYnkCD5ExAA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 08:24:44 -0000 On Thu, 3 Aug 2017, Ngie Cooper wrote: > Log: > Fix the return types for printf and putchar to match their libc and > POSIX equivalents > > Both printf and putchar return int, not void. > > This will allow code that leverages the libcalls and checks/rely on the > return type to interchangeably between loader code and non-loader > code. > > MFC after: 1 month > > Modified: > head/sys/boot/arm/at91/libat91/lib.h > head/sys/boot/arm/at91/libat91/printf.c > head/sys/boot/arm/at91/libat91/putchar.c > head/sys/boot/arm/ixp425/boot2/ixp425_board.c > head/sys/boot/arm/ixp425/boot2/lib.h > head/sys/boot/i386/boot2/boot2.c This is wrong for at least i386/boot2. It isn't part of the loader, and saves space by not returning unused values. > Modified: head/sys/boot/i386/boot2/boot2.c > ============================================================================== > --- head/sys/boot/i386/boot2/boot2.c Thu Aug 3 03:45:48 2017 (r321968) > +++ head/sys/boot/i386/boot2/boot2.c Thu Aug 3 05:27:05 2017 (r321969) > @@ -114,8 +114,8 @@ void exit(int); > static void load(void); > static int parse(void); > static int dskread(void *, unsigned, unsigned); > -static void printf(const char *,...); > -static void putchar(int); > +static int printf(const char *,...); > +static int putchar(int); These are freestanding static functions, so they have nothing to do with library functions except their name is a hint that they are similar. Since they are static, -funit-at-a-time might allow the unused return values to be optimized away. Then returning unused values would be just an obfuscation. This file still has a static memcpy() which is quite different from the libc version. It doesn't return an unused value, and its arg types are all different (no newfangled size_t or newerfangled restrict). Freestanding versions (static and otherwise) cause problems with builtins. -ffreestanding turns off all builtins. The static memcpy used to be ifdefed so as to use __builtin_memcpy instead of the static one if the compiler is gcc. That apparently broke with gcc-4.2, since the builtin will call libc memcpy() in some cases, although memcpy() is unavailable in the freestanding case. Bruce From owner-svn-src-all@freebsd.org Thu Aug 3 09:11:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38794DD28EA; Thu, 3 Aug 2017 09:11:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F352E6E9C6; Thu, 3 Aug 2017 09:11:52 +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 v739Bqpf033839; Thu, 3 Aug 2017 09:11:52 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v739Bqhk033838; Thu, 3 Aug 2017 09:11:52 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708030911.v739Bqhk033838@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Aug 2017 09:11:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321983 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 321983 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 09:11:53 -0000 Author: hselasky Date: Thu Aug 3 09:11:51 2017 New Revision: 321983 URL: https://svnweb.freebsd.org/changeset/base/321983 Log: Using GFP_ATOMIC with firmware commands is not supported after busdma was introduced in the mlx5core, because busdma might sleep when loading memory into DMA. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Thu Aug 3 08:03:22 2017 (r321982) +++ head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Thu Aug 3 09:11:51 2017 (r321983) @@ -1434,12 +1434,11 @@ static int cmd_exec_helper(struct mlx5_core_dev *dev, struct mlx5_cmd_msg *inb; struct mlx5_cmd_msg *outb; int pages_queue; - gfp_t gfp; + const gfp_t gfp = GFP_KERNEL; int err; u8 status = 0; pages_queue = is_manage_pages(in); - gfp = callback ? GFP_ATOMIC : GFP_KERNEL; inb = alloc_msg(dev, in_size, gfp); if (IS_ERR(inb)) { From owner-svn-src-all@freebsd.org Thu Aug 3 09:14:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A944CDD2AAD; Thu, 3 Aug 2017 09:14:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 75EED6EC13; Thu, 3 Aug 2017 09:14:44 +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 v739Ehm6034699; Thu, 3 Aug 2017 09:14:43 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v739Ehds034698; Thu, 3 Aug 2017 09:14:43 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708030914.v739Ehds034698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Aug 2017 09:14:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321984 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 321984 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 09:14:44 -0000 Author: hselasky Date: Thu Aug 3 09:14:43 2017 New Revision: 321984 URL: https://svnweb.freebsd.org/changeset/base/321984 Log: Resolve locking issue for non-sleepable context in the mlx5core. Code inspection reveals the busdma unload and free functions do not write to the belonging dma tag and does not need to be serialized. This allows mlx5_fwp_free() to be called from software interrupt context. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c Thu Aug 3 09:11:51 2017 (r321983) +++ head/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c Thu Aug 3 09:14:43 2017 (r321984) @@ -190,13 +190,10 @@ mlx5_fwp_free(struct mlx5_fw_page *fwp) num = fwp->numpages; dev = fwp->dev; - /* serialize unloading the DMA maps */ - sx_xlock(&dev->cmd.dma_sx); while (num--) { bus_dmamap_unload(dev->cmd.dma_tag, fwp[num].dma_map); bus_dmamem_free(dev->cmd.dma_tag, fwp[num].virt_addr, fwp[num].dma_map); } - sx_xunlock(&dev->cmd.dma_sx); kfree(fwp); } From owner-svn-src-all@freebsd.org Thu Aug 3 09:18:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6689BDD2D14; Thu, 3 Aug 2017 09:18:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C61A6EE17; Thu, 3 Aug 2017 09:18:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v739IPbo034867; Thu, 3 Aug 2017 09:18:25 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v739IPVY034866; Thu, 3 Aug 2017 09:18:25 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708030918.v739IPVY034866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Aug 2017 09:18:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321985 - head/sys/ofed/drivers/infiniband/core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/ofed/drivers/infiniband/core X-SVN-Commit-Revision: 321985 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 09:18:26 -0000 Author: hselasky Date: Thu Aug 3 09:18:25 2017 New Revision: 321985 URL: https://svnweb.freebsd.org/changeset/base/321985 Log: Ticks are 32-bit in FreeBSD. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/ofed/drivers/infiniband/core/addr.c Modified: head/sys/ofed/drivers/infiniband/core/addr.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/addr.c Thu Aug 3 09:14:43 2017 (r321984) +++ head/sys/ofed/drivers/infiniband/core/addr.c Thu Aug 3 09:18:25 2017 (r321985) @@ -187,10 +187,10 @@ EXPORT_SYMBOL(rdma_translate_ip); static void set_timeout(unsigned long time) { - unsigned long delay; + int delay; /* under FreeBSD ticks are 32-bit */ delay = time - jiffies; - if ((long)delay <= 0) + if (delay <= 0) delay = 1; mod_delayed_work(addr_wq, &work, delay); From owner-svn-src-all@freebsd.org Thu Aug 3 09:31:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08C09DD36E4; Thu, 3 Aug 2017 09:31:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C88EC6F82E; Thu, 3 Aug 2017 09:31:11 +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 v739VAvX042290; Thu, 3 Aug 2017 09:31:10 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v739VAfg042289; Thu, 3 Aug 2017 09:31:10 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708030931.v739VAfg042289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Aug 2017 09:31:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321986 - head/sys/ofed/drivers/infiniband/core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/ofed/drivers/infiniband/core X-SVN-Commit-Revision: 321986 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 09:31:12 -0000 Author: hselasky Date: Thu Aug 3 09:31:10 2017 New Revision: 321986 URL: https://svnweb.freebsd.org/changeset/base/321986 Log: Change reject message type when destroying cm_id in ibore. This patch fixes an interopability issue between FreeBSD and non-FreeBSD systems when the connection establishment is aborted. Refer to the initial commit in Linux, drivers/infiniband/core/cm.c, for a more detailed description. Obtained from: Linux MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/ofed/drivers/infiniband/core/cm.c Modified: head/sys/ofed/drivers/infiniband/core/cm.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/cm.c Thu Aug 3 09:18:25 2017 (r321985) +++ head/sys/ofed/drivers/infiniband/core/cm.c Thu Aug 3 09:31:10 2017 (r321986) @@ -889,6 +889,7 @@ retest: cm_reject_sidr_req(cm_id_priv, IB_SIDR_REJECT); break; case IB_CM_REQ_SENT: + case IB_CM_MRA_REQ_RCVD: ib_cancel_mad(cm_id_priv->av.port->mad_agent, cm_id_priv->msg); spin_unlock_irq(&cm_id_priv->lock); ib_send_cm_rej(cm_id, IB_CM_REJ_TIMEOUT, @@ -907,7 +908,6 @@ retest: NULL, 0, NULL, 0); } break; - case IB_CM_MRA_REQ_RCVD: case IB_CM_REP_SENT: case IB_CM_MRA_REP_RCVD: ib_cancel_mad(cm_id_priv->av.port->mad_agent, cm_id_priv->msg); From owner-svn-src-all@freebsd.org Thu Aug 3 09:35:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A59ADD3A71; Thu, 3 Aug 2017 09:35:00 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 054FC6FABC; Thu, 3 Aug 2017 09:34:59 +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 mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 409F24283EE; Thu, 3 Aug 2017 19:34:57 +1000 (AEST) Date: Thu, 3 Aug 2017 19:34:56 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: Bruce Evans , Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r321920 - head/sys/sys In-Reply-To: <20170803075747.GJ1700@kib.kiev.ua> Message-ID: <20170803180419.R2314@besplex.bde.org> References: <201708021014.v72AEHEk061037@repo.freebsd.org> <37abc595-c80e-a8da-04a8-815f42c634de@selasky.org> <20170802135455.GG1700@kib.kiev.ua> <20170803122015.Q1093@besplex.bde.org> <20170803075747.GJ1700@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=VbSHBBh9 c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=Ny7lnamD2apBV3MTSKcA:9 a=McBudY7oVUTvH_Sq:21 a=J-jyvF9bBr_6Nz8R:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 09:35:00 -0000 On Thu, 3 Aug 2017, Konstantin Belousov wrote: > On Thu, Aug 03, 2017 at 01:21:56PM +1000, Bruce Evans wrote: >> It would be better to remove the comments. >> >> makedev() actually has a man page (a FreeBSD addition makedev(3)). >> This could have been better, and is now out of date. The largest error >> is that major() is still documented to return a value between 0 and >> 255. This reduction prevented makedev() being the inverse of >> major()+minor() on arbitrary args. The man page doesn't claim that >> it is, and barely gives a hint that makedev() can be used to synthesize >> a dev_t from (x, y) provided 0 <= x <= 255. > > See below. > > diff --git a/share/man/man3/makedev.3 b/share/man/man3/makedev.3 > index 87ca953dc79..a54d0590bc5 100644 > --- a/share/man/man3/makedev.3 > +++ b/share/man/man3/makedev.3 > ... > @@ -54,11 +54,18 @@ and > .Fn minor > macros can be used to obtain the original numbers from the device number Problems with old wording: - "can be used" is too informal. Before this, makedev() is described as "allows" something. "allow" is almost never used in share/man3/*, even in the sense of giving permission. Only pthread man pages have many instances of this bug. - "original" is an anachronism. The major and minor used to be the original numbers, but now it is the dev_t that is original except when the dev_t is synthesized. "original" might also mean "original representation". Fixes: "can be used to obtain" is just a verbose spelling of "return". "allows" can be improved using "returns" too, and it would be good to shorten "a unique device number to be generated based on" to something that says less about the one to one correspondence. "generation" is just a special case of applying the correspondence to get an alternative representation. "original" is also related to the correspondence. Perhaps describe the correspondence first and then only say that the functions are the ones that implement it. > .Fa dev . > +In other words, for a value > +.Va dev > +of the type > +.Vt dev_t , > +the assertion > +.Dl dev == makedev(major(dev), minor(dev)) > +is valid. This describes the correspondence in another way. Pehaps delete all details about what the functions do in ther previous description and say that they are defined by this property. I think the inverse property also needs to be spelled out. It is that for (int ma, int mi) .Dl ma = major(makedev(ma, mi)) .Dl mi = minor(makedev(ma, mi)) > .Pp > In previous implementations of > .Fx > all block and character devices were uniquely identified by a pair of > -major and minor numbers. > +stable major and minor numbers. "stable" is clarified later, but is hard to understand in context. > The major number referred to a certain device class (e.g. disks, TTYs) > while the minor number identified an instance within the device class. > Later versions of > @@ -66,7 +73,8 @@ Later versions of > automatically generate a unique device number for each character device > visible in > .Pa /dev/ . > -These numbers are not divided in device classes. > +These numbers are not divided in device classes and are not guaranteed > +to be stable upon reboot or driver reload. They used to be stable across even more than reboot. They were kept in file systems, and that required them to be stable across OS versions in practice. > .Pp > On > .Fx > @@ -78,11 +86,9 @@ conventional way. > .Sh RETURN VALUES > The > .Fn major > -macro returns a device major number that has a value between 0 and 255. > -The > +and > .Fn minor > -macro returns a device minor number whose value can span the complete > -range of an > +macros return numbers whose value can span the complete range of an > .Vt int . > .Sh SEE ALSO > .Xr mknod 2 , > diff --git a/sys/sys/types.h b/sys/sys/types.h > index 30a08724443..8ea6e146e08 100644 > --- a/sys/sys/types.h > +++ b/sys/sys/types.h > @@ -364,9 +364,9 @@ __bitcount64(__uint64_t _x) > > #include > > -#define major(x) ((int)((dev_t)(x) >> 32)) /* major number */ > -#define minor(x) ((int)((x) & 0xffffffff)) /* minor number */ > -#define makedev(x, y) (((dev_t)(x) << 32) | (unsigned)(y)) /* create dev_t */ > +#define major(x) ((int)((dev_t)(x) >> 32)) > +#define minor(x) ((int)((x) & 0xffffffff)) > +#define makedev(x, y) (((dev_t)(x) << 32) | (unsigned)(y)) I see another problem. Masking with 0xfffffffff and casting to unsigned are gratuitously different spellings for extracting the low 32 bits. I prefer the cast. It only works if ints have 32 bits, but we assume that for other reasons. The mask is especially hard to understand for the 1's complement case. We avoid complications with dodgy args for major() by casting the arg to dev_t. For minor(), the behaviour is only clear if x is unsigned (it should be dev_t), or int or lower rank unsigned and typeof(0xffffffff) == unsigned (true with 32-bit ints). In the second case, the default promotions convert x to unsigned. -0 becomes 0U which probably breaks it on 1's complement systems, but -0L doesn't change, which is hard to understand. To avoid complications, we could cast to dev_t, but that is verbose, or to unsigned, but then the mask is redundant if ints are 32 bits. For makedev() we, do just cast to unsigned and assume 32 bits. > > /* > * These declarations belong elsewhere, but are repeated here and in > Bruce From owner-svn-src-all@freebsd.org Thu Aug 3 10:10:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B962DDD4E91; Thu, 3 Aug 2017 10:10:21 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 606E470A69; Thu, 3 Aug 2017 10:10:21 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v73AAKr8055735; Thu, 3 Aug 2017 10:10:20 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73AAKgn055733; Thu, 3 Aug 2017 10:10:20 GMT (envelope-from des@FreeBSD.org) Message-Id: <201708031010.v73AAKgn055733@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Thu, 3 Aug 2017 10:10:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r321987 - in vendor-crypto/openssh/dist: . contrib/cygwin contrib/redhat contrib/suse openbsd-compat regress regress/unittests regress/unittests/conversion regress/unittests/match regre... X-SVN-Group: vendor-crypto X-SVN-Commit-Author: des X-SVN-Commit-Paths: in vendor-crypto/openssh/dist: . contrib/cygwin contrib/redhat contrib/suse openbsd-compat regress regress/unittests regress/unittests/conversion regress/unittests/match regress/unittests/test_helper ... X-SVN-Commit-Revision: 321987 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 10:10:21 -0000 Author: des Date: Thu Aug 3 10:10:20 2017 New Revision: 321987 URL: https://svnweb.freebsd.org/changeset/base/321987 Log: Vendor import of OpenSSH 7.5p1. Added: vendor-crypto/openssh/dist/regress/unittests/conversion/ vendor-crypto/openssh/dist/regress/unittests/conversion/Makefile (contents, props changed) vendor-crypto/openssh/dist/regress/unittests/conversion/tests.c (contents, props changed) Modified: vendor-crypto/openssh/dist/ChangeLog vendor-crypto/openssh/dist/INSTALL vendor-crypto/openssh/dist/Makefile.in vendor-crypto/openssh/dist/README vendor-crypto/openssh/dist/auth-pam.c vendor-crypto/openssh/dist/auth2-pubkey.c vendor-crypto/openssh/dist/auth2.c vendor-crypto/openssh/dist/channels.c vendor-crypto/openssh/dist/channels.h vendor-crypto/openssh/dist/clientloop.c vendor-crypto/openssh/dist/compat.c vendor-crypto/openssh/dist/config.h.in vendor-crypto/openssh/dist/configure vendor-crypto/openssh/dist/configure.ac vendor-crypto/openssh/dist/contrib/cygwin/ssh-host-config vendor-crypto/openssh/dist/contrib/redhat/openssh.spec vendor-crypto/openssh/dist/contrib/suse/openssh.spec vendor-crypto/openssh/dist/digest-openssl.c vendor-crypto/openssh/dist/hostfile.c vendor-crypto/openssh/dist/kex.c vendor-crypto/openssh/dist/krl.c vendor-crypto/openssh/dist/log.c vendor-crypto/openssh/dist/match.c vendor-crypto/openssh/dist/match.h vendor-crypto/openssh/dist/misc.c vendor-crypto/openssh/dist/monitor.c vendor-crypto/openssh/dist/mux.c vendor-crypto/openssh/dist/openbsd-compat/bsd-misc.c vendor-crypto/openssh/dist/openbsd-compat/bsd-misc.h vendor-crypto/openssh/dist/openbsd-compat/fmt_scaled.c vendor-crypto/openssh/dist/packet.c vendor-crypto/openssh/dist/packet.h vendor-crypto/openssh/dist/pathnames.h vendor-crypto/openssh/dist/readconf.c vendor-crypto/openssh/dist/regress/Makefile vendor-crypto/openssh/dist/regress/agent-getpeereid.sh vendor-crypto/openssh/dist/regress/allow-deny-users.sh vendor-crypto/openssh/dist/regress/cert-file.sh vendor-crypto/openssh/dist/regress/forwarding.sh vendor-crypto/openssh/dist/regress/integrity.sh vendor-crypto/openssh/dist/regress/test-exec.sh vendor-crypto/openssh/dist/regress/unittests/Makefile vendor-crypto/openssh/dist/regress/unittests/match/tests.c vendor-crypto/openssh/dist/regress/unittests/test_helper/test_helper.c vendor-crypto/openssh/dist/regress/unittests/test_helper/test_helper.h vendor-crypto/openssh/dist/regress/unittests/utf8/tests.c vendor-crypto/openssh/dist/sandbox-seccomp-filter.c vendor-crypto/openssh/dist/servconf.c vendor-crypto/openssh/dist/serverloop.c vendor-crypto/openssh/dist/sftp-client.c vendor-crypto/openssh/dist/sftp.c vendor-crypto/openssh/dist/ssh-agent.c vendor-crypto/openssh/dist/ssh-keygen.c vendor-crypto/openssh/dist/ssh-keyscan.c vendor-crypto/openssh/dist/ssh.c vendor-crypto/openssh/dist/ssh_config.0 vendor-crypto/openssh/dist/ssh_config.5 vendor-crypto/openssh/dist/sshconnect.c vendor-crypto/openssh/dist/sshconnect1.c vendor-crypto/openssh/dist/sshconnect2.c vendor-crypto/openssh/dist/sshd.0 vendor-crypto/openssh/dist/sshd.8 vendor-crypto/openssh/dist/sshd.c vendor-crypto/openssh/dist/sshd_config vendor-crypto/openssh/dist/sshd_config.0 vendor-crypto/openssh/dist/sshd_config.5 vendor-crypto/openssh/dist/sshkey.c vendor-crypto/openssh/dist/sshkey.h vendor-crypto/openssh/dist/utf8.c vendor-crypto/openssh/dist/version.h Modified: vendor-crypto/openssh/dist/ChangeLog ============================================================================== --- vendor-crypto/openssh/dist/ChangeLog Thu Aug 3 09:31:10 2017 (r321986) +++ vendor-crypto/openssh/dist/ChangeLog Thu Aug 3 10:10:20 2017 (r321987) @@ -1,3 +1,1174 @@ +commit d38f05dbdd291212bc95ea80648b72b7177e9f4e +Author: Darren Tucker +Date: Mon Mar 20 13:38:27 2017 +1100 + + Add llabs() implementation. + +commit 72536316a219b7394996a74691a5d4ec197480f7 +Author: Damien Miller +Date: Mon Mar 20 12:23:04 2017 +1100 + + crank version numbers + +commit 3be52bc36bdfd24ded7e0f46999e7db520fb4e3f +Author: djm@openbsd.org +Date: Mon Mar 20 01:18:59 2017 +0000 + + upstream commit + + openssh-7.5 + + Upstream-ID: b8b9a4a949427c393cd868215e1724ceb3467ee5 + +commit db84e52fe9cfad57f22e7e23c5fbf00092385129 +Author: Damien Miller +Date: Mon Mar 20 12:07:20 2017 +1100 + + I'm a doofus. + + Unbreak obvious syntax error. + +commit 89f04852db27643717c9c3a2b0dde97ae50099ee +Author: Damien Miller +Date: Mon Mar 20 11:53:34 2017 +1100 + + on Cygwin, check paths from server for backslashes + + Pointed out by Jann Horn of Google Project Zero + +commit 7ef1f9bafc2cc8d97ff2fbd4f280002b6e8ea5d9 +Author: Damien Miller +Date: Mon Mar 20 11:48:34 2017 +1100 + + Yet another synonym for ASCII: "646" + + Used by NetBSD; this unbreaks mprintf() and friends there for the C + locale (caught by dtucker@ and his menagerie of test systems). + +commit 9165abfea3f68a0c684a6ed2e575e59bc31a3a6b +Author: Damien Miller +Date: Mon Mar 20 09:58:34 2017 +1100 + + create test mux socket in /tmp + + Creating the socket in $OBJ could blow past the (quite limited) + path limit for Unix domain sockets. As a bandaid for bz#2660, + reported by Colin Watson; ok dtucker@ + +commit 2adbe1e63bc313d03e8e84e652cc623af8ebb163 +Author: markus@openbsd.org +Date: Wed Mar 15 07:07:39 2017 +0000 + + upstream commit + + disallow KEXINIT before NEWKEYS; ok djm; report by + vegard.nossum at oracle.com + + Upstream-ID: 3668852d1f145050e62f1da08917de34cb0c5234 + +commit 2fbf91684d76d38b9cf06550b69c9e41bca5a71c +Author: Darren Tucker +Date: Thu Mar 16 14:05:46 2017 +1100 + + Include includes.h for compat bits. + +commit b55f634e96b9c5b0cd991e23a9ca181bec4bdbad +Author: Darren Tucker +Date: Thu Mar 16 13:45:17 2017 +1100 + + Wrap stdint.h in #ifdef HAVE_STDINT_H + +commit 55a1117d7342a0bf8b793250cf314bab6b482b99 +Author: Damien Miller +Date: Thu Mar 16 11:22:42 2017 +1100 + + Adapt Cygwin config script to privsep knob removal + + Patch from Corinna Vinschen. + +commit 1a321bfdb91defe3c4d9cca5651724ae167e5436 +Author: deraadt@openbsd.org +Date: Wed Mar 15 03:52:30 2017 +0000 + + upstream commit + + accidents happen to the best of us; ok djm + + Upstream-ID: b7a9dbd71011ffde95e06f6945fe7197dedd1604 + +commit 25f837646be8c2017c914d34be71ca435dfc0e07 +Author: djm@openbsd.org +Date: Wed Mar 15 02:25:09 2017 +0000 + + upstream commit + + fix regression in 7.4: deletion of PKCS#11-hosted keys + would fail unless they were specified by full physical pathname. Report and + fix from Jakub Jelen via bz#2682; ok dtucker@ + + Upstream-ID: 5b5bc20ca11cacb5d5eb29c3f93fd18425552268 + +commit a8c5eeacf032a7d3408957e45dd7603cc1baf55f +Author: djm@openbsd.org +Date: Wed Mar 15 02:19:09 2017 +0000 + + upstream commit + + Fix segfault when sshd attempts to load RSA1 keys (can + only happen when protocol v.1 support is enabled for the client). Reported by + Jakub Jelen in bz#2686; ok dtucker + + Upstream-ID: 8fdaec2ba4b5f65db1d094f6714ce64b25d871d7 + +commit 66705948c0639a7061a0d0753266da7685badfec +Author: djm@openbsd.org +Date: Tue Mar 14 07:19:07 2017 +0000 + + upstream commit + + Mark the sshd_config UsePrivilegeSeparation option as + deprecated, effectively making privsep mandatory in sandboxing mode. ok + markus@ deraadt@ + + (note: this doesn't remove the !privsep code paths, though that will + happen eventually). + + Upstream-ID: b4c52666256c4dd865f8ce9431af5d6ce2d74a0a + +commit f86586b03fe6cd8f595289bde200a94bc2c191af +Author: Damien Miller +Date: Tue Mar 14 18:26:29 2017 +1100 + + Make seccomp-bpf sandbox work on Linux/X32 + + Allow clock_gettime syscall with X32 bit masked off. Apparently + this is required for at least some kernel versions. bz#2142 + Patch mostly by Colin Watson. ok dtucker@ + +commit 2429cf78dd2a9741ce27ba25ac41c535274a0af6 +Author: Damien Miller +Date: Tue Mar 14 18:01:52 2017 +1100 + + require OpenSSL >=1.0.1 + +commit e3ea335abeab731c68f2b2141bee85a4b0bf680f +Author: Damien Miller +Date: Tue Mar 14 17:48:43 2017 +1100 + + Remove macro trickery; no binary change + + This stops the SC_ALLOW(), SC_ALLOW_ARG() and SC_DENY() macros + prepending __NR_ to the syscall number parameter and just makes + them explicit in the macro invocations. + + No binary change in stripped object file before/after. + +commit 5f1596e11d55539678c41f68aed358628d33d86f +Author: Damien Miller +Date: Tue Mar 14 13:15:18 2017 +1100 + + support ioctls for ICA crypto card on Linux/s390 + + Based on patch from Eduardo Barretto; ok dtucker@ + +commit b1b22dd0df2668b322dda174e501dccba2cf5c44 +Author: Darren Tucker +Date: Tue Mar 14 14:19:36 2017 +1100 + + Plumb conversion test into makefile. + +commit f57783f1ddfb4cdfbd612c6beb5ec01cb5b9a6b9 +Author: dtucker@openbsd.org +Date: Tue Mar 14 01:20:29 2017 +0000 + + upstream commit + + Add unit test for convtime(). + + Upstream-Regress-ID: 8717bc0ca4c21120f6dd3a1d3b7a363f707c31e1 + +commit 8884b7247d094cd11ff9e39c325ba928c5bdbc6c +Author: dtucker@openbsd.org +Date: Tue Mar 14 01:10:07 2017 +0000 + + upstream commit + + Add ASSERT_LONG_* helpers. + + Upstream-Regress-ID: fe15beaea8f5063c7f21b0660c722648e3d76431 + +commit c6774d21185220c0ba11e8fd204bf0ad1a432071 +Author: dtucker@openbsd.org +Date: Tue Mar 14 00:55:37 2017 +0000 + + upstream commit + + Fix convtime() overflow test on boundary condition, + spotted by & ok djm. + + Upstream-ID: 51f14c507ea87a3022e63f574100613ab2ba5708 + +commit f5746b40cfe6d767c8e128fe50c43274b31cd594 +Author: dtucker@openbsd.org +Date: Tue Mar 14 00:25:03 2017 +0000 + + upstream commit + + Check for integer overflow when parsing times in + convtime(). Reported by nicolas.iooss at m4x.org, ok djm@ + + Upstream-ID: 35e6a4e98f6fa24df50bfb8ba1307cf70e966f13 + +commit f5907982f42a8d88a430b8a46752cbb7859ba979 +Author: Darren Tucker +Date: Tue Mar 14 13:38:15 2017 +1100 + + Add a "unit" target to run only unit tests. + +commit 9e96b41682aed793fadbea5ccd472f862179fb02 +Author: Damien Miller +Date: Tue Mar 14 12:24:47 2017 +1100 + + Fix weakness in seccomp-bpf sandbox arg inspection + + Syscall arguments are passed via an array of 64-bit values in struct + seccomp_data, but we were only inspecting the bottom 32 bits and not + even those correctly for BE systems. + + Fortunately, the only case argument inspection was used was in the + socketcall filtering so using this for sandbox escape seems + impossible. + + ok dtucker + +commit 8ff3fc3f2f7c13e8968717bc2b895ee32c441275 +Author: djm@openbsd.org +Date: Sat Mar 11 23:44:16 2017 +0000 + + upstream commit + + regress tests for loading certificates without public keys; + bz#2617 based on patch from Adam Eijdenberg; ok markus@ dtucker@ + + Upstream-Regress-ID: 0145d19328ed995b73fe2d9da33596b17429d0d0 + +commit 1e24552716194db8f2f620587b876158a9ef56ad +Author: djm@openbsd.org +Date: Sat Mar 11 23:40:26 2017 +0000 + + upstream commit + + allow ssh to use certificates accompanied by a private + key file but no corresponding plain *.pub public key. bz#2617 based on patch + from Adam Eijdenberg; ok dtucker@ markus@ + + Upstream-ID: 295668dca2c39505281577217583ddd2bd4b00b9 + +commit 0fb1a617a07b8df5de188dd5a0c8bf293d4bfc0e +Author: markus@openbsd.org +Date: Sat Mar 11 13:07:35 2017 +0000 + + upstream commit + + Don't count the initial block twice when computing how + many bytes to discard for the work around for the attacks against CBC-mode. + ok djm@; report from Jean Paul, Kenny, Martin and Torben @ RHUL + + Upstream-ID: f445f509a4e0a7ba3b9c0dae7311cb42458dc1e2 + +commit ef653dd5bd5777132d9f9ee356225f9ee3379504 +Author: dtucker@openbsd.org +Date: Fri Mar 10 07:18:32 2017 +0000 + + upstream commit + + krl.c + + Upstream-ID: fc5e695d5d107d730182e2da7b23f00b489e0ee1 + +commit d94c1dfef2ea30ca67b1204ada7c3b537c54f4d0 +Author: Damien Miller +Date: Sun Mar 12 10:48:14 2017 +1100 + + sync fmt_scaled.c with OpenBSD + + revision 1.13 + date: 2017/03/11 23:37:23; author: djm; state: Exp; lines: +14 -1; commitid: jnFKyHkB3CEiEZ2R; + fix signed integer overflow in scan_scaled. Found by Nicolas Iooss + using AFL against ssh_config. ok deraadt@ millert@ + ---------------------------- + revision 1.12 + date: 2013/11/29 19:00:51; author: deraadt; state: Exp; lines: +6 -5; + fairly simple unsigned char casts for ctype + ok krw + ---------------------------- + revision 1.11 + date: 2012/11/12 14:07:20; author: halex; state: Exp; lines: +4 -2; + make scan_scaled set errno to EINVAL rather than ERANGE if it encounters + an invalid multiplier, like the man page says it should + + "looks sensible" deraadt@, ok ian@ + ---------------------------- + revision 1.10 + date: 2009/06/20 15:00:04; author: martynas; state: Exp; lines: +4 -4; + use llabs instead of the home-grown version; and some comment changes + ok ian@, millert@ + ---------------------------- + +commit 894221a63fa061e52e414ca58d47edc5fe645968 +Author: djm@openbsd.org +Date: Fri Mar 10 05:01:13 2017 +0000 + + upstream commit + + When updating hostkeys, accept RSA keys if + HostkeyAlgorithms contains any RSA keytype. Previously, ssh could ignore RSA + keys when any of the ssh-rsa-sha2-* methods was enabled in HostkeyAlgorithms + nit ssh-rsa (SHA1 signatures) was not. bz#2650 reported by Luis Ressel; ok + dtucker@ + + Upstream-ID: c5e8cfee15c42f4a05d126158a0766ea06da79d2 + +commit dd3e2298663f4cc1a06bc69582d00dcfee27d73c +Author: djm@openbsd.org +Date: Fri Mar 10 04:24:55 2017 +0000 + + upstream commit + + make hostname matching really insensitive to case; + bz#2685, reported by Petr Cerny; ok dtucker@ + + Upstream-ID: e467622ff154269e36ba8b6c9e3d105e1c4a9253 + +commit 77a9be9446697fe8b5499fe651f4a82a71a4b51f +Author: djm@openbsd.org +Date: Fri Mar 10 03:52:48 2017 +0000 + + upstream commit + + reword a comment to make it fit 80 columns + + Upstream-ID: 4ef509a66b96c7314bbcc87027c2af71fa9d0ba4 + +commit 61b8ef6a66efaec07e023342cb94a10bdc2254dc +Author: djm@openbsd.org +Date: Fri Mar 10 04:27:32 2017 +0000 + + upstream commit + + better match sshd config parser behaviour: fatal() if + line is overlong, increase line buffer to match sshd's; bz#2651 reported by + Don Fong; ok dtucker@ + + Upstream-ID: b175ae7e0ba403833f1ee566edf10f67443ccd18 + +commit db2597207e69912f2592cd86a1de8e948a9d7ffb +Author: djm@openbsd.org +Date: Fri Mar 10 04:26:06 2017 +0000 + + upstream commit + + ensure hostname is lower-case before hashing it; + bz#2591 reported by Griff Miller II; ok dtucker@ + + Upstream-ID: c3b8b93804f376bd00d859b8bcd9fc0d86b4db17 + +commit df9936936c695f85c1038bd706d62edf752aca4b +Author: djm@openbsd.org +Date: Fri Mar 10 04:24:55 2017 +0000 + + upstream commit + + make hostname matching really insensitive to case; + bz#2685, reported by Petr Cerny; ok dtucker@ + + Upstream-ID: e632b7a9bf0d0558d5ff56dab98b7cca6c3db549 + +commit 67eed24bfa7645d88fa0b883745fccb22a0e527e +Author: dtucker@openbsd.org +Date: Fri Mar 10 04:11:00 2017 +0000 + + upstream commit + + Remove old null check from config dumper. Patch from + jjelen at redhat.com vi bz#2687, ok djm@ + + Upstream-ID: 824ab71467b78c4bab0dd1b3a38e8bc5f63dd528 + +commit 183ba55aaaecca0206184b854ad6155df237adbe +Author: djm@openbsd.org +Date: Fri Mar 10 04:07:20 2017 +0000 + + upstream commit + + fix regression in 7.4 server-sig-algs, where we were + accidentally excluding SHA2 RSA signature methods. bz#2680, patch from Nuno + Goncalves; ok dtucker@ + + Upstream-ID: 81ac8bfb30960447740b9b8f6a214dcf322f12e8 + +commit 66be4fe8c4435af5bbc82998501a142a831f1181 +Author: dtucker@openbsd.org +Date: Fri Mar 10 03:53:11 2017 +0000 + + upstream commit + + Check for NULL return value from key_new. Patch from + jjelen at redhat.com via bz#2687, ok djm@ + + Upstream-ID: 059e33cd43cba88dc8caf0b1936fd4dd88fd5b8e + +commit ec2892b5c7fea199914cb3a6afb3af38f84990bf +Author: djm@openbsd.org +Date: Fri Mar 10 03:52:48 2017 +0000 + + upstream commit + + reword a comment to make it fit 80 columns + + Upstream-ID: b4b48b4487c0821d16e812c40c9b09f03b28e349 + +commit 7fadbb6da3f4122de689165651eb39985e1cba85 +Author: dtucker@openbsd.org +Date: Fri Mar 10 03:48:57 2017 +0000 + + upstream commit + + Check for NULL argument to sshkey_read. Patch from + jjelen at redhat.com via bz#2687, ok djm@ + + Upstream-ID: c2d00c2ea50c4861d271d0a586f925cc64a87e0e + +commit 5a06b9e019e2b0b0f65a223422935b66f3749de3 +Author: dtucker@openbsd.org +Date: Fri Mar 10 03:45:40 2017 +0000 + + upstream commit + + Plug some mem leaks mostly on error paths. From jjelen + at redhat.com via bz#2687, ok djm@ + + Upstream-ID: 3fb030149598957a51b7c8beb32bf92cf30c96f2 + +commit f6edbe9febff8121f26835996b1229b5064d31b7 +Author: dtucker@openbsd.org +Date: Fri Mar 10 03:24:48 2017 +0000 + + upstream commit + + Plug mem leak on GLOB_NOMATCH case. From jjelen at + redhat.com via bz#2687, ok djm@ + + Upstream-ID: 8016a7ae97719d3aa55fb723fc2ad3200058340d + +commit 566b3a46e89a2fda2db46f04f2639e92da64a120 +Author: dtucker@openbsd.org +Date: Fri Mar 10 03:22:40 2017 +0000 + + upstream commit + + Plug descriptor leaks of auth_sock. From jjelen at + redhat.com via bz#2687, ok djm@ + + Upstream-ID: 248acb99a5ed2fdca37d1aa33c0fcee7be286d88 + +commit 8a2834454c73dfc1eb96453c0e97690595f3f4c2 +Author: djm@openbsd.org +Date: Fri Mar 10 03:18:24 2017 +0000 + + upstream commit + + correctly hash hosts with a port number. Reported by Josh + Powers in bz#2692; ok dtucker@ + + Upstream-ID: 468e357ff143e00acc05bdd2803a696b3d4b6442 + +commit 9747b9c742de409633d4753bf1a752cbd211e2d3 +Author: djm@openbsd.org +Date: Fri Mar 10 03:15:58 2017 +0000 + + upstream commit + + don't truncate off \r\n from long stderr lines; bz#2688, + reported by Brian Dyson; ok dtucker@ + + Upstream-ID: cdfdc4ba90639af807397ce996153c88af046ca4 + +commit 4a4b75adac862029a1064577eb5af299b1580cdd +Author: dtucker@openbsd.org +Date: Fri Mar 10 02:59:51 2017 +0000 + + upstream commit + + Validate digest arg in ssh_digest_final; from jjelen at + redhat.com via bz#2687, ok djm@ + + Upstream-ID: dbe5494dfddfe523fab341a3dab5a79e7338f878 + +commit bee0167be2340d8de4bdc1ab1064ec957c85a447 +Author: Darren Tucker +Date: Fri Mar 10 13:40:18 2017 +1100 + + Check for NULL from malloc. + + Part of bz#2687, from jjelen at redhat.com. + +commit da39b09d43b137a5a3d071b51589e3efb3701238 +Author: Darren Tucker +Date: Fri Mar 10 13:22:32 2017 +1100 + + If OSX is using launchd, remove screen no. + + Check for socket with and without screen number. From Apple and Jakob + Schlyter via bz#2341, with contributions from Ron Frederick, ok djm@ + +commit 8fb15311a011517eb2394bb95a467c209b8b336c +Author: djm@openbsd.org +Date: Wed Mar 8 12:07:47 2017 +0000 + + upstream commit + + quote [host]:port in generated ProxyJump commandline; the + [ / ] characters can confuse some shells (e.g. zsh). Reported by Lauri + Tirkkonen via bugs@ + + Upstream-ID: 65cdd161460e1351c3d778e974c1c2a4fa4bc182 + +commit 18501151cf272a15b5f2c5e777f2e0933633c513 +Author: dtucker@openbsd.org +Date: Mon Mar 6 02:03:20 2017 +0000 + + upstream commit + + Check l->hosts before dereferencing; fixes potential null + pointer deref. ok djm@ + + Upstream-ID: 81c0327c6ec361da794b5c680601195cc23d1301 + +commit d072370793f1a20f01ad827ba8fcd3b8f2c46165 +Author: dtucker@openbsd.org +Date: Mon Mar 6 00:44:51 2017 +0000 + + upstream commit + + linenum is unsigned long so use %lu in log formats. ok + deraadt@ + + Upstream-ID: 9dc582d9bb887ebe0164e030d619fc20b1a4ea08 + +commit 12d3767ba4c84c32150cbe6ff6494498780f12c9 +Author: djm@openbsd.org +Date: Fri Mar 3 06:13:11 2017 +0000 + + upstream commit + + fix ssh-keygen -H accidentally corrupting known_hosts that + contained already-hashed entries. HKF_MATCH_HOST_HASHED is only set by + hostkeys_foreach() when hostname matching is in use, so we need to look for + the hash marker explicitly. + + Upstream-ID: da82ad653b93e8a753580d3cf5cd448bc2520528 + +commit d7abb771bd5a941b26144ba400a34563a1afa589 +Author: djm@openbsd.org +Date: Tue Feb 28 06:10:08 2017 +0000 + + upstream commit + + small memleak: free fd_set on connection timeout (though + we are heading to exit anyway). From Tom Rix in bz#2683 + + Upstream-ID: 10e3dadbb8199845b66581473711642d9e6741c4 + +commit 78142e3ab3887e53a968d6e199bcb18daaf2436e +Author: jmc@openbsd.org +Date: Mon Feb 27 14:30:33 2017 +0000 + + upstream commit + + errant dot; from klemens nanni + + Upstream-ID: 83d93366a5acf47047298c5d3ebc5e7426f37921 + +commit 8071a6924c12bb51406a9a64a4b2892675112c87 +Author: djm@openbsd.org +Date: Fri Feb 24 03:16:34 2017 +0000 + + upstream commit + + might as well set the listener socket CLOEXEC + + Upstream-ID: 9c538433d6a0ca79f5f21decc5620e46fb68ab57 + +commit d5499190559ebe374bcdfa8805408646ceffad64 +Author: djm@openbsd.org +Date: Sun Feb 19 00:11:29 2017 +0000 + + upstream commit + + add test cases for C locale; ok schwarze@ + + Upstream-Regress-ID: 783d75de35fbc923d46e2a5e6cee30f8f381ba87 + +commit 011c8ffbb0275281a0cf330054cf21be10c43e37 +Author: djm@openbsd.org +Date: Sun Feb 19 00:10:57 2017 +0000 + + upstream commit + + Add a common nl_langinfo(CODESET) alias for US-ASCII + "ANSI_X3.4-1968" that is used by Linux. Fixes mprintf output truncation for + non-UTF-8 locales on Linux spotted by dtucker@; ok deraadt@ schwarze@ + + Upstream-ID: c6808956ebffd64066f9075d839f74ff0dd60719 + +commit 0c4430a19b73058a569573492f55e4c9eeaae67b +Author: dtucker@openbsd.org +Date: Tue Feb 7 23:03:11 2017 +0000 + + upstream commit + + Remove deprecated SSH1 options RSAAuthentication and + RhostsRSAAuthentication from regression test sshd_config. + + Upstream-Regress-ID: 8066b753d9dce7cf02ff87af5c727ff680d99491 + +commit 3baa4cdd197c95d972ec3d07f1c0d08f2d7d9199 +Author: dtucker@openbsd.org +Date: Fri Feb 17 02:32:05 2017 +0000 + + upstream commit + + Do not show rsa1 key type in usage when compiled without + SSH1 support. + + Upstream-ID: 068b5c41357a02f319957746fa4e84ea73960f57 + +commit ecc35893715f969e98fee118481f404772de4132 +Author: dtucker@openbsd.org +Date: Fri Feb 17 02:31:14 2017 +0000 + + upstream commit + + ifdef out "rsa1" from the list of supported keytypes when + compiled without SSH1 support. Found by kdunlop at guralp.com, ok djm@ + + Upstream-ID: cea93a26433d235bb1d64b1d990f19a9c160a70f + +commit 10577c6d96a55b877a960b2d0b75edef1b9945af +Author: djm@openbsd.org +Date: Fri Feb 17 02:04:15 2017 +0000 + + upstream commit + + For ProxyJump/-J, surround host name with brackets to + allow literal IPv6 addresses. From Dick Visser; ok dtucker@ + + Upstream-ID: 3a5d3b0171250daf6a5235e91bce09c1d5746bf1 + +commit b2afdaf1b52231aa23d2153f4a8c5a60a694dda4 +Author: jsg@openbsd.org +Date: Wed Feb 15 23:38:31 2017 +0000 + + upstream commit + + Fix memory leaks in match_filter_list() error paths. + + ok dtucker@ markus@ + + Upstream-ID: c7f96ac0877f6dc9188bbc908100a8d246cc7f0e + +commit 6d5a41b38b55258213ecfaae9df7a758caa752a1 +Author: djm@openbsd.org +Date: Wed Feb 15 01:46:47 2017 +0000 + + upstream commit + + fix division by zero crash in "df" output when server + returns zero total filesystem blocks/inodes. Spotted by Guido Vranken; ok + dtucker@ + + Upstream-ID: 6fb6c2ae6b289aa07b6232dbc0be54682ef5419f + +commit bd5d7d239525d595ecea92765334af33a45d9d63 +Author: Darren Tucker +Date: Sun Feb 12 15:45:15 2017 +1100 + + ifdef out EVP_R_PRIVATE_KEY_DECODE_ERROR + + EVP_R_PRIVATE_KEY_DECODE_ERROR was added in OpenSSL 1.0.0 so ifdef out + for the benefit of OpenSSL versions prior to that. + +commit 155d540d00ff55f063421ec182ec8ff2b7ab6cbe +Author: djm@openbsd.org +Date: Fri Feb 10 04:34:50 2017 +0000 + + upstream commit + + bring back r1.34 that was backed out for problems loading + public keys: + + translate OpenSSL error codes to something more + meaninful; bz#2522 reported by Jakub Jelen, ok dtucker@ + + with additional fix from Jakub Jelen to solve the backout. + bz#2525 bz#2523 re-ok dtucker@ + + Upstream-ID: a9d5bc0306f4473d9b4f4484f880e95f3c1cc031 + +commit a287c5ad1e0bf9811c7b9221979b969255076019 +Author: djm@openbsd.org +Date: Fri Feb 10 03:36:40 2017 +0000 + + upstream commit + + Sanitise escape sequences in key comments sent to printf + but preserve valid UTF-8 when the locale supports it; bz#2520 ok dtucker@ + + Upstream-ID: e8eed28712ba7b22d49be534237eed019875bd1e + +commit e40269be388972848aafcca7060111c70aab5b87 +Author: millert@openbsd.org +Date: Wed Feb 8 20:32:43 2017 +0000 + + upstream commit + + Avoid printf %s NULL. From semarie@, OK djm@ + + Upstream-ID: 06beef7344da0208efa9275d504d60d2a5b9266c + +commit 5b90709ab8704dafdb31e5651073b259d98352bc +Author: djm@openbsd.org +Date: Mon Feb 6 09:22:51 2017 +0000 + + upstream commit + + Restore \r\n newline sequence for server ident string. The CR + got lost in the flensing of SSHv1. Pointed out by Stef Bon + + Upstream-ID: 5333fd43ce5396bf5999496096fac5536e678fac + +commit 97c31c46ee2e6b46dfffdfc4f90bbbf188064cbc +Author: djm@openbsd.org +Date: Fri Feb 3 23:01:42 2017 +0000 + + upstream commit + + unit test for match_filter_list() function; still want a + better name for this... + + Upstream-Regress-ID: 840ad6118552c35111f0a897af9c8d93ab8de92a + +commit f1a193464a7b77646f0d0cedc929068e4a413ab4 +Author: djm@openbsd.org +Date: Fri Feb 3 23:05:57 2017 +0000 + + upstream commit + + use ssh_packet_set_log_preamble() to include connection + username in packet log messages, e.g. + + Connection closed by invalid user foo 10.1.1.1 port 44056 [preauth] + + ok markus@ bz#113 + + Upstream-ID: 3591b88bdb5416d6066fb3d49d8fff2375bf1a15 + +commit 07edd7e9537ab32aa52abb5fb2a915c350fcf441 +Author: djm@openbsd.org +Date: Fri Feb 3 23:03:33 2017 +0000 + + upstream commit + + add ssh_packet_set_log_preamble() to allow inclusion of a + preamble string in disconnect messages; ok markus@ + + Upstream-ID: 34cb41182cd76d414c214ccb01c01707849afead + +commit 68bc8cfa7642d3ccbf2cd64281c16b8b9205be59 +Author: djm@openbsd.org +Date: Fri Feb 3 23:01:19 2017 +0000 + + upstream commit + + support =- for removing methods from algorithms lists, + e.g. Ciphers=-*cbc; suggested by Cristian Ionescu-Idbohrn in bz#2671 "I like + it" markus@ + + Upstream-ID: c78c38f9f81a963b33d0eade559f6048add24a6d + +commit c924b2ef941028a1f31e6e94f54dfeeeef462a4e +Author: djm@openbsd.org +Date: Fri Feb 3 05:05:56 2017 +0000 + + upstream commit + + allow form-feed characters at EOL; bz#2431 ok dtucker@ + + Upstream-ID: 1f453afaba6da2ae69d6afdf1ae79a917552f1a2 + +commit 523db8540b720c4d21ab0ff6f928476c70c38aab +Author: Damien Miller +Date: Fri Feb 3 16:01:22 2017 +1100 + + prefer to use ldns-config to find libldns + + Should fix bz#2603 - "Build with ldns and without kerberos support + fails if ldns compiled with kerberos support" by including correct + cflags/libs + + ok dtucker@ + +commit c998bf0afa1a01257a53793eba57941182e9e0b7 +Author: dtucker@openbsd.org +Date: Fri Feb 3 02:56:00 2017 +0000 + + upstream commit + + Make ssh_packet_set_rekey_limits take u32 for the number of + seconds until rekeying (negative values are rejected at config parse time). + This allows the removal of some casts and a signed vs unsigned comparison + warning. + + rekey_time is cast to int64 for the comparison which is a no-op + on OpenBSD, but should also do the right thing in -portable on + anything still using 32bit time_t (until the system time actually + wraps, anyway). + + some early guidance deraadt@, ok djm@ + + Upstream-ID: c9f18613afb994a07e7622eb326f49de3d123b6c + +commit 3ec5fa4ba97d4c4853620daea26a33b9f1fe3422 +Author: jsg@openbsd.org +Date: Thu Feb 2 10:54:25 2017 +0000 + + upstream commit + + In vasnmprintf() return an error if malloc fails and + don't set a function argument to the address of free'd memory. + + ok djm@ + + Upstream-ID: 1efffffff2f51d53c9141f245b90ac23d33b9779 + +commit 858252fb1d451ebb0969cf9749116c8f0ee42753 +Author: dtucker@openbsd.org +Date: Wed Feb 1 02:59:09 2017 +0000 + + upstream commit + + Return true reason for port forwarding failures where + feasible rather than always "administratively prohibited". bz#2674, ok djm@ + + Upstream-ID: d901d9887951774e604ca970e1827afaaef9e419 + +commit 6ba9f893838489add6ec4213c7a997b425e4a9e0 +Author: dtucker@openbsd.org +Date: Mon Jan 30 23:27:39 2017 +0000 + + upstream commit + + Small correction to the known_hosts section on when it is + updated. Patch from lkppo at free.fr some time ago, pointed out by smallm at + sdf.org + + Upstream-ID: 1834d7af179dea1a12ad2137f84566664af225d5 + +commit c61d5ec3c11e7ff9779b6127421d9f166cf10915 +Author: Darren Tucker +Date: Fri Feb 3 14:10:34 2017 +1100 + + Remove _XOPEN_SOURCE from wide char detection. + + Having _XOPEN_SOURCE unconditionally causes problems on some platforms + and configurations, notably Solaris 64-bit binaries. It was there for + the benefit of Linux put the required bits in the *-*linux* section. + + Patch from yvoinov at gmail.com. + +commit f25ee13b3e81fd80efeb871dc150fe49d7fc8afd +Author: djm@openbsd.org +Date: Mon Jan 30 05:22:14 2017 +0000 + + upstream commit + + fully unbreak: some $SSH invocations did not have -F + specified and could pick up the ~/.ssh/config of the user running the tests + + Upstream-Regress-ID: f362d1892c0d3e66212d5d3fc02d915c58ef6b89 + +commit 6956e21fb26652887475fe77ea40d2efcf25908b +Author: djm@openbsd.org +Date: Mon Jan 30 04:54:07 2017 +0000 + + upstream commit + + partially unbreak: was not specifying hostname on some + $SSH invocations + + Upstream-Regress-ID: bc8a5e98e57bad0a92ef4f34ed91c1d18294e2cc + +commit 52763dd3fe0a4678dafdf7aeb32286e514130afc +Author: djm@openbsd.org +Date: Mon Jan 30 01:03:00 2017 +0000 + + upstream commit + + revise keys/principals command hang fix (bz#2655) to + consume entire output, avoiding sending SIGPIPE to subprocesses early; ok + dtucker@ + + Upstream-ID: 7cb04b31a61f8c78c4e48ceededcd2fd5c4ee1bc + +commit 381a2615a154a82c4c53b787f4a564ef894fe9ac +Author: djm@openbsd.org +Date: Mon Jan 30 00:38:50 2017 +0000 + + upstream commit + + small cleanup post SSHv1 removal: + + remove SSHv1-isms in commented examples + + reorder token table to group deprecated and compile-time conditional tokens + better + + fix config dumping code for some compile-time conditional options that + weren't being correctly skipped (SSHv1 and PKCS#11) + + Upstream-ID: f2e96b3cb3158d857c5a91ad2e15925df3060105 + +commit 4833d01591b7eb049489d9558b65f5553387ed43 +Author: djm@openbsd.org +Date: Mon Jan 30 00:34:01 2017 +0000 + + upstream commit + + some explicit NULL tests when dumping configured + forwardings; from Karsten Weiss + + Upstream-ID: 40957b8dea69672b0e50df6b4a91a94e3e37f72d + +commit 326e2fae9f2e3e067b5651365eba86b35ee5a6b2 +Author: djm@openbsd.org +Date: Mon Jan 30 00:32:28 2017 +0000 + + upstream commit + + misplaced braces in test; from Karsten Weiss + + Upstream-ID: f7b794074d3aae8e35b69a91d211c599c94afaae + +commit 3e032a95e46bfaea9f9e857678ac8fa5f63997fb +Author: djm@openbsd.org +Date: Mon Jan 30 00:32:03 2017 +0000 + + upstream commit + + don't dereference authctxt before testing != NULL, it + causes compilers to make assumptions; from Karsten Weiss + + Upstream-ID: 794243aad1e976ebc717885b7a97a25e00c031b2 + +commit 01cfaa2b1cfb84f3cdd32d1bf82b120a8d30e057 +Author: djm@openbsd.org +Date: Fri Jan 6 02:51:16 2017 +0000 + + upstream commit + + use correct ssh-add program; bz#2654, from Colin Watson + + Upstream-Regress-ID: 7042a36e1bdaec6562f6e57e9d047efe9c7a6030 + +commit e5c7ec67cdc42ae2584085e0fc5cc5ee91133cf5 +Author: dtucker@openbsd.org +Date: Fri Jan 6 02:26:10 2017 +0000 + + upstream commit + + Account for timeouts in the integrity tests as failures. + + If the first test in a series for a given MAC happens to modify the low + bytes of a packet length, then ssh will time out and this will be + interpreted as a test failure. Patch from cjwatson at debian.org via + bz#2658. + + Upstream-Regress-ID: e7467613b0badedaa300bc6fc7495ec2f44e2fb9 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Aug 3 10:11:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E885DD511E; Thu, 3 Aug 2017 10:11:08 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7D2670E3E; Thu, 3 Aug 2017 10:11:07 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v73AB6BV058605; Thu, 3 Aug 2017 10:11:06 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73AB6Nu058604; Thu, 3 Aug 2017 10:11:06 GMT (envelope-from des@FreeBSD.org) Message-Id: <201708031011.v73AB6Nu058604@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Thu, 3 Aug 2017 10:11:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r321988 - vendor-crypto/openssh/7.5p1 X-SVN-Group: vendor-crypto X-SVN-Commit-Author: des X-SVN-Commit-Paths: vendor-crypto/openssh/7.5p1 X-SVN-Commit-Revision: 321988 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 10:11:08 -0000 Author: des Date: Thu Aug 3 10:11:06 2017 New Revision: 321988 URL: https://svnweb.freebsd.org/changeset/base/321988 Log: Tag OpenSSH 7.5p1. Added: vendor-crypto/openssh/7.5p1/ - copied from r321987, vendor-crypto/openssh/dist/ From owner-svn-src-all@freebsd.org Thu Aug 3 11:49:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B00BDB2E21 for ; Thu, 3 Aug 2017 11:49:13 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yw0-x22d.google.com (mail-yw0-x22d.google.com [IPv6:2607:f8b0:4002:c05::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E68A73D77 for ; Thu, 3 Aug 2017 11:49:12 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yw0-x22d.google.com with SMTP id p68so6714064ywg.0 for ; Thu, 03 Aug 2017 04:49:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=aOyJ+/Xe93y+3+PpIBZv+iBe4n9nStyjkLkGNLTMHNA=; b=M95h/LqZDOj02WcXaZ/4t97N8uOcp5K9coRx9P1VNej3q1qyf4BVR7rxRG39kLKwuf bIsV7l6581MYK+5+sNJTFiWGwroB8S5z5tA/2Mo3dLQnGYqwlhmvtNgrrqCc9Jy8RYP4 mONbbFF9i5IkvSXE3m+lSb8DplZVydQ34iiUtft21iOmv4J+oj2CWtfM8XrkkcZ0OIiq 5Vy1x0ltm08VTUp6VVm1rhWqeqjrA4OsCWYIuKgu4j7oMLLRDLWSrXFI7yhlbRRe64Ma lSs9NPO2GoYLU6yYzuAtjX7E1RvRMOBX5ipzC9GFkrsTBitHHiSBQLganghHK7UAJRwJ EM0g== 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=aOyJ+/Xe93y+3+PpIBZv+iBe4n9nStyjkLkGNLTMHNA=; b=ukZOm29AoDVOrwiwV+WNfxu2lS78Wu2gbkoI08UlMwMDtGvEzpqVGvYWO0z00aBfs2 aWnN1BfaaplFKIcUUG3kHy/Lnah8CNSD0kSwpfTm9zCu9QEFR1H0K30sSpnvxf6/Pylj y0317iJwu9lPoM8gwP7fCA1ZAZutyMSxTDIosdrPTNdlIRGDFFNwxnW/PtbsT3CZH77z eAcXxGT4pX2+buGxgRRv0Wh0sxhPNSeL5ZegQ74+wBSJpLpU4YMpIjjeljoLVoIvApSm QorKhrRZg9QVJV84Oi5Wc34XzITanrrWgsM4VfgJIVETzEmbbxvos65k2KJ4q/Cs9TL2 QX6w== X-Gm-Message-State: AIVw112Vz4FnwAbUVlY0BHKp1VWKVtG4XRwQijWm98bTWJ0H/dnJab1j nO/C+LXUG8T76ZxL2rRol7jbDyzeZPwk X-Received: by 10.129.226.5 with SMTP id p5mr947560ywl.0.1501760951987; Thu, 03 Aug 2017 04:49:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.13.218.69 with HTTP; Thu, 3 Aug 2017 04:48:41 -0700 (PDT) In-Reply-To: <201708030527.v735R5dg041043@repo.freebsd.org> References: <201708030527.v735R5dg041043@repo.freebsd.org> From: Ed Schouten Date: Thu, 3 Aug 2017 13:48:41 +0200 Message-ID: Subject: Re: svn commit: r321969 - in head/sys/boot: arm/at91/libat91 arm/ixp425/boot2 i386/boot2 To: Ngie Cooper Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 11:49:13 -0000 2017-08-03 7:27 GMT+02:00 Ngie Cooper : > Modified: head/sys/boot/arm/at91/libat91/printf.c > ============================================================================== > --- head/sys/boot/arm/at91/libat91/printf.c Thu Aug 3 03:45:48 2017 (r321968) > +++ head/sys/boot/arm/at91/libat91/printf.c Thu Aug 3 05:27:05 2017 (r321969) > @@ -20,12 +20,13 @@ > #include > #include "lib.h" > > -void > +int > printf(const char *fmt,...) > { > va_list ap; > const char *hex = "0123456789abcdef"; > char buf[10]; > + const char *fmt_orig = fmt; > char *s; > unsigned u; > int c; > @@ -66,5 +67,5 @@ printf(const char *fmt,...) > } > va_end(ap); > > - return; > + return (int)(fmt - fmt_orig); > } This makes printf() return the number of characters from the format processed, right? This is different from libc's printf(), which returns the number of characters printed. -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-all@freebsd.org Thu Aug 3 12:07:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CD95DB48F2; Thu, 3 Aug 2017 12:07:36 +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 D942874CBD; Thu, 3 Aug 2017 12:07:35 +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 v73C7Up9050902 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 3 Aug 2017 15:07:30 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v73C7Up9050902 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v73C7THF050900; Thu, 3 Aug 2017 15:07:29 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 3 Aug 2017 15:07:29 +0300 From: Konstantin Belousov To: Bruce Evans Cc: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r321920 - head/sys/sys Message-ID: <20170803120729.GO1700@kib.kiev.ua> References: <201708021014.v72AEHEk061037@repo.freebsd.org> <37abc595-c80e-a8da-04a8-815f42c634de@selasky.org> <20170802135455.GG1700@kib.kiev.ua> <20170803122015.Q1093@besplex.bde.org> <20170803075747.GJ1700@kib.kiev.ua> <20170803180419.R2314@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170803180419.R2314@besplex.bde.org> User-Agent: Mutt/1.8.3 (2017-05-23) 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 12:07:36 -0000 On Thu, Aug 03, 2017 at 07:34:56PM +1000, Bruce Evans wrote: > I see another problem. Masking with 0xfffffffff and casting to unsigned > are gratuitously different spellings for extracting the low 32 bits. > I prefer the cast. Below is one more update. I reformulated the man page text, but not too deep. Also I replaced masking with the cast. diff --git a/share/man/man3/makedev.3 b/share/man/man3/makedev.3 index 87ca953dc79..8ce9c554a09 100644 --- a/share/man/man3/makedev.3 +++ b/share/man/man3/makedev.3 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 28, 2008 +.Dd August 3, 2017 .Dt MAKEDEV 3 .Os .Sh NAME @@ -43,7 +43,7 @@ .Sh DESCRIPTION The .Fn makedev -macro allows a unique device number to be generated based on its +macro returns a device number created from the provided .Fa major and .Fa minor @@ -52,13 +52,26 @@ The .Fn major and .Fn minor -macros can be used to obtain the original numbers from the device number +macros return the original numbers from the device number .Fa dev . +In other words, for a value +.Va dev +of the type +.Vt dev_t , +and values +.Va ma , mi +of the type +.Vt int , +the assertions +.Dl dev == makedev(major(dev), minor(dev)) +.Dl ma == major(makedev(ma, mi)) +.Dl mi == minor(makedev(ma, mi)) +are valid. .Pp In previous implementations of .Fx all block and character devices were uniquely identified by a pair of -major and minor numbers. +stable major and minor numbers. The major number referred to a certain device class (e.g. disks, TTYs) while the minor number identified an instance within the device class. Later versions of @@ -66,7 +79,8 @@ Later versions of automatically generate a unique device number for each character device visible in .Pa /dev/ . -These numbers are not divided in device classes. +These numbers are not divided in device classes and are not guaranteed +to be stable upon reboot or driver reload. .Pp On .Fx @@ -78,11 +92,9 @@ conventional way. .Sh RETURN VALUES The .Fn major -macro returns a device major number that has a value between 0 and 255. -The +and .Fn minor -macro returns a device minor number whose value can span the complete -range of an +macros return numbers whose value can span the complete range of an .Vt int . .Sh SEE ALSO .Xr mknod 2 , diff --git a/sys/sys/types.h b/sys/sys/types.h index 30a08724443..eacbc1ba0c4 100644 --- a/sys/sys/types.h +++ b/sys/sys/types.h @@ -364,9 +364,9 @@ __bitcount64(__uint64_t _x) #include -#define major(x) ((int)((dev_t)(x) >> 32)) /* major number */ -#define minor(x) ((int)((x) & 0xffffffff)) /* minor number */ -#define makedev(x, y) (((dev_t)(x) << 32) | (unsigned)(y)) /* create dev_t */ +#define major(x) ((int)((dev_t)(x) >> 32)) +#define minor(x) ((int)(x)) +#define makedev(x, y) (((dev_t)(x) << 32) | (unsigned)(y)) /* * These declarations belong elsewhere, but are repeated here and in From owner-svn-src-all@freebsd.org Thu Aug 3 12:45:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A176DB65B4; Thu, 3 Aug 2017 12:45:17 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x231.google.com (mail-pf0-x231.google.com [IPv6:2607:f8b0:400e:c00::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 F0C8875F60; Thu, 3 Aug 2017 12:45:16 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x231.google.com with SMTP id d67so5963612pfc.0; Thu, 03 Aug 2017 05:45:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=ZZkInlk8nbjw6Hzm1zXUDrCfN2+xI1v9lRIe0iROnOw=; b=LCJlIhKyvU7LFr9P+GGMbA/kCwnspjqqtIiU+N2CokGxjiqqxHmAHPMzKpLzp8m0A9 GbnTHOfyycILDIHVE/wpvbVyefyAGuLtO42ws32jG9Tzig4yngJbd0nh5Q0IxvZKHp2t I9HbZmyFvCMeAiHHxZ3DnhAvC+LrXpNqRbrKdJJz4/OoDVDeuQi7bjMGgxAoYcxCi3mX CvHAJDcT3yXlxewQcPSOHccuR0trlV3Hij0yqVSRN1izwqd4Ct+ZHHIO5YDtgsjaPjhN lo0gIbCZtFVLdG0V6MjcQVwbgJPYtucbPjhR+RPeiD0X6qxErDLcZpBZLhO6LPRbf2Ed kZTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=ZZkInlk8nbjw6Hzm1zXUDrCfN2+xI1v9lRIe0iROnOw=; b=F0mJar7PKIx3A1+ZUFlu16eFZVkPzoSE437XDrBBofbULRDi5vuP5Rm9he3ukUDTTd eaAiLRoOcJ/WUKKiO58JvlGtZHbZvVqFFmdYBFZJURk4ZBRHoYsM+zboKCBqmPWU0BMx n0YOgn0EvPKi6FvESI7IJJggL3k/PlEcT7dnFZeAgqAsiGxV49I3GXfYmGVK/5TKkhx0 VLJkgeINR87s+009lAuDqzUDcACTMIG2LAeJBgknmfa9aSB6/I2sN2GzNQMmMVXP9Fm6 NtbHp5YaBmsW7Py0DgkMzE/NZqEnByPsaCnv+08pfr3Wsc2NBkGM/y/WS97Ln6YQNH+g FyFQ== X-Gm-Message-State: AIVw113Dj1HT/fenMT59YD5Xz0QmwDxgLXdpxrMpfY7PObawT+UitJUg xrJsKK/7VsTU0g== X-Received: by 10.98.33.9 with SMTP id h9mr1503690pfh.185.1501764316268; Thu, 03 Aug 2017 05:45:16 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id q24sm30356206pgc.61.2017.08.03.05.45.14 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 03 Aug 2017 05:45:15 -0700 (PDT) Subject: Re: svn commit: r321969 - in head/sys/boot: arm/at91/libat91 arm/ixp425/boot2 i386/boot2 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_08D14944-C06A-484C-A555-04B8B077EACF"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: Date: Thu, 3 Aug 2017 05:45:13 -0700 Cc: Ngie Cooper , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <18B68C5B-DFB6-4871-9E56-AFACD0D3CBCE@gmail.com> References: <201708030527.v735R5dg041043@repo.freebsd.org> To: Ed Schouten X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 12:45:17 -0000 --Apple-Mail=_08D14944-C06A-484C-A555-04B8B077EACF Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Aug 3, 2017, at 04:48, Ed Schouten wrote: >=20 > 2017-08-03 7:27 GMT+02:00 Ngie Cooper : >> Modified: head/sys/boot/arm/at91/libat91/printf.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/boot/arm/at91/libat91/printf.c Thu Aug 3 03:45:48 = 2017 (r321968) >> +++ head/sys/boot/arm/at91/libat91/printf.c Thu Aug 3 05:27:05 = 2017 (r321969) >> @@ -20,12 +20,13 @@ >> #include >> #include "lib.h" >>=20 >> -void >> +int >> printf(const char *fmt,...) >> { >> va_list ap; >> const char *hex =3D "0123456789abcdef"; >> char buf[10]; >> + const char *fmt_orig =3D fmt; >> char *s; >> unsigned u; >> int c; >> @@ -66,5 +67,5 @@ printf(const char *fmt,...) >> } >> va_end(ap); >>=20 >> - return; >> + return (int)(fmt - fmt_orig); >> } >=20 > This makes printf() return the number of characters from the format > processed, right? This is different from libc's printf(), which > returns the number of characters printed. Yes. markj identified flaws with my approach that need to be = addressed in another commit (unfortunately I didn=E2=80=99t pay close = enough attention to the details when I implemented the change). Thanks, -Ngie --Apple-Mail=_08D14944-C06A-484C-A555-04B8B077EACF Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZgxrZAAoJEPWDqSZpMIYVQFMQAIQ0UKMtX8Q6Wkc06aqqb7ky kbm3ofOiuxjJ/BtAzaWF3l9wZptLhc7B+8ZrM4XO4781g9oHVw0Z0oY/ncPv86AA OgnK7ASMgb/8hby2KIMhdADRB8v8ciUhsNoIv8hX5pMjU+FwyPNoLI86JvLwZNS4 Zn5F51HDKRm09Kz0djepBVkQgFcpWnsyHF4V7LRvgX2n/3E/X5qyayxvAa63naPA YF7tO4wV4UuVU3LSKF5yQgNDx98u9dmmxn20IyWAGjSD127Uf302NmZazhQqAd93 wFxBpOgeRVgKcRsBMzYmCaynIncz+xPwHDeAchu9MjVP3I7vh0wmEbpo5Ht7YC1c bH21uy+9OaSc4sYm1oZlRzUcs8owKMdSuKXoXmdOSZWwtlAxE+4gkSxkqUQIIi+O T5WVXENQjWR9FOpVPZZLMjvwb5XbeTdMcV4FtCZRUE/R6WhLkDTr8PJHYFGmDoxC FL13wrz/XtvfC66hqtuvJhKNJwOqhJjJSbeKRnwX2IuXAIUaQHCJkGEBddEfSuZH PimJM4p7XUbStdjyboSeECPnlX4JE+QDbJPaC1M6hLcazvPm5WIS6Roy2ovBBV/2 bIEqgo/PWDrZiOlBDMambe8MRId5bSVzIfQpz6o2IKZ2tyQNOjNzBY8R8+KcDQIM tinvf2OijcLFGh2abbhf =WCIN -----END PGP SIGNATURE----- --Apple-Mail=_08D14944-C06A-484C-A555-04B8B077EACF-- From owner-svn-src-all@freebsd.org Thu Aug 3 12:46:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69BD5DB6708; Thu, 3 Aug 2017 12:46:49 +0000 (UTC) (envelope-from joerg@bec.de) Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [IPv6:2001:4b98:c:538::194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35DA5760CB; Thu, 3 Aug 2017 12:46:49 +0000 (UTC) (envelope-from joerg@bec.de) Received: from britannica.bec.de (p200300D2ABC21B104639C4FFFE599710.dip0.t-ipconnect.de [IPv6:2003:d2:abc2:1b10:4639:c4ff:fe59:9710]) (Authenticated sender: joerg@bec.de) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 27F5CC5A51; Thu, 3 Aug 2017 14:46:45 +0200 (CEST) Date: Thu, 3 Aug 2017 14:46:27 +0200 From: Joerg Sonnenberger To: Bruce Evans Cc: Ngie Cooper , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r321969 - in head/sys/boot: arm/at91/libat91 arm/ixp425/boot2 i386/boot2 Message-ID: <20170803124627.GB2734@britannica.bec.de> References: <201708030527.v735R5dg041043@repo.freebsd.org> <20170803173421.C2203@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170803173421.C2203@besplex.bde.org> User-Agent: Mutt/1.8.3 (2017-05-23) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 12:46:49 -0000 On Thu, Aug 03, 2017 at 05:53:43PM +1000, Bruce Evans wrote: > Freestanding versions (static and otherwise) cause problems with builtins. > -ffreestanding turns off all builtins. The static memcpy used to be > ifdefed so as to use __builtin_memcpy instead of the static one if the > compiler is gcc. That apparently broke with gcc-4.2, since the builtin > will call libc memcpy() in some cases, although memcpy() is unavailable > in the freestanding case. GCC always had a requirement that freestanding environment must provide certain functions (memcpy, memmove, memset, memcmp). At least memcpy and memset are regulary used for certain code constructs. While most calls will be inlined, it is not required. Joerg From owner-svn-src-all@freebsd.org Thu Aug 3 12:51:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80DD3DB6BFB; Thu, 3 Aug 2017 12:51:45 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x229.google.com (mail-pf0-x229.google.com [IPv6:2607:f8b0:400e:c00::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 4A4D476445; Thu, 3 Aug 2017 12:51:45 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x229.google.com with SMTP id d67so6027592pfc.0; Thu, 03 Aug 2017 05:51:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=NWlqcWaCGlX2NOEdQ5SeuLPmtlsPOth5X8/aaoz8SIg=; b=kYk3b9OpaWvlub6NULKWerEHPdxWxTJ0K5zmqmHC6nfor4Vd4JMY+WnrGTRRkhEmGm s2MOyzPID6vkpckmzMXQUf6Vb1MexZhw6U9WJh2Wp9gOIpeiCikOMZpJLeso2ETj3Y9v +UYacX6rtvW3U+WdGaGYEImui4s66g4oiYRfY3+JgjCz5eP+p85S/IGAM/O6wuqRxZbr xe7X4axar2lpxLC9rIJdpoU8Es+N6pJm2B4y+6t8hYjqKAvbw7CnrakhGqT8CDbzgb5v XhSl8gQIVcVrHyQJzVJ3SqDyzZDZ/TY7Wbs3ZjygrXt47Kft2gtrgGgaB2u1q+4IWDDQ Qzqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=NWlqcWaCGlX2NOEdQ5SeuLPmtlsPOth5X8/aaoz8SIg=; b=T7UjS6n+f/GPwj8RWJtaAzSbhacE3UQrummF3J4/CFbI9/9Ks+MlUr+2uQvPNz+mOK 04h6gzI+A0errv0p9qpCxgvqFB3B+MIxES00w4Eo0YgKcqWjGn9e6fdBPSfvnMsAdNRY sCkshzQti5yzk/ALvnhOhdhRQCk0P4MW8hUKX+lvY4okcWmiEmwoVCwl8Q7HARRwOA2M KXj1HrYCdO0UqwqdbOZezPbyN4HspDXblGCOVtvmuAL9U3cM479goyuH2doowYlWRI+G 4argwB5CjaWAi4so+GO1BNRC8z79nuoDwq88L/F0sOnQEiOfck9st+NU1hiTPELPgvcx 215w== X-Gm-Message-State: AIVw110HSMAYTS0DlVuoSPXpwHouQbJ+sajYXcTWwxu5H8YXrdQ/Wvib Uso1QNzAhB+9IRL4+bY= X-Received: by 10.84.228.215 with SMTP id y23mr1778115pli.358.1501764704596; Thu, 03 Aug 2017 05:51:44 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id i67sm12875393pgd.25.2017.08.03.05.51.43 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 03 Aug 2017 05:51:43 -0700 (PDT) Subject: Re: svn commit: r321969 - in head/sys/boot: arm/at91/libat91 arm/ixp425/boot2 i386/boot2 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_00D0BBC5-84C1-4464-844F-7D7F64E274A1"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <20170803173421.C2203@besplex.bde.org> Date: Thu, 3 Aug 2017 05:51:42 -0700 Cc: Ngie Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201708030527.v735R5dg041043@repo.freebsd.org> <20170803173421.C2203@besplex.bde.org> To: Bruce Evans X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 12:51:45 -0000 --Apple-Mail=_00D0BBC5-84C1-4464-844F-7D7F64E274A1 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Aug 3, 2017, at 00:53, Bruce Evans wrote: >=20 > On Thu, 3 Aug 2017, Ngie Cooper wrote: >=20 >> Log: >> Fix the return types for printf and putchar to match their libc and >> POSIX equivalents >>=20 >> Both printf and putchar return int, not void. >>=20 >> This will allow code that leverages the libcalls and checks/rely on = the >> return type to interchangeably between loader code and non-loader >> code. >>=20 >> MFC after: 1 month >>=20 >> Modified: >> head/sys/boot/arm/at91/libat91/lib.h >> head/sys/boot/arm/at91/libat91/printf.c >> head/sys/boot/arm/at91/libat91/putchar.c >> head/sys/boot/arm/ixp425/boot2/ixp425_board.c >> head/sys/boot/arm/ixp425/boot2/lib.h >> head/sys/boot/i386/boot2/boot2.c >=20 > This is wrong for at least i386/boot2. It isn't part of the loader, = and > saves space by not returning unused values. >=20 >> Modified: head/sys/boot/i386/boot2/boot2.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/boot/i386/boot2/boot2.c Thu Aug 3 03:45:48 2017 = (r321968) >> +++ head/sys/boot/i386/boot2/boot2.c Thu Aug 3 05:27:05 2017 = (r321969) >> @@ -114,8 +114,8 @@ void exit(int); >> static void load(void); >> static int parse(void); >> static int dskread(void *, unsigned, unsigned); >> -static void printf(const char *,...); >> -static void putchar(int); >> +static int printf(const char *,...); >> +static int putchar(int); >=20 > These are freestanding static functions, so they have nothing to do > with library functions except their name is a hint that they are > similar. >=20 > Since they are static, -funit-at-a-time might allow the unused return = values > to be optimized away. Then returning unused values would be just an > obfuscation. >=20 > This file still has a static memcpy() which is quite different from = the > libc version. It doesn't return an unused value, and its arg types = are > all different (no newfangled size_t or newerfangled restrict). >=20 > Freestanding versions (static and otherwise) cause problems with = builtins. > -ffreestanding turns off all builtins. The static memcpy used to be > ifdefed so as to use __builtin_memcpy instead of the static one if the > compiler is gcc. That apparently broke with gcc-4.2, since the = builtin > will call libc memcpy() in some cases, although memcpy() is = unavailable > in the freestanding case. I get the point about them being freestanding functions, but if the = functions aren=E2=80=99t meant to be compatible they should be named = differently. Part of the issue some code that bridged loader and = non-loader users (bootdevtest and zfsboottest for example) relied on = feature parity (in part because the ZFS code required it and because of = how things are compiled/linked together). If compilers get pedantic = enough, then they=E2=80=99ll flag these issues as errors and we=E2=80=99ll= have to address these compatibilities at that point. My intent was ok (I think), but the implementation I did is wrong, so = I=E2=80=99ll revert the change completely and leave it for someone else = to deal with the incompatibilities (I=E2=80=99ll just integrate = bootdevtest and zfsboottest into buildworld under sys/boot so they = won=E2=80=99t remain broken for weeks on end, like they were recently). Thanks, -Ngie --Apple-Mail=_00D0BBC5-84C1-4464-844F-7D7F64E274A1 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZgxxeAAoJEPWDqSZpMIYV9cwQALEbGxM4T5iX8c8dSM8SnRXR ZIU7so3LCYyB90eUAejhAmf9DD0VKkPq/Jt4btMpht8Y5zqZuskvcweuAxTZlZ+y EDHVVrvz0afYO9iwjV3UVjVCE7Kh7aZ0PfH44Nu1SqseTxqd5mueG6Gi/oAXv0nu +n35vZnbNcyl1ZpPrxp+UQ01TcyOJkjUHwW+Bzb4EXtE+7DRzIkO2popNWvJf12a ht6iapBUWuTLj/zfPb2cSa2R+bWUeXBFVbGmP4ugIws/Nv2cgGbLpZw/EoAviYvq vh/7r/pzQDQPqg/Zz0QOlprZ1TtwsnJ+XaLPHmjXYanFplCZ6NRtIp2AWnRX++AT /7IQ0oaCUtos2oakqHgH9Xiw7vESpfSJxR8yZsYtYSH0xSG9gbR1gBBWCd0B1x6F 2Dvr5zzc2pOs9mDsPjiRsyU5lecKH1ULn81jIK/FSxmI34o0O/KjarYu4jDtabqE NkxfvQBYAl3XALM1iSfNuo640/gPJoHGI5lpuLhz4Pl/a6pMTNXUBk+dE1EX9lOK LkjtzqjAAvVly2tl4dLJWLPUeAoyjJNbOo2NbHzcp1zXwxqXEGFGwscY6ZIukCWy 6BGusj35HqWEQdhhgeRC2zXuLiQPnb/hkBSaVWTxisCL06rOgmnbBokkwgzVOXtp WdQ5xacFWGHgp0l1iGGq =TrgD -----END PGP SIGNATURE----- --Apple-Mail=_00D0BBC5-84C1-4464-844F-7D7F64E274A1-- From owner-svn-src-all@freebsd.org Thu Aug 3 13:26:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B4CFDBC730; Thu, 3 Aug 2017 13:26:52 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 153F877721; Thu, 3 Aug 2017 13:26:52 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v73DQpkP036981; Thu, 3 Aug 2017 13:26:51 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73DQpf1036980; Thu, 3 Aug 2017 13:26:51 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201708031326.v73DQpf1036980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Thu, 3 Aug 2017 13:26:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321989 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: loos X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 321989 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 13:26:52 -0000 Author: loos Date: Thu Aug 3 13:26:51 2017 New Revision: 321989 URL: https://svnweb.freebsd.org/changeset/base/321989 Log: Add myself to the calendar.freebsd. Reported by: mckusick Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Thu Aug 3 10:11:06 2017 (r321988) +++ head/usr.bin/calendar/calendars/calendar.freebsd Thu Aug 3 13:26:51 2017 (r321989) @@ -99,6 +99,7 @@ 03/07 Michael P. Pritchard born in Los Angeles, California, United States, 1964 03/07 Giorgos Keramidas born in Athens, Greece, 1976 03/10 Andreas Klemm born in Duesseldorf, Nordrhein-Westfalen, Germany, 1963 +03/10 Luiz Otavio O Souza born in Bauru, Sao Paulo, Brazil, 1978 03/10 Nikolai Lifanov born in Moscow, Russian Federation, 1989 03/11 Soeren Straarup born in Andst, Denmark, 1978 03/12 Greg Lewis born in Adelaide, South Australia, Australia, 1969 From owner-svn-src-all@freebsd.org Thu Aug 3 13:45:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7CCBDBD6C1; Thu, 3 Aug 2017 13:45:27 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C3DB7C59E; Thu, 3 Aug 2017 13:45:27 +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 v73DjQRV045591; Thu, 3 Aug 2017 13:45:26 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73DjQkL045590; Thu, 3 Aug 2017 13:45:26 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708031345.v73DjQkL045590@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Aug 2017 13:45:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321990 - stable/11/sys/dev/usb/controller X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/usb/controller X-SVN-Commit-Revision: 321990 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 13:45:27 -0000 Author: hselasky Date: Thu Aug 3 13:45:26 2017 New Revision: 321990 URL: https://svnweb.freebsd.org/changeset/base/321990 Log: MFC r320773: Implement fix for BULK IN-token retry mechanism. When the hardware is programmed for infinite IN token retry after NAK, the SAF1761 hardware, however, does not retry the IN-token. This problem is described in the SAF1761 errata, section 18.1.1. While at it: - Add some minor chip specific initialization for RTEMS. - Add debug print for status registers in the interrupt filter. Submitted by: Christian Mauderer Modified: stable/11/sys/dev/usb/controller/saf1761_otg.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/controller/saf1761_otg.c ============================================================================== --- stable/11/sys/dev/usb/controller/saf1761_otg.c Thu Aug 3 13:26:51 2017 (r321989) +++ stable/11/sys/dev/usb/controller/saf1761_otg.c Thu Aug 3 13:45:26 2017 (r321990) @@ -516,7 +516,25 @@ saf1761_host_bulk_data_rx(struct saf1761_otg_softc *sc DPRINTFN(5, "STATUS=0x%08x\n", status); if (status & SOTG_PTD_DW3_ACTIVE) { - goto busy; + temp = saf1761_peek_host_status_le_4(sc, + pdt_addr + SOTG_PTD_DW0); + if (temp & SOTG_PTD_DW0_VALID) { + goto busy; + } else { + status = saf1761_peek_host_status_le_4(sc, + pdt_addr + SOTG_PTD_DW3); + + /* check if still active */ + if (status & SOTG_PTD_DW3_ACTIVE) { + saf1761_host_channel_free(sc, td); + goto retry; + } else if (status & SOTG_PTD_DW3_HALTED) { + if (!(status & SOTG_PTD_DW3_ERRORS)) + td->error_stall = 1; + td->error_any = 1; + goto complete; + } + } } else if (status & SOTG_PTD_DW3_HALTED) { if (!(status & SOTG_PTD_DW3_ERRORS)) td->error_stall = 1; @@ -560,6 +578,7 @@ saf1761_host_bulk_data_rx(struct saf1761_otg_softc *sc } saf1761_host_channel_free(sc, td); } +retry: if (saf1761_host_channel_alloc(sc, td)) goto busy; @@ -1589,6 +1608,8 @@ saf1761_otg_filter_interrupt(void *arg) (void) SAF1761_READ_LE_4(sc, SOTG_INT_PTD_DONE_PTD); (void) SAF1761_READ_LE_4(sc, SOTG_ISO_PTD_DONE_PTD); + DPRINTFN(9, "HCINTERRUPT=0x%08x DCINTERRUPT=0x%08x\n", hcstat, status); + if (status & SOTG_DCINTERRUPT_IEPSOF) { if ((sc->sc_host_async_busy_map[1] | sc->sc_host_async_busy_map[0] | sc->sc_host_intr_busy_map[1] | sc->sc_host_intr_busy_map[0] | @@ -2446,11 +2467,15 @@ saf1761_otg_init(struct saf1761_otg_softc *sc) */ SAF1761_WRITE_LE_4(sc, SOTG_CTRL_SET_CLR, SOTG_CTRL_CLR(0xFFFF)); +#ifdef __rtems__ SAF1761_WRITE_LE_4(sc, SOTG_CTRL_SET_CLR, + SOTG_CTRL_SET(SOTG_CTRL_SEL_CP_EXT | SOTG_CTRL_VBUS_DRV)); +#else + SAF1761_WRITE_LE_4(sc, SOTG_CTRL_SET_CLR, SOTG_CTRL_SET(SOTG_CTRL_SW_SEL_HC_DC | SOTG_CTRL_BDIS_ACON_EN | SOTG_CTRL_SEL_CP_EXT | SOTG_CTRL_VBUS_DRV)); - +#endif /* disable device address */ SAF1761_WRITE_LE_4(sc, SOTG_ADDRESS, 0); From owner-svn-src-all@freebsd.org Thu Aug 3 13:50:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2FBDDBDC68; Thu, 3 Aug 2017 13:50:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7ED427C91A; Thu, 3 Aug 2017 13:50:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v73DokNK045972; Thu, 3 Aug 2017 13:50:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73DokLX045966; Thu, 3 Aug 2017 13:50:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201708031350.v73DokLX045966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 3 Aug 2017 13:50:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321991 - in head/sys/boot: arm/at91/libat91 arm/ixp425/boot2 i386/boot2 X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in head/sys/boot: arm/at91/libat91 arm/ixp425/boot2 i386/boot2 X-SVN-Commit-Revision: 321991 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 13:50:47 -0000 Author: ngie Date: Thu Aug 3 13:50:46 2017 New Revision: 321991 URL: https://svnweb.freebsd.org/changeset/base/321991 Log: Revert r321969 My change had good intentions, but the implementation was incorrect: - printf was returning the number of characters in the format string plus the NUL, but failed in two regards implementation wise: -- the pathological case, printf(""), wasn't being handled properly since the pointer is always incremented, so the value returned would be off-by-one. -- printf(3) reports the number of characters printed post-conversion via vfprintf, etc. - putchar(3) should return the character printed or EOF, not the number of characters output to the screen. My goal in making the change (again) was to increase parity, but as bde pointed out these are freestanding functions, so they don't have to conform to libc/POSIX. I argued that the functions should be named differently since the implementation is different enough to warrant it and to allow boot2 code to be usable when linked against sys/boot and libstand and other libraries in base. I have no interest in pushing this change forward more though, as the original concern I had behind the change with zfsboottest was resolved in r321849 and r321852. The next person that updates the toolchain gets to deal with the inconsistency if it's flagged by a newer compiler. MFC after: 1 month Reported by: ed, markj Modified: head/sys/boot/arm/at91/libat91/lib.h head/sys/boot/arm/at91/libat91/printf.c head/sys/boot/arm/at91/libat91/putchar.c head/sys/boot/arm/ixp425/boot2/ixp425_board.c head/sys/boot/arm/ixp425/boot2/lib.h head/sys/boot/i386/boot2/boot2.c Modified: head/sys/boot/arm/at91/libat91/lib.h ============================================================================== --- head/sys/boot/arm/at91/libat91/lib.h Thu Aug 3 13:45:26 2017 (r321990) +++ head/sys/boot/arm/at91/libat91/lib.h Thu Aug 3 13:50:46 2017 (r321991) @@ -28,9 +28,9 @@ #define ARM_BOOT_LIB_H int getc(int); -int putchar(int); -int xputchar(int); -int printf(const char *fmt,...); +void putchar(int); +void xputchar(int); +void printf(const char *fmt,...); /* The following function write eeprom at ee_addr using data */ /* from data_add for size bytes. */ Modified: head/sys/boot/arm/at91/libat91/printf.c ============================================================================== --- head/sys/boot/arm/at91/libat91/printf.c Thu Aug 3 13:45:26 2017 (r321990) +++ head/sys/boot/arm/at91/libat91/printf.c Thu Aug 3 13:50:46 2017 (r321991) @@ -20,13 +20,12 @@ #include #include "lib.h" -int +void printf(const char *fmt,...) { va_list ap; const char *hex = "0123456789abcdef"; char buf[10]; - const char *fmt_orig = fmt; char *s; unsigned u; int c; @@ -67,5 +66,5 @@ printf(const char *fmt,...) } va_end(ap); - return (int)(fmt - fmt_orig); + return; } Modified: head/sys/boot/arm/at91/libat91/putchar.c ============================================================================== --- head/sys/boot/arm/at91/libat91/putchar.c Thu Aug 3 13:45:26 2017 (r321990) +++ head/sys/boot/arm/at91/libat91/putchar.c Thu Aug 3 13:50:46 2017 (r321991) @@ -39,11 +39,11 @@ #include "lib.h" /* - * int putchar(int ch) + * void putchar(int ch) * Writes a character to the DBGU port. It assumes that DBGU has * already been initialized. */ -int +void putchar(int ch) { AT91PS_USART pUSART = (AT91PS_USART)AT91C_BASE_DBGU; @@ -51,14 +51,12 @@ putchar(int ch) while (!(pUSART->US_CSR & AT91C_US_TXRDY)) continue; pUSART->US_THR = (ch & 0xFF); - return (1); } -int +void xputchar(int ch) { - if (ch == '\n') - putchar('\r'); - putchar(ch); - return (ch == '\n' ? 2 : 1); + if (ch == '\n') + putchar('\r'); + putchar(ch); } Modified: head/sys/boot/arm/ixp425/boot2/ixp425_board.c ============================================================================== --- head/sys/boot/arm/ixp425/boot2/ixp425_board.c Thu Aug 3 13:45:26 2017 (r321990) +++ head/sys/boot/arm/ixp425/boot2/ixp425_board.c Thu Aug 3 13:50:46 2017 (r321991) @@ -165,7 +165,7 @@ getc(int seconds) return c; } -int +void putchar(int ch) { int delay, limit; @@ -179,16 +179,14 @@ putchar(int ch) limit = 40; while ((uart_getreg(ubase, REG_LSR) & LSR_TEMT) == 0 && --limit) DELAY(delay); - return (1); } -int +void xputchar(int ch) { if (ch == '\n') putchar('\r'); putchar(ch); - return (ch == '\n' ? 2 : 1); } void Modified: head/sys/boot/arm/ixp425/boot2/lib.h ============================================================================== --- head/sys/boot/arm/ixp425/boot2/lib.h Thu Aug 3 13:45:26 2017 (r321990) +++ head/sys/boot/arm/ixp425/boot2/lib.h Thu Aug 3 13:50:46 2017 (r321991) @@ -35,12 +35,12 @@ int main(void); void DELAY(int); int getc(int); -int putchar(int); -int xputchar(int); +void putchar(int); +void xputchar(int); void putstr(const char *); void puthex8(u_int8_t); void puthexlist(const u_int8_t *, int); -int printf(const char *fmt,...); +void printf(const char *fmt,...); void bzero(void *, size_t); char *strcpy(char *to, const char *from); Modified: head/sys/boot/i386/boot2/boot2.c ============================================================================== --- head/sys/boot/i386/boot2/boot2.c Thu Aug 3 13:45:26 2017 (r321990) +++ head/sys/boot/i386/boot2/boot2.c Thu Aug 3 13:50:46 2017 (r321991) @@ -114,8 +114,8 @@ void exit(int); static void load(void); static int parse(void); static int dskread(void *, unsigned, unsigned); -static int printf(const char *,...); -static int putchar(int); +static void printf(const char *,...); +static void putchar(int); static int drvread(void *, unsigned, unsigned); static int keyhit(unsigned); static int xputc(int); @@ -521,12 +521,11 @@ error: return -1; } -static int +static void printf(const char *fmt,...) { va_list ap; static char buf[10]; - const char *fmt_orig = fmt; char *s; unsigned u; int c; @@ -557,16 +556,15 @@ printf(const char *fmt,...) putchar(c); } va_end(ap); - return (int)(fmt - fmt_orig); + return; } -static int +static void putchar(int c) { if (c == '\n') xputc('\r'); xputc(c); - return (c == '\n' ? 2 : 1); } static int From owner-svn-src-all@freebsd.org Thu Aug 3 13:51:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C750DDBDE2C; Thu, 3 Aug 2017 13:51:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F03E7CABA; Thu, 3 Aug 2017 13:51:19 +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 v73DpIn5046704; Thu, 3 Aug 2017 13:51:18 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73DpIYK046702; Thu, 3 Aug 2017 13:51:18 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708031351.v73DpIYK046702@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Aug 2017 13:51:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321992 - stable/11/sys/dev/mlx5 X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/mlx5 X-SVN-Commit-Revision: 321992 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 13:51:19 -0000 Author: hselasky Date: Thu Aug 3 13:51:18 2017 New Revision: 321992 URL: https://svnweb.freebsd.org/changeset/base/321992 Log: MFC r312526: Update firmware interface structures and definitions adding support for new features and commands. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_ifc.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_ifc.h ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_ifc.h Thu Aug 3 13:50:46 2017 (r321991) +++ stable/11/sys/dev/mlx5/mlx5_ifc.h Thu Aug 3 13:51:18 2017 (r321992) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2015, Mellanox Technologies, Ltd. All rights reserved. + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -23,13 +23,8 @@ * SUCH DAMAGE. * * $FreeBSD$ + */ - Autogenerated file. - Date: 2015-04-13 14:59 - Source Document Name: Mellanox - Source Document Version: 0.28 - Generated by adb_to_c.py (EAT.ME Version: 1.0.70) -*/ #ifndef MLX5_IFC_H #define MLX5_IFC_H @@ -56,6 +51,8 @@ enum { MLX5_EVENT_TYPE_CODING_TEMP_WARNING_EVENT = 0x17, MLX5_EVENT_TYPE_REMOTE_CONFIG = 0x19, MLX5_EVENT_TYPE_CODING_DCBX_CHANGE_EVENT = 0x1e, + MLX5_EVENT_TYPE_CODING_PPS_EVENT = 0x25, + MLX5_EVENT_TYPE_CODING_GENERAL_NOTIFICATION_EVENT = 0x22, MLX5_EVENT_TYPE_DB_BF_CONGESTION = 0x1a, MLX5_EVENT_TYPE_STALL_EVENT = 0x1b, MLX5_EVENT_TYPE_DROPPED_PACKET_LOGGED_EVENT = 0x1f, @@ -89,6 +86,8 @@ enum { MLX5_CMD_OP_QUERY_ISSI = 0x10a, MLX5_CMD_OP_SET_ISSI = 0x10b, MLX5_CMD_OP_SET_DRIVER_VERSION = 0x10d, + MLX5_CMD_OP_QUERY_OTHER_HCA_CAP = 0x10e, + MLX5_CMD_OP_MODIFY_OTHER_HCA_CAP = 0x10f, MLX5_CMD_OP_CREATE_MKEY = 0x200, MLX5_CMD_OP_QUERY_MKEY = 0x201, MLX5_CMD_OP_DESTROY_MKEY = 0x202, @@ -190,6 +189,12 @@ enum { MLX5_CMD_OP_DELETE_L2_TABLE_ENTRY = 0x82b, MLX5_CMD_OP_SET_WOL_ROL = 0x830, MLX5_CMD_OP_QUERY_WOL_ROL = 0x831, + MLX5_CMD_OP_CREATE_LAG = 0x840, + MLX5_CMD_OP_MODIFY_LAG = 0x841, + MLX5_CMD_OP_QUERY_LAG = 0x842, + MLX5_CMD_OP_DESTROY_LAG = 0x843, + MLX5_CMD_OP_CREATE_VPORT_LAG = 0x844, + MLX5_CMD_OP_DESTROY_VPORT_LAG = 0x845, MLX5_CMD_OP_CREATE_TIR = 0x900, MLX5_CMD_OP_MODIFY_TIR = 0x901, MLX5_CMD_OP_DESTROY_TIR = 0x902, @@ -206,6 +211,8 @@ enum { MLX5_CMD_OP_MODIFY_RMP = 0x90d, MLX5_CMD_OP_DESTROY_RMP = 0x90e, MLX5_CMD_OP_QUERY_RMP = 0x90f, + MLX5_CMD_OP_SET_DELAY_DROP_PARAMS = 0x910, + MLX5_CMD_OP_QUERY_DELAY_DROP_PARAMS = 0x911, MLX5_CMD_OP_CREATE_TIS = 0x912, MLX5_CMD_OP_MODIFY_TIS = 0x913, MLX5_CMD_OP_DESTROY_TIS = 0x914, @@ -226,7 +233,10 @@ enum { MLX5_CMD_OP_DELETE_FLOW_TABLE_ENTRY = 0x938, MLX5_CMD_OP_ALLOC_FLOW_COUNTER = 0x939, MLX5_CMD_OP_DEALLOC_FLOW_COUNTER = 0x93a, - MLX5_CMD_OP_QUERY_FLOW_COUNTER = 0x93b + MLX5_CMD_OP_QUERY_FLOW_COUNTER = 0x93b, + MLX5_CMD_OP_MODIFY_FLOW_TABLE = 0x93c, + MLX5_CMD_OP_ALLOC_ENCAP_HEADER = 0x93d, + MLX5_CMD_OP_DEALLOC_ENCAP_HEADER = 0x93e, }; enum { @@ -271,7 +281,11 @@ struct mlx5_ifc_flow_table_fields_supported_bits { u8 outer_gre_protocol[0x1]; u8 outer_gre_key[0x1]; u8 outer_vxlan_vni[0x1]; - u8 reserved_2[0x5]; + u8 outer_geneve_vni[0x1]; + u8 outer_geneve_oam[0x1]; + u8 outer_geneve_protocol_type[0x1]; + u8 outer_geneve_opt_len[0x1]; + u8 reserved_2[0x1]; u8 source_eswitch_port[0x1]; u8 inner_dmac[0x1]; @@ -299,10 +313,12 @@ struct mlx5_ifc_flow_table_fields_supported_bits { u8 inner_tcp_flags[0x1]; u8 reserved_5[0x9]; - u8 reserved_6[0x1f]; + u8 reserved_6[0x1a]; + u8 bth_dst_qp[0x1]; + u8 reserved_7[0x4]; u8 source_sqn[0x1]; - u8 reserved_7[0x20]; + u8 reserved_8[0x20]; }; struct mlx5_ifc_eth_discard_cntrs_grp_bits { @@ -356,7 +372,11 @@ struct mlx5_ifc_eth_discard_cntrs_grp_bits { u8 egress_stp_filter_low[0x20]; - u8 reserved_at_340[0x480]; + u8 egress_hoq_stall_high[0x20]; + + u8 egress_hoq_stall_low[0x20]; + + u8 reserved_at_340[0x440]; }; struct mlx5_ifc_flow_table_prop_layout_bits { u8 ft_support[0x1]; @@ -411,6 +431,7 @@ enum { MLX5_FLOW_CONTEXT_DEST_TYPE_VPORT = 0x0, MLX5_FLOW_CONTEXT_DEST_TYPE_FLOW_TABLE = 0x1, MLX5_FLOW_CONTEXT_DEST_TYPE_TIR = 0x2, + MLX5_FLOW_CONTEXT_DEST_TYPE_QP = 0x3, }; struct mlx5_ifc_dest_format_struct_bits { @@ -490,9 +511,14 @@ struct mlx5_ifc_fte_match_set_misc_bits { u8 reserved_6[0xc]; u8 inner_ipv6_flow_label[0x14]; - u8 reserved7[0x10]; + u8 reserved_7[0xa]; + u8 geneve_opt_len[0x6]; u8 geneve_protocol_type[0x10]; - u8 reserved8[0xc0]; + + u8 reserved_8[0x8]; + u8 bth_dst_qp[0x18]; + + u8 reserved_9[0xa0]; }; struct mlx5_ifc_cmd_pas_bits { @@ -698,7 +724,8 @@ struct mlx5_ifc_per_protocol_networking_offload_caps_b u8 lro_psh_flag[0x1]; u8 lro_time_stamp[0x1]; u8 lro_max_msg_sz_mode[0x2]; - u8 reserved_0[0x2]; + u8 wqe_vlan_insert[0x1]; + u8 self_lb_en_modifiable[0x1]; u8 self_lb_mc[0x1]; u8 self_lb_uc[0x1]; u8 max_lso_cap[0x5]; @@ -715,7 +742,8 @@ struct mlx5_ifc_per_protocol_networking_offload_caps_b u8 swp[0x1]; u8 swp_csum[0x1]; u8 swp_lso[0x1]; - u8 reserved_2[0x1c]; + u8 reserved_2[0x1b]; + u8 max_geneve_opt_len[0x1]; u8 tunnel_stateless_geneve_rx[0x1]; u8 reserved_3[0x10]; @@ -910,7 +938,8 @@ struct mlx5_ifc_cmd_hca_cap_bits { u8 vport_counters[0x1]; u8 retransmission_q_counters[0x1]; u8 debug[0x1]; - u8 reserved_16[0x2]; + u8 modify_rq_counters_set_id[0x1]; + u8 rq_delay_drop[0x1]; u8 max_qp_cnt[0xa]; u8 pkey_table_size[0x10]; @@ -980,7 +1009,9 @@ struct mlx5_ifc_cmd_hca_cap_bits { u8 cq_oi[0x1]; u8 cq_resize[0x1]; u8 cq_moderation[0x1]; - u8 reserved_31[0x3]; + u8 cq_period_mode_modify[0x1]; + u8 cq_invalidate[0x1]; + u8 reserved_at_225[0x1]; u8 cq_eq_remap[0x1]; u8 pg[0x1]; u8 block_lb_mc[0x1]; @@ -1068,7 +1099,8 @@ struct mlx5_ifc_cmd_hca_cap_bits { u8 log_max_wq_sz[0x5]; u8 nic_vport_change_event[0x1]; - u8 reserved_59[0xa]; + u8 disable_local_lb[0x1]; + u8 reserved_59[0x9]; u8 log_max_vlan_list[0x5]; u8 reserved_60[0x3]; u8 log_max_current_mc_list[0x5]; @@ -1312,6 +1344,8 @@ enum { MLX5_MODIFY_FIELD_SELECT_MODIFY_FIELD_SELECT_CQ_MAX_COUNT = 0x2, MLX5_MODIFY_FIELD_SELECT_MODIFY_FIELD_SELECT_OI = 0x4, MLX5_MODIFY_FIELD_SELECT_MODIFY_FIELD_SELECT_C_EQN = 0x8, + MLX5_MODIFY_FIELD_SELECT_MODIFY_FIELD_SELECT_CQ_PERIOD_MODE = 0x10, + MLX5_MODIFY_FIELD_SELECT_MODIFY_FIELD_SELECT_STATUS = 0x20, }; struct mlx5_ifc_modify_field_select_bits { @@ -2239,9 +2273,15 @@ enum { MLX5_RQC_STATE_ERR = 0x3, }; +enum { + MLX5_RQC_DROPLESS_MODE_DISABLE = 0x0, + MLX5_RQC_DROPLESS_MODE_ENABLE = 0x1, +}; + struct mlx5_ifc_rqc_bits { - u8 rlky[0x1]; - u8 reserved_0[0x2]; + u8 rlkey[0x1]; + u8 delay_drop_en[0x1]; + u8 scatter_fcs[0x1]; u8 vlan_strip_disable[0x1]; u8 mem_rq_type[0x4]; u8 state[0x4]; @@ -2293,7 +2333,9 @@ enum { struct mlx5_ifc_nic_vport_context_bits { u8 reserved_0[0x5]; u8 min_wqe_inline_mode[0x3]; - u8 reserved_1[0x17]; + u8 reserved_1[0x15]; + u8 disable_mc_local_lb[0x1]; + u8 disable_uc_local_lb[0x1]; u8 roce_en[0x1]; u8 arm_change_event[0x1]; @@ -3075,6 +3117,50 @@ struct mlx5_ifc_teardown_hca_in_bits { u8 reserved_3[0x20]; }; +struct mlx5_ifc_set_delay_drop_params_out_bits { + u8 status[0x8]; + u8 reserved_at_8[0x18]; + + u8 syndrome[0x20]; + + u8 reserved_at_40[0x40]; +}; + +struct mlx5_ifc_set_delay_drop_params_in_bits { + u8 opcode[0x10]; + u8 reserved_at_10[0x10]; + + u8 reserved_at_20[0x10]; + u8 op_mod[0x10]; + + u8 reserved_at_40[0x20]; + + u8 reserved_at_60[0x10]; + u8 delay_drop_timeout[0x10]; +}; + +struct mlx5_ifc_query_delay_drop_params_out_bits { + u8 status[0x8]; + u8 reserved_at_8[0x18]; + + u8 syndrome[0x20]; + + u8 reserved_at_40[0x20]; + + u8 reserved_at_60[0x10]; + u8 delay_drop_timeout[0x10]; +}; + +struct mlx5_ifc_query_delay_drop_params_in_bits { + u8 opcode[0x10]; + u8 reserved_at_10[0x10]; + + u8 reserved_at_20[0x10]; + u8 op_mod[0x10]; + + u8 reserved_at_40[0x40]; +}; + struct mlx5_ifc_suspend_qp_out_bits { u8 status[0x8]; u8 reserved_0[0x18]; @@ -4076,31 +4162,39 @@ struct mlx5_ifc_query_q_counter_out_bits { u8 out_of_buffer[0x20]; - u8 reserved_7[0x20]; + u8 reserved_7[0x20]; u8 out_of_sequence[0x20]; - u8 reserved_8[0x20]; + u8 reserved_8[0x20]; - u8 duplicate_request[0x20]; + u8 duplicate_request[0x20]; - u8 reserved_9[0x20]; + u8 reserved_9[0x20]; - u8 rnr_nak_retry_err[0x20]; + u8 rnr_nak_retry_err[0x20]; - u8 reserved_10[0x20]; + u8 reserved_10[0x20]; - u8 packet_seq_err[0x20]; + u8 packet_seq_err[0x20]; - u8 reserved_11[0x20]; + u8 reserved_11[0x20]; - u8 implied_nak_seq_err[0x20]; + u8 implied_nak_seq_err[0x20]; - u8 reserved_12[0x20]; + u8 reserved_12[0x20]; - u8 local_ack_timeout_err[0x20]; + u8 local_ack_timeout_err[0x20]; - u8 reserved_13[0x4e0]; + u8 reserved_13[0x20]; + + u8 resp_rnr_nak[0x20]; + + u8 reserved_14[0x20]; + + u8 req_rnr_retries_exceeded[0x20]; + + u8 reserved_15[0x460]; }; struct mlx5_ifc_query_q_counter_in_bits { @@ -5204,7 +5298,9 @@ struct mlx5_ifc_modify_nic_vport_context_out_bits { }; struct mlx5_ifc_modify_nic_vport_field_select_bits { - u8 reserved_0[0x16]; + u8 reserved_0[0x14]; + u8 disable_uc_local_lb[0x1]; + u8 disable_mc_local_lb[0x1]; u8 node_guid[0x1]; u8 port_guid[0x1]; u8 min_wqe_inline_mode[0x1]; @@ -7958,6 +8054,42 @@ struct mlx5_ifc_phys_layer_cntrs_bits { u8 reserved_0[0x180]; }; +struct mlx5_ifc_phys_layer_statistical_cntrs_bits { + u8 time_since_last_clear_high[0x20]; + + u8 time_since_last_clear_low[0x20]; + + u8 phy_received_bits_high[0x20]; + + u8 phy_received_bits_low[0x20]; + + u8 phy_symbol_errors_high[0x20]; + + u8 phy_symbol_errors_low[0x20]; + + u8 phy_corrected_bits_high[0x20]; + + u8 phy_corrected_bits_low[0x20]; + + u8 phy_corrected_bits_lane0_high[0x20]; + + u8 phy_corrected_bits_lane0_low[0x20]; + + u8 phy_corrected_bits_lane1_high[0x20]; + + u8 phy_corrected_bits_lane1_low[0x20]; + + u8 phy_corrected_bits_lane2_high[0x20]; + + u8 phy_corrected_bits_lane2_low[0x20]; + + u8 phy_corrected_bits_lane3_high[0x20]; + + u8 phy_corrected_bits_lane3_low[0x20]; + + u8 reserved_at_200[0x5c0]; +}; + struct mlx5_ifc_infiniband_port_cntrs_bits { u8 symbol_error_counter[0x10]; u8 link_error_recovery_counter[0x8]; @@ -9187,6 +9319,7 @@ union mlx5_ifc_eth_cntrs_grp_data_layout_auto_bits { struct mlx5_ifc_eth_discard_cntrs_grp_bits eth_discard_cntrs_grp; struct mlx5_ifc_eth_per_prio_grp_data_layout_bits eth_per_prio_grp_data_layout; struct mlx5_ifc_phys_layer_cntrs_bits phys_layer_cntrs; + struct mlx5_ifc_phys_layer_statistical_cntrs_bits phys_layer_statistical_cntrs; struct mlx5_ifc_infiniband_port_cntrs_bits infiniband_port_cntrs; u8 reserved_0[0x7c0]; }; From owner-svn-src-all@freebsd.org Thu Aug 3 13:52:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B65E7DBDF7E; Thu, 3 Aug 2017 13:52:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 59AEC7CDD8; Thu, 3 Aug 2017 13:52:41 +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 v73DqebI049673; Thu, 3 Aug 2017 13:52:40 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73DqeFB049672; Thu, 3 Aug 2017 13:52:40 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708031352.v73DqeFB049672@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Aug 2017 13:52:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321993 - stable/10/sys/dev/mlx5 X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/dev/mlx5 X-SVN-Commit-Revision: 321993 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 13:52:41 -0000 Author: hselasky Date: Thu Aug 3 13:52:39 2017 New Revision: 321993 URL: https://svnweb.freebsd.org/changeset/base/321993 Log: MFC r312526: Update firmware interface structures and definitions adding support for new features and commands. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_ifc.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_ifc.h ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_ifc.h Thu Aug 3 13:51:18 2017 (r321992) +++ stable/10/sys/dev/mlx5/mlx5_ifc.h Thu Aug 3 13:52:39 2017 (r321993) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2015, Mellanox Technologies, Ltd. All rights reserved. + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -23,13 +23,8 @@ * SUCH DAMAGE. * * $FreeBSD$ + */ - Autogenerated file. - Date: 2015-04-13 14:59 - Source Document Name: Mellanox - Source Document Version: 0.28 - Generated by adb_to_c.py (EAT.ME Version: 1.0.70) -*/ #ifndef MLX5_IFC_H #define MLX5_IFC_H @@ -56,6 +51,8 @@ enum { MLX5_EVENT_TYPE_CODING_TEMP_WARNING_EVENT = 0x17, MLX5_EVENT_TYPE_REMOTE_CONFIG = 0x19, MLX5_EVENT_TYPE_CODING_DCBX_CHANGE_EVENT = 0x1e, + MLX5_EVENT_TYPE_CODING_PPS_EVENT = 0x25, + MLX5_EVENT_TYPE_CODING_GENERAL_NOTIFICATION_EVENT = 0x22, MLX5_EVENT_TYPE_DB_BF_CONGESTION = 0x1a, MLX5_EVENT_TYPE_STALL_EVENT = 0x1b, MLX5_EVENT_TYPE_DROPPED_PACKET_LOGGED_EVENT = 0x1f, @@ -89,6 +86,8 @@ enum { MLX5_CMD_OP_QUERY_ISSI = 0x10a, MLX5_CMD_OP_SET_ISSI = 0x10b, MLX5_CMD_OP_SET_DRIVER_VERSION = 0x10d, + MLX5_CMD_OP_QUERY_OTHER_HCA_CAP = 0x10e, + MLX5_CMD_OP_MODIFY_OTHER_HCA_CAP = 0x10f, MLX5_CMD_OP_CREATE_MKEY = 0x200, MLX5_CMD_OP_QUERY_MKEY = 0x201, MLX5_CMD_OP_DESTROY_MKEY = 0x202, @@ -190,6 +189,12 @@ enum { MLX5_CMD_OP_DELETE_L2_TABLE_ENTRY = 0x82b, MLX5_CMD_OP_SET_WOL_ROL = 0x830, MLX5_CMD_OP_QUERY_WOL_ROL = 0x831, + MLX5_CMD_OP_CREATE_LAG = 0x840, + MLX5_CMD_OP_MODIFY_LAG = 0x841, + MLX5_CMD_OP_QUERY_LAG = 0x842, + MLX5_CMD_OP_DESTROY_LAG = 0x843, + MLX5_CMD_OP_CREATE_VPORT_LAG = 0x844, + MLX5_CMD_OP_DESTROY_VPORT_LAG = 0x845, MLX5_CMD_OP_CREATE_TIR = 0x900, MLX5_CMD_OP_MODIFY_TIR = 0x901, MLX5_CMD_OP_DESTROY_TIR = 0x902, @@ -206,6 +211,8 @@ enum { MLX5_CMD_OP_MODIFY_RMP = 0x90d, MLX5_CMD_OP_DESTROY_RMP = 0x90e, MLX5_CMD_OP_QUERY_RMP = 0x90f, + MLX5_CMD_OP_SET_DELAY_DROP_PARAMS = 0x910, + MLX5_CMD_OP_QUERY_DELAY_DROP_PARAMS = 0x911, MLX5_CMD_OP_CREATE_TIS = 0x912, MLX5_CMD_OP_MODIFY_TIS = 0x913, MLX5_CMD_OP_DESTROY_TIS = 0x914, @@ -226,7 +233,10 @@ enum { MLX5_CMD_OP_DELETE_FLOW_TABLE_ENTRY = 0x938, MLX5_CMD_OP_ALLOC_FLOW_COUNTER = 0x939, MLX5_CMD_OP_DEALLOC_FLOW_COUNTER = 0x93a, - MLX5_CMD_OP_QUERY_FLOW_COUNTER = 0x93b + MLX5_CMD_OP_QUERY_FLOW_COUNTER = 0x93b, + MLX5_CMD_OP_MODIFY_FLOW_TABLE = 0x93c, + MLX5_CMD_OP_ALLOC_ENCAP_HEADER = 0x93d, + MLX5_CMD_OP_DEALLOC_ENCAP_HEADER = 0x93e, }; enum { @@ -271,7 +281,11 @@ struct mlx5_ifc_flow_table_fields_supported_bits { u8 outer_gre_protocol[0x1]; u8 outer_gre_key[0x1]; u8 outer_vxlan_vni[0x1]; - u8 reserved_2[0x5]; + u8 outer_geneve_vni[0x1]; + u8 outer_geneve_oam[0x1]; + u8 outer_geneve_protocol_type[0x1]; + u8 outer_geneve_opt_len[0x1]; + u8 reserved_2[0x1]; u8 source_eswitch_port[0x1]; u8 inner_dmac[0x1]; @@ -299,10 +313,12 @@ struct mlx5_ifc_flow_table_fields_supported_bits { u8 inner_tcp_flags[0x1]; u8 reserved_5[0x9]; - u8 reserved_6[0x1f]; + u8 reserved_6[0x1a]; + u8 bth_dst_qp[0x1]; + u8 reserved_7[0x4]; u8 source_sqn[0x1]; - u8 reserved_7[0x20]; + u8 reserved_8[0x20]; }; struct mlx5_ifc_eth_discard_cntrs_grp_bits { @@ -356,7 +372,11 @@ struct mlx5_ifc_eth_discard_cntrs_grp_bits { u8 egress_stp_filter_low[0x20]; - u8 reserved_at_340[0x480]; + u8 egress_hoq_stall_high[0x20]; + + u8 egress_hoq_stall_low[0x20]; + + u8 reserved_at_340[0x440]; }; struct mlx5_ifc_flow_table_prop_layout_bits { u8 ft_support[0x1]; @@ -411,6 +431,7 @@ enum { MLX5_FLOW_CONTEXT_DEST_TYPE_VPORT = 0x0, MLX5_FLOW_CONTEXT_DEST_TYPE_FLOW_TABLE = 0x1, MLX5_FLOW_CONTEXT_DEST_TYPE_TIR = 0x2, + MLX5_FLOW_CONTEXT_DEST_TYPE_QP = 0x3, }; struct mlx5_ifc_dest_format_struct_bits { @@ -490,9 +511,14 @@ struct mlx5_ifc_fte_match_set_misc_bits { u8 reserved_6[0xc]; u8 inner_ipv6_flow_label[0x14]; - u8 reserved7[0x10]; + u8 reserved_7[0xa]; + u8 geneve_opt_len[0x6]; u8 geneve_protocol_type[0x10]; - u8 reserved8[0xc0]; + + u8 reserved_8[0x8]; + u8 bth_dst_qp[0x18]; + + u8 reserved_9[0xa0]; }; struct mlx5_ifc_cmd_pas_bits { @@ -698,7 +724,8 @@ struct mlx5_ifc_per_protocol_networking_offload_caps_b u8 lro_psh_flag[0x1]; u8 lro_time_stamp[0x1]; u8 lro_max_msg_sz_mode[0x2]; - u8 reserved_0[0x2]; + u8 wqe_vlan_insert[0x1]; + u8 self_lb_en_modifiable[0x1]; u8 self_lb_mc[0x1]; u8 self_lb_uc[0x1]; u8 max_lso_cap[0x5]; @@ -715,7 +742,8 @@ struct mlx5_ifc_per_protocol_networking_offload_caps_b u8 swp[0x1]; u8 swp_csum[0x1]; u8 swp_lso[0x1]; - u8 reserved_2[0x1c]; + u8 reserved_2[0x1b]; + u8 max_geneve_opt_len[0x1]; u8 tunnel_stateless_geneve_rx[0x1]; u8 reserved_3[0x10]; @@ -910,7 +938,8 @@ struct mlx5_ifc_cmd_hca_cap_bits { u8 vport_counters[0x1]; u8 retransmission_q_counters[0x1]; u8 debug[0x1]; - u8 reserved_16[0x2]; + u8 modify_rq_counters_set_id[0x1]; + u8 rq_delay_drop[0x1]; u8 max_qp_cnt[0xa]; u8 pkey_table_size[0x10]; @@ -980,7 +1009,9 @@ struct mlx5_ifc_cmd_hca_cap_bits { u8 cq_oi[0x1]; u8 cq_resize[0x1]; u8 cq_moderation[0x1]; - u8 reserved_31[0x3]; + u8 cq_period_mode_modify[0x1]; + u8 cq_invalidate[0x1]; + u8 reserved_at_225[0x1]; u8 cq_eq_remap[0x1]; u8 pg[0x1]; u8 block_lb_mc[0x1]; @@ -1068,7 +1099,8 @@ struct mlx5_ifc_cmd_hca_cap_bits { u8 log_max_wq_sz[0x5]; u8 nic_vport_change_event[0x1]; - u8 reserved_59[0xa]; + u8 disable_local_lb[0x1]; + u8 reserved_59[0x9]; u8 log_max_vlan_list[0x5]; u8 reserved_60[0x3]; u8 log_max_current_mc_list[0x5]; @@ -1312,6 +1344,8 @@ enum { MLX5_MODIFY_FIELD_SELECT_MODIFY_FIELD_SELECT_CQ_MAX_COUNT = 0x2, MLX5_MODIFY_FIELD_SELECT_MODIFY_FIELD_SELECT_OI = 0x4, MLX5_MODIFY_FIELD_SELECT_MODIFY_FIELD_SELECT_C_EQN = 0x8, + MLX5_MODIFY_FIELD_SELECT_MODIFY_FIELD_SELECT_CQ_PERIOD_MODE = 0x10, + MLX5_MODIFY_FIELD_SELECT_MODIFY_FIELD_SELECT_STATUS = 0x20, }; struct mlx5_ifc_modify_field_select_bits { @@ -2239,9 +2273,15 @@ enum { MLX5_RQC_STATE_ERR = 0x3, }; +enum { + MLX5_RQC_DROPLESS_MODE_DISABLE = 0x0, + MLX5_RQC_DROPLESS_MODE_ENABLE = 0x1, +}; + struct mlx5_ifc_rqc_bits { - u8 rlky[0x1]; - u8 reserved_0[0x2]; + u8 rlkey[0x1]; + u8 delay_drop_en[0x1]; + u8 scatter_fcs[0x1]; u8 vlan_strip_disable[0x1]; u8 mem_rq_type[0x4]; u8 state[0x4]; @@ -2293,7 +2333,9 @@ enum { struct mlx5_ifc_nic_vport_context_bits { u8 reserved_0[0x5]; u8 min_wqe_inline_mode[0x3]; - u8 reserved_1[0x17]; + u8 reserved_1[0x15]; + u8 disable_mc_local_lb[0x1]; + u8 disable_uc_local_lb[0x1]; u8 roce_en[0x1]; u8 arm_change_event[0x1]; @@ -3075,6 +3117,50 @@ struct mlx5_ifc_teardown_hca_in_bits { u8 reserved_3[0x20]; }; +struct mlx5_ifc_set_delay_drop_params_out_bits { + u8 status[0x8]; + u8 reserved_at_8[0x18]; + + u8 syndrome[0x20]; + + u8 reserved_at_40[0x40]; +}; + +struct mlx5_ifc_set_delay_drop_params_in_bits { + u8 opcode[0x10]; + u8 reserved_at_10[0x10]; + + u8 reserved_at_20[0x10]; + u8 op_mod[0x10]; + + u8 reserved_at_40[0x20]; + + u8 reserved_at_60[0x10]; + u8 delay_drop_timeout[0x10]; +}; + +struct mlx5_ifc_query_delay_drop_params_out_bits { + u8 status[0x8]; + u8 reserved_at_8[0x18]; + + u8 syndrome[0x20]; + + u8 reserved_at_40[0x20]; + + u8 reserved_at_60[0x10]; + u8 delay_drop_timeout[0x10]; +}; + +struct mlx5_ifc_query_delay_drop_params_in_bits { + u8 opcode[0x10]; + u8 reserved_at_10[0x10]; + + u8 reserved_at_20[0x10]; + u8 op_mod[0x10]; + + u8 reserved_at_40[0x40]; +}; + struct mlx5_ifc_suspend_qp_out_bits { u8 status[0x8]; u8 reserved_0[0x18]; @@ -4076,31 +4162,39 @@ struct mlx5_ifc_query_q_counter_out_bits { u8 out_of_buffer[0x20]; - u8 reserved_7[0x20]; + u8 reserved_7[0x20]; u8 out_of_sequence[0x20]; - u8 reserved_8[0x20]; + u8 reserved_8[0x20]; - u8 duplicate_request[0x20]; + u8 duplicate_request[0x20]; - u8 reserved_9[0x20]; + u8 reserved_9[0x20]; - u8 rnr_nak_retry_err[0x20]; + u8 rnr_nak_retry_err[0x20]; - u8 reserved_10[0x20]; + u8 reserved_10[0x20]; - u8 packet_seq_err[0x20]; + u8 packet_seq_err[0x20]; - u8 reserved_11[0x20]; + u8 reserved_11[0x20]; - u8 implied_nak_seq_err[0x20]; + u8 implied_nak_seq_err[0x20]; - u8 reserved_12[0x20]; + u8 reserved_12[0x20]; - u8 local_ack_timeout_err[0x20]; + u8 local_ack_timeout_err[0x20]; - u8 reserved_13[0x4e0]; + u8 reserved_13[0x20]; + + u8 resp_rnr_nak[0x20]; + + u8 reserved_14[0x20]; + + u8 req_rnr_retries_exceeded[0x20]; + + u8 reserved_15[0x460]; }; struct mlx5_ifc_query_q_counter_in_bits { @@ -5204,7 +5298,9 @@ struct mlx5_ifc_modify_nic_vport_context_out_bits { }; struct mlx5_ifc_modify_nic_vport_field_select_bits { - u8 reserved_0[0x16]; + u8 reserved_0[0x14]; + u8 disable_uc_local_lb[0x1]; + u8 disable_mc_local_lb[0x1]; u8 node_guid[0x1]; u8 port_guid[0x1]; u8 min_wqe_inline_mode[0x1]; @@ -7958,6 +8054,42 @@ struct mlx5_ifc_phys_layer_cntrs_bits { u8 reserved_0[0x180]; }; +struct mlx5_ifc_phys_layer_statistical_cntrs_bits { + u8 time_since_last_clear_high[0x20]; + + u8 time_since_last_clear_low[0x20]; + + u8 phy_received_bits_high[0x20]; + + u8 phy_received_bits_low[0x20]; + + u8 phy_symbol_errors_high[0x20]; + + u8 phy_symbol_errors_low[0x20]; + + u8 phy_corrected_bits_high[0x20]; + + u8 phy_corrected_bits_low[0x20]; + + u8 phy_corrected_bits_lane0_high[0x20]; + + u8 phy_corrected_bits_lane0_low[0x20]; + + u8 phy_corrected_bits_lane1_high[0x20]; + + u8 phy_corrected_bits_lane1_low[0x20]; + + u8 phy_corrected_bits_lane2_high[0x20]; + + u8 phy_corrected_bits_lane2_low[0x20]; + + u8 phy_corrected_bits_lane3_high[0x20]; + + u8 phy_corrected_bits_lane3_low[0x20]; + + u8 reserved_at_200[0x5c0]; +}; + struct mlx5_ifc_infiniband_port_cntrs_bits { u8 symbol_error_counter[0x10]; u8 link_error_recovery_counter[0x8]; @@ -9187,6 +9319,7 @@ union mlx5_ifc_eth_cntrs_grp_data_layout_auto_bits { struct mlx5_ifc_eth_discard_cntrs_grp_bits eth_discard_cntrs_grp; struct mlx5_ifc_eth_per_prio_grp_data_layout_bits eth_per_prio_grp_data_layout; struct mlx5_ifc_phys_layer_cntrs_bits phys_layer_cntrs; + struct mlx5_ifc_phys_layer_statistical_cntrs_bits phys_layer_statistical_cntrs; struct mlx5_ifc_infiniband_port_cntrs_bits infiniband_port_cntrs; u8 reserved_0[0x7c0]; }; From owner-svn-src-all@freebsd.org Thu Aug 3 13:55:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4184ADBE1C4; Thu, 3 Aug 2017 13:55:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B8917D06B; Thu, 3 Aug 2017 13:55:41 +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 v73Dte9W049955; Thu, 3 Aug 2017 13:55:40 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73DtdDZ049951; Thu, 3 Aug 2017 13:55:39 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708031355.v73DtdDZ049951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Aug 2017 13:55: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: r321995 - in stable/11/sys/dev/mlx5: . mlx5_core mlx5_en X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/dev/mlx5: . mlx5_core mlx5_en X-SVN-Commit-Revision: 321995 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 13:55:41 -0000 Author: hselasky Date: Thu Aug 3 13:55:39 2017 New Revision: 321995 URL: https://svnweb.freebsd.org/changeset/base/321995 Log: MFC r312527: Add runtime support for modifying the SQ and RQ completion event moderation mode. The presence of this feature is indicated through the firmware capabilities. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/cq.h stable/11/sys/dev/mlx5/mlx5_core/mlx5_cq.c stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/cq.h ============================================================================== --- stable/11/sys/dev/mlx5/cq.h Thu Aug 3 13:54:46 2017 (r321994) +++ stable/11/sys/dev/mlx5/cq.h Thu Aug 3 13:55:39 2017 (r321995) @@ -88,6 +88,7 @@ enum { MLX5_CQ_MODIFY_PERIOD = 1 << 0, MLX5_CQ_MODIFY_COUNT = 1 << 1, MLX5_CQ_MODIFY_OVERRUN = 1 << 2, + MLX5_CQ_MODIFY_PERIOD_MODE = 1 << 4, }; enum { @@ -165,6 +166,11 @@ int mlx5_core_modify_cq(struct mlx5_core_dev *dev, str int mlx5_core_modify_cq_moderation(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq, u16 cq_period, u16 cq_max_count); +int mlx5_core_modify_cq_moderation_mode(struct mlx5_core_dev *dev, + struct mlx5_core_cq *cq, + u16 cq_period, + u16 cq_max_count, + u8 cq_mode); int mlx5_debug_cq_add(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq); void mlx5_debug_cq_remove(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq); Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_cq.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_cq.c Thu Aug 3 13:54:46 2017 (r321994) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_cq.c Thu Aug 3 13:55:39 2017 (r321995) @@ -266,6 +266,28 @@ int mlx5_core_modify_cq_moderation(struct mlx5_core_de return mlx5_core_modify_cq(dev, cq, &in, sizeof(in)); } +int mlx5_core_modify_cq_moderation_mode(struct mlx5_core_dev *dev, + struct mlx5_core_cq *cq, + u16 cq_period, + u16 cq_max_count, + u8 cq_mode) +{ + struct mlx5_modify_cq_mbox_in in; + + memset(&in, 0, sizeof(in)); + + in.cqn = cpu_to_be32(cq->cqn); + in.ctx.cq_period = cpu_to_be16(cq_period); + in.ctx.cq_max_count = cpu_to_be16(cq_max_count); + in.ctx.cqe_sz_flags = (cq_mode & 2) >> 1; + in.ctx.st = (cq_mode & 1) << 7; + in.field_select = cpu_to_be32(MLX5_CQ_MODIFY_PERIOD | + MLX5_CQ_MODIFY_COUNT | + MLX5_CQ_MODIFY_PERIOD_MODE); + + return mlx5_core_modify_cq(dev, cq, &in, sizeof(in)); +} + int mlx5_init_cq_table(struct mlx5_core_dev *dev) { struct mlx5_cq_table *table = &dev->priv.cq_table; Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Thu Aug 3 13:54:46 2017 (r321994) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Thu Aug 3 13:55:39 2017 (r321995) @@ -92,6 +92,7 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS) { struct mlx5e_priv *priv = arg1; uint64_t value; + int mode_modify; int was_opened; int error; @@ -114,6 +115,7 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS) goto done; } was_opened = test_bit(MLX5E_STATE_OPENED, &priv->state); + mode_modify = MLX5_CAP_GEN(priv->mdev, cq_period_mode_modify); switch (MLX5_PARAM_OFFSET(arg[arg2])) { case MLX5_PARAM_OFFSET(rx_coalesce_usecs): @@ -266,7 +268,7 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS) case MLX5_PARAM_OFFSET(rx_coalesce_mode): /* network interface must be down */ - if (was_opened) + if (was_opened != 0 && mode_modify == 0) mlx5e_close_locked(priv->ifp); /* import RX coalesce mode */ @@ -276,13 +278,17 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS) priv->params_ethtool.rx_coalesce_mode; /* restart network interface, if any */ - if (was_opened) - mlx5e_open_locked(priv->ifp); + if (was_opened != 0) { + if (mode_modify == 0) + mlx5e_open_locked(priv->ifp); + else + error = mlx5e_refresh_channel_params(priv); + } break; case MLX5_PARAM_OFFSET(tx_coalesce_mode): /* network interface must be down */ - if (was_opened) + if (was_opened != 0 && mode_modify == 0) mlx5e_close_locked(priv->ifp); /* import TX coalesce mode */ @@ -292,8 +298,12 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS) priv->params_ethtool.tx_coalesce_mode; /* restart network interface, if any */ - if (was_opened) - mlx5e_open_locked(priv->ifp); + if (was_opened != 0) { + if (mode_modify == 0) + mlx5e_open_locked(priv->ifp); + else + error = mlx5e_refresh_channel_params(priv); + } break; case MLX5_PARAM_OFFSET(hw_lro): Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Aug 3 13:54:46 2017 (r321994) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Aug 3 13:55:39 2017 (r321995) @@ -1780,6 +1780,25 @@ mlx5e_close_channels(struct mlx5e_priv *priv) static int mlx5e_refresh_sq_params(struct mlx5e_priv *priv, struct mlx5e_sq *sq) { + + if (MLX5_CAP_GEN(priv->mdev, cq_period_mode_modify)) { + uint8_t cq_mode; + + switch (priv->params.tx_cq_moderation_mode) { + case 0: + cq_mode = MLX5_CQ_PERIOD_MODE_START_FROM_EQE; + break; + default: + cq_mode = MLX5_CQ_PERIOD_MODE_START_FROM_CQE; + break; + } + + return (mlx5_core_modify_cq_moderation_mode(priv->mdev, &sq->cq.mcq, + priv->params.tx_cq_moderation_usec, + priv->params.tx_cq_moderation_pkts, + cq_mode)); + } + return (mlx5_core_modify_cq_moderation(priv->mdev, &sq->cq.mcq, priv->params.tx_cq_moderation_usec, priv->params.tx_cq_moderation_pkts)); @@ -1788,6 +1807,28 @@ mlx5e_refresh_sq_params(struct mlx5e_priv *priv, struc static int mlx5e_refresh_rq_params(struct mlx5e_priv *priv, struct mlx5e_rq *rq) { + + if (MLX5_CAP_GEN(priv->mdev, cq_period_mode_modify)) { + uint8_t cq_mode; + int retval; + + switch (priv->params.rx_cq_moderation_mode) { + case 0: + cq_mode = MLX5_CQ_PERIOD_MODE_START_FROM_EQE; + break; + default: + cq_mode = MLX5_CQ_PERIOD_MODE_START_FROM_CQE; + break; + } + + retval = mlx5_core_modify_cq_moderation_mode(priv->mdev, &rq->cq.mcq, + priv->params.rx_cq_moderation_usec, + priv->params.rx_cq_moderation_pkts, + cq_mode); + + return (retval); + } + return (mlx5_core_modify_cq_moderation(priv->mdev, &rq->cq.mcq, priv->params.rx_cq_moderation_usec, priv->params.rx_cq_moderation_pkts)); From owner-svn-src-all@freebsd.org Thu Aug 3 13:57:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A48BDBE319; Thu, 3 Aug 2017 13:57:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3681F7D1D0; Thu, 3 Aug 2017 13:57:19 +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 v73DvIna050100; Thu, 3 Aug 2017 13:57:18 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73DvI1S050096; Thu, 3 Aug 2017 13:57:18 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708031357.v73DvI1S050096@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Aug 2017 13:57:18 +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: r321996 - in stable/10/sys/dev/mlx5: . mlx5_core mlx5_en X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/10/sys/dev/mlx5: . mlx5_core mlx5_en X-SVN-Commit-Revision: 321996 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 13:57:19 -0000 Author: hselasky Date: Thu Aug 3 13:57:17 2017 New Revision: 321996 URL: https://svnweb.freebsd.org/changeset/base/321996 Log: MFC r312527: Add runtime support for modifying the SQ and RQ completion event moderation mode. The presence of this feature is indicated through the firmware capabilities. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/cq.h stable/10/sys/dev/mlx5/mlx5_core/mlx5_cq.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/cq.h ============================================================================== --- stable/10/sys/dev/mlx5/cq.h Thu Aug 3 13:55:39 2017 (r321995) +++ stable/10/sys/dev/mlx5/cq.h Thu Aug 3 13:57:17 2017 (r321996) @@ -88,6 +88,7 @@ enum { MLX5_CQ_MODIFY_PERIOD = 1 << 0, MLX5_CQ_MODIFY_COUNT = 1 << 1, MLX5_CQ_MODIFY_OVERRUN = 1 << 2, + MLX5_CQ_MODIFY_PERIOD_MODE = 1 << 4, }; enum { @@ -165,6 +166,11 @@ int mlx5_core_modify_cq(struct mlx5_core_dev *dev, str int mlx5_core_modify_cq_moderation(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq, u16 cq_period, u16 cq_max_count); +int mlx5_core_modify_cq_moderation_mode(struct mlx5_core_dev *dev, + struct mlx5_core_cq *cq, + u16 cq_period, + u16 cq_max_count, + u8 cq_mode); int mlx5_debug_cq_add(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq); void mlx5_debug_cq_remove(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq); Modified: stable/10/sys/dev/mlx5/mlx5_core/mlx5_cq.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_core/mlx5_cq.c Thu Aug 3 13:55:39 2017 (r321995) +++ stable/10/sys/dev/mlx5/mlx5_core/mlx5_cq.c Thu Aug 3 13:57:17 2017 (r321996) @@ -266,6 +266,28 @@ int mlx5_core_modify_cq_moderation(struct mlx5_core_de return mlx5_core_modify_cq(dev, cq, &in, sizeof(in)); } +int mlx5_core_modify_cq_moderation_mode(struct mlx5_core_dev *dev, + struct mlx5_core_cq *cq, + u16 cq_period, + u16 cq_max_count, + u8 cq_mode) +{ + struct mlx5_modify_cq_mbox_in in; + + memset(&in, 0, sizeof(in)); + + in.cqn = cpu_to_be32(cq->cqn); + in.ctx.cq_period = cpu_to_be16(cq_period); + in.ctx.cq_max_count = cpu_to_be16(cq_max_count); + in.ctx.cqe_sz_flags = (cq_mode & 2) >> 1; + in.ctx.st = (cq_mode & 1) << 7; + in.field_select = cpu_to_be32(MLX5_CQ_MODIFY_PERIOD | + MLX5_CQ_MODIFY_COUNT | + MLX5_CQ_MODIFY_PERIOD_MODE); + + return mlx5_core_modify_cq(dev, cq, &in, sizeof(in)); +} + int mlx5_init_cq_table(struct mlx5_core_dev *dev) { struct mlx5_cq_table *table = &dev->priv.cq_table; Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Thu Aug 3 13:55:39 2017 (r321995) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Thu Aug 3 13:57:17 2017 (r321996) @@ -92,6 +92,7 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS) { struct mlx5e_priv *priv = arg1; uint64_t value; + int mode_modify; int was_opened; int error; @@ -114,6 +115,7 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS) goto done; } was_opened = test_bit(MLX5E_STATE_OPENED, &priv->state); + mode_modify = MLX5_CAP_GEN(priv->mdev, cq_period_mode_modify); switch (MLX5_PARAM_OFFSET(arg[arg2])) { case MLX5_PARAM_OFFSET(rx_coalesce_usecs): @@ -266,7 +268,7 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS) case MLX5_PARAM_OFFSET(rx_coalesce_mode): /* network interface must be down */ - if (was_opened) + if (was_opened != 0 && mode_modify == 0) mlx5e_close_locked(priv->ifp); /* import RX coalesce mode */ @@ -276,13 +278,17 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS) priv->params_ethtool.rx_coalesce_mode; /* restart network interface, if any */ - if (was_opened) - mlx5e_open_locked(priv->ifp); + if (was_opened != 0) { + if (mode_modify == 0) + mlx5e_open_locked(priv->ifp); + else + error = mlx5e_refresh_channel_params(priv); + } break; case MLX5_PARAM_OFFSET(tx_coalesce_mode): /* network interface must be down */ - if (was_opened) + if (was_opened != 0 && mode_modify == 0) mlx5e_close_locked(priv->ifp); /* import TX coalesce mode */ @@ -292,8 +298,12 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS) priv->params_ethtool.tx_coalesce_mode; /* restart network interface, if any */ - if (was_opened) - mlx5e_open_locked(priv->ifp); + if (was_opened != 0) { + if (mode_modify == 0) + mlx5e_open_locked(priv->ifp); + else + error = mlx5e_refresh_channel_params(priv); + } break; case MLX5_PARAM_OFFSET(hw_lro): Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Aug 3 13:55:39 2017 (r321995) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Aug 3 13:57:17 2017 (r321996) @@ -1787,6 +1787,25 @@ mlx5e_close_channels(struct mlx5e_priv *priv) static int mlx5e_refresh_sq_params(struct mlx5e_priv *priv, struct mlx5e_sq *sq) { + + if (MLX5_CAP_GEN(priv->mdev, cq_period_mode_modify)) { + uint8_t cq_mode; + + switch (priv->params.tx_cq_moderation_mode) { + case 0: + cq_mode = MLX5_CQ_PERIOD_MODE_START_FROM_EQE; + break; + default: + cq_mode = MLX5_CQ_PERIOD_MODE_START_FROM_CQE; + break; + } + + return (mlx5_core_modify_cq_moderation_mode(priv->mdev, &sq->cq.mcq, + priv->params.tx_cq_moderation_usec, + priv->params.tx_cq_moderation_pkts, + cq_mode)); + } + return (mlx5_core_modify_cq_moderation(priv->mdev, &sq->cq.mcq, priv->params.tx_cq_moderation_usec, priv->params.tx_cq_moderation_pkts)); @@ -1795,6 +1814,28 @@ mlx5e_refresh_sq_params(struct mlx5e_priv *priv, struc static int mlx5e_refresh_rq_params(struct mlx5e_priv *priv, struct mlx5e_rq *rq) { + + if (MLX5_CAP_GEN(priv->mdev, cq_period_mode_modify)) { + uint8_t cq_mode; + int retval; + + switch (priv->params.rx_cq_moderation_mode) { + case 0: + cq_mode = MLX5_CQ_PERIOD_MODE_START_FROM_EQE; + break; + default: + cq_mode = MLX5_CQ_PERIOD_MODE_START_FROM_CQE; + break; + } + + retval = mlx5_core_modify_cq_moderation_mode(priv->mdev, &rq->cq.mcq, + priv->params.rx_cq_moderation_usec, + priv->params.rx_cq_moderation_pkts, + cq_mode); + + return (retval); + } + return (mlx5_core_modify_cq_moderation(priv->mdev, &rq->cq.mcq, priv->params.rx_cq_moderation_usec, priv->params.rx_cq_moderation_pkts)); From owner-svn-src-all@freebsd.org Thu Aug 3 14:00:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04D37DBE581; Thu, 3 Aug 2017 14:00:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2CEA7D3DE; Thu, 3 Aug 2017 14:00:27 +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 v73E0QWV050304; Thu, 3 Aug 2017 14:00:26 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73E0QDa050301; Thu, 3 Aug 2017 14:00:26 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708031400.v73E0QDa050301@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Aug 2017 14:00:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r321997 - stable/11/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 321997 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 14:00:28 -0000 Author: hselasky Date: Thu Aug 3 14:00:26 2017 New Revision: 321997 URL: https://svnweb.freebsd.org/changeset/base/321997 Log: MFC r312528: Make draining a sendqueue more robust. Add own state variable to track if a sendqueue is stopped or not. This will prevent traffic from entering the sendqueue while it is being destroyed. Update drain function to wait for traffic to be transmitted before returning when the link state is active. Add extra checks in transmit path for stopped SQ's. While at it: - Use likely() for a mbuf pointer check. - Remove redundant IFF_DRV_RUNNING check. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_en/en.h stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/en.h Thu Aug 3 13:57:17 2017 (r321996) +++ stable/11/sys/dev/mlx5/mlx5_en/en.h Thu Aug 3 14:00:26 2017 (r321997) @@ -507,10 +507,11 @@ struct mlx5e_sq { u16 bf_offset; u16 cev_counter; /* completion event counter */ u16 cev_factor; /* completion event factor */ - u32 cev_next_state; /* next completion event state */ + u16 cev_next_state; /* next completion event state */ #define MLX5E_CEV_STATE_INITIAL 0 /* timer not started */ #define MLX5E_CEV_STATE_SEND_NOPS 1 /* send NOPs */ #define MLX5E_CEV_STATE_HOLD_NOPS 2 /* don't send NOPs yet */ + u16 stopped; /* set if SQ is stopped */ struct callout cev_callout; union { u32 d32[2]; Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Aug 3 13:57:17 2017 (r321996) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Aug 3 14:00:26 2017 (r321997) @@ -1233,8 +1233,25 @@ mlx5e_sq_cev_timeout(void *arg) void mlx5e_drain_sq(struct mlx5e_sq *sq) { + int error; + /* + * Check if already stopped. + * + * NOTE: The "stopped" variable is only written when both the + * priv's configuration lock and the SQ's lock is locked. It + * can therefore safely be read when only one of the two locks + * is locked. This function is always called when the priv's + * configuration lock is locked. + */ + if (sq->stopped != 0) + return; + mtx_lock(&sq->lock); + + /* don't put more packets into the SQ */ + sq->stopped = 1; + /* teardown event factor timer, if any */ sq->cev_next_state = MLX5E_CEV_STATE_HOLD_NOPS; callout_stop(&sq->cev_callout); @@ -1246,14 +1263,29 @@ mlx5e_drain_sq(struct mlx5e_sq *sq) /* make sure it is safe to free the callout */ callout_drain(&sq->cev_callout); + /* wait till SQ is empty or link is down */ + mtx_lock(&sq->lock); + while (sq->cc != sq->pc && + (sq->priv->media_status_last & IFM_ACTIVE) != 0) { + mtx_unlock(&sq->lock); + msleep(1); + sq->cq.mcq.comp(&sq->cq.mcq); + mtx_lock(&sq->lock); + } + mtx_unlock(&sq->lock); + /* error out remaining requests */ - mlx5e_modify_sq(sq, MLX5_SQC_STATE_RDY, MLX5_SQC_STATE_ERR); + error = mlx5e_modify_sq(sq, MLX5_SQC_STATE_RDY, MLX5_SQC_STATE_ERR); + if (error != 0) { + if_printf(sq->ifp, + "mlx5e_modify_sq() from RDY to ERR failed: %d\n", error); + } /* wait till SQ is empty */ mtx_lock(&sq->lock); while (sq->cc != sq->pc) { mtx_unlock(&sq->lock); - msleep(4); + msleep(1); sq->cq.mcq.comp(&sq->cq.mcq); mtx_lock(&sq->lock); } Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu Aug 3 13:57:17 2017 (r321996) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu Aug 3 14:00:26 2017 (r321997) @@ -81,11 +81,15 @@ static struct mlx5e_sq * mlx5e_select_queue(struct ifnet *ifp, struct mbuf *mb) { struct mlx5e_priv *priv = ifp->if_softc; + struct mlx5e_channel * volatile *ppch; + struct mlx5e_channel *pch; u32 ch; u32 tc; + ppch = priv->channel; + /* check if channels are successfully opened */ - if (unlikely(priv->channel == NULL)) + if (unlikely(ppch == NULL)) return (NULL); /* obtain VLAN information if present */ @@ -123,11 +127,11 @@ mlx5e_select_queue(struct ifnet *ifp, struct mbuf *mb) #endif } - /* check if channel is allocated */ - if (unlikely(priv->channel[ch] == NULL)) - return (NULL); - - return (&priv->channel[ch]->sq[tc]); + /* check if channel is allocated and not stopped */ + pch = ppch[ch]; + if (likely(pch != NULL && pch->sq[tc].stopped == 0)) + return (&pch->sq[tc]); + return (NULL); } static inline u16 @@ -445,19 +449,22 @@ mlx5e_xmit_locked(struct ifnet *ifp, struct mlx5e_sq * struct mbuf *next; int err = 0; - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { - if (mb) - err = drbr_enqueue(ifp, sq->br, mb); - return (err); - } - - if (mb != NULL) + if (likely(mb != NULL)) { /* * If we can't insert mbuf into drbr, try to xmit anyway. * We keep the error we got so we could return that after xmit. */ err = drbr_enqueue(ifp, sq->br, mb); + } + /* + * Check if the network interface is closed or if the SQ is + * being stopped: + */ + if (unlikely((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || + sq->stopped != 0)) + return (err); + /* Process the queue */ while ((next = drbr_peek(ifp, sq->br)) != NULL) { if (mlx5e_sq_xmit(sq, &next) != 0) { @@ -470,8 +477,6 @@ mlx5e_xmit_locked(struct ifnet *ifp, struct mlx5e_sq * break; } drbr_advance(ifp, sq->br); - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) - break; } /* Check if we need to write the doorbell */ if (likely(sq->doorbell.d64 != 0)) { From owner-svn-src-all@freebsd.org Thu Aug 3 14:01:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A260FDBE64E; Thu, 3 Aug 2017 14:01:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6452F7D6A4; Thu, 3 Aug 2017 14:01:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v73E1Po0054198; Thu, 3 Aug 2017 14:01:25 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73E1PYJ054195; Thu, 3 Aug 2017 14:01:25 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708031401.v73E1PYJ054195@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Aug 2017 14:01:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r321998 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 321998 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 14:01:26 -0000 Author: hselasky Date: Thu Aug 3 14:01:25 2017 New Revision: 321998 URL: https://svnweb.freebsd.org/changeset/base/321998 Log: MFC r312528: Make draining a sendqueue more robust. Add own state variable to track if a sendqueue is stopped or not. This will prevent traffic from entering the sendqueue while it is being destroyed. Update drain function to wait for traffic to be transmitted before returning when the link state is active. Add extra checks in transmit path for stopped SQ's. While at it: - Use likely() for a mbuf pointer check. - Remove redundant IFF_DRV_RUNNING check. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/en.h Thu Aug 3 14:00:26 2017 (r321997) +++ stable/10/sys/dev/mlx5/mlx5_en/en.h Thu Aug 3 14:01:25 2017 (r321998) @@ -517,10 +517,11 @@ struct mlx5e_sq { u16 bf_offset; u16 cev_counter; /* completion event counter */ u16 cev_factor; /* completion event factor */ - u32 cev_next_state; /* next completion event state */ + u16 cev_next_state; /* next completion event state */ #define MLX5E_CEV_STATE_INITIAL 0 /* timer not started */ #define MLX5E_CEV_STATE_SEND_NOPS 1 /* send NOPs */ #define MLX5E_CEV_STATE_HOLD_NOPS 2 /* don't send NOPs yet */ + u16 stopped; /* set if SQ is stopped */ struct callout cev_callout; union { u32 d32[2]; Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Aug 3 14:00:26 2017 (r321997) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Aug 3 14:01:25 2017 (r321998) @@ -1240,8 +1240,25 @@ mlx5e_sq_cev_timeout(void *arg) void mlx5e_drain_sq(struct mlx5e_sq *sq) { + int error; + /* + * Check if already stopped. + * + * NOTE: The "stopped" variable is only written when both the + * priv's configuration lock and the SQ's lock is locked. It + * can therefore safely be read when only one of the two locks + * is locked. This function is always called when the priv's + * configuration lock is locked. + */ + if (sq->stopped != 0) + return; + mtx_lock(&sq->lock); + + /* don't put more packets into the SQ */ + sq->stopped = 1; + /* teardown event factor timer, if any */ sq->cev_next_state = MLX5E_CEV_STATE_HOLD_NOPS; callout_stop(&sq->cev_callout); @@ -1253,14 +1270,29 @@ mlx5e_drain_sq(struct mlx5e_sq *sq) /* make sure it is safe to free the callout */ callout_drain(&sq->cev_callout); + /* wait till SQ is empty or link is down */ + mtx_lock(&sq->lock); + while (sq->cc != sq->pc && + (sq->priv->media_status_last & IFM_ACTIVE) != 0) { + mtx_unlock(&sq->lock); + msleep(1); + sq->cq.mcq.comp(&sq->cq.mcq); + mtx_lock(&sq->lock); + } + mtx_unlock(&sq->lock); + /* error out remaining requests */ - mlx5e_modify_sq(sq, MLX5_SQC_STATE_RDY, MLX5_SQC_STATE_ERR); + error = mlx5e_modify_sq(sq, MLX5_SQC_STATE_RDY, MLX5_SQC_STATE_ERR); + if (error != 0) { + if_printf(sq->ifp, + "mlx5e_modify_sq() from RDY to ERR failed: %d\n", error); + } /* wait till SQ is empty */ mtx_lock(&sq->lock); while (sq->cc != sq->pc) { mtx_unlock(&sq->lock); - msleep(4); + msleep(1); sq->cq.mcq.comp(&sq->cq.mcq); mtx_lock(&sq->lock); } Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu Aug 3 14:00:26 2017 (r321997) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu Aug 3 14:01:25 2017 (r321998) @@ -81,11 +81,15 @@ static struct mlx5e_sq * mlx5e_select_queue(struct ifnet *ifp, struct mbuf *mb) { struct mlx5e_priv *priv = ifp->if_softc; + struct mlx5e_channel * volatile *ppch; + struct mlx5e_channel *pch; u32 ch; u32 tc; + ppch = priv->channel; + /* check if channels are successfully opened */ - if (unlikely(priv->channel == NULL)) + if (unlikely(ppch == NULL)) return (NULL); /* obtain VLAN information if present */ @@ -123,11 +127,11 @@ mlx5e_select_queue(struct ifnet *ifp, struct mbuf *mb) #endif } - /* check if channel is allocated */ - if (unlikely(priv->channel[ch] == NULL)) - return (NULL); - - return (&priv->channel[ch]->sq[tc]); + /* check if channel is allocated and not stopped */ + pch = ppch[ch]; + if (likely(pch != NULL && pch->sq[tc].stopped == 0)) + return (&pch->sq[tc]); + return (NULL); } static inline u16 @@ -445,19 +449,22 @@ mlx5e_xmit_locked(struct ifnet *ifp, struct mlx5e_sq * struct mbuf *next; int err = 0; - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { - if (mb) - err = drbr_enqueue(ifp, sq->br, mb); - return (err); - } - - if (mb != NULL) + if (likely(mb != NULL)) { /* * If we can't insert mbuf into drbr, try to xmit anyway. * We keep the error we got so we could return that after xmit. */ err = drbr_enqueue(ifp, sq->br, mb); + } + /* + * Check if the network interface is closed or if the SQ is + * being stopped: + */ + if (unlikely((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || + sq->stopped != 0)) + return (err); + /* Process the queue */ while ((next = drbr_peek(ifp, sq->br)) != NULL) { if (mlx5e_sq_xmit(sq, &next) != 0) { @@ -470,8 +477,6 @@ mlx5e_xmit_locked(struct ifnet *ifp, struct mlx5e_sq * break; } drbr_advance(ifp, sq->br); - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) - break; } /* Check if we need to write the doorbell */ if (likely(sq->doorbell.d64 != 0)) { From owner-svn-src-all@freebsd.org Thu Aug 3 14:03:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D76BDBE9FF; Thu, 3 Aug 2017 14:03:50 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC3987D9C6; Thu, 3 Aug 2017 14:03:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v73E3nCl054355; Thu, 3 Aug 2017 14:03:49 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73E3mAW054351; Thu, 3 Aug 2017 14:03:48 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708031403.v73E3mAW054351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Aug 2017 14:03:48 +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: r321999 - stable/11/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 321999 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 14:03:50 -0000 Author: hselasky Date: Thu Aug 3 14:03:48 2017 New Revision: 321999 URL: https://svnweb.freebsd.org/changeset/base/321999 Log: MFC r312536: Allow transmit packet bufring in software to be disabled. - Add new sysctl node to control the transmit packet bufring. - Add optimised version of the transmit routine which output packets directly to the DMA ring instead of using bufring in case the transmit lock is congested. This can reduce the number of taskswitches which in turn influence the overall system CPU usage, depending on the workload. - Add " TX" suffix to debug name for transmit mutexes to silence some witness warnings about aquiring duplicate locks having same name. Sponsored by: Mellanox Technologies Suggested by: gallatin @ Modified: stable/11/sys/dev/mlx5/mlx5_en/en.h stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/en.h Thu Aug 3 14:01:25 2017 (r321998) +++ stable/11/sys/dev/mlx5/mlx5_en/en.h Thu Aug 3 14:03:48 2017 (r321999) @@ -402,6 +402,7 @@ struct mlx5e_params { m(+1, u64 tx_coalesce_usecs, "tx_coalesce_usecs", "Limit in usec for joining tx packets") \ m(+1, u64 tx_coalesce_pkts, "tx_coalesce_pkts", "Maximum number of tx packets to join") \ m(+1, u64 tx_coalesce_mode, "tx_coalesce_mode", "0: EQE mode 1: CQE mode") \ + m(+1, u64 tx_bufring_disable, "tx_bufring_disable", "0: Enable bufring 1: Disable bufring") \ m(+1, u64 tx_completion_fact, "tx_completion_fact", "1..MAX: Completion event ratio") \ m(+1, u64 tx_completion_fact_max, "tx_completion_fact_max", "Maximum completion event ratio") \ m(+1, u64 hw_lro, "hw_lro", "set to enable hw_lro") \ Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Thu Aug 3 14:01:25 2017 (r321998) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Thu Aug 3 14:03:48 2017 (r321999) @@ -352,6 +352,18 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS) mlx5e_open_locked(priv->ifp); break; + case MLX5_PARAM_OFFSET(tx_bufring_disable): + /* rangecheck input value */ + priv->params_ethtool.tx_bufring_disable = + priv->params_ethtool.tx_bufring_disable ? 1 : 0; + + /* reconfigure the sendqueues, if any */ + if (was_opened) { + mlx5e_close_locked(priv->ifp); + mlx5e_open_locked(priv->ifp); + } + break; + case MLX5_PARAM_OFFSET(tx_completion_fact): /* network interface must be down */ if (was_opened) Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Aug 3 14:01:25 2017 (r321998) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Aug 3 14:03:48 2017 (r321999) @@ -439,7 +439,8 @@ mlx5e_update_stats_work(struct work_struct *work) tso_packets += sq_stats->tso_packets; tso_bytes += sq_stats->tso_bytes; tx_queue_dropped += sq_stats->dropped; - tx_queue_dropped += sq_br->br_drops; + if (sq_br != NULL) + tx_queue_dropped += sq_br->br_drops; tx_defragged += sq_stats->defragged; tx_offload_none += sq_stats->csum_offload_none; } @@ -1001,34 +1002,37 @@ mlx5e_create_sq(struct mlx5e_channel *c, sq->priv = priv; sq->tc = tc; - sq->br = buf_ring_alloc(MLX5E_SQ_TX_QUEUE_SIZE, M_MLX5EN, - M_WAITOK, &sq->lock); - if (sq->br == NULL) { - if_printf(c->ifp, "%s: Failed allocating sq drbr buffer\n", - __func__); - err = -ENOMEM; - goto err_free_sq_db; - } + /* check if we should allocate a second packet buffer */ + if (priv->params_ethtool.tx_bufring_disable == 0) { + sq->br = buf_ring_alloc(MLX5E_SQ_TX_QUEUE_SIZE, M_MLX5EN, + M_WAITOK, &sq->lock); + if (sq->br == NULL) { + if_printf(c->ifp, "%s: Failed allocating sq drbr buffer\n", + __func__); + err = -ENOMEM; + goto err_free_sq_db; + } - sq->sq_tq = taskqueue_create_fast("mlx5e_que", M_WAITOK, - taskqueue_thread_enqueue, &sq->sq_tq); - if (sq->sq_tq == NULL) { - if_printf(c->ifp, "%s: Failed allocating taskqueue\n", - __func__); - err = -ENOMEM; - goto err_free_drbr; - } + sq->sq_tq = taskqueue_create_fast("mlx5e_que", M_WAITOK, + taskqueue_thread_enqueue, &sq->sq_tq); + if (sq->sq_tq == NULL) { + if_printf(c->ifp, "%s: Failed allocating taskqueue\n", + __func__); + err = -ENOMEM; + goto err_free_drbr; + } - TASK_INIT(&sq->sq_task, 0, mlx5e_tx_que, sq); + TASK_INIT(&sq->sq_task, 0, mlx5e_tx_que, sq); #ifdef RSS - cpu_id = rss_getcpu(c->ix % rss_getnumbuckets()); - CPU_SETOF(cpu_id, &cpu_mask); - taskqueue_start_threads_cpuset(&sq->sq_tq, 1, PI_NET, &cpu_mask, - "%s TX SQ%d.%d CPU%d", c->ifp->if_xname, c->ix, tc, cpu_id); + cpu_id = rss_getcpu(c->ix % rss_getnumbuckets()); + CPU_SETOF(cpu_id, &cpu_mask); + taskqueue_start_threads_cpuset(&sq->sq_tq, 1, PI_NET, &cpu_mask, + "%s TX SQ%d.%d CPU%d", c->ifp->if_xname, c->ix, tc, cpu_id); #else - taskqueue_start_threads(&sq->sq_tq, 1, PI_NET, - "%s TX SQ%d.%d", c->ifp->if_xname, c->ix, tc); + taskqueue_start_threads(&sq->sq_tq, 1, PI_NET, + "%s TX SQ%d.%d", c->ifp->if_xname, c->ix, tc); #endif + } snprintf(buffer, sizeof(buffer), "txstat%dtc%d", c->ix, tc); mlx5e_create_stats(&sq->stats.ctx, SYSCTL_CHILDREN(priv->sysctl_ifnet), buffer, mlx5e_sq_stats_desc, MLX5E_SQ_STATS_NUM, @@ -1061,9 +1065,12 @@ mlx5e_destroy_sq(struct mlx5e_sq *sq) mlx5e_free_sq_db(sq); mlx5_wq_destroy(&sq->wq_ctrl); mlx5_unmap_free_uar(sq->priv->mdev, &sq->uar); - taskqueue_drain(sq->sq_tq, &sq->sq_task); - taskqueue_free(sq->sq_tq); - buf_ring_free(sq->br, M_MLX5EN); + if (sq->sq_tq != NULL) { + taskqueue_drain(sq->sq_tq, &sq->sq_task); + taskqueue_free(sq->sq_tq); + } + if (sq->br != NULL) + buf_ring_free(sq->br, M_MLX5EN); } int @@ -1511,9 +1518,10 @@ mlx5e_chan_mtx_init(struct mlx5e_channel *c) for (tc = 0; tc < c->num_tc; tc++) { struct mlx5e_sq *sq = c->sq + tc; - mtx_init(&sq->lock, "mlx5tx", MTX_NETWORK_LOCK, MTX_DEF); - mtx_init(&sq->comp_lock, "mlx5comp", MTX_NETWORK_LOCK, - MTX_DEF); + mtx_init(&sq->lock, "mlx5tx", + MTX_NETWORK_LOCK " TX", MTX_DEF); + mtx_init(&sq->comp_lock, "mlx5comp", + MTX_NETWORK_LOCK " TX", MTX_DEF); callout_init_mtx(&sq->cev_callout, &sq->lock, 0); Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu Aug 3 14:01:25 2017 (r321998) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu Aug 3 14:03:48 2017 (r321999) @@ -439,7 +439,8 @@ mlx5e_poll_tx_cq(struct mlx5e_sq *sq, int budget) sq->cc = sqcc; - if (atomic_cmpset_int(&sq->queue_state, MLX5E_SQ_FULL, MLX5E_SQ_READY)) + if (sq->sq_tq != NULL && + atomic_cmpset_int(&sq->queue_state, MLX5E_SQ_FULL, MLX5E_SQ_READY)) taskqueue_enqueue(sq->sq_tq, &sq->sq_task); } @@ -498,6 +499,45 @@ mlx5e_xmit_locked(struct ifnet *ifp, struct mlx5e_sq * return (err); } +static int +mlx5e_xmit_locked_no_br(struct ifnet *ifp, struct mlx5e_sq *sq, struct mbuf *mb) +{ + int err = 0; + + if (unlikely((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || + sq->stopped != 0)) { + m_freem(mb); + return (ENETDOWN); + } + + /* Do transmit */ + if (mlx5e_sq_xmit(sq, &mb) != 0) { + /* NOTE: m_freem() is NULL safe */ + m_freem(mb); + err = ENOBUFS; + } + + /* Check if we need to write the doorbell */ + if (likely(sq->doorbell.d64 != 0)) { + mlx5e_tx_notify_hw(sq, sq->doorbell.d32, 0); + sq->doorbell.d64 = 0; + } + + /* + * Check if we need to start the event timer which flushes the + * transmit ring on timeout: + */ + if (unlikely(sq->cev_next_state == MLX5E_CEV_STATE_INITIAL && + sq->cev_factor != 1)) { + /* start the timer */ + mlx5e_sq_cev_timeout(sq); + } else { + /* don't send NOPs yet */ + sq->cev_next_state = MLX5E_CEV_STATE_HOLD_NOPS; + } + return (err); +} + int mlx5e_xmit(struct ifnet *ifp, struct mbuf *mb) { @@ -510,7 +550,13 @@ mlx5e_xmit(struct ifnet *ifp, struct mbuf *mb) m_freem(mb); return (ENXIO); } - if (mtx_trylock(&sq->lock)) { + + if (unlikely(sq->br == NULL)) { + /* rate limited traffic */ + mtx_lock(&sq->lock); + ret = mlx5e_xmit_locked_no_br(ifp, sq, mb); + mtx_unlock(&sq->lock); + } else if (mtx_trylock(&sq->lock)) { ret = mlx5e_xmit_locked(ifp, sq, mb); mtx_unlock(&sq->lock); } else { From owner-svn-src-all@freebsd.org Thu Aug 3 14:05:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08950DBEB72; Thu, 3 Aug 2017 14:05:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D36D77DB30; Thu, 3 Aug 2017 14:05:04 +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 v73E53DV054477; Thu, 3 Aug 2017 14:05:03 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73E534G054473; Thu, 3 Aug 2017 14:05:03 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708031405.v73E534G054473@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Aug 2017 14:05:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322000 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 322000 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 14:05:05 -0000 Author: hselasky Date: Thu Aug 3 14:05:03 2017 New Revision: 322000 URL: https://svnweb.freebsd.org/changeset/base/322000 Log: MFC r312536: Allow transmit packet bufring in software to be disabled. - Add new sysctl node to control the transmit packet bufring. - Add optimised version of the transmit routine which output packets directly to the DMA ring instead of using bufring in case the transmit lock is congested. This can reduce the number of taskswitches which in turn influence the overall system CPU usage, depending on the workload. - Add " TX" suffix to debug name for transmit mutexes to silence some witness warnings about aquiring duplicate locks having same name. Sponsored by: Mellanox Technologies Suggested by: gallatin @ Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/en.h Thu Aug 3 14:03:48 2017 (r321999) +++ stable/10/sys/dev/mlx5/mlx5_en/en.h Thu Aug 3 14:05:03 2017 (r322000) @@ -408,6 +408,7 @@ struct mlx5e_params { m(+1, u64 tx_coalesce_usecs, "tx_coalesce_usecs", "Limit in usec for joining tx packets") \ m(+1, u64 tx_coalesce_pkts, "tx_coalesce_pkts", "Maximum number of tx packets to join") \ m(+1, u64 tx_coalesce_mode, "tx_coalesce_mode", "0: EQE mode 1: CQE mode") \ + m(+1, u64 tx_bufring_disable, "tx_bufring_disable", "0: Enable bufring 1: Disable bufring") \ m(+1, u64 tx_completion_fact, "tx_completion_fact", "1..MAX: Completion event ratio") \ m(+1, u64 tx_completion_fact_max, "tx_completion_fact_max", "Maximum completion event ratio") \ m(+1, u64 hw_lro, "hw_lro", "set to enable hw_lro") \ Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Thu Aug 3 14:03:48 2017 (r321999) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Thu Aug 3 14:05:03 2017 (r322000) @@ -352,6 +352,18 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS) mlx5e_open_locked(priv->ifp); break; + case MLX5_PARAM_OFFSET(tx_bufring_disable): + /* rangecheck input value */ + priv->params_ethtool.tx_bufring_disable = + priv->params_ethtool.tx_bufring_disable ? 1 : 0; + + /* reconfigure the sendqueues, if any */ + if (was_opened) { + mlx5e_close_locked(priv->ifp); + mlx5e_open_locked(priv->ifp); + } + break; + case MLX5_PARAM_OFFSET(tx_completion_fact): /* network interface must be down */ if (was_opened) Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Aug 3 14:03:48 2017 (r321999) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Aug 3 14:05:03 2017 (r322000) @@ -439,7 +439,8 @@ mlx5e_update_stats_work(struct work_struct *work) tso_packets += sq_stats->tso_packets; tso_bytes += sq_stats->tso_bytes; tx_queue_dropped += sq_stats->dropped; - tx_queue_dropped += sq_br->br_drops; + if (sq_br != NULL) + tx_queue_dropped += sq_br->br_drops; tx_defragged += sq_stats->defragged; tx_offload_none += sq_stats->csum_offload_none; } @@ -1008,34 +1009,37 @@ mlx5e_create_sq(struct mlx5e_channel *c, sq->priv = priv; sq->tc = tc; - sq->br = buf_ring_alloc(MLX5E_SQ_TX_QUEUE_SIZE, M_MLX5EN, - M_WAITOK, &sq->lock); - if (sq->br == NULL) { - if_printf(c->ifp, "%s: Failed allocating sq drbr buffer\n", - __func__); - err = -ENOMEM; - goto err_free_sq_db; - } + /* check if we should allocate a second packet buffer */ + if (priv->params_ethtool.tx_bufring_disable == 0) { + sq->br = buf_ring_alloc(MLX5E_SQ_TX_QUEUE_SIZE, M_MLX5EN, + M_WAITOK, &sq->lock); + if (sq->br == NULL) { + if_printf(c->ifp, "%s: Failed allocating sq drbr buffer\n", + __func__); + err = -ENOMEM; + goto err_free_sq_db; + } - sq->sq_tq = taskqueue_create_fast("mlx5e_que", M_WAITOK, - taskqueue_thread_enqueue, &sq->sq_tq); - if (sq->sq_tq == NULL) { - if_printf(c->ifp, "%s: Failed allocating taskqueue\n", - __func__); - err = -ENOMEM; - goto err_free_drbr; - } + sq->sq_tq = taskqueue_create_fast("mlx5e_que", M_WAITOK, + taskqueue_thread_enqueue, &sq->sq_tq); + if (sq->sq_tq == NULL) { + if_printf(c->ifp, "%s: Failed allocating taskqueue\n", + __func__); + err = -ENOMEM; + goto err_free_drbr; + } - TASK_INIT(&sq->sq_task, 0, mlx5e_tx_que, sq); + TASK_INIT(&sq->sq_task, 0, mlx5e_tx_que, sq); #ifdef RSS - cpu_id = rss_getcpu(c->ix % rss_getnumbuckets()); - CPU_SETOF(cpu_id, &cpu_mask); - taskqueue_start_threads_cpuset(&sq->sq_tq, 1, PI_NET, &cpu_mask, - "%s TX SQ%d.%d CPU%d", c->ifp->if_xname, c->ix, tc, cpu_id); + cpu_id = rss_getcpu(c->ix % rss_getnumbuckets()); + CPU_SETOF(cpu_id, &cpu_mask); + taskqueue_start_threads_cpuset(&sq->sq_tq, 1, PI_NET, &cpu_mask, + "%s TX SQ%d.%d CPU%d", c->ifp->if_xname, c->ix, tc, cpu_id); #else - taskqueue_start_threads(&sq->sq_tq, 1, PI_NET, - "%s TX SQ%d.%d", c->ifp->if_xname, c->ix, tc); + taskqueue_start_threads(&sq->sq_tq, 1, PI_NET, + "%s TX SQ%d.%d", c->ifp->if_xname, c->ix, tc); #endif + } snprintf(buffer, sizeof(buffer), "txstat%dtc%d", c->ix, tc); mlx5e_create_stats(&sq->stats.ctx, SYSCTL_CHILDREN(priv->sysctl_ifnet), buffer, mlx5e_sq_stats_desc, MLX5E_SQ_STATS_NUM, @@ -1068,9 +1072,12 @@ mlx5e_destroy_sq(struct mlx5e_sq *sq) mlx5e_free_sq_db(sq); mlx5_wq_destroy(&sq->wq_ctrl); mlx5_unmap_free_uar(sq->priv->mdev, &sq->uar); - taskqueue_drain(sq->sq_tq, &sq->sq_task); - taskqueue_free(sq->sq_tq); - buf_ring_free(sq->br, M_MLX5EN); + if (sq->sq_tq != NULL) { + taskqueue_drain(sq->sq_tq, &sq->sq_task); + taskqueue_free(sq->sq_tq); + } + if (sq->br != NULL) + buf_ring_free(sq->br, M_MLX5EN); } int @@ -1518,9 +1525,10 @@ mlx5e_chan_mtx_init(struct mlx5e_channel *c) for (tc = 0; tc < c->num_tc; tc++) { struct mlx5e_sq *sq = c->sq + tc; - mtx_init(&sq->lock, "mlx5tx", MTX_NETWORK_LOCK, MTX_DEF); - mtx_init(&sq->comp_lock, "mlx5comp", MTX_NETWORK_LOCK, - MTX_DEF); + mtx_init(&sq->lock, "mlx5tx", + MTX_NETWORK_LOCK " TX", MTX_DEF); + mtx_init(&sq->comp_lock, "mlx5comp", + MTX_NETWORK_LOCK " TX", MTX_DEF); callout_init_mtx(&sq->cev_callout, &sq->lock, 0); Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu Aug 3 14:03:48 2017 (r321999) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu Aug 3 14:05:03 2017 (r322000) @@ -439,7 +439,8 @@ mlx5e_poll_tx_cq(struct mlx5e_sq *sq, int budget) sq->cc = sqcc; - if (atomic_cmpset_int(&sq->queue_state, MLX5E_SQ_FULL, MLX5E_SQ_READY)) + if (sq->sq_tq != NULL && + atomic_cmpset_int(&sq->queue_state, MLX5E_SQ_FULL, MLX5E_SQ_READY)) taskqueue_enqueue(sq->sq_tq, &sq->sq_task); } @@ -498,6 +499,45 @@ mlx5e_xmit_locked(struct ifnet *ifp, struct mlx5e_sq * return (err); } +static int +mlx5e_xmit_locked_no_br(struct ifnet *ifp, struct mlx5e_sq *sq, struct mbuf *mb) +{ + int err = 0; + + if (unlikely((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || + sq->stopped != 0)) { + m_freem(mb); + return (ENETDOWN); + } + + /* Do transmit */ + if (mlx5e_sq_xmit(sq, &mb) != 0) { + /* NOTE: m_freem() is NULL safe */ + m_freem(mb); + err = ENOBUFS; + } + + /* Check if we need to write the doorbell */ + if (likely(sq->doorbell.d64 != 0)) { + mlx5e_tx_notify_hw(sq, sq->doorbell.d32, 0); + sq->doorbell.d64 = 0; + } + + /* + * Check if we need to start the event timer which flushes the + * transmit ring on timeout: + */ + if (unlikely(sq->cev_next_state == MLX5E_CEV_STATE_INITIAL && + sq->cev_factor != 1)) { + /* start the timer */ + mlx5e_sq_cev_timeout(sq); + } else { + /* don't send NOPs yet */ + sq->cev_next_state = MLX5E_CEV_STATE_HOLD_NOPS; + } + return (err); +} + int mlx5e_xmit(struct ifnet *ifp, struct mbuf *mb) { @@ -510,7 +550,13 @@ mlx5e_xmit(struct ifnet *ifp, struct mbuf *mb) m_freem(mb); return (ENXIO); } - if (mtx_trylock(&sq->lock)) { + + if (unlikely(sq->br == NULL)) { + /* rate limited traffic */ + mtx_lock(&sq->lock); + ret = mlx5e_xmit_locked_no_br(ifp, sq, mb); + mtx_unlock(&sq->lock); + } else if (mtx_trylock(&sq->lock)) { ret = mlx5e_xmit_locked(ifp, sq, mb); mtx_unlock(&sq->lock); } else { From owner-svn-src-all@freebsd.org Thu Aug 3 14:06:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE9EFDBECD1; Thu, 3 Aug 2017 14:06:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B4DA7DCA8; Thu, 3 Aug 2017 14:06:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v73E6MSF054578; Thu, 3 Aug 2017 14:06:22 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73E6MVu054577; Thu, 3 Aug 2017 14:06:22 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708031406.v73E6MVu054577@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Aug 2017 14:06: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: r322001 - stable/11/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 322001 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 14:06:23 -0000 Author: hselasky Date: Thu Aug 3 14:06:22 2017 New Revision: 322001 URL: https://svnweb.freebsd.org/changeset/base/322001 Log: MFC r312537: Remove superfluous return statement. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Aug 3 14:05:03 2017 (r322000) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Aug 3 14:06:22 2017 (r322001) @@ -1205,7 +1205,6 @@ done: mlx5e_tx_notify_hw(sq, sq->doorbell.d32, 0); sq->doorbell.d64 = 0; } - return; } void From owner-svn-src-all@freebsd.org Thu Aug 3 14:07:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71CC1DBED97; Thu, 3 Aug 2017 14:07:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 405537DDEC; Thu, 3 Aug 2017 14:07:15 +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 v73E7Eob054669; Thu, 3 Aug 2017 14:07:14 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73E7EV2054668; Thu, 3 Aug 2017 14:07:14 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708031407.v73E7EV2054668@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Aug 2017 14:07:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322002 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 322002 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 14:07:15 -0000 Author: hselasky Date: Thu Aug 3 14:07:14 2017 New Revision: 322002 URL: https://svnweb.freebsd.org/changeset/base/322002 Log: MFC r312537: Remove superfluous return statement. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Aug 3 14:06:22 2017 (r322001) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Aug 3 14:07:14 2017 (r322002) @@ -1212,7 +1212,6 @@ done: mlx5e_tx_notify_hw(sq, sq->doorbell.d32, 0); sq->doorbell.d64 = 0; } - return; } void From owner-svn-src-all@freebsd.org Thu Aug 3 14:08:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C53ADBEEE1; Thu, 3 Aug 2017 14:08:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D9BB27DF60; Thu, 3 Aug 2017 14:08:38 +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 v73E8c19054771; Thu, 3 Aug 2017 14:08:38 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73E8ccr054770; Thu, 3 Aug 2017 14:08:38 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708031408.v73E8ccr054770@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Aug 2017 14:08:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r322003 - stable/11/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 322003 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 14:08:39 -0000 Author: hselasky Date: Thu Aug 3 14:08:37 2017 New Revision: 322003 URL: https://svnweb.freebsd.org/changeset/base/322003 Log: MFC r312865: Enforce reading the consumer and producer counters once to ensure consistent return values from the mlx5e_sq_has_room_for() function. The two counters are incremented by different threads under different locks. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_en/en.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/en.h Thu Aug 3 14:07:14 2017 (r322002) +++ stable/11/sys/dev/mlx5/mlx5_en/en.h Thu Aug 3 14:08:37 2017 (r322003) @@ -546,8 +546,10 @@ struct mlx5e_sq { static inline bool mlx5e_sq_has_room_for(struct mlx5e_sq *sq, u16 n) { - return ((sq->wq.sz_m1 & (sq->cc - sq->pc)) >= n || - sq->cc == sq->pc); + u16 cc = sq->cc; + u16 pc = sq->pc; + + return ((sq->wq.sz_m1 & (cc - pc)) >= n || cc == pc); } struct mlx5e_channel { From owner-svn-src-all@freebsd.org Thu Aug 3 14:09:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C167ADBEFD1; Thu, 3 Aug 2017 14:09:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8DCAD7E176; Thu, 3 Aug 2017 14:09:37 +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 v73E9aOL054905; Thu, 3 Aug 2017 14:09:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73E9aWR054904; Thu, 3 Aug 2017 14:09:36 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708031409.v73E9aWR054904@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Aug 2017 14:09:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322005 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 322005 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 14:09:37 -0000 Author: hselasky Date: Thu Aug 3 14:09:36 2017 New Revision: 322005 URL: https://svnweb.freebsd.org/changeset/base/322005 Log: MFC r312865: Enforce reading the consumer and producer counters once to ensure consistent return values from the mlx5e_sq_has_room_for() function. The two counters are incremented by different threads under different locks. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/en.h Thu Aug 3 14:08:39 2017 (r322004) +++ stable/10/sys/dev/mlx5/mlx5_en/en.h Thu Aug 3 14:09:36 2017 (r322005) @@ -556,8 +556,10 @@ struct mlx5e_sq { static inline bool mlx5e_sq_has_room_for(struct mlx5e_sq *sq, u16 n) { - return ((sq->wq.sz_m1 & (sq->cc - sq->pc)) >= n || - sq->cc == sq->pc); + u16 cc = sq->cc; + u16 pc = sq->pc; + + return ((sq->wq.sz_m1 & (cc - pc)) >= n || cc == pc); } struct mlx5e_channel { From owner-svn-src-all@freebsd.org Thu Aug 3 14:12:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C54A4DBF2E9; Thu, 3 Aug 2017 14:12:24 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F9437E589; Thu, 3 Aug 2017 14:12:24 +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 v73ECN01058829; Thu, 3 Aug 2017 14:12:23 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73ECNA9058822; Thu, 3 Aug 2017 14:12:23 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708031412.v73ECNA9058822@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Aug 2017 14:12:23 +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: r322006 - in stable/11/sys: conf dev/mlx5 dev/mlx5/mlx5_core dev/mlx5/mlx5_en modules/mlx5 X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys: conf dev/mlx5 dev/mlx5/mlx5_core dev/mlx5/mlx5_en modules/mlx5 X-SVN-Commit-Revision: 322006 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 14:12:24 -0000 Author: hselasky Date: Thu Aug 3 14:12:23 2017 New Revision: 322006 URL: https://svnweb.freebsd.org/changeset/base/322006 Log: MFC r312872: Add support for reading advanced diagnostic counters. By default reading the diagnostic counters is disabled. The firmware decides which counters are supported and only those supported show up in the dev.mce.X.diagnostics sysctl tree. To enable reading of diagnostic counters set one or more of the following sysctls to one: dev.mce.X.conf.diag_general_enable=1 dev.mce.X.conf.diag_pci_enable=1 Sponsored by: Mellanox Technologies Added: stable/11/sys/dev/mlx5/diagnostics.h - copied unchanged from r312872, head/sys/dev/mlx5/diagnostics.h stable/11/sys/dev/mlx5/mlx5_core/mlx5_diagnostics.c - copied unchanged from r312872, head/sys/dev/mlx5/mlx5_core/mlx5_diagnostics.c Modified: stable/11/sys/conf/files stable/11/sys/dev/mlx5/mlx5_en/en.h stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c stable/11/sys/modules/mlx5/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Thu Aug 3 14:09:36 2017 (r322005) +++ stable/11/sys/conf/files Thu Aug 3 14:12:23 2017 (r322006) @@ -4288,6 +4288,8 @@ dev/mlx5/mlx5_core/mlx5_cmd.c optional mlx5 pci \ compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_cq.c optional mlx5 pci \ compile-with "${OFED_C}" +dev/mlx5/mlx5_core/mlx5_diagnostics.c optional mlx5 pci \ + compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_eq.c optional mlx5 pci \ compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_flow_table.c optional mlx5 pci \ Copied: stable/11/sys/dev/mlx5/diagnostics.h (from r312872, head/sys/dev/mlx5/diagnostics.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/dev/mlx5/diagnostics.h Thu Aug 3 14:12:23 2017 (r322006, copy of r312872, head/sys/dev/mlx5/diagnostics.h) @@ -0,0 +1,138 @@ +/*- + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. 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 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 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 MLX5_CORE_DIAGNOSTICS_H +#define MLX5_CORE_DIAGNOSTICS_H + +#define MLX5_CORE_DIAGNOSTICS_NUM(n, s, t) n +#define MLX5_CORE_DIAGNOSTICS_STRUCT(n, s, t) s, +#define MLX5_CORE_DIAGNOSTICS_ENTRY(n, s, t) { #s, (t) }, + +struct mlx5_core_diagnostics_entry { + const char *const desc; + u16 counter_id; +}; + +#define MLX5_CORE_PCI_DIAGNOSTICS(m) \ +m(+1, pxd_ready_bp, 0x0401) \ +m(+1, pci_write_bp, 0x0402) \ +m(+1, pci_read_bp, 0x0403) \ +m(+1, pci_read_stuck_no_completion_buffer, 0x0404) \ +m(+1, max_pci_bw, 0x0405) \ +m(+1, used_pci_bw, 0x0406) \ +m(+1, rx_pci_errors, 0) \ +m(+1, tx_pci_errors, 0) \ +m(+1, tx_pci_correctable_errors, 0) \ +m(+1, tx_pci_non_fatal_errors, 0) \ +m(+1, tx_pci_fatal_errors, 0) + +#define MLX5_CORE_PCI_DIAGNOSTICS_NUM \ + (0 MLX5_CORE_PCI_DIAGNOSTICS(MLX5_CORE_DIAGNOSTICS_NUM)) + +union mlx5_core_pci_diagnostics { + u64 array[MLX5_CORE_PCI_DIAGNOSTICS_NUM]; + struct { + u64 MLX5_CORE_PCI_DIAGNOSTICS( + MLX5_CORE_DIAGNOSTICS_STRUCT) dummy[0]; + } counter; +}; + +extern const struct mlx5_core_diagnostics_entry + mlx5_core_pci_diagnostics_table[MLX5_CORE_PCI_DIAGNOSTICS_NUM]; + +#define MLX5_CORE_GENERAL_DIAGNOSTICS(m) \ +m(+1, l0_mtt_miss, 0x0801) \ +m(+1, l0_mtt_hit, 0x0802) \ +m(+1, l1_mtt_miss, 0x0803) \ +m(+1, l1_mtt_hit, 0x0804) \ +m(+1, l0_mpt_miss, 0x0805) \ +m(+1, l0_mpt_hit, 0x0806) \ +m(+1, l1_mpt_miss, 0x0807) \ +m(+1, l1_mpt_hit, 0x0808) \ +m(+1, rxb_no_slow_path_credits, 0x0c01) \ +m(+1, rxb_no_fast_path_credits, 0x0c02) \ +m(+1, rxb_rxt_no_slow_path_cred_perf_count, 0x0c03) \ +m(+1, rxb_rxt_no_fast_path_cred_perf_count, 0x0c04) \ +m(+1, rxt_ctrl_perf_slice_load_slow, 0x1001) \ +m(+1, rxt_ctrl_perf_slice_load_fast, 0x1002) \ +m(+1, rxt_steering_perf_count_steering0_rse_work_rate, 0x1003) \ +m(+1, rxt_steering_perf_count_steering1_rse_work_rate, 0x1004) \ +m(+1, perf_count_tpt_credit, 0x1401) \ +m(+1, perf_wb_miss, 0x1402) \ +m(+1, perf_wb_hit, 0x1403) \ +m(+1, rxw_perf_rx_l1_slow_miss_ldb, 0x1404) \ +m(+1, rxw_perf_rx_l1_slow_hit_ldb, 0x1405) \ +m(+1, rxw_perf_rx_l1_fast_miss_ldb, 0x1406) \ +m(+1, rxw_perf_rx_l1_fast_hit_ldb, 0x1407) \ +m(+1, rxw_perf_l2_cache_read_miss_ldb, 0x1408) \ +m(+1, rxw_perf_l2_cache_read_hit_ldb, 0x1409) \ +m(+1, rxw_perf_rx_l1_slow_miss_reqsl, 0x140a) \ +m(+1, rxw_perf_rx_l1_slow_hit_reqsl, 0x140b) \ +m(+1, rxw_perf_rx_l1_fast_miss_reqsl, 0x140c) \ +m(+1, rxw_perf_rx_l1_fast_hit_reqsl, 0x140d) \ +m(+1, rxw_perf_l2_cache_read_miss_reqsl, 0x140e) \ +m(+1, rxw_perf_l2_cache_read_hit_reqsl, 0x140f) \ +m(+1, rxs_no_pxt_credits, 0x1801) \ +m(+1, rxc_eq_all_slices_busy, 0x1c01) \ +m(+1, rxc_cq_all_slices_busy, 0x1c02) \ +m(+1, rxc_msix_all_slices_busy, 0x1c03) \ +m(+1, sxw_qp_done_due_to_vl_limited, 0x2001) \ +m(+1, sxw_qp_done_due_to_desched, 0x2002) \ +m(+1, sxw_qp_done_due_to_work_done, 0x2003) \ +m(+1, sxw_qp_done_due_to_limited, 0x2004) \ +m(+1, sxw_qp_done_due_to_e2e_credits, 0x2005) \ +m(+1, sxw_packet_send_sxw2sxp_go_vld, 0x2006) \ +m(+1, sxw_perf_count_steering_hit, 0x2007) \ +m(+1, sxw_perf_count_steering_miss, 0x2008) \ +m(+1, sxw_perf_count_steering_rse_0, 0x2009) \ +m(+1, sxd_no_sched_credits, 0x2401) \ +m(+1, sxd_no_slow_path_sched_credits, 0x2402) \ +m(+1, tpt_indirect_mem_key, 0x2801) + +#define MLX5_CORE_GENERAL_DIAGNOSTICS_NUM \ + (0 MLX5_CORE_GENERAL_DIAGNOSTICS(MLX5_CORE_DIAGNOSTICS_NUM)) + +union mlx5_core_general_diagnostics { + u64 array[MLX5_CORE_GENERAL_DIAGNOSTICS_NUM]; + struct { + u64 MLX5_CORE_GENERAL_DIAGNOSTICS( + MLX5_CORE_DIAGNOSTICS_STRUCT) dummy[0]; + } counter; +}; + +extern const struct mlx5_core_diagnostics_entry + mlx5_core_general_diagnostics_table[MLX5_CORE_GENERAL_DIAGNOSTICS_NUM]; + +/* function prototypes */ +int mlx5_core_set_diagnostics_full(struct mlx5_core_dev *mdev, + u8 enable_pci, u8 enable_general); +int mlx5_core_get_diagnostics_full(struct mlx5_core_dev *mdev, + union mlx5_core_pci_diagnostics *ppci, + union mlx5_core_general_diagnostics *pgen); +int mlx5_core_supports_diagnostics(struct mlx5_core_dev *mdev, u16 counter_id); + +#endif /* MLX5_CORE_DIAGNOSTICS_H */ Copied: stable/11/sys/dev/mlx5/mlx5_core/mlx5_diagnostics.c (from r312872, head/sys/dev/mlx5/mlx5_core/mlx5_diagnostics.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_diagnostics.c Thu Aug 3 14:12:23 2017 (r322006, copy of r312872, head/sys/dev/mlx5/mlx5_core/mlx5_diagnostics.c) @@ -0,0 +1,286 @@ +/*- + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. 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 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 AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include + +const struct mlx5_core_diagnostics_entry + mlx5_core_pci_diagnostics_table[ + MLX5_CORE_PCI_DIAGNOSTICS_NUM] = { + MLX5_CORE_PCI_DIAGNOSTICS(MLX5_CORE_DIAGNOSTICS_ENTRY) +}; + +const struct mlx5_core_diagnostics_entry + mlx5_core_general_diagnostics_table[ + MLX5_CORE_GENERAL_DIAGNOSTICS_NUM] = { + MLX5_CORE_GENERAL_DIAGNOSTICS(MLX5_CORE_DIAGNOSTICS_ENTRY) +}; + +static int mlx5_core_get_index_of_diag_counter( + const struct mlx5_core_diagnostics_entry *entry, + int size, u16 counter_id) +{ + int x; + + /* check for invalid counter ID */ + if (counter_id == 0) + return -1; + + /* lookup counter ID in table */ + for (x = 0; x != size; x++) { + if (entry[x].counter_id == counter_id) + return x; + } + return -1; +} + +static void mlx5_core_put_diag_counter( + const struct mlx5_core_diagnostics_entry *entry, + u64 *array, int size, u16 counter_id, u64 value) +{ + int x; + + /* check for invalid counter ID */ + if (counter_id == 0) + return; + + /* lookup counter ID in table */ + for (x = 0; x != size; x++) { + if (entry[x].counter_id == counter_id) { + array[x] = value; + break; + } + } +} + +int mlx5_core_set_diagnostics_full(struct mlx5_core_dev *dev, + u8 enable_pci, u8 enable_general) +{ + void *diag_params_ctx; + void *in; + int numcounters; + int inlen; + int err; + int x; + int y; + + if (MLX5_CAP_GEN(dev, debug) == 0) + return 0; + + numcounters = MLX5_CAP_GEN(dev, num_of_diagnostic_counters); + if (numcounters == 0) + return 0; + + inlen = MLX5_ST_SZ_BYTES(set_diagnostic_params_in) + + MLX5_ST_SZ_BYTES(diagnostic_counter) * numcounters; + in = mlx5_vzalloc(inlen); + if (in == NULL) + return -ENOMEM; + + diag_params_ctx = MLX5_ADDR_OF(set_diagnostic_params_in, in, + diagnostic_params_ctx); + + MLX5_SET(diagnostic_params_context, diag_params_ctx, + enable, enable_pci || enable_general); + MLX5_SET(diagnostic_params_context, diag_params_ctx, + single, 1); + MLX5_SET(diagnostic_params_context, diag_params_ctx, + on_demand, 1); + + /* collect the counters we want to enable */ + for (x = y = 0; x != numcounters; x++) { + u16 counter_id = + MLX5_CAP_DEBUG(dev, diagnostic_counter[x].counter_id); + int index = -1; + + if (index < 0 && enable_pci != 0) { + /* check if counter ID exists in local table */ + index = mlx5_core_get_index_of_diag_counter( + mlx5_core_pci_diagnostics_table, + MLX5_CORE_PCI_DIAGNOSTICS_NUM, + counter_id); + } + if (index < 0 && enable_general != 0) { + /* check if counter ID exists in local table */ + index = mlx5_core_get_index_of_diag_counter( + mlx5_core_general_diagnostics_table, + MLX5_CORE_GENERAL_DIAGNOSTICS_NUM, + counter_id); + } + if (index < 0) + continue; + + MLX5_SET(diagnostic_params_context, + diag_params_ctx, + counter_id[y].counter_id, + counter_id); + y++; + } + + /* recompute input length */ + inlen = MLX5_ST_SZ_BYTES(set_diagnostic_params_in) + + MLX5_ST_SZ_BYTES(diagnostic_counter) * y; + + /* set number of counters */ + MLX5_SET(diagnostic_params_context, diag_params_ctx, + num_of_counters, y); + + /* execute firmware command */ + err = mlx5_set_diagnostic_params(dev, in, inlen); + + kvfree(in); + + return err; +} + +int mlx5_core_get_diagnostics_full(struct mlx5_core_dev *dev, + union mlx5_core_pci_diagnostics *pdiag, + union mlx5_core_general_diagnostics *pgen) +{ + void *out; + void *in; + int numcounters; + int outlen; + int inlen; + int err; + int x; + + if (MLX5_CAP_GEN(dev, debug) == 0) + return 0; + + numcounters = MLX5_CAP_GEN(dev, num_of_diagnostic_counters); + if (numcounters == 0) + return 0; + + outlen = MLX5_ST_SZ_BYTES(query_diagnostic_counters_out) + + MLX5_ST_SZ_BYTES(diagnostic_counter) * numcounters; + + out = mlx5_vzalloc(outlen); + if (out == NULL) + return -ENOMEM; + + err = mlx5_query_diagnostic_counters(dev, 1, 0, out, outlen); + if (err == 0) { + for (x = 0; x != numcounters; x++) { + u16 counter_id = MLX5_GET( + query_diagnostic_counters_out, + out, diag_counter[x].counter_id); + u64 counter_value = MLX5_GET64( + query_diagnostic_counters_out, + out, diag_counter[x].counter_value_h); + + if (pdiag != NULL) { + mlx5_core_put_diag_counter( + mlx5_core_pci_diagnostics_table, + pdiag->array, + MLX5_CORE_PCI_DIAGNOSTICS_NUM, + counter_id, counter_value); + } + if (pgen != NULL) { + mlx5_core_put_diag_counter( + mlx5_core_general_diagnostics_table, + pgen->array, + MLX5_CORE_GENERAL_DIAGNOSTICS_NUM, + counter_id, counter_value); + } + } + } + kvfree(out); + + if (pdiag != NULL) { + inlen = MLX5_ST_SZ_BYTES(mpcnt_reg); + outlen = MLX5_ST_SZ_BYTES(mpcnt_reg); + + in = mlx5_vzalloc(inlen); + if (in == NULL) + return -ENOMEM; + + out = mlx5_vzalloc(outlen); + if (out == NULL) { + kvfree(in); + return -ENOMEM; + } + MLX5_SET(mpcnt_reg, in, grp, + MLX5_PCIE_PERFORMANCE_COUNTERS_GROUP); + + err = mlx5_core_access_reg(dev, in, inlen, out, outlen, + MLX5_REG_MPCNT, 0, 0); + if (err == 0) { + void *pcounters = MLX5_ADDR_OF(mpcnt_reg, out, + counter_set.pcie_performance_counters_data_layout); + + pdiag->counter.rx_pci_errors = + MLX5_GET(pcie_performance_counters_data_layout, + pcounters, rx_errors); + pdiag->counter.tx_pci_errors = + MLX5_GET(pcie_performance_counters_data_layout, + pcounters, tx_errors); + } + MLX5_SET(mpcnt_reg, in, grp, + MLX5_PCIE_TIMERS_AND_STATES_COUNTERS_GROUP); + + err = mlx5_core_access_reg(dev, in, inlen, out, outlen, + MLX5_REG_MPCNT, 0, 0); + if (err == 0) { + void *pcounters = MLX5_ADDR_OF(mpcnt_reg, out, + counter_set.pcie_timers_and_states_data_layout); + + pdiag->counter.tx_pci_non_fatal_errors = + MLX5_GET(pcie_timers_and_states_data_layout, + pcounters, non_fatal_err_msg_sent); + pdiag->counter.tx_pci_fatal_errors = + MLX5_GET(pcie_timers_and_states_data_layout, + pcounters, fatal_err_msg_sent); + } + kvfree(in); + kvfree(out); + } + return 0; +} + +int mlx5_core_supports_diagnostics(struct mlx5_core_dev *dev, u16 counter_id) +{ + int numcounters; + int x; + + if (MLX5_CAP_GEN(dev, debug) == 0) + return 0; + + /* check for any counter */ + if (counter_id == 0) + return 1; + + numcounters = MLX5_CAP_GEN(dev, num_of_diagnostic_counters); + + /* check if counter ID exists in debug capability */ + for (x = 0; x != numcounters; x++) { + if (MLX5_CAP_DEBUG(dev, diagnostic_counter[x].counter_id) == + counter_id) + return 1; + } + return 0; /* not supported counter */ +} Modified: stable/11/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/en.h Thu Aug 3 14:09:36 2017 (r322005) +++ stable/11/sys/dev/mlx5/mlx5_en/en.h Thu Aug 3 14:12:23 2017 (r322006) @@ -63,6 +63,7 @@ #include #include #include +#include #include #include @@ -406,7 +407,9 @@ struct mlx5e_params { m(+1, u64 tx_completion_fact, "tx_completion_fact", "1..MAX: Completion event ratio") \ m(+1, u64 tx_completion_fact_max, "tx_completion_fact_max", "Maximum completion event ratio") \ m(+1, u64 hw_lro, "hw_lro", "set to enable hw_lro") \ - m(+1, u64 cqe_zipping, "cqe_zipping", "0 : CQE zipping disabled") + m(+1, u64 cqe_zipping, "cqe_zipping", "0 : CQE zipping disabled") \ + m(+1, u64 diag_pci_enable, "diag_pci_enable", "0: Disabled 1: Enabled") \ + m(+1, u64 diag_general_enable, "diag_general_enable", "0: Disabled 1: Enabled") #define MLX5E_PARAMS_NUM (0 MLX5E_PARAMS(MLX5E_STATS_COUNT)) @@ -660,6 +663,8 @@ struct mlx5e_priv { struct mlx5e_params params; struct mlx5e_params_ethtool params_ethtool; + union mlx5_core_pci_diagnostics params_pci; + union mlx5_core_general_diagnostics params_general; struct mtx async_events_mtx; /* sync hw events */ struct work_struct update_stats_work; struct work_struct update_carrier_work; Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Thu Aug 3 14:09:36 2017 (r322005) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Thu Aug 3 14:12:23 2017 (r322006) @@ -377,6 +377,24 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS) mlx5e_open_locked(priv->ifp); break; + case MLX5_PARAM_OFFSET(diag_pci_enable): + priv->params_ethtool.diag_pci_enable = + priv->params_ethtool.diag_pci_enable ? 1 : 0; + + error = -mlx5_core_set_diagnostics_full(priv->mdev, + priv->params_ethtool.diag_pci_enable, + priv->params_ethtool.diag_general_enable); + break; + + case MLX5_PARAM_OFFSET(diag_general_enable): + priv->params_ethtool.diag_general_enable = + priv->params_ethtool.diag_general_enable ? 1 : 0; + + error = -mlx5_core_set_diagnostics_full(priv->mdev, + priv->params_ethtool.diag_pci_enable, + priv->params_ethtool.diag_general_enable); + break; + default: break; } @@ -624,6 +642,45 @@ mlx5e_ethtool_debug_stats(SYSCTL_HANDLER_ARGS) return (error); } +static void +mlx5e_create_diagnostics(struct mlx5e_priv *priv) +{ + struct mlx5_core_diagnostics_entry entry; + struct sysctl_ctx_list *ctx; + struct sysctl_oid *node; + int x; + + /* sysctl context we are using */ + ctx = &priv->sysctl_ctx; + + /* create root node */ + node = SYSCTL_ADD_NODE(ctx, + SYSCTL_CHILDREN(priv->sysctl_ifnet), OID_AUTO, + "diagnostics", CTLFLAG_RD, NULL, "Diagnostics"); + if (node == NULL) + return; + + /* create PCI diagnostics */ + for (x = 0; x != MLX5_CORE_PCI_DIAGNOSTICS_NUM; x++) { + entry = mlx5_core_pci_diagnostics_table[x]; + if (mlx5_core_supports_diagnostics(priv->mdev, entry.counter_id) == 0) + continue; + SYSCTL_ADD_UQUAD(ctx, SYSCTL_CHILDREN(node), OID_AUTO, + entry.desc, CTLFLAG_RD, priv->params_pci.array + x, + "PCI diagnostics counter"); + } + + /* create general diagnostics */ + for (x = 0; x != MLX5_CORE_GENERAL_DIAGNOSTICS_NUM; x++) { + entry = mlx5_core_general_diagnostics_table[x]; + if (mlx5_core_supports_diagnostics(priv->mdev, entry.counter_id) == 0) + continue; + SYSCTL_ADD_UQUAD(ctx, SYSCTL_CHILDREN(node), OID_AUTO, + entry.desc, CTLFLAG_RD, priv->params_general.array + x, + "General diagnostics counter"); + } +} + void mlx5e_create_ethtool(struct mlx5e_priv *priv) { @@ -705,4 +762,7 @@ mlx5e_create_ethtool(struct mlx5e_priv *priv) SYSCTL_ADD_PROC(&priv->sysctl_ctx, SYSCTL_CHILDREN(node), OID_AUTO, "eeprom_info", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, priv, 0, mlx5e_read_eeprom, "I", "EEPROM information"); + + /* Diagnostics support */ + mlx5e_create_diagnostics(priv); } Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Aug 3 14:09:36 2017 (r322005) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Aug 3 14:12:23 2017 (r322006) @@ -573,6 +573,16 @@ mlx5e_update_stats_work(struct work_struct *work) free_out: kvfree(out); + + /* Update diagnostics, if any */ + if (priv->params_ethtool.diag_pci_enable || + priv->params_ethtool.diag_general_enable) { + int error = mlx5_core_get_diagnostics_full(mdev, + priv->params_ethtool.diag_pci_enable ? &priv->params_pci : NULL, + priv->params_ethtool.diag_general_enable ? &priv->params_general : NULL); + if (error != 0) + if_printf(priv->ifp, "Failed reading diagnostics: %d\n", error); + } PRIV_UNLOCK(priv); } Modified: stable/11/sys/modules/mlx5/Makefile ============================================================================== --- stable/11/sys/modules/mlx5/Makefile Thu Aug 3 14:09:36 2017 (r322005) +++ stable/11/sys/modules/mlx5/Makefile Thu Aug 3 14:12:23 2017 (r322006) @@ -6,6 +6,7 @@ SRCS= \ mlx5_alloc.c \ mlx5_cmd.c \ mlx5_cq.c \ +mlx5_diagnostics.c \ mlx5_eq.c \ mlx5_eswitch_vacl.c \ mlx5_flow_table.c \ From owner-svn-src-all@freebsd.org Thu Aug 3 14:14:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E21EBDBF5AF; Thu, 3 Aug 2017 14:14:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5BC87E726; Thu, 3 Aug 2017 14:14:14 +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 v73EEDea058946; Thu, 3 Aug 2017 14:14:13 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73EEDSt058939; Thu, 3 Aug 2017 14:14:13 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708031414.v73EEDSt058939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Aug 2017 14:14:13 +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: r322007 - in stable/10/sys: conf dev/mlx5 dev/mlx5/mlx5_core dev/mlx5/mlx5_en modules/mlx5 X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/10/sys: conf dev/mlx5 dev/mlx5/mlx5_core dev/mlx5/mlx5_en modules/mlx5 X-SVN-Commit-Revision: 322007 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 14:14:15 -0000 Author: hselasky Date: Thu Aug 3 14:14:13 2017 New Revision: 322007 URL: https://svnweb.freebsd.org/changeset/base/322007 Log: MFC r312872: Add support for reading advanced diagnostic counters. By default reading the diagnostic counters is disabled. The firmware decides which counters are supported and only those supported show up in the dev.mce.X.diagnostics sysctl tree. To enable reading of diagnostic counters set one or more of the following sysctls to one: dev.mce.X.conf.diag_general_enable=1 dev.mce.X.conf.diag_pci_enable=1 Sponsored by: Mellanox Technologies Added: stable/10/sys/dev/mlx5/diagnostics.h - copied unchanged from r312872, head/sys/dev/mlx5/diagnostics.h stable/10/sys/dev/mlx5/mlx5_core/mlx5_diagnostics.c - copied unchanged from r312872, head/sys/dev/mlx5/mlx5_core/mlx5_diagnostics.c Modified: stable/10/sys/conf/files stable/10/sys/dev/mlx5/mlx5_en/en.h stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c stable/10/sys/modules/mlx5/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Thu Aug 3 14:12:23 2017 (r322006) +++ stable/10/sys/conf/files Thu Aug 3 14:14:13 2017 (r322007) @@ -3939,6 +3939,8 @@ dev/mlx5/mlx5_core/mlx5_cmd.c optional mlx5 pci \ compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_cq.c optional mlx5 pci \ compile-with "${OFED_C}" +dev/mlx5/mlx5_core/mlx5_diagnostics.c optional mlx5 pci \ + compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_eq.c optional mlx5 pci \ compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_flow_table.c optional mlx5 pci \ Copied: stable/10/sys/dev/mlx5/diagnostics.h (from r312872, head/sys/dev/mlx5/diagnostics.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/mlx5/diagnostics.h Thu Aug 3 14:14:13 2017 (r322007, copy of r312872, head/sys/dev/mlx5/diagnostics.h) @@ -0,0 +1,138 @@ +/*- + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. 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 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 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 MLX5_CORE_DIAGNOSTICS_H +#define MLX5_CORE_DIAGNOSTICS_H + +#define MLX5_CORE_DIAGNOSTICS_NUM(n, s, t) n +#define MLX5_CORE_DIAGNOSTICS_STRUCT(n, s, t) s, +#define MLX5_CORE_DIAGNOSTICS_ENTRY(n, s, t) { #s, (t) }, + +struct mlx5_core_diagnostics_entry { + const char *const desc; + u16 counter_id; +}; + +#define MLX5_CORE_PCI_DIAGNOSTICS(m) \ +m(+1, pxd_ready_bp, 0x0401) \ +m(+1, pci_write_bp, 0x0402) \ +m(+1, pci_read_bp, 0x0403) \ +m(+1, pci_read_stuck_no_completion_buffer, 0x0404) \ +m(+1, max_pci_bw, 0x0405) \ +m(+1, used_pci_bw, 0x0406) \ +m(+1, rx_pci_errors, 0) \ +m(+1, tx_pci_errors, 0) \ +m(+1, tx_pci_correctable_errors, 0) \ +m(+1, tx_pci_non_fatal_errors, 0) \ +m(+1, tx_pci_fatal_errors, 0) + +#define MLX5_CORE_PCI_DIAGNOSTICS_NUM \ + (0 MLX5_CORE_PCI_DIAGNOSTICS(MLX5_CORE_DIAGNOSTICS_NUM)) + +union mlx5_core_pci_diagnostics { + u64 array[MLX5_CORE_PCI_DIAGNOSTICS_NUM]; + struct { + u64 MLX5_CORE_PCI_DIAGNOSTICS( + MLX5_CORE_DIAGNOSTICS_STRUCT) dummy[0]; + } counter; +}; + +extern const struct mlx5_core_diagnostics_entry + mlx5_core_pci_diagnostics_table[MLX5_CORE_PCI_DIAGNOSTICS_NUM]; + +#define MLX5_CORE_GENERAL_DIAGNOSTICS(m) \ +m(+1, l0_mtt_miss, 0x0801) \ +m(+1, l0_mtt_hit, 0x0802) \ +m(+1, l1_mtt_miss, 0x0803) \ +m(+1, l1_mtt_hit, 0x0804) \ +m(+1, l0_mpt_miss, 0x0805) \ +m(+1, l0_mpt_hit, 0x0806) \ +m(+1, l1_mpt_miss, 0x0807) \ +m(+1, l1_mpt_hit, 0x0808) \ +m(+1, rxb_no_slow_path_credits, 0x0c01) \ +m(+1, rxb_no_fast_path_credits, 0x0c02) \ +m(+1, rxb_rxt_no_slow_path_cred_perf_count, 0x0c03) \ +m(+1, rxb_rxt_no_fast_path_cred_perf_count, 0x0c04) \ +m(+1, rxt_ctrl_perf_slice_load_slow, 0x1001) \ +m(+1, rxt_ctrl_perf_slice_load_fast, 0x1002) \ +m(+1, rxt_steering_perf_count_steering0_rse_work_rate, 0x1003) \ +m(+1, rxt_steering_perf_count_steering1_rse_work_rate, 0x1004) \ +m(+1, perf_count_tpt_credit, 0x1401) \ +m(+1, perf_wb_miss, 0x1402) \ +m(+1, perf_wb_hit, 0x1403) \ +m(+1, rxw_perf_rx_l1_slow_miss_ldb, 0x1404) \ +m(+1, rxw_perf_rx_l1_slow_hit_ldb, 0x1405) \ +m(+1, rxw_perf_rx_l1_fast_miss_ldb, 0x1406) \ +m(+1, rxw_perf_rx_l1_fast_hit_ldb, 0x1407) \ +m(+1, rxw_perf_l2_cache_read_miss_ldb, 0x1408) \ +m(+1, rxw_perf_l2_cache_read_hit_ldb, 0x1409) \ +m(+1, rxw_perf_rx_l1_slow_miss_reqsl, 0x140a) \ +m(+1, rxw_perf_rx_l1_slow_hit_reqsl, 0x140b) \ +m(+1, rxw_perf_rx_l1_fast_miss_reqsl, 0x140c) \ +m(+1, rxw_perf_rx_l1_fast_hit_reqsl, 0x140d) \ +m(+1, rxw_perf_l2_cache_read_miss_reqsl, 0x140e) \ +m(+1, rxw_perf_l2_cache_read_hit_reqsl, 0x140f) \ +m(+1, rxs_no_pxt_credits, 0x1801) \ +m(+1, rxc_eq_all_slices_busy, 0x1c01) \ +m(+1, rxc_cq_all_slices_busy, 0x1c02) \ +m(+1, rxc_msix_all_slices_busy, 0x1c03) \ +m(+1, sxw_qp_done_due_to_vl_limited, 0x2001) \ +m(+1, sxw_qp_done_due_to_desched, 0x2002) \ +m(+1, sxw_qp_done_due_to_work_done, 0x2003) \ +m(+1, sxw_qp_done_due_to_limited, 0x2004) \ +m(+1, sxw_qp_done_due_to_e2e_credits, 0x2005) \ +m(+1, sxw_packet_send_sxw2sxp_go_vld, 0x2006) \ +m(+1, sxw_perf_count_steering_hit, 0x2007) \ +m(+1, sxw_perf_count_steering_miss, 0x2008) \ +m(+1, sxw_perf_count_steering_rse_0, 0x2009) \ +m(+1, sxd_no_sched_credits, 0x2401) \ +m(+1, sxd_no_slow_path_sched_credits, 0x2402) \ +m(+1, tpt_indirect_mem_key, 0x2801) + +#define MLX5_CORE_GENERAL_DIAGNOSTICS_NUM \ + (0 MLX5_CORE_GENERAL_DIAGNOSTICS(MLX5_CORE_DIAGNOSTICS_NUM)) + +union mlx5_core_general_diagnostics { + u64 array[MLX5_CORE_GENERAL_DIAGNOSTICS_NUM]; + struct { + u64 MLX5_CORE_GENERAL_DIAGNOSTICS( + MLX5_CORE_DIAGNOSTICS_STRUCT) dummy[0]; + } counter; +}; + +extern const struct mlx5_core_diagnostics_entry + mlx5_core_general_diagnostics_table[MLX5_CORE_GENERAL_DIAGNOSTICS_NUM]; + +/* function prototypes */ +int mlx5_core_set_diagnostics_full(struct mlx5_core_dev *mdev, + u8 enable_pci, u8 enable_general); +int mlx5_core_get_diagnostics_full(struct mlx5_core_dev *mdev, + union mlx5_core_pci_diagnostics *ppci, + union mlx5_core_general_diagnostics *pgen); +int mlx5_core_supports_diagnostics(struct mlx5_core_dev *mdev, u16 counter_id); + +#endif /* MLX5_CORE_DIAGNOSTICS_H */ Copied: stable/10/sys/dev/mlx5/mlx5_core/mlx5_diagnostics.c (from r312872, head/sys/dev/mlx5/mlx5_core/mlx5_diagnostics.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/mlx5/mlx5_core/mlx5_diagnostics.c Thu Aug 3 14:14:13 2017 (r322007, copy of r312872, head/sys/dev/mlx5/mlx5_core/mlx5_diagnostics.c) @@ -0,0 +1,286 @@ +/*- + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. 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 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 AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include + +const struct mlx5_core_diagnostics_entry + mlx5_core_pci_diagnostics_table[ + MLX5_CORE_PCI_DIAGNOSTICS_NUM] = { + MLX5_CORE_PCI_DIAGNOSTICS(MLX5_CORE_DIAGNOSTICS_ENTRY) +}; + +const struct mlx5_core_diagnostics_entry + mlx5_core_general_diagnostics_table[ + MLX5_CORE_GENERAL_DIAGNOSTICS_NUM] = { + MLX5_CORE_GENERAL_DIAGNOSTICS(MLX5_CORE_DIAGNOSTICS_ENTRY) +}; + +static int mlx5_core_get_index_of_diag_counter( + const struct mlx5_core_diagnostics_entry *entry, + int size, u16 counter_id) +{ + int x; + + /* check for invalid counter ID */ + if (counter_id == 0) + return -1; + + /* lookup counter ID in table */ + for (x = 0; x != size; x++) { + if (entry[x].counter_id == counter_id) + return x; + } + return -1; +} + +static void mlx5_core_put_diag_counter( + const struct mlx5_core_diagnostics_entry *entry, + u64 *array, int size, u16 counter_id, u64 value) +{ + int x; + + /* check for invalid counter ID */ + if (counter_id == 0) + return; + + /* lookup counter ID in table */ + for (x = 0; x != size; x++) { + if (entry[x].counter_id == counter_id) { + array[x] = value; + break; + } + } +} + +int mlx5_core_set_diagnostics_full(struct mlx5_core_dev *dev, + u8 enable_pci, u8 enable_general) +{ + void *diag_params_ctx; + void *in; + int numcounters; + int inlen; + int err; + int x; + int y; + + if (MLX5_CAP_GEN(dev, debug) == 0) + return 0; + + numcounters = MLX5_CAP_GEN(dev, num_of_diagnostic_counters); + if (numcounters == 0) + return 0; + + inlen = MLX5_ST_SZ_BYTES(set_diagnostic_params_in) + + MLX5_ST_SZ_BYTES(diagnostic_counter) * numcounters; + in = mlx5_vzalloc(inlen); + if (in == NULL) + return -ENOMEM; + + diag_params_ctx = MLX5_ADDR_OF(set_diagnostic_params_in, in, + diagnostic_params_ctx); + + MLX5_SET(diagnostic_params_context, diag_params_ctx, + enable, enable_pci || enable_general); + MLX5_SET(diagnostic_params_context, diag_params_ctx, + single, 1); + MLX5_SET(diagnostic_params_context, diag_params_ctx, + on_demand, 1); + + /* collect the counters we want to enable */ + for (x = y = 0; x != numcounters; x++) { + u16 counter_id = + MLX5_CAP_DEBUG(dev, diagnostic_counter[x].counter_id); + int index = -1; + + if (index < 0 && enable_pci != 0) { + /* check if counter ID exists in local table */ + index = mlx5_core_get_index_of_diag_counter( + mlx5_core_pci_diagnostics_table, + MLX5_CORE_PCI_DIAGNOSTICS_NUM, + counter_id); + } + if (index < 0 && enable_general != 0) { + /* check if counter ID exists in local table */ + index = mlx5_core_get_index_of_diag_counter( + mlx5_core_general_diagnostics_table, + MLX5_CORE_GENERAL_DIAGNOSTICS_NUM, + counter_id); + } + if (index < 0) + continue; + + MLX5_SET(diagnostic_params_context, + diag_params_ctx, + counter_id[y].counter_id, + counter_id); + y++; + } + + /* recompute input length */ + inlen = MLX5_ST_SZ_BYTES(set_diagnostic_params_in) + + MLX5_ST_SZ_BYTES(diagnostic_counter) * y; + + /* set number of counters */ + MLX5_SET(diagnostic_params_context, diag_params_ctx, + num_of_counters, y); + + /* execute firmware command */ + err = mlx5_set_diagnostic_params(dev, in, inlen); + + kvfree(in); + + return err; +} + +int mlx5_core_get_diagnostics_full(struct mlx5_core_dev *dev, + union mlx5_core_pci_diagnostics *pdiag, + union mlx5_core_general_diagnostics *pgen) +{ + void *out; + void *in; + int numcounters; + int outlen; + int inlen; + int err; + int x; + + if (MLX5_CAP_GEN(dev, debug) == 0) + return 0; + + numcounters = MLX5_CAP_GEN(dev, num_of_diagnostic_counters); + if (numcounters == 0) + return 0; + + outlen = MLX5_ST_SZ_BYTES(query_diagnostic_counters_out) + + MLX5_ST_SZ_BYTES(diagnostic_counter) * numcounters; + + out = mlx5_vzalloc(outlen); + if (out == NULL) + return -ENOMEM; + + err = mlx5_query_diagnostic_counters(dev, 1, 0, out, outlen); + if (err == 0) { + for (x = 0; x != numcounters; x++) { + u16 counter_id = MLX5_GET( + query_diagnostic_counters_out, + out, diag_counter[x].counter_id); + u64 counter_value = MLX5_GET64( + query_diagnostic_counters_out, + out, diag_counter[x].counter_value_h); + + if (pdiag != NULL) { + mlx5_core_put_diag_counter( + mlx5_core_pci_diagnostics_table, + pdiag->array, + MLX5_CORE_PCI_DIAGNOSTICS_NUM, + counter_id, counter_value); + } + if (pgen != NULL) { + mlx5_core_put_diag_counter( + mlx5_core_general_diagnostics_table, + pgen->array, + MLX5_CORE_GENERAL_DIAGNOSTICS_NUM, + counter_id, counter_value); + } + } + } + kvfree(out); + + if (pdiag != NULL) { + inlen = MLX5_ST_SZ_BYTES(mpcnt_reg); + outlen = MLX5_ST_SZ_BYTES(mpcnt_reg); + + in = mlx5_vzalloc(inlen); + if (in == NULL) + return -ENOMEM; + + out = mlx5_vzalloc(outlen); + if (out == NULL) { + kvfree(in); + return -ENOMEM; + } + MLX5_SET(mpcnt_reg, in, grp, + MLX5_PCIE_PERFORMANCE_COUNTERS_GROUP); + + err = mlx5_core_access_reg(dev, in, inlen, out, outlen, + MLX5_REG_MPCNT, 0, 0); + if (err == 0) { + void *pcounters = MLX5_ADDR_OF(mpcnt_reg, out, + counter_set.pcie_performance_counters_data_layout); + + pdiag->counter.rx_pci_errors = + MLX5_GET(pcie_performance_counters_data_layout, + pcounters, rx_errors); + pdiag->counter.tx_pci_errors = + MLX5_GET(pcie_performance_counters_data_layout, + pcounters, tx_errors); + } + MLX5_SET(mpcnt_reg, in, grp, + MLX5_PCIE_TIMERS_AND_STATES_COUNTERS_GROUP); + + err = mlx5_core_access_reg(dev, in, inlen, out, outlen, + MLX5_REG_MPCNT, 0, 0); + if (err == 0) { + void *pcounters = MLX5_ADDR_OF(mpcnt_reg, out, + counter_set.pcie_timers_and_states_data_layout); + + pdiag->counter.tx_pci_non_fatal_errors = + MLX5_GET(pcie_timers_and_states_data_layout, + pcounters, non_fatal_err_msg_sent); + pdiag->counter.tx_pci_fatal_errors = + MLX5_GET(pcie_timers_and_states_data_layout, + pcounters, fatal_err_msg_sent); + } + kvfree(in); + kvfree(out); + } + return 0; +} + +int mlx5_core_supports_diagnostics(struct mlx5_core_dev *dev, u16 counter_id) +{ + int numcounters; + int x; + + if (MLX5_CAP_GEN(dev, debug) == 0) + return 0; + + /* check for any counter */ + if (counter_id == 0) + return 1; + + numcounters = MLX5_CAP_GEN(dev, num_of_diagnostic_counters); + + /* check if counter ID exists in debug capability */ + for (x = 0; x != numcounters; x++) { + if (MLX5_CAP_DEBUG(dev, diagnostic_counter[x].counter_id) == + counter_id) + return 1; + } + return 0; /* not supported counter */ +} Modified: stable/10/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/en.h Thu Aug 3 14:12:23 2017 (r322006) +++ stable/10/sys/dev/mlx5/mlx5_en/en.h Thu Aug 3 14:14:13 2017 (r322007) @@ -69,6 +69,7 @@ #include #include #include +#include #include #include @@ -412,7 +413,9 @@ struct mlx5e_params { m(+1, u64 tx_completion_fact, "tx_completion_fact", "1..MAX: Completion event ratio") \ m(+1, u64 tx_completion_fact_max, "tx_completion_fact_max", "Maximum completion event ratio") \ m(+1, u64 hw_lro, "hw_lro", "set to enable hw_lro") \ - m(+1, u64 cqe_zipping, "cqe_zipping", "0 : CQE zipping disabled") + m(+1, u64 cqe_zipping, "cqe_zipping", "0 : CQE zipping disabled") \ + m(+1, u64 diag_pci_enable, "diag_pci_enable", "0: Disabled 1: Enabled") \ + m(+1, u64 diag_general_enable, "diag_general_enable", "0: Disabled 1: Enabled") #define MLX5E_PARAMS_NUM (0 MLX5E_PARAMS(MLX5E_STATS_COUNT)) @@ -670,6 +673,8 @@ struct mlx5e_priv { struct mlx5e_params params; struct mlx5e_params_ethtool params_ethtool; + union mlx5_core_pci_diagnostics params_pci; + union mlx5_core_general_diagnostics params_general; struct mtx async_events_mtx; /* sync hw events */ struct work_struct update_stats_work; struct work_struct update_carrier_work; Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Thu Aug 3 14:12:23 2017 (r322006) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Thu Aug 3 14:14:13 2017 (r322007) @@ -377,6 +377,24 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS) mlx5e_open_locked(priv->ifp); break; + case MLX5_PARAM_OFFSET(diag_pci_enable): + priv->params_ethtool.diag_pci_enable = + priv->params_ethtool.diag_pci_enable ? 1 : 0; + + error = -mlx5_core_set_diagnostics_full(priv->mdev, + priv->params_ethtool.diag_pci_enable, + priv->params_ethtool.diag_general_enable); + break; + + case MLX5_PARAM_OFFSET(diag_general_enable): + priv->params_ethtool.diag_general_enable = + priv->params_ethtool.diag_general_enable ? 1 : 0; + + error = -mlx5_core_set_diagnostics_full(priv->mdev, + priv->params_ethtool.diag_pci_enable, + priv->params_ethtool.diag_general_enable); + break; + default: break; } @@ -624,6 +642,45 @@ mlx5e_ethtool_debug_stats(SYSCTL_HANDLER_ARGS) return (error); } +static void +mlx5e_create_diagnostics(struct mlx5e_priv *priv) +{ + struct mlx5_core_diagnostics_entry entry; + struct sysctl_ctx_list *ctx; + struct sysctl_oid *node; + int x; + + /* sysctl context we are using */ + ctx = &priv->sysctl_ctx; + + /* create root node */ + node = SYSCTL_ADD_NODE(ctx, + SYSCTL_CHILDREN(priv->sysctl_ifnet), OID_AUTO, + "diagnostics", CTLFLAG_RD, NULL, "Diagnostics"); + if (node == NULL) + return; + + /* create PCI diagnostics */ + for (x = 0; x != MLX5_CORE_PCI_DIAGNOSTICS_NUM; x++) { + entry = mlx5_core_pci_diagnostics_table[x]; + if (mlx5_core_supports_diagnostics(priv->mdev, entry.counter_id) == 0) + continue; + SYSCTL_ADD_UQUAD(ctx, SYSCTL_CHILDREN(node), OID_AUTO, + entry.desc, CTLFLAG_RD, priv->params_pci.array + x, + "PCI diagnostics counter"); + } + + /* create general diagnostics */ + for (x = 0; x != MLX5_CORE_GENERAL_DIAGNOSTICS_NUM; x++) { + entry = mlx5_core_general_diagnostics_table[x]; + if (mlx5_core_supports_diagnostics(priv->mdev, entry.counter_id) == 0) + continue; + SYSCTL_ADD_UQUAD(ctx, SYSCTL_CHILDREN(node), OID_AUTO, + entry.desc, CTLFLAG_RD, priv->params_general.array + x, + "General diagnostics counter"); + } +} + void mlx5e_create_ethtool(struct mlx5e_priv *priv) { @@ -705,4 +762,7 @@ mlx5e_create_ethtool(struct mlx5e_priv *priv) SYSCTL_ADD_PROC(&priv->sysctl_ctx, SYSCTL_CHILDREN(node), OID_AUTO, "eeprom_info", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, priv, 0, mlx5e_read_eeprom, "I", "EEPROM information"); + + /* Diagnostics support */ + mlx5e_create_diagnostics(priv); } Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Aug 3 14:12:23 2017 (r322006) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Aug 3 14:14:13 2017 (r322007) @@ -573,6 +573,16 @@ mlx5e_update_stats_work(struct work_struct *work) free_out: kvfree(out); + + /* Update diagnostics, if any */ + if (priv->params_ethtool.diag_pci_enable || + priv->params_ethtool.diag_general_enable) { + int error = mlx5_core_get_diagnostics_full(mdev, + priv->params_ethtool.diag_pci_enable ? &priv->params_pci : NULL, + priv->params_ethtool.diag_general_enable ? &priv->params_general : NULL); + if (error != 0) + if_printf(priv->ifp, "Failed reading diagnostics: %d\n", error); + } PRIV_UNLOCK(priv); } Modified: stable/10/sys/modules/mlx5/Makefile ============================================================================== --- stable/10/sys/modules/mlx5/Makefile Thu Aug 3 14:12:23 2017 (r322006) +++ stable/10/sys/modules/mlx5/Makefile Thu Aug 3 14:14:13 2017 (r322007) @@ -6,6 +6,7 @@ SRCS= \ mlx5_alloc.c \ mlx5_cmd.c \ mlx5_cq.c \ +mlx5_diagnostics.c \ mlx5_eq.c \ mlx5_eswitch_vacl.c \ mlx5_flow_table.c \ From owner-svn-src-all@freebsd.org Thu Aug 3 14:16:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7654DBF798; Thu, 3 Aug 2017 14:16:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C164D7E8D3; Thu, 3 Aug 2017 14:16:32 +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 v73EGVg7059098; Thu, 3 Aug 2017 14:16:31 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73EGVZd059096; Thu, 3 Aug 2017 14:16:31 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708031416.v73EGVZd059096@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Aug 2017 14:16:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r322008 - in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 322008 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 14:16:33 -0000 Author: hselasky Date: Thu Aug 3 14:16:31 2017 New Revision: 322008 URL: https://svnweb.freebsd.org/changeset/base/322008 Log: MFC r312876: Use ffs() to scan for first bit instead of using a for() loop. Minor code refactor while at it. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/driver.h stable/11/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/driver.h ============================================================================== --- stable/11/sys/dev/mlx5/driver.h Thu Aug 3 14:14:13 2017 (r322007) +++ stable/11/sys/dev/mlx5/driver.h Thu Aug 3 14:16:31 2017 (r322008) @@ -859,7 +859,7 @@ void mlx5_cq_completion(struct mlx5_core_dev *dev, u32 void mlx5_rsc_event(struct mlx5_core_dev *dev, u32 rsn, int event_type); void mlx5_srq_event(struct mlx5_core_dev *dev, u32 srqn, int event_type); struct mlx5_core_srq *mlx5_core_get_srq(struct mlx5_core_dev *dev, u32 srqn); -void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, unsigned long vector); +void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, u32 vector); void mlx5_cq_event(struct mlx5_core_dev *dev, u32 cqn, int event_type); int mlx5_create_map_eq(struct mlx5_core_dev *dev, struct mlx5_eq *eq, u8 vecidx, int nent, u64 mask, const char *name, struct mlx5_uar *uar); Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_cmd.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Thu Aug 3 14:14:13 2017 (r322007) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Thu Aug 3 14:16:31 2017 (r322008) @@ -760,7 +760,7 @@ static void cmd_work_handler(struct work_struct *work) poll_timeout(ent); /* make sure we read the descriptor after ownership is SW */ rmb(); - mlx5_cmd_comp_handler(dev, 1UL << ent->idx); + mlx5_cmd_comp_handler(dev, 1U << ent->idx); } } @@ -1104,7 +1104,7 @@ static void free_msg(struct mlx5_core_dev *dev, struct } } -void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, unsigned long vector) +void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, u32 vector) { struct mlx5_cmd *cmd = &dev->cmd; struct mlx5_cmd_work_ent *ent; @@ -1112,60 +1112,63 @@ void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, void *context; int err; int i; + struct semaphore *sem; s64 ds; struct mlx5_cmd_stats *stats; unsigned long flags; - for (i = 0; i < (1 << cmd->log_sz); i++) { - if (test_bit(i, &vector)) { - struct semaphore *sem; - - ent = cmd->ent_arr[i]; - if (ent->page_queue) - sem = &cmd->pages_sem; + while (vector != 0) { + i = ffs(vector) - 1; + vector &= ~(1U << i); + ent = cmd->ent_arr[i]; + if (ent->page_queue) + sem = &cmd->pages_sem; + else + sem = &cmd->sem; + ent->ts2 = ktime_get_ns(); + memcpy(ent->out->first.data, ent->lay->out, + sizeof(ent->lay->out)); + dump_command(dev, ent, 0); + if (!ent->ret) { + if (!cmd->checksum_disabled) + ent->ret = verify_signature(ent); else - sem = &cmd->sem; - ent->ts2 = ktime_get_ns(); - memcpy(ent->out->first.data, ent->lay->out, sizeof(ent->lay->out)); - dump_command(dev, ent, 0); - if (!ent->ret) { - if (!cmd->checksum_disabled) - ent->ret = verify_signature(ent); - else - ent->ret = 0; - ent->status = ent->lay->status_own >> 1; - mlx5_core_dbg(dev, "command completed. ret 0x%x, delivery status %s(0x%x)\n", - ent->ret, deliv_status_to_str(ent->status), ent->status); + ent->ret = 0; + ent->status = ent->lay->status_own >> 1; + mlx5_core_dbg(dev, + "FW command ret 0x%x, status %s(0x%x)\n", + ent->ret, + deliv_status_to_str(ent->status), + ent->status); + } + free_ent(cmd, ent->idx); + if (ent->callback) { + ds = ent->ts2 - ent->ts1; + if (ent->op < ARRAY_SIZE(cmd->stats)) { + stats = &cmd->stats[ent->op]; + spin_lock_irqsave(&stats->lock, flags); + stats->sum += ds; + ++stats->n; + spin_unlock_irqrestore(&stats->lock, flags); } - free_ent(cmd, ent->idx); - if (ent->callback) { - ds = ent->ts2 - ent->ts1; - if (ent->op < ARRAY_SIZE(cmd->stats)) { - stats = &cmd->stats[ent->op]; - spin_lock_irqsave(&stats->lock, flags); - stats->sum += ds; - ++stats->n; - spin_unlock_irqrestore(&stats->lock, flags); - } - callback = ent->callback; - context = ent->context; - err = ent->ret; - if (!err) - err = mlx5_copy_from_msg(ent->uout, - ent->out, - ent->uout_size); + callback = ent->callback; + context = ent->context; + err = ent->ret; + if (!err) + err = mlx5_copy_from_msg(ent->uout, + ent->out, + ent->uout_size); - mlx5_free_cmd_msg(dev, ent->out); - free_msg(dev, ent->in); + mlx5_free_cmd_msg(dev, ent->out); + free_msg(dev, ent->in); - free_cmd(ent); - callback(err, context); - } else { - complete(&ent->done); - } - up(sem); + free_cmd(ent); + callback(err, context); + } else { + complete(&ent->done); } + up(sem); } } EXPORT_SYMBOL(mlx5_cmd_comp_handler); From owner-svn-src-all@freebsd.org Thu Aug 3 14:17:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D13DDBF849; Thu, 3 Aug 2017 14:17:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 795AE7EA10; Thu, 3 Aug 2017 14:17:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v73EHPX4059187; Thu, 3 Aug 2017 14:17:25 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73EHPmP059185; Thu, 3 Aug 2017 14:17:25 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708031417.v73EHPmP059185@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Aug 2017 14:17:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322009 - in stable/10/sys/dev/mlx5: . mlx5_core X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/10/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 322009 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 14:17:26 -0000 Author: hselasky Date: Thu Aug 3 14:17:25 2017 New Revision: 322009 URL: https://svnweb.freebsd.org/changeset/base/322009 Log: MFC r312876: Use ffs() to scan for first bit instead of using a for() loop. Minor code refactor while at it. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/driver.h stable/10/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/driver.h ============================================================================== --- stable/10/sys/dev/mlx5/driver.h Thu Aug 3 14:16:31 2017 (r322008) +++ stable/10/sys/dev/mlx5/driver.h Thu Aug 3 14:17:25 2017 (r322009) @@ -859,7 +859,7 @@ void mlx5_cq_completion(struct mlx5_core_dev *dev, u32 void mlx5_rsc_event(struct mlx5_core_dev *dev, u32 rsn, int event_type); void mlx5_srq_event(struct mlx5_core_dev *dev, u32 srqn, int event_type); struct mlx5_core_srq *mlx5_core_get_srq(struct mlx5_core_dev *dev, u32 srqn); -void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, unsigned long vector); +void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, u32 vector); void mlx5_cq_event(struct mlx5_core_dev *dev, u32 cqn, int event_type); int mlx5_create_map_eq(struct mlx5_core_dev *dev, struct mlx5_eq *eq, u8 vecidx, int nent, u64 mask, const char *name, struct mlx5_uar *uar); Modified: stable/10/sys/dev/mlx5/mlx5_core/mlx5_cmd.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Thu Aug 3 14:16:31 2017 (r322008) +++ stable/10/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Thu Aug 3 14:17:25 2017 (r322009) @@ -760,7 +760,7 @@ static void cmd_work_handler(struct work_struct *work) poll_timeout(ent); /* make sure we read the descriptor after ownership is SW */ rmb(); - mlx5_cmd_comp_handler(dev, 1UL << ent->idx); + mlx5_cmd_comp_handler(dev, 1U << ent->idx); } } @@ -1104,7 +1104,7 @@ static void free_msg(struct mlx5_core_dev *dev, struct } } -void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, unsigned long vector) +void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, u32 vector) { struct mlx5_cmd *cmd = &dev->cmd; struct mlx5_cmd_work_ent *ent; @@ -1112,60 +1112,63 @@ void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, void *context; int err; int i; + struct semaphore *sem; s64 ds; struct mlx5_cmd_stats *stats; unsigned long flags; - for (i = 0; i < (1 << cmd->log_sz); i++) { - if (test_bit(i, &vector)) { - struct semaphore *sem; - - ent = cmd->ent_arr[i]; - if (ent->page_queue) - sem = &cmd->pages_sem; + while (vector != 0) { + i = ffs(vector) - 1; + vector &= ~(1U << i); + ent = cmd->ent_arr[i]; + if (ent->page_queue) + sem = &cmd->pages_sem; + else + sem = &cmd->sem; + ent->ts2 = ktime_get_ns(); + memcpy(ent->out->first.data, ent->lay->out, + sizeof(ent->lay->out)); + dump_command(dev, ent, 0); + if (!ent->ret) { + if (!cmd->checksum_disabled) + ent->ret = verify_signature(ent); else - sem = &cmd->sem; - ent->ts2 = ktime_get_ns(); - memcpy(ent->out->first.data, ent->lay->out, sizeof(ent->lay->out)); - dump_command(dev, ent, 0); - if (!ent->ret) { - if (!cmd->checksum_disabled) - ent->ret = verify_signature(ent); - else - ent->ret = 0; - ent->status = ent->lay->status_own >> 1; - mlx5_core_dbg(dev, "command completed. ret 0x%x, delivery status %s(0x%x)\n", - ent->ret, deliv_status_to_str(ent->status), ent->status); + ent->ret = 0; + ent->status = ent->lay->status_own >> 1; + mlx5_core_dbg(dev, + "FW command ret 0x%x, status %s(0x%x)\n", + ent->ret, + deliv_status_to_str(ent->status), + ent->status); + } + free_ent(cmd, ent->idx); + if (ent->callback) { + ds = ent->ts2 - ent->ts1; + if (ent->op < ARRAY_SIZE(cmd->stats)) { + stats = &cmd->stats[ent->op]; + spin_lock_irqsave(&stats->lock, flags); + stats->sum += ds; + ++stats->n; + spin_unlock_irqrestore(&stats->lock, flags); } - free_ent(cmd, ent->idx); - if (ent->callback) { - ds = ent->ts2 - ent->ts1; - if (ent->op < ARRAY_SIZE(cmd->stats)) { - stats = &cmd->stats[ent->op]; - spin_lock_irqsave(&stats->lock, flags); - stats->sum += ds; - ++stats->n; - spin_unlock_irqrestore(&stats->lock, flags); - } - callback = ent->callback; - context = ent->context; - err = ent->ret; - if (!err) - err = mlx5_copy_from_msg(ent->uout, - ent->out, - ent->uout_size); + callback = ent->callback; + context = ent->context; + err = ent->ret; + if (!err) + err = mlx5_copy_from_msg(ent->uout, + ent->out, + ent->uout_size); - mlx5_free_cmd_msg(dev, ent->out); - free_msg(dev, ent->in); + mlx5_free_cmd_msg(dev, ent->out); + free_msg(dev, ent->in); - free_cmd(ent); - callback(err, context); - } else { - complete(&ent->done); - } - up(sem); + free_cmd(ent); + callback(err, context); + } else { + complete(&ent->done); } + up(sem); } } EXPORT_SYMBOL(mlx5_cmd_comp_handler); From owner-svn-src-all@freebsd.org Thu Aug 3 14:19:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11C7EDBFA0A; Thu, 3 Aug 2017 14:19:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D1ED97EBDA; Thu, 3 Aug 2017 14:19:27 +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 v73EJRqA059308; Thu, 3 Aug 2017 14:19:27 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73EJR49059307; Thu, 3 Aug 2017 14:19:27 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708031419.v73EJR49059307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Aug 2017 14:19: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: r322010 - stable/11/sys/dev/mlx5 X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/mlx5 X-SVN-Commit-Revision: 322010 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 14:19:28 -0000 Author: hselasky Date: Thu Aug 3 14:19:26 2017 New Revision: 322010 URL: https://svnweb.freebsd.org/changeset/base/322010 Log: MFC r312983: Make "desc" pointer non-constant inside the mlx5_core_diagnostics_entry structure. This fixes compilation with amd64-xtoolchain-gcc. PR: 216588 Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/diagnostics.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/diagnostics.h ============================================================================== --- stable/11/sys/dev/mlx5/diagnostics.h Thu Aug 3 14:17:25 2017 (r322009) +++ stable/11/sys/dev/mlx5/diagnostics.h Thu Aug 3 14:19:26 2017 (r322010) @@ -33,7 +33,7 @@ #define MLX5_CORE_DIAGNOSTICS_ENTRY(n, s, t) { #s, (t) }, struct mlx5_core_diagnostics_entry { - const char *const desc; + const char *desc; u16 counter_id; }; From owner-svn-src-all@freebsd.org Thu Aug 3 14:20:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7FF2DBFB73; Thu, 3 Aug 2017 14:20:20 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 732917ED9B; Thu, 3 Aug 2017 14:20:20 +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 v73EKJRr059439; Thu, 3 Aug 2017 14:20:19 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73EKJIV059438; Thu, 3 Aug 2017 14:20:19 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201708031420.v73EKJIV059438@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Aug 2017 14:20:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322011 - stable/10/sys/dev/mlx5 X-SVN-Group: stable-10 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/10/sys/dev/mlx5 X-SVN-Commit-Revision: 322011 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 14:20:20 -0000 Author: hselasky Date: Thu Aug 3 14:20:19 2017 New Revision: 322011 URL: https://svnweb.freebsd.org/changeset/base/322011 Log: MFC r312983: Make "desc" pointer non-constant inside the mlx5_core_diagnostics_entry structure. This fixes compilation with amd64-xtoolchain-gcc. PR: 216588 Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/diagnostics.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/diagnostics.h ============================================================================== --- stable/10/sys/dev/mlx5/diagnostics.h Thu Aug 3 14:19:26 2017 (r322010) +++ stable/10/sys/dev/mlx5/diagnostics.h Thu Aug 3 14:20:19 2017 (r322011) @@ -33,7 +33,7 @@ #define MLX5_CORE_DIAGNOSTICS_ENTRY(n, s, t) { #s, (t) }, struct mlx5_core_diagnostics_entry { - const char *const desc; + const char *desc; u16 counter_id; }; From owner-svn-src-all@freebsd.org Thu Aug 3 14:22:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64C22DBFF81; Thu, 3 Aug 2017 14:22:49 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 32D847F23E; Thu, 3 Aug 2017 14:22:49 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v73EMmI9063094; Thu, 3 Aug 2017 14:22:48 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73EMmd5063093; Thu, 3 Aug 2017 14:22:48 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201708031422.v73EMmd5063093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 3 Aug 2017 14:22:48 +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: r322012 - in stable: 10/contrib/ipfilter 11/contrib/ipfilter X-SVN-Group: stable-10 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/contrib/ipfilter 11/contrib/ipfilter X-SVN-Commit-Revision: 322012 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 14:22:49 -0000 Author: cy Date: Thu Aug 3 14:22:48 2017 New Revision: 322012 URL: https://svnweb.freebsd.org/changeset/base/322012 Log: MFC r321605: As in r315225, discard 3072 bytes of RC4 bytestream instead of 1024. (This implementation of arc4rand(9) is used by the userland ipftest utility as it approximates ipfilter kernelspace in userspace.) PR: 217920 Submitted by: codarren@hackers.mu Reviewed by: emaste, cem Approved by: so (implicit, in r315225) Differential Revision: D11747 Patterned after: r315225 Modified: stable/10/contrib/ipfilter/arc4random.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/ipfilter/arc4random.c Directory Properties: stable/11/ (props changed) Modified: stable/10/contrib/ipfilter/arc4random.c ============================================================================== --- stable/10/contrib/ipfilter/arc4random.c Thu Aug 3 14:20:19 2017 (r322011) +++ stable/10/contrib/ipfilter/arc4random.c Thu Aug 3 14:22:48 2017 (r322012) @@ -109,9 +109,9 @@ arc4_randomstir (void) /* * Throw away the first N words of output, as suggested in the * paper "Weaknesses in the Key Scheduling Algorithm of RC4" - * by Fluher, Mantin, and Shamir. (N = 256 in our case.) + * by Fluher, Mantin, and Shamir. (N = 768 in our case.) */ - for (n = 0; n < 256*4; n++) + for (n = 0; n < 768*4; n++) arc4_randbyte(); MUTEX_EXIT(&arc4_mtx); } From owner-svn-src-all@freebsd.org Thu Aug 3 14:22:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3403FDBFF7D; Thu, 3 Aug 2017 14:22:49 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F3DC17F23D; Thu, 3 Aug 2017 14:22:48 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v73EMmFN063088; Thu, 3 Aug 2017 14:22:48 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73EMmQ5063087; Thu, 3 Aug 2017 14:22:48 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201708031422.v73EMmQ5063087@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 3 Aug 2017 14:22:48 +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: r322012 - in stable: 10/contrib/ipfilter 11/contrib/ipfilter X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/contrib/ipfilter 11/contrib/ipfilter X-SVN-Commit-Revision: 322012 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 14:22:49 -0000 Author: cy Date: Thu Aug 3 14:22:48 2017 New Revision: 322012 URL: https://svnweb.freebsd.org/changeset/base/322012 Log: MFC r321605: As in r315225, discard 3072 bytes of RC4 bytestream instead of 1024. (This implementation of arc4rand(9) is used by the userland ipftest utility as it approximates ipfilter kernelspace in userspace.) PR: 217920 Submitted by: codarren@hackers.mu Reviewed by: emaste, cem Approved by: so (implicit, in r315225) Differential Revision: D11747 Patterned after: r315225 Modified: stable/11/contrib/ipfilter/arc4random.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/ipfilter/arc4random.c Directory Properties: stable/10/ (props changed) Modified: stable/11/contrib/ipfilter/arc4random.c ============================================================================== --- stable/11/contrib/ipfilter/arc4random.c Thu Aug 3 14:20:19 2017 (r322011) +++ stable/11/contrib/ipfilter/arc4random.c Thu Aug 3 14:22:48 2017 (r322012) @@ -109,9 +109,9 @@ arc4_randomstir (void) /* * Throw away the first N words of output, as suggested in the * paper "Weaknesses in the Key Scheduling Algorithm of RC4" - * by Fluher, Mantin, and Shamir. (N = 256 in our case.) + * by Fluher, Mantin, and Shamir. (N = 768 in our case.) */ - for (n = 0; n < 256*4; n++) + for (n = 0; n < 768*4; n++) arc4_randbyte(); MUTEX_EXIT(&arc4_mtx); } From owner-svn-src-all@freebsd.org Thu Aug 3 14:35:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23349DC07E0; Thu, 3 Aug 2017 14:35:04 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E624A7F979; Thu, 3 Aug 2017 14:35:03 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v73EZ3sj067388; Thu, 3 Aug 2017 14:35:03 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73EZ3v5067387; Thu, 3 Aug 2017 14:35:03 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201708031435.v73EZ3v5067387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Thu, 3 Aug 2017 14:35:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322013 - head/usr.bin/cut X-SVN-Group: head X-SVN-Commit-Author: sevan X-SVN-Commit-Paths: head/usr.bin/cut X-SVN-Commit-Revision: 322013 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 14:35:04 -0000 Author: sevan (doc committer) Date: Thu Aug 3 14:35:02 2017 New Revision: 322013 URL: https://svnweb.freebsd.org/changeset/base/322013 Log: Document -w flag is an extension to POSIX. PR: 201937 Submitted by: Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D11842 Modified: head/usr.bin/cut/cut.1 Modified: head/usr.bin/cut/cut.1 ============================================================================== --- head/usr.bin/cut/cut.1 Thu Aug 3 14:22:48 2017 (r322012) +++ head/usr.bin/cut/cut.1 Thu Aug 3 14:35:02 2017 (r322013) @@ -31,7 +31,7 @@ .\" @(#)cut.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd August 8, 2012 +.Dd August 3, 2017 .Dt CUT 1 .Os .Sh NAME @@ -154,6 +154,10 @@ The .Nm utility conforms to .St -p1003.2-92 . +.Pp +The +.Fl w +flag is an extension to the specification. .Sh HISTORY A .Nm From owner-svn-src-all@freebsd.org Thu Aug 3 14:43:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B458DC0D9F; Thu, 3 Aug 2017 14:43:32 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 38B967FE34; Thu, 3 Aug 2017 14:43:32 +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 v73EhVo9071403; Thu, 3 Aug 2017 14:43:31 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73EhVdf071397; Thu, 3 Aug 2017 14:43:31 GMT (envelope-from np@FreeBSD.org) Message-Id: <201708031443.v73EhVdf071397@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 3 Aug 2017 14:43:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322014 - in head: sys/conf sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/cudbg sys/modules/cxgbe/if_cxgbe usr.sbin/cxgbetool X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head: sys/conf sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/cudbg sys/modules/cxgbe/if_cxgbe usr.sbin/cxgbetool X-SVN-Commit-Revision: 322014 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 14:43:32 -0000 Author: np Date: Thu Aug 3 14:43:30 2017 New Revision: 322014 URL: https://svnweb.freebsd.org/changeset/base/322014 Log: cxgbe(4): Initial import of the "collect" component of Chelsio unified debug (cudbg) code, hooked up to the main driver via an ioctl. The ioctl can be used to collect the chip's internal state in a compressed dump file. These dumps can be decoded with the "view" component of cudbg. Obtained from: Chelsio Communications MFC after: 2 months Sponsored by: Chelsio Communications Added: head/sys/dev/cxgbe/cudbg/ head/sys/dev/cxgbe/cudbg/cudbg.h (contents, props changed) head/sys/dev/cxgbe/cudbg/cudbg_common.c (contents, props changed) head/sys/dev/cxgbe/cudbg/cudbg_entity.h (contents, props changed) head/sys/dev/cxgbe/cudbg/cudbg_flash_utils.c (contents, props changed) head/sys/dev/cxgbe/cudbg/cudbg_lib.c (contents, props changed) head/sys/dev/cxgbe/cudbg/cudbg_lib.h (contents, props changed) head/sys/dev/cxgbe/cudbg/cudbg_lib_common.h (contents, props changed) head/sys/dev/cxgbe/cudbg/cudbg_wtp.c (contents, props changed) head/sys/dev/cxgbe/cudbg/fastlz.c (contents, props changed) head/sys/dev/cxgbe/cudbg/fastlz.h (contents, props changed) head/sys/dev/cxgbe/cudbg/fastlz_api.c (contents, props changed) Modified: head/sys/conf/files head/sys/dev/cxgbe/common/t4_hw.h head/sys/dev/cxgbe/t4_ioctl.h head/sys/dev/cxgbe/t4_main.c head/sys/modules/cxgbe/if_cxgbe/Makefile head/usr.sbin/cxgbetool/cxgbetool.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Aug 3 14:35:02 2017 (r322013) +++ head/sys/conf/files Thu Aug 3 14:43:30 2017 (r322014) @@ -1352,6 +1352,18 @@ dev/cxgbe/common/t4_hw.c optional cxgbe pci \ compile-with "${NORMAL_C} -I$S/dev/cxgbe" dev/cxgbe/common/t4vf_hw.c optional cxgbev pci \ compile-with "${NORMAL_C} -I$S/dev/cxgbe" +dev/cxgbe/cudbg/cudbg_common.c optional cxgbe \ + compile-with "${NORMAL_C} -I$S/dev/cxgbe" +dev/cxgbe/cudbg/cudbg_flash_utils.c optional cxgbe \ + compile-with "${NORMAL_C} -I$S/dev/cxgbe" +dev/cxgbe/cudbg/cudbg_lib.c optional cxgbe \ + compile-with "${NORMAL_C} -I$S/dev/cxgbe" +dev/cxgbe/cudbg/cudbg_wtp.c optional cxgbe \ + compile-with "${NORMAL_C} -I$S/dev/cxgbe" +dev/cxgbe/cudbg/fastlz.c optional cxgbe \ + compile-with "${NORMAL_C} -I$S/dev/cxgbe" +dev/cxgbe/cudbg/fastlz_api.c optional cxgbe \ + compile-with "${NORMAL_C} -I$S/dev/cxgbe" t4fw_cfg.c optional cxgbe \ compile-with "${AWK} -f $S/tools/fw_stub.awk t4fw_cfg.fw:t4fw_cfg t4fw_cfg_uwire.fw:t4fw_cfg_uwire t4fw.fw:t4fw -mt4fw_cfg -c${.TARGET}" \ no-implicit-rule before-depend local \ Modified: head/sys/dev/cxgbe/common/t4_hw.h ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.h Thu Aug 3 14:35:02 2017 (r322013) +++ head/sys/dev/cxgbe/common/t4_hw.h Thu Aug 3 14:43:30 2017 (r322014) @@ -276,8 +276,17 @@ enum { FLASH_MIN_SIZE = FLASH_CFG_START + FLASH_CFG_MAX_SIZE, /* - * Sectors 32-63 are reserved for FLASH failover. + * Sectors 32-63 for CUDBG. */ + FLASH_CUDBG_START_SEC = 32, + FLASH_CUDBG_NSECS = 32, + FLASH_CUDBG_START = FLASH_START(FLASH_CUDBG_START_SEC), + FLASH_CUDBG_MAX_SIZE = FLASH_MAX_SIZE(FLASH_CUDBG_NSECS), + + /* + * Size of defined FLASH regions. + */ + FLASH_END_SEC = 64, }; #undef FLASH_START Added: head/sys/dev/cxgbe/cudbg/cudbg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/cxgbe/cudbg/cudbg.h Thu Aug 3 14:43:30 2017 (r322014) @@ -0,0 +1,474 @@ +/*- + * Copyright (c) 2017 Chelsio Communications, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + */ + +/* + * Chelsio Unified Debug Interface header file. + * Version 1.1 + */ +#ifndef _CUDBG_IF_H_ +#define _CUDBG_IF_H_ + +#ifdef __GNUC__ +#define ATTRIBUTE_UNUSED __attribute__ ((unused)) +#else +#define ATTRIBUTE_UNUSED +#endif + +#if defined(CONFIG_CUDBG_DEBUG) +#define cudbg_debug(pdbg_init, format, ...) do {\ + pdbg_init->print(format, ##__VA_ARGS__); \ +} while (0) +#else +#define cudbg_debug(pdbg_init, format, ...) do { } while (0) +#endif + +#define OUT +#define IN +#define INOUT + +/* Error codes */ + +#define CUDBG_STATUS_SUCCESS 0 +#define CUDBG_STATUS_NOSPACE -2 +#define CUDBG_STATUS_FLASH_WRITE_FAIL -3 +#define CUDBG_STATUS_FLASH_READ_FAIL -4 +#define CUDBG_STATUS_UNDEFINED_OUT_BUF -5 +#define CUDBG_STATUS_UNDEFINED_CBFN -6 +#define CUDBG_STATUS_UNDEFINED_PRINTF_CBFN -7 +#define CUDBG_STATUS_ADAP_INVALID -8 +#define CUDBG_STATUS_FLASH_EMPTY -9 +#define CUDBG_STATUS_NO_ADAPTER -10 +#define CUDBG_STATUS_NO_SIGNATURE -11 +#define CUDBG_STATUS_MULTIPLE_REG -12 +#define CUDBG_STATUS_UNREGISTERED -13 +#define CUDBG_STATUS_UNDEFINED_ENTITY -14 +#define CUDBG_STATUS_REG_FAIlED -15 +#define CUDBG_STATUS_DEVLOG_FAILED -16 +#define CUDBG_STATUS_SMALL_BUFF -17 +#define CUDBG_STATUS_CHKSUM_MISSMATCH -18 +#define CUDBG_STATUS_NO_SCRATCH_MEM -19 +#define CUDBG_STATUS_OUTBUFF_OVERFLOW -20 +#define CUDBG_STATUS_INVALID_BUFF -21 /* Invalid magic */ +#define CUDBG_STATUS_FILE_OPEN_FAIL -22 +#define CUDBG_STATUS_DEVLOG_INT_FAIL -23 +#define CUDBG_STATUS_ENTITY_NOT_FOUND -24 +#define CUDBG_STATUS_DECOMPRESS_FAIL -25 +#define CUDBG_STATUS_BUFFER_SHORT -26 +#define CUDBG_METADATA_VERSION_MISMATCH -27 +#define CUDBG_STATUS_NOT_IMPLEMENTED -28 +#define CUDBG_SYSTEM_ERROR -29 +#define CUDBG_STATUS_MMAP_FAILED -30 +#define CUDBG_STATUS_FILE_WRITE_FAILED -31 +#define CUDBG_STATUS_CCLK_NOT_DEFINED -32 +#define CUDBG_STATUS_FLASH_FULL -33 +#define CUDBG_STATUS_SECTOR_EMPTY -34 +#define CUDBG_STATUS_ENTITY_NOT_REQUESTED -35 +#define CUDBG_STATUS_NOT_SUPPORTED -36 +#define CUDBG_STATUS_FILE_READ_FAILED -37 +#define CUDBG_STATUS_CORRUPTED -38 +#define CUDBG_STATUS_INVALID_INDEX -39 + +#define CUDBG_MAJOR_VERSION 1 +#define CUDBG_MINOR_VERSION 14 +#define CUDBG_BUILD_VERSION 0 + +#define CUDBG_FILE_NAME_LEN 256 +#define CUDBG_DIR_NAME_LEN 256 +#define CUDBG_MAX_BITMAP_LEN 16 + +static char ATTRIBUTE_UNUSED * err_msg[] = { + "Success", + "Unknown", + "No space", + "Flash write fail", + "Flash read fail", + "Undefined out buf", + "Callback function undefined", + "Print callback function undefined", + "ADAP invalid", + "Flash empty", + "No adapter", + "No signature", + "Multiple registration", + "Unregistered", + "Undefined entity", + "Reg failed", + "Devlog failed", + "Small buff", + "Checksum mismatch", + "No scratch memory", + "Outbuff overflow", + "Invalid buffer", + "File open fail", + "Devlog int fail", + "Entity not found", + "Decompress fail", + "Buffer short", + "Version mismatch", + "Not implemented", + "System error", + "Mmap failed", + "File write failed", + "cclk not defined", + "Flash full", + "Sector empty", + "Entity not requested", + "Not supported", + "File read fail", + "Corrupted", + "Invalid Index" +}; + +enum CUDBG_DBG_ENTITY_TYPE { + CUDBG_ALL = 0, + CUDBG_REG_DUMP = 1, + CUDBG_DEV_LOG = 2, + CUDBG_CIM_LA = 3, + CUDBG_CIM_MA_LA = 4, + CUDBG_CIM_QCFG = 5, + CUDBG_CIM_IBQ_TP0 = 6, + CUDBG_CIM_IBQ_TP1 = 7, + CUDBG_CIM_IBQ_ULP = 8, + CUDBG_CIM_IBQ_SGE0 = 9, + CUDBG_CIM_IBQ_SGE1 = 10, + CUDBG_CIM_IBQ_NCSI = 11, + CUDBG_CIM_OBQ_ULP0 = 12, + CUDBG_CIM_OBQ_ULP1 = 13, + CUDBG_CIM_OBQ_ULP2 = 14, + CUDBG_CIM_OBQ_ULP3 = 15, + CUDBG_CIM_OBQ_SGE = 16, + CUDBG_CIM_OBQ_NCSI = 17, + CUDBG_EDC0 = 18, + CUDBG_EDC1 = 19, + CUDBG_MC0 = 20, + CUDBG_MC1 = 21, + CUDBG_RSS = 22, + CUDBG_RSS_PF_CONF = 23, + CUDBG_RSS_KEY = 24, + CUDBG_RSS_VF_CONF = 25, + CUDBG_RSS_CONF = 26, + CUDBG_PATH_MTU = 27, + CUDBG_SW_STATE = 28, + CUDBG_WTP = 29, + CUDBG_PM_STATS = 30, + CUDBG_HW_SCHED = 31, + CUDBG_TCP_STATS = 32, + CUDBG_TP_ERR_STATS = 33, + CUDBG_FCOE_STATS = 34, + CUDBG_RDMA_STATS = 35, + CUDBG_TP_INDIRECT = 36, + CUDBG_SGE_INDIRECT = 37, + CUDBG_CPL_STATS = 38, + CUDBG_DDP_STATS = 39, + CUDBG_WC_STATS = 40, + CUDBG_ULPRX_LA = 41, + CUDBG_LB_STATS = 42, + CUDBG_TP_LA = 43, + CUDBG_MEMINFO = 44, + CUDBG_CIM_PIF_LA = 45, + CUDBG_CLK = 46, + CUDBG_CIM_OBQ_RXQ0 = 47, + CUDBG_CIM_OBQ_RXQ1 = 48, + CUDBG_MAC_STATS = 49, + CUDBG_PCIE_INDIRECT = 50, + CUDBG_PM_INDIRECT = 51, + CUDBG_FULL = 52, + CUDBG_TX_RATE = 53, + CUDBG_TID_INFO = 54, + CUDBG_PCIE_CONFIG = 55, + CUDBG_DUMP_CONTEXT = 56, + CUDBG_MPS_TCAM = 57, + CUDBG_VPD_DATA = 58, + CUDBG_LE_TCAM = 59, + CUDBG_CCTRL = 60, + CUDBG_MA_INDIRECT = 61, + CUDBG_ULPTX_LA = 62, + CUDBG_EXT_ENTITY = 63, + CUDBG_UP_CIM_INDIRECT = 64, + CUDBG_PBT_TABLE = 65, + CUDBG_MBOX_LOG = 66, + CUDBG_HMA_INDIRECT = 67, + CUDBG_MAX_ENTITY = 68, +}; + +#define ENTITY_FLAG_NULL 0 +#define ENTITY_FLAG_REGISTER 1 +#define ENTITY_FLAG_BINARY 2 +#define ENTITY_FLAG_FW_NO_ATTACH 3 + +/* file_name matches Linux cxgb4 debugfs entry names. */ +struct el {char *name; char *file_name; int bit; u32 flag; }; +static struct el ATTRIBUTE_UNUSED entity_list[] = { + {"all", "all", CUDBG_ALL, ENTITY_FLAG_NULL}, + {"regdump", "regdump", CUDBG_REG_DUMP, 1 << ENTITY_FLAG_REGISTER}, + /* {"reg", CUDBG_REG_DUMP},*/ + {"devlog", "devlog", CUDBG_DEV_LOG, ENTITY_FLAG_NULL}, + {"cimla", "cim_la", CUDBG_CIM_LA, ENTITY_FLAG_NULL}, + {"cimmala", "cim_ma_la", CUDBG_CIM_MA_LA, ENTITY_FLAG_NULL}, + {"cimqcfg", "cim_qcfg", CUDBG_CIM_QCFG, ENTITY_FLAG_NULL}, + {"ibqtp0", "ibq_tp0", CUDBG_CIM_IBQ_TP0, ENTITY_FLAG_NULL}, + {"ibqtp1", "ibq_tp1", CUDBG_CIM_IBQ_TP1, ENTITY_FLAG_NULL}, + {"ibqulp", "ibq_ulp", CUDBG_CIM_IBQ_ULP, ENTITY_FLAG_NULL}, + {"ibqsge0", "ibq_sge0", CUDBG_CIM_IBQ_SGE0, ENTITY_FLAG_NULL}, + {"ibqsge1", "ibq_sge1", CUDBG_CIM_IBQ_SGE1, ENTITY_FLAG_NULL}, + {"ibqncsi", "ibq_ncsi", CUDBG_CIM_IBQ_NCSI, ENTITY_FLAG_NULL}, + {"obqulp0", "obq_ulp0", CUDBG_CIM_OBQ_ULP0, ENTITY_FLAG_NULL}, + /* {"cimobqulp1", CUDBG_CIM_OBQ_ULP1},*/ + {"obqulp1", "obq_ulp1", CUDBG_CIM_OBQ_ULP1, ENTITY_FLAG_NULL}, + {"obqulp2", "obq_ulp2", CUDBG_CIM_OBQ_ULP2, ENTITY_FLAG_NULL}, + {"obqulp3", "obq_ulp3", CUDBG_CIM_OBQ_ULP3, ENTITY_FLAG_NULL}, + {"obqsge", "obq_sge", CUDBG_CIM_OBQ_SGE, ENTITY_FLAG_NULL}, + {"obqncsi", "obq_ncsi", CUDBG_CIM_OBQ_NCSI, ENTITY_FLAG_NULL}, + {"edc0", "edc0", CUDBG_EDC0, (1 << ENTITY_FLAG_BINARY)}, + {"edc1", "edc1", CUDBG_EDC1, (1 << ENTITY_FLAG_BINARY)}, + {"mc0", "mc0", CUDBG_MC0, (1 << ENTITY_FLAG_BINARY)}, + {"mc1", "mc1", CUDBG_MC1, (1 << ENTITY_FLAG_BINARY)}, + {"rss", "rss", CUDBG_RSS, ENTITY_FLAG_NULL}, + {"rss_pf_config", "rss_pf_config", CUDBG_RSS_PF_CONF, ENTITY_FLAG_NULL}, + {"rss_key", "rss_key", CUDBG_RSS_KEY, ENTITY_FLAG_NULL}, + {"rss_vf_config", "rss_vf_config", CUDBG_RSS_VF_CONF, ENTITY_FLAG_NULL}, + {"rss_config", "rss_config", CUDBG_RSS_CONF, ENTITY_FLAG_NULL}, + {"pathmtu", "path_mtus", CUDBG_PATH_MTU, ENTITY_FLAG_NULL}, + {"swstate", "sw_state", CUDBG_SW_STATE, ENTITY_FLAG_NULL}, + {"wtp", "wtp", CUDBG_WTP, ENTITY_FLAG_NULL}, + {"pmstats", "pm_stats", CUDBG_PM_STATS, ENTITY_FLAG_NULL}, + {"hwsched", "hw_sched", CUDBG_HW_SCHED, ENTITY_FLAG_NULL}, + {"tcpstats", "tcp_stats", CUDBG_TCP_STATS, ENTITY_FLAG_NULL}, + {"tperrstats", "tp_err_stats", CUDBG_TP_ERR_STATS, ENTITY_FLAG_NULL}, + {"fcoestats", "fcoe_stats", CUDBG_FCOE_STATS, ENTITY_FLAG_NULL}, + {"rdmastats", "rdma_stats", CUDBG_RDMA_STATS, ENTITY_FLAG_NULL}, + {"tpindirect", "tp_indirect", CUDBG_TP_INDIRECT, + 1 << ENTITY_FLAG_REGISTER}, + {"sgeindirect", "sge_indirect", CUDBG_SGE_INDIRECT, + 1 << ENTITY_FLAG_REGISTER}, + {"cplstats", "cpl_stats", CUDBG_CPL_STATS, ENTITY_FLAG_NULL}, + {"ddpstats", "ddp_stats", CUDBG_DDP_STATS, ENTITY_FLAG_NULL}, + {"wcstats", "wc_stats", CUDBG_WC_STATS, ENTITY_FLAG_NULL}, + {"ulprxla", "ulprx_la", CUDBG_ULPRX_LA, ENTITY_FLAG_NULL}, + {"lbstats", "lb_stats", CUDBG_LB_STATS, ENTITY_FLAG_NULL}, + {"tpla", "tp_la", CUDBG_TP_LA, ENTITY_FLAG_NULL}, + {"meminfo", "meminfo", CUDBG_MEMINFO, ENTITY_FLAG_NULL}, + {"cimpifla", "cim_pif_la", CUDBG_CIM_PIF_LA, ENTITY_FLAG_NULL}, + {"clk", "clk", CUDBG_CLK, ENTITY_FLAG_NULL}, + {"obq_sge_rx_q0", "obq_sge_rx_q0", CUDBG_CIM_OBQ_RXQ0, + ENTITY_FLAG_NULL}, + {"obq_sge_rx_q1", "obq_sge_rx_q1", CUDBG_CIM_OBQ_RXQ1, + ENTITY_FLAG_NULL}, + {"macstats", "mac_stats", CUDBG_MAC_STATS, ENTITY_FLAG_NULL}, + {"pcieindirect", "pcie_indirect", CUDBG_PCIE_INDIRECT, + 1 << ENTITY_FLAG_REGISTER}, + {"pmindirect", "pm_indirect", CUDBG_PM_INDIRECT, + 1 << ENTITY_FLAG_REGISTER}, + {"full", "full", CUDBG_FULL, ENTITY_FLAG_NULL}, + {"txrate", "tx_rate", CUDBG_TX_RATE, ENTITY_FLAG_NULL}, + {"tidinfo", "tids", CUDBG_TID_INFO, ENTITY_FLAG_NULL | + (1 << ENTITY_FLAG_FW_NO_ATTACH)}, + {"pcieconfig", "pcie_config", CUDBG_PCIE_CONFIG, ENTITY_FLAG_NULL}, + {"dumpcontext", "dump_context", CUDBG_DUMP_CONTEXT, ENTITY_FLAG_NULL}, + {"mpstcam", "mps_tcam", CUDBG_MPS_TCAM, ENTITY_FLAG_NULL}, + {"vpddata", "vpd_data", CUDBG_VPD_DATA, ENTITY_FLAG_NULL}, + {"letcam", "le_tcam", CUDBG_LE_TCAM, ENTITY_FLAG_NULL}, + {"cctrl", "cctrl", CUDBG_CCTRL, ENTITY_FLAG_NULL}, + {"maindirect", "ma_indirect", CUDBG_MA_INDIRECT, + 1 << ENTITY_FLAG_REGISTER}, + {"ulptxla", "ulptx_la", CUDBG_ULPTX_LA, ENTITY_FLAG_NULL}, + {"extentity", "ext_entity", CUDBG_EXT_ENTITY, ENTITY_FLAG_NULL}, + {"upcimindirect", "up_cim_indirect", CUDBG_UP_CIM_INDIRECT, + 1 << ENTITY_FLAG_REGISTER}, + {"pbttables", "pbt_tables", CUDBG_PBT_TABLE, ENTITY_FLAG_NULL}, + {"mboxlog", "mboxlog", CUDBG_MBOX_LOG, ENTITY_FLAG_NULL}, + {"hmaindirect", "hma_indirect", CUDBG_HMA_INDIRECT, + 1 << ENTITY_FLAG_REGISTER}, +}; + +typedef int (*cudbg_print_cb) (char *str, ...); + +struct cudbg_init_hdr { + u8 major_ver; + u8 minor_ver; + u8 build_ver; + u8 res; + u16 init_struct_size; +}; + +struct cudbg_flash_hdr { + u32 signature; + u8 major_ver; + u8 minor_ver; + u8 build_ver; + u8 res; + u64 timestamp; + u64 time_res; + u32 hdr_len; + u32 data_len; + u32 hdr_flags; + u32 sec_seq_no; + u32 reserved[22]; +}; + +struct cudbg_param { + u16 param_type; + u16 reserved; + union { + struct { + u32 memtype; /* which memory (EDC0, EDC1, MC) */ + u32 start; /* start of log in firmware memory */ + u32 size; /* size of log */ + } devlog_param; + struct { + struct mbox_cmd_log *log; + u16 mbox_cmds; + } mboxlog_param; + struct { + u8 caller_string[100]; + u8 os_type; + } sw_state_param; + u64 time; + u8 tcb_bit_param; + void *adap; + void *access_lock; + } u; +}; + +/* params for tcb_bit_param */ +#define CUDBG_TCB_BRIEF_PARAM 0x1 +#define CUDBG_TCB_FROM_CARD_PARAM 0x2 +#define CUDBG_TCB_AS_SCB_PARAM 0x4 + +/* + * * What is OFFLINE_VIEW_ONLY mode? + * + * cudbg frame work will be used only to interpret previously collected + * data store in a file (i.e NOT hw flash) + */ + +struct cudbg_init { + struct cudbg_init_hdr header; + struct adapter *adap; /* Pointer to adapter structure + with filled fields */ + cudbg_print_cb print; /* Platform dependent print + function */ + u32 verbose:1; /* Turn on verbose print */ + u32 use_flash:1; /* Use flash to collect or view + debug */ + u32 full_mode:1; /* If set, cudbg will pull in + common code */ + u32 no_compress:1; /* Dont compress will storing + the collected debug */ + u32 info:1; /* Show just the info, Dont + interpret */ + u32 reserved:27; + u8 dbg_bitmap[CUDBG_MAX_BITMAP_LEN]; + /* Bit map to select the dbg + data type to be collected + or viewed */ +}; + + +/********************************* Helper functions *************************/ +static inline void set_dbg_bitmap(u8 *bitmap, enum CUDBG_DBG_ENTITY_TYPE type) +{ + int index = type / 8; + int bit = type % 8; + + bitmap[index] |= (1 << bit); +} + +static inline void reset_dbg_bitmap(u8 *bitmap, enum CUDBG_DBG_ENTITY_TYPE type) +{ + int index = type / 8; + int bit = type % 8; + + bitmap[index] &= ~(1 << bit); +} + +/********************************* End of Helper functions + * *************************/ + +/* API Prototypes */ + +/** + * cudbg_alloc_handle - Allocates and initializes a handle that represents + * cudbg state. Needs to called first before calling any other function. + * + * returns a pointer to memory that has a cudbg_init structure at the begining + * and enough space after that for internal book keeping. + */ + +void *cudbg_alloc_handle(void); +static inline struct cudbg_init *cudbg_get_init(void *handle) +{ + return (handle); +} + +/** + * cudbg_collect - Collect and store debug information. + * ## Parameters ## + * @handle : A pointer returned by cudbg_alloc_handle. + * @outbuf : pointer to output buffer, to store the collected information + * or to use it as a scratch buffer in case HW flash is used to + * store the debug information. + * @outbuf_size : Size of output buffer. + * ## Return ## + * If the function succeeds, the return value will be size of debug information + * collected and stored. + * -ve value represent error. + */ +int cudbg_collect(void *handle, void *outbuf, u32 *outbuf_size); + +/** + * cudbg_free_handle - Release cudbg resources. + * ## Parameters ## + * @handle : A pointer returned by cudbg_alloc_handle. + */ + +void cudbg_free_handle(IN void *handle); + +/** + * cudbg_read_flash_data - Read cudbg “flash†header from adapter flash. + * This will be used by the consumer mainly to + * know the size of the data in flash. + * ## Parameters ## + * @handle : A pointer returned by cudbg_hello. + * @data : A pointer to data/header buffer + */ + +int cudbg_read_flash_details(void *handle, struct cudbg_flash_hdr *data); + +/** + * cudbg_read_flash_data - Read cudbg dump contents stored in flash. + * ## Parameters ## + * @handle : A pointer returned by cudbg_hello. + * @data_buf : A pointer to data buffer. + * @data_buf_size : Data buffer size. + */ + +int cudbg_read_flash_data(void *handle, void *data_buf, u32 data_buf_size); + +#endif /* _CUDBG_IF_H_ */ Added: head/sys/dev/cxgbe/cudbg/cudbg_common.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/cxgbe/cudbg/cudbg_common.c Thu Aug 3 14:43:30 2017 (r322014) @@ -0,0 +1,96 @@ +/*- + * Copyright (c) 2017 Chelsio Communications, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include "common/common.h" +#include "cudbg.h" +#include "cudbg_lib_common.h" + +int get_scratch_buff(struct cudbg_buffer *pdbg_buff, u32 size, + struct cudbg_buffer *pscratch_buff) +{ + u32 scratch_offset; + int rc = 0; + + scratch_offset = pdbg_buff->size - size; + + if (pdbg_buff->offset > (int)scratch_offset || pdbg_buff->size < size) { + rc = CUDBG_STATUS_NO_SCRATCH_MEM; + goto err; + } else { + pscratch_buff->data = (char *)pdbg_buff->data + scratch_offset; + pscratch_buff->offset = 0; + pscratch_buff->size = size; + pdbg_buff->size -= size; + } + +err: + return rc; +} + +void release_scratch_buff(struct cudbg_buffer *pscratch_buff, + struct cudbg_buffer *pdbg_buff) +{ + pdbg_buff->size += pscratch_buff->size; + /* Reset the used buffer to zero. + * If we dont do this, then it will effect the ext entity logic. + */ + memset(pscratch_buff->data, 0, pscratch_buff->size); + pscratch_buff->data = NULL; + pscratch_buff->offset = 0; + pscratch_buff->size = 0; +} + +static inline void init_cudbg_hdr(struct cudbg_init_hdr *hdr) +{ + hdr->major_ver = CUDBG_MAJOR_VERSION; + hdr->minor_ver = CUDBG_MINOR_VERSION; + hdr->build_ver = CUDBG_BUILD_VERSION; + hdr->init_struct_size = sizeof(struct cudbg_init); +} + +void * +cudbg_alloc_handle(void) +{ + struct cudbg_private *handle; + + handle = malloc(sizeof(*handle), M_CXGBE, M_ZERO | M_WAITOK); + init_cudbg_hdr(&handle->dbg_init.header); + + return (handle); +} + +void +cudbg_free_handle(void *handle) +{ + + free(handle, M_CXGBE); +} Added: head/sys/dev/cxgbe/cudbg/cudbg_entity.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/cxgbe/cudbg/cudbg_entity.h Thu Aug 3 14:43:30 2017 (r322014) @@ -0,0 +1,909 @@ +/*- + * Copyright (c) 2017 Chelsio Communications, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + */ + +#ifndef __CUDBG_ENTITY_H__ +#define __CUDBG_ENTITY_H__ + +#ifdef __GNUC__ +#define ATTRIBUTE_UNUSED __attribute__ ((unused)) +#else +#define ATTRIBUTE_UNUSED +#endif + +#define MC0_FLAG 1 +#define MC1_FLAG 2 +#define EDC0_FLAG 3 +#define EDC1_FLAG 4 + +#define NUM_PCIE_CONFIG_REGS 0x61 +#define CUDBG_CTXT_SIZE_BYTES 24 +#define CUDBG_MAX_INGRESS_QIDS 65536 +#define CUDBG_MAX_FL_QIDS 2048 +#define CUDBG_MAX_CNM_QIDS 1024 +#define CUDBG_LOWMEM_MAX_CTXT_QIDS 256 +#define ETH_ALEN 6 +#define CUDBG_MAX_RPLC_SIZE 128 +#define CUDBG_NUM_REQ_REGS 17 +#define CUDBG_MAX_TCAM_TID 0x800 +#define CUDBG_NUM_ULPTX 11 +#define CUDBG_NUM_ULPTX_READ 512 + +#define SN_REG_ADDR 0x183f +#define BN_REG_ADDR 0x1819 +#define NA_REG_ADDR 0x185a +#define MN_REG_ADDR 0x1803 + +#define A_MPS_VF_RPLCT_MAP0 0x1111c +#define A_MPS_VF_RPLCT_MAP1 0x11120 +#define A_MPS_VF_RPLCT_MAP2 0x11124 +#define A_MPS_VF_RPLCT_MAP3 0x11128 +#define A_MPS_VF_RPLCT_MAP4 0x11300 +#define A_MPS_VF_RPLCT_MAP5 0x11304 +#define A_MPS_VF_RPLCT_MAP6 0x11308 +#define A_MPS_VF_RPLCT_MAP7 0x1130c + +#define PORT_TYPE_ADDR 0x1869 +#define PORT_TYPE_LEN 8 + +/* For T6 */ +#define SN_T6_ADDR 0x83f +#define BN_T6_ADDR 0x819 +#define NA_T6_ADDR 0x85a +#define MN_T6_ADDR 0x803 + +#define SN_MAX_LEN 24 +#define BN_MAX_LEN 16 +#define NA_MAX_LEN 12 +#define MN_MAX_LEN 16 +#define MAX_VPD_DATA_LEN 32 + +#define VPD_VER_ADDR 0x18c7 +#define VPD_VER_LEN 2 +#define SCFG_VER_ADDR 0x06 +#define SCFG_VER_LEN 4 + +#define CUDBG_CIM_BUSY_BIT (1 << 17) + +#define CUDBG_CHAC_PBT_ADDR 0x2800 +#define CUDBG_CHAC_PBT_LRF 0x3000 +#define CUDBG_CHAC_PBT_DATA 0x3800 +#define CUDBG_PBT_DYNAMIC_ENTRIES 8 +#define CUDBG_PBT_STATIC_ENTRIES 16 +#define CUDBG_LRF_ENTRIES 8 +#define CUDBG_PBT_DATA_ENTRIES 512 + +#define CUDBG_ENTITY_SIGNATURE 0xCCEDB001 +#define CUDBG_TID_INFO_REV 1 +#define CUDBG_MAC_STATS_REV 1 + +#ifndef ARRAY_SIZE +#define ARRAY_SIZE(_a) (sizeof((_a)) / sizeof((_a)[0])) +#endif + +struct cudbg_pbt_tables { + u32 pbt_dynamic[CUDBG_PBT_DYNAMIC_ENTRIES]; + u32 pbt_static[CUDBG_PBT_STATIC_ENTRIES]; + u32 lrf_table[CUDBG_LRF_ENTRIES]; + u32 pbt_data[CUDBG_PBT_DATA_ENTRIES]; +}; + +struct card_mem { + u16 size_mc0; + u16 size_mc1; + u16 size_edc0; + u16 size_edc1; + u16 mem_flag; + u16 res; +}; + +struct rss_pf_conf { + u32 rss_pf_map; + u32 rss_pf_mask; + u32 rss_pf_config; +}; + +struct cudbg_ch_cntxt { + uint32_t cntxt_type; + uint32_t cntxt_id; + uint32_t data[SGE_CTXT_SIZE / 4]; +}; + +struct cudbg_tcam { + u32 filter_start; + u32 server_start; + u32 clip_start; + u32 routing_start; + u32 tid_hash_base; + u32 max_tid; +}; + +#if 0 +struct cudbg_mbox_log { + struct mbox_cmd entry; + u32 hi[MBOX_LEN / 8]; + u32 lo[MBOX_LEN / 8]; +}; +#endif + +struct cudbg_tid_data { + u32 tid; + u32 dbig_cmd; + u32 dbig_conf; + u32 dbig_rsp_stat; + u32 data[CUDBG_NUM_REQ_REGS]; +}; + +struct cudbg_cntxt_field { + char *name; + u32 start_bit; + u32 end_bit; + u32 shift; + u32 islog2; +}; + +struct cudbg_mps_tcam { + u64 mask; + u32 rplc[8]; + u32 idx; + u32 cls_lo; + u32 cls_hi; + u32 rplc_size; + u32 vniy; + u32 vnix; + u32 dip_hit; + u32 vlan_vld; + u32 repli; + u16 ivlan; + u8 addr[ETH_ALEN]; + u8 lookup_type; + u8 port_num; + u8 reserved[2]; +}; + +struct rss_vf_conf { + u32 rss_vf_vfl; + u32 rss_vf_vfh; +}; + +struct rss_config { + u32 tp_rssconf; /* A_TP_RSS_CONFIG */ + u32 tp_rssconf_tnl; /* A_TP_RSS_CONFIG_TNL */ + u32 tp_rssconf_ofd; /* A_TP_RSS_CONFIG_OFD */ + u32 tp_rssconf_syn; /* A_TP_RSS_CONFIG_SYN */ + u32 tp_rssconf_vrt; /* A_TP_RSS_CONFIG_VRT */ + u32 tp_rssconf_cng; /* A_TP_RSS_CONFIG_CNG */ + u32 chip; +}; + +struct struct_pm_stats { + u32 tx_cnt[T6_PM_NSTATS]; + u32 rx_cnt[T6_PM_NSTATS]; + u64 tx_cyc[T6_PM_NSTATS]; + u64 rx_cyc[T6_PM_NSTATS]; +}; + +struct struct_hw_sched { + u32 kbps[NTX_SCHED]; + u32 ipg[NTX_SCHED]; + u32 pace_tab[NTX_SCHED]; + u32 mode; + u32 map; +}; + +struct struct_tcp_stats { + struct tp_tcp_stats v4, v6; +}; + +struct struct_tp_err_stats { + struct tp_err_stats stats; + u32 nchan; +}; + +struct struct_tp_fcoe_stats { + struct tp_fcoe_stats stats[4]; + u32 nchan; +}; + +struct struct_mac_stats { + u32 port_count; + struct port_stats stats[4]; +}; + +struct struct_mac_stats_rev1 { + struct cudbg_ver_hdr ver_hdr; + u32 port_count; + u32 reserved; + struct port_stats stats[4]; +}; + +struct struct_tp_cpl_stats { + struct tp_cpl_stats stats; + u32 nchan; +}; + +struct struct_wc_stats { + u32 wr_cl_success; + u32 wr_cl_fail; +}; + +struct struct_ulptx_la { + u32 rdptr[CUDBG_NUM_ULPTX]; + u32 wrptr[CUDBG_NUM_ULPTX]; + u32 rddata[CUDBG_NUM_ULPTX]; + u32 rd_data[CUDBG_NUM_ULPTX][CUDBG_NUM_ULPTX_READ]; +}; + +struct struct_ulprx_la { + u32 data[ULPRX_LA_SIZE * 8]; + u32 size; +}; + +struct struct_cim_qcfg { + u8 chip; + u16 base[CIM_NUM_IBQ + CIM_NUM_OBQ_T5]; + u16 size[CIM_NUM_IBQ + CIM_NUM_OBQ_T5]; + u16 thres[CIM_NUM_IBQ]; + u32 obq_wr[2 * CIM_NUM_OBQ_T5]; + u32 stat[4 * (CIM_NUM_IBQ + CIM_NUM_OBQ_T5)]; +}; + +enum region_index { + REGN_DBQ_CONTEXS_IDX, + REGN_IMSG_CONTEXTS_IDX, + REGN_FLM_CACHE_IDX, + REGN_TCBS_IDX, + REGN_PSTRUCT_IDX, + REGN_TIMERS_IDX, + REGN_RX_FL_IDX, + REGN_TX_FL_IDX, + REGN_PSTRUCT_FL_IDX, + REGN_TX_PAYLOAD_IDX, + REGN_RX_PAYLOAD_IDX, + REGN_LE_HASH_IDX, + REGN_ISCSI_IDX, + REGN_TDDP_IDX, + REGN_TPT_IDX, + REGN_STAG_IDX, + REGN_RQ_IDX, + REGN_RQUDP_IDX, + REGN_PBL_IDX, + REGN_TXPBL_IDX, + REGN_DBVFIFO_IDX, + REGN_ULPRX_STATE_IDX, + REGN_ULPTX_STATE_IDX, +#ifndef __NO_DRIVER_OCQ_SUPPORT__ + REGN_ON_CHIP_Q_IDX, +#endif +}; + +static const char * const region[] = { + "DBQ contexts:", "IMSG contexts:", "FLM cache:", "TCBs:", + "Pstructs:", "Timers:", "Rx FL:", "Tx FL:", "Pstruct FL:", + "Tx payload:", "Rx payload:", "LE hash:", "iSCSI region:", + "TDDP region:", "TPT region:", "STAG region:", "RQ region:", + "RQUDP region:", "PBL region:", "TXPBL region:", + "DBVFIFO region:", "ULPRX state:", "ULPTX state:", +#ifndef __NO_DRIVER_OCQ_SUPPORT__ + "On-chip queues:" +#endif +}; + +/* Info relative to memory region (i.e. wrt 0). */ +struct struct_region_info { + bool exist; /* Does region exists in current memory region? */ + u32 start; /* Start wrt 0 */ + u32 end; /* End wrt 0 */ +}; + +struct struct_port_usage { + u32 id; + u32 used; + u32 alloc; +}; + +struct struct_lpbk_usage { + u32 id; + u32 used; + u32 alloc; +}; + +struct struct_mem_desc { + u32 base; + u32 limit; + u32 idx; +}; + +enum string_size_units { + STRING_UNITS_10, /* use powers of 10^3 (standard SI) */ + STRING_UNITS_2, /* use binary powers of 2^10 */ +}; + +struct struct_meminfo { + struct struct_mem_desc avail[4]; + struct struct_mem_desc mem[ARRAY_SIZE(region) + 3]; + u32 avail_c; + u32 mem_c; + u32 up_ram_lo; + u32 up_ram_hi; + u32 up_extmem2_lo; + u32 up_extmem2_hi; + u32 rx_pages_data[3]; + u32 tx_pages_data[4]; + u32 p_structs; + struct struct_port_usage port_data[4]; + u32 port_used[4]; + u32 port_alloc[4]; + u32 loopback_used[NCHAN]; + u32 loopback_alloc[NCHAN]; +}; + +#ifndef __GNUC__ +#pragma warning(disable : 4200) +#endif + +struct struct_lb_stats { + int nchan; + struct lb_port_stats s[0]; +}; + +struct struct_clk_info { + u64 retransmit_min; + u64 retransmit_max; + u64 persist_timer_min; + u64 persist_timer_max; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Aug 3 14:43:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A8F9DC0DF3; Thu, 3 Aug 2017 14:43:43 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51FAB7FECD; Thu, 3 Aug 2017 14:43:43 +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 v73EhgpU071462; Thu, 3 Aug 2017 14:43:42 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73Ehfd5071454; Thu, 3 Aug 2017 14:43:41 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201708031443.v73Ehfd5071454@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 3 Aug 2017 14:43:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322015 - in head/sys/arm: conf freescale/imx X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys/arm: conf freescale/imx X-SVN-Commit-Revision: 322015 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 14:43:43 -0000 Author: ian Date: Thu Aug 3 14:43:41 2017 New Revision: 322015 URL: https://svnweb.freebsd.org/changeset/base/322015 Log: Add an ahci driver for imx6. This was submitted by Rogiel Sulzbach (thank you!) but has a few last-minute changes by me, mostly where the code interfaces to my still-utterly-deficient imx6_ccm clocks implementation. So blame me for any mistakes. Submitted by: Rogiel Sulzbach Differential Revision: https://reviews.freebsd.org/D11177 Added: head/sys/arm/freescale/imx/imx6_ahci.c (contents, props changed) Modified: head/sys/arm/conf/IMX6 head/sys/arm/freescale/imx/files.imx6 head/sys/arm/freescale/imx/imx6_ccm.c head/sys/arm/freescale/imx/imx6_ccmreg.h head/sys/arm/freescale/imx/imx_ccmvar.h head/sys/arm/freescale/imx/imx_iomuxreg.h Modified: head/sys/arm/conf/IMX6 ============================================================================== --- head/sys/arm/conf/IMX6 Thu Aug 3 14:43:30 2017 (r322014) +++ head/sys/arm/conf/IMX6 Thu Aug 3 14:43:41 2017 (r322015) @@ -78,6 +78,9 @@ device da # Direct Access (disks) device cd # CD device pass # Passthrough device (direct ATA/SCSI access) +# ATA controllers +device ahci # AHCI-compatible SATA controllers + # USB support device ehci # OHCI USB interface device usb # USB Bus (required) Modified: head/sys/arm/freescale/imx/files.imx6 ============================================================================== --- head/sys/arm/freescale/imx/files.imx6 Thu Aug 3 14:43:30 2017 (r322014) +++ head/sys/arm/freescale/imx/files.imx6 Thu Aug 3 14:43:41 2017 (r322015) @@ -25,6 +25,7 @@ arm/freescale/imx/imx_i2c.c optional fsliic arm/freescale/imx/imx6_sdma.c optional sdma arm/freescale/imx/imx6_audmux.c optional sound arm/freescale/imx/imx6_ssi.c optional sound +arm/freescale/imx/imx6_ahci.c optional ahci dev/hdmi/hdmi_if.m optional hdmi dev/hdmi/dwc_hdmi.c optional hdmi Added: head/sys/arm/freescale/imx/imx6_ahci.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/imx/imx6_ahci.c Thu Aug 3 14:43:41 2017 (r322015) @@ -0,0 +1,358 @@ +/*- + * Copyright (c) 2017 Rogiel Sulzbach + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include + +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + +#define SATA_TIMER1MS 0x000000e0 + +#define SATA_P0PHYCR 0x00000178 +#define SATA_P0PHYCR_CR_READ (1 << 19) +#define SATA_P0PHYCR_CR_WRITE (1 << 18) +#define SATA_P0PHYCR_CR_CAP_DATA (1 << 17) +#define SATA_P0PHYCR_CR_CAP_ADDR (1 << 16) +#define SATA_P0PHYCR_CR_DATA_IN(v) ((v) & 0xffff) + +#define SATA_P0PHYSR 0x0000017c +#define SATA_P0PHYSR_CR_ACK (1 << 18) +#define SATA_P0PHYSR_CR_DATA_OUT(v) ((v) & 0xffff) + +/* phy registers */ +#define SATA_PHY_CLOCK_RESET 0x7f3f +#define SATA_PHY_CLOCK_RESET_RST (1 << 0) + +#define SATA_PHY_LANE0_OUT_STAT 0x2003 +#define SATA_PHY_LANE0_OUT_STAT_RX_PLL_STATE (1 << 1) + +static int +imx6_ahci_phy_ctrl(struct ahci_controller* sc, uint32_t bitmask, bool on) +{ + uint32_t v; + int timeout; + bool state; + + v = ATA_INL(sc->r_mem, SATA_P0PHYCR); + if (on) { + v |= bitmask; + } else { + v &= ~bitmask; + } + ATA_OUTL(sc->r_mem, SATA_P0PHYCR, v); + + for (timeout = 5000; timeout > 0; --timeout) { + v = ATA_INL(sc->r_mem, SATA_P0PHYSR); + state = (v & SATA_P0PHYSR_CR_ACK) == SATA_P0PHYSR_CR_ACK; + if(state == on) { + break; + } + DELAY(100); + } + + if (timeout > 0) { + return (0); + } + + return (ETIMEDOUT); +} + +static int +imx6_ahci_phy_addr(struct ahci_controller* sc, uint32_t addr) +{ + int error; + + DELAY(100); + + ATA_OUTL(sc->r_mem, SATA_P0PHYCR, addr); + + error = imx6_ahci_phy_ctrl(sc, SATA_P0PHYCR_CR_CAP_ADDR, true); + if (error != 0) { + device_printf(sc->dev, + "%s: timeout on SATA_P0PHYCR_CR_CAP_ADDR=1\n", + __FUNCTION__); + return (error); + } + + error = imx6_ahci_phy_ctrl(sc, SATA_P0PHYCR_CR_CAP_ADDR, false); + if (error != 0) { + device_printf(sc->dev, + "%s: timeout on SATA_P0PHYCR_CR_CAP_ADDR=0\n", + __FUNCTION__); + return (error); + } + + return (0); +} + +static int +imx6_ahci_phy_write(struct ahci_controller* sc, uint32_t addr, + uint16_t data) +{ + int error; + + error = imx6_ahci_phy_addr(sc, addr); + if (error != 0) { + device_printf(sc->dev, "%s: error on imx6_ahci_phy_addr\n", + __FUNCTION__); + return (error); + } + + ATA_OUTL(sc->r_mem, SATA_P0PHYCR, data); + + error = imx6_ahci_phy_ctrl(sc, SATA_P0PHYCR_CR_CAP_DATA, true); + if (error != 0) { + device_printf(sc->dev, + "%s: error on SATA_P0PHYCR_CR_CAP_DATA=1\n", __FUNCTION__); + return (error); + } + if (imx6_ahci_phy_ctrl(sc, SATA_P0PHYCR_CR_CAP_DATA, false) != 0) { + device_printf(sc->dev, + "%s: error on SATA_P0PHYCR_CR_CAP_DATA=0\n", __FUNCTION__); + return (error); + } + + if ((addr == SATA_PHY_CLOCK_RESET) && data) { + /* we can't check ACK after RESET */ + ATA_OUTL(sc->r_mem, SATA_P0PHYCR, + SATA_P0PHYCR_CR_DATA_IN(data) | SATA_P0PHYCR_CR_WRITE); + return (0); + } + + error = imx6_ahci_phy_ctrl(sc, SATA_P0PHYCR_CR_WRITE, true); + if (error != 0) { + device_printf(sc->dev, "%s: error on SATA_P0PHYCR_CR_WRITE=1\n", + __FUNCTION__); + return (error); + } + + error = imx6_ahci_phy_ctrl(sc, SATA_P0PHYCR_CR_WRITE, false); + if (error != 0) { + device_printf(sc->dev, "%s: error on SATA_P0PHYCR_CR_WRITE=0\n", + __FUNCTION__); + return (error); + } + + return (0); +} + +static int +imx6_ahci_phy_read(struct ahci_controller* sc, uint32_t addr, uint16_t* val) +{ + int error; + uint32_t v; + + error = imx6_ahci_phy_addr(sc, addr); + if (error != 0) { + device_printf(sc->dev, "%s: error on imx6_ahci_phy_addr\n", + __FUNCTION__); + return (error); + } + + error = imx6_ahci_phy_ctrl(sc, SATA_P0PHYCR_CR_READ, true); + if (error != 0) { + device_printf(sc->dev, "%s: error on SATA_P0PHYCR_CR_READ=1\n", + __FUNCTION__); + return (error); + } + + v = ATA_INL(sc->r_mem, SATA_P0PHYSR); + + error = imx6_ahci_phy_ctrl(sc, SATA_P0PHYCR_CR_READ, false); + if (error != 0) { + device_printf(sc->dev, "%s: error on SATA_P0PHYCR_CR_READ=0\n", + __FUNCTION__); + return (error); + } + + *val = SATA_P0PHYSR_CR_DATA_OUT(v); + return (0); +} + +static int +imx6_ahci_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) { + return (ENXIO); + } + + if (!ofw_bus_is_compatible(dev, "fsl,imx6q-ahci")) { + return (ENXIO); + } + device_set_desc(dev, "i.MX6 Integrated AHCI controller"); + + return (BUS_PROBE_DEFAULT); +} + +static int +imx6_ahci_attach(device_t dev) +{ + struct ahci_controller* ctlr; + uint16_t pllstat; + uint32_t v; + int error, timeout; + + ctlr = device_get_softc(dev); + + /* Power up the controller and phy. */ + error = imx6_ccm_sata_enable(); + if (error != 0) { + device_printf(dev, "error enabling controller and phy\n"); + return (error); + } + + ctlr->vendorid = 0; + ctlr->deviceid = 0; + ctlr->subvendorid = 0; + ctlr->subdeviceid = 0; + ctlr->numirqs = 1; + ctlr->r_rid = 0; + if ((ctlr->r_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &ctlr->r_rid, RF_ACTIVE)) == NULL) { + return (ENXIO); + } + + v = imx_iomux_gpr_get(IOMUX_GPR13); + /* Clear out existing values; these numbers are bitmasks. */ + v &= ~(IOMUX_GPR13_SATA_PHY_8(7) | + IOMUX_GPR13_SATA_PHY_7(0x1f) | + IOMUX_GPR13_SATA_PHY_6(7) | + IOMUX_GPR13_SATA_SPEED(1) | + IOMUX_GPR13_SATA_PHY_5(1) | + IOMUX_GPR13_SATA_PHY_4(7) | + IOMUX_GPR13_SATA_PHY_3(0xf) | + IOMUX_GPR13_SATA_PHY_2(0x1f) | + IOMUX_GPR13_SATA_PHY_1(1) | + IOMUX_GPR13_SATA_PHY_0(1)); + /* setting */ + v |= IOMUX_GPR13_SATA_PHY_8(5) | /* Rx 3.0db */ + IOMUX_GPR13_SATA_PHY_7(0x12) | /* Rx SATA2m */ + IOMUX_GPR13_SATA_PHY_6(3) | /* Rx DPLL mode */ + IOMUX_GPR13_SATA_SPEED(1) | /* 3.0GHz */ + IOMUX_GPR13_SATA_PHY_5(0) | /* SpreadSpectram */ + IOMUX_GPR13_SATA_PHY_4(4) | /* Tx Attenuation 9/16 */ + IOMUX_GPR13_SATA_PHY_3(0) | /* Tx Boost 0db */ + IOMUX_GPR13_SATA_PHY_2(0x11) | /* Tx Level 1.104V */ + IOMUX_GPR13_SATA_PHY_1(1); /* PLL clock enable */ + imx_iomux_gpr_set(IOMUX_GPR13, v); + + /* phy reset */ + error = imx6_ahci_phy_write(ctlr, SATA_PHY_CLOCK_RESET, + SATA_PHY_CLOCK_RESET_RST); + if (error != 0) { + device_printf(dev, "cannot reset PHY\n"); + goto fail; + } + + for (timeout = 50; timeout > 0; --timeout) { + DELAY(100); + error = imx6_ahci_phy_read(ctlr, SATA_PHY_LANE0_OUT_STAT, + &pllstat); + if (error != 0) { + device_printf(dev, "cannot read LANE0 status\n"); + goto fail; + } + if (pllstat & SATA_PHY_LANE0_OUT_STAT_RX_PLL_STATE) { + break; + } + } + if (timeout <= 0) { + device_printf(dev, "time out reading LANE0 status\n"); + error = ETIMEDOUT; + goto fail; + } + + /* Support Staggered Spin-up */ + v = ATA_INL(ctlr->r_mem, AHCI_CAP); + ATA_OUTL(ctlr->r_mem, AHCI_CAP, v | AHCI_CAP_SSS); + + /* Ports Implemented. must set 1 */ + v = ATA_INL(ctlr->r_mem, AHCI_PI); + ATA_OUTL(ctlr->r_mem, AHCI_PI, v | (1 << 0)); + + /* set 1ms-timer = AHB clock / 1000 */ + ATA_OUTL(ctlr->r_mem, SATA_TIMER1MS, + imx_ccm_ahb_hz() / 1000); + + /* + * Note: ahci_attach will release ctlr->r_mem on errors automatically + */ + return (ahci_attach(dev)); + +fail: + bus_release_resource(dev, SYS_RES_MEMORY, ctlr->r_rid, ctlr->r_mem); + return (error); +} + +static int +imx6_ahci_detach(device_t dev) +{ + + return (ahci_detach(dev)); +} + +devclass_t ahci_devclass; + +static device_method_t imx6_ahci_ata_methods[] = { + /* device probe, attach and detach methods */ + DEVMETHOD(device_probe, imx6_ahci_probe), + DEVMETHOD(device_attach, imx6_ahci_attach), + DEVMETHOD(device_detach, imx6_ahci_detach), + + /* ahci bus methods */ + DEVMETHOD(bus_print_child, ahci_print_child), + DEVMETHOD(bus_alloc_resource, ahci_alloc_resource), + DEVMETHOD(bus_release_resource, ahci_release_resource), + DEVMETHOD(bus_setup_intr, ahci_setup_intr), + DEVMETHOD(bus_teardown_intr, ahci_teardown_intr), + DEVMETHOD(bus_child_location_str, ahci_child_location_str), + + DEVMETHOD_END +}; + +static driver_t ahci_ata_driver = { + "ahci", + imx6_ahci_ata_methods, + sizeof(struct ahci_controller) +}; + +DRIVER_MODULE(ahci, simplebus, ahci_ata_driver, ahci_devclass, 0, 0); Modified: head/sys/arm/freescale/imx/imx6_ccm.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_ccm.c Thu Aug 3 14:43:30 2017 (r322014) +++ head/sys/arm/freescale/imx/imx6_ccm.c Thu Aug 3 14:43:41 2017 (r322015) @@ -314,6 +314,41 @@ imx_ccm_usbphy_enable(device_t _phydev) #endif } +int +imx6_ccm_sata_enable(void) +{ + uint32_t v; + int timeout; + + /* Un-gate the sata controller. */ + WR4(ccm_sc, CCM_CCGR5, RD4(ccm_sc, CCM_CCGR5) | CCGR5_SATA); + + /* Power up the PLL that feeds ENET/SATA/PCI phys, wait for lock. */ + v = RD4(ccm_sc, CCM_ANALOG_PLL_ENET); + v &= ~CCM_ANALOG_PLL_ENET_POWERDOWN; + WR4(ccm_sc, CCM_ANALOG_PLL_ENET, v); + + for (timeout = 100000; timeout > 0; timeout--) { + if (RD4(ccm_sc, CCM_ANALOG_PLL_ENET) & + CCM_ANALOG_PLL_ENET_LOCK) { + break; + } + } + if (timeout <= 0) { + return ETIMEDOUT; + } + + /* Enable the PLL, and enable its 100mhz output. */ + v |= CCM_ANALOG_PLL_ENET_ENABLE; + v &= ~CCM_ANALOG_PLL_ENET_BYPASS; + WR4(ccm_sc, CCM_ANALOG_PLL_ENET, v); + + v |= CCM_ANALOG_PLL_ENET_ENABLE_100M; + WR4(ccm_sc, CCM_ANALOG_PLL_ENET, v); + + return 0; +} + uint32_t imx_ccm_ipg_hz(void) { Modified: head/sys/arm/freescale/imx/imx6_ccmreg.h ============================================================================== --- head/sys/arm/freescale/imx/imx6_ccmreg.h Thu Aug 3 14:43:30 2017 (r322014) +++ head/sys/arm/freescale/imx/imx6_ccmreg.h Thu Aug 3 14:43:41 2017 (r322015) @@ -116,6 +116,7 @@ #define CCGR4_PL301_MX6QPER1_BCH (0x3 << 12) #define CCGR4_PL301_MX6QPER2_MAIN (0x3 << 14) #define CCM_CCGR5 0x07C +#define CCGR5_SATA (0x3 << 4) #define CCGR5_SDMA (0x3 << 6) #define CCGR5_SSI1 (0x3 << 18) #define CCGR5_SSI2 (0x3 << 20) @@ -129,5 +130,12 @@ #define CCGR6_USDHC3 (0x3 << 6) #define CCGR6_USDHC4 (0x3 << 8) #define CCM_CMEOR 0x088 + +#define CCM_ANALOG_PLL_ENET 0x000040e0 +#define CCM_ANALOG_PLL_ENET_LOCK (1u << 31) +#define CCM_ANALOG_PLL_ENET_ENABLE_100M (1u << 20) /* SATA */ +#define CCM_ANALOG_PLL_ENET_BYPASS (1u << 16) +#define CCM_ANALOG_PLL_ENET_ENABLE (1u << 13) /* Ether */ +#define CCM_ANALOG_PLL_ENET_POWERDOWN (1u << 12) #endif Modified: head/sys/arm/freescale/imx/imx_ccmvar.h ============================================================================== --- head/sys/arm/freescale/imx/imx_ccmvar.h Thu Aug 3 14:43:30 2017 (r322014) +++ head/sys/arm/freescale/imx/imx_ccmvar.h Thu Aug 3 14:43:41 2017 (r322015) @@ -54,6 +54,7 @@ void imx_ccm_usbphy_enable(device_t _phydev); void imx_ccm_ssi_configure(device_t _ssidev); void imx_ccm_hdmi_enable(void); void imx_ccm_ipu_enable(int ipu); +int imx6_ccm_sata_enable(void); /* Routines to get and set the arm clock root divisor register. */ uint32_t imx_ccm_get_cacrr(void); Modified: head/sys/arm/freescale/imx/imx_iomuxreg.h ============================================================================== --- head/sys/arm/freescale/imx/imx_iomuxreg.h Thu Aug 3 14:43:30 2017 (r322014) +++ head/sys/arm/freescale/imx/imx_iomuxreg.h Thu Aug 3 14:43:41 2017 (r322015) @@ -29,14 +29,33 @@ #ifndef IMX_IOMUXREG_H #define IMX_IOMUXREG_H -#define IOMUXC_GPR0 0x00 -#define IOMUXC_GPR1 0x04 -#define IOMUXC_GPR2 0x08 -#define IOMUXC_GPR3 0x0C -#define IOMUXC_GPR3_HDMI_MASK (3 << 2) -#define IOMUXC_GPR3_HDMI_IPU1_DI0 (0 << 2) -#define IOMUXC_GPR3_HDMI_IPU1_DI1 (1 << 2) -#define IOMUXC_GPR3_HDMI_IPU2_DI0 (2 << 2) -#define IOMUXC_GPR3_HDMI_IPU2_DI1 (3 << 2) +#define IMX_IOMUXREG_LOWEST_SET_BIT(__mask) ((((__mask) - 1) & (__mask)) ^ (__mask)) +#define IMX_IOMUXREG_SHIFTIN(__x, __mask) ((__x) * IMX_IOMUXREG_LOWEST_SET_BIT(__mask)) + +#define IMX_IOMUXREG_BIT(n) (1 << (n)) +#define IMX_IOMUXREG_BITS(__m, __n) \ + ((IMX_IOMUXREG_BIT(MAX((__m), (__n)) + 1) - 1) ^ (IMX_IOMUXREG_BIT(MIN((__m), (__n))) - 1)) + +#define IOMUXC_GPR0 0x00 +#define IOMUXC_GPR1 0x04 +#define IOMUXC_GPR2 0x08 +#define IOMUXC_GPR3 0x0C +#define IOMUXC_GPR3_HDMI_MASK (3 << 2) +#define IOMUXC_GPR3_HDMI_IPU1_DI0 (0 << 2) +#define IOMUXC_GPR3_HDMI_IPU1_DI1 (1 << 2) +#define IOMUXC_GPR3_HDMI_IPU2_DI0 (2 << 2) +#define IOMUXC_GPR3_HDMI_IPU2_DI1 (3 << 2) + +#define IOMUX_GPR13 0x34 +#define IOMUX_GPR13_SATA_PHY_8(n) IMX_IOMUXREG_SHIFTIN(n, IMX_IOMUXREG_BITS(26, 24)) +#define IOMUX_GPR13_SATA_PHY_7(n) IMX_IOMUXREG_SHIFTIN(n, IMX_IOMUXREG_BITS(23, 19)) +#define IOMUX_GPR13_SATA_PHY_6(n) IMX_IOMUXREG_SHIFTIN(n, IMX_IOMUXREG_BITS(18, 16)) +#define IOMUX_GPR13_SATA_SPEED(n) IMX_IOMUXREG_SHIFTIN(n, (1 << 15)) +#define IOMUX_GPR13_SATA_PHY_5(n) IMX_IOMUXREG_SHIFTIN(n, (1 << 14)) +#define IOMUX_GPR13_SATA_PHY_4(n) IMX_IOMUXREG_SHIFTIN(n, IMX_IOMUXREG_BITS(13, 11)) +#define IOMUX_GPR13_SATA_PHY_3(n) IMX_IOMUXREG_SHIFTIN(n, IMX_IOMUXREG_BITS(10, 7)) +#define IOMUX_GPR13_SATA_PHY_2(n) IMX_IOMUXREG_SHIFTIN(n, IMX_IOMUXREG_BITS(6, 2)) +#define IOMUX_GPR13_SATA_PHY_1(n) IMX_IOMUXREG_SHIFTIN(n, (1 << 1)) +#define IOMUX_GPR13_SATA_PHY_0(n) IMX_IOMUXREG_SHIFTIN(n, (1 << 0)) #endif From owner-svn-src-all@freebsd.org Thu Aug 3 15:04:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1FAFDC227F; Thu, 3 Aug 2017 15:04:19 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-pf0-f169.google.com (mail-pf0-f169.google.com [209.85.192.169]) (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 BAED181415; Thu, 3 Aug 2017 15:04:19 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-pf0-f169.google.com with SMTP id d67so7439061pfc.0; Thu, 03 Aug 2017 08:04:19 -0700 (PDT) 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=pxeGlPlQ7nm8ePiDzas1N9zkAgZ7AjcDg25p7fAnMGo=; b=oUAMHPTElmjh4PVI8m8/o76lDMhZC63XPsQEg500CZuJ9Lw8I9r5MmTx5sZKJIwE1l sUex65ufvjIIddL442tIpoLGiPx2ffm7BhibAkK1Ld4Yj3+W2hcq3rKFYh+y/JDETIxj iYJoGSvKuucVetyeKqsITfBruUwtfFulq6zGckbhebOmjHqJ3mBc/BW+yic5wZ2F52NK j0btlbIcSMDehbZcsQr/hYIUL0VezLbbXeuZ8d9GtU52UM5sikrKCLhRNAgO9nZqa7BJ AdRYMnT7jcU3ckdjJsjcrtwnSHi5reLqwXtPmscA2VWuhpcurVa64S89iDrBd7SFIz3S k2fA== X-Gm-Message-State: AIVw1119VD05HtEyU4kDGyozViANUPFcfd09kWReYn8LCSU3Ar6UkleV LLzfQH6nV5h+xxdPWP4= X-Received: by 10.84.211.108 with SMTP id b99mr2212530pli.473.1501771067294; Thu, 03 Aug 2017 07:37:47 -0700 (PDT) Received: from mail-pg0-f52.google.com (mail-pg0-f52.google.com. [74.125.83.52]) by smtp.gmail.com with ESMTPSA id n19sm31159217pfi.35.2017.08.03.07.37.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Aug 2017 07:37:47 -0700 (PDT) Received: by mail-pg0-f52.google.com with SMTP id l64so6963708pge.5; Thu, 03 Aug 2017 07:37:47 -0700 (PDT) X-Received: by 10.84.198.129 with SMTP id p1mr2181847pld.120.1501771067016; Thu, 03 Aug 2017 07:37:47 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.100.169.8 with HTTP; Thu, 3 Aug 2017 07:37:46 -0700 (PDT) In-Reply-To: <201708030918.v739IPVY034866@repo.freebsd.org> References: <201708030918.v739IPVY034866@repo.freebsd.org> From: Conrad Meyer Date: Thu, 3 Aug 2017 07:37:46 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r321985 - head/sys/ofed/drivers/infiniband/core To: Hans Petter Selasky 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 15:04:20 -0000 Hey Hans, Is it not important that the subtraction and result are evaluated without truncation? Thanks, Conrad On Thu, Aug 3, 2017 at 2:18 AM, Hans Petter Selasky wrote: > Author: hselasky > Date: Thu Aug 3 09:18:25 2017 > New Revision: 321985 > URL: https://svnweb.freebsd.org/changeset/base/321985 > > Log: > Ticks are 32-bit in FreeBSD. > > MFC after: 3 days > Sponsored by: Mellanox Technologies > > Modified: > head/sys/ofed/drivers/infiniband/core/addr.c > > Modified: head/sys/ofed/drivers/infiniband/core/addr.c > ============================================================================== > --- head/sys/ofed/drivers/infiniband/core/addr.c Thu Aug 3 09:14:43 2017 (r321984) > +++ head/sys/ofed/drivers/infiniband/core/addr.c Thu Aug 3 09:18:25 2017 (r321985) > @@ -187,10 +187,10 @@ EXPORT_SYMBOL(rdma_translate_ip); > > static void set_timeout(unsigned long time) > { > - unsigned long delay; > + int delay; /* under FreeBSD ticks are 32-bit */ > > delay = time - jiffies; > - if ((long)delay <= 0) > + if (delay <= 0) > delay = 1; > > mod_delayed_work(addr_wq, &work, delay); > From owner-svn-src-all@freebsd.org Thu Aug 3 15:04:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABF85DC2317; Thu, 3 Aug 2017 15:04:55 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7710D81556; Thu, 3 Aug 2017 15:04:55 +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 v73F4s64081282; Thu, 3 Aug 2017 15:04:54 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73F4snb081281; Thu, 3 Aug 2017 15:04:54 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201708031504.v73F4snb081281@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Thu, 3 Aug 2017 15:04:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322016 - head/usr.bin/mt X-SVN-Group: head X-SVN-Commit-Author: ken X-SVN-Commit-Paths: head/usr.bin/mt X-SVN-Commit-Revision: 322016 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 15:04:55 -0000 Author: ken Date: Thu Aug 3 15:04:54 2017 New Revision: 322016 URL: https://svnweb.freebsd.org/changeset/base/322016 Log: Oracle T10000 tape drives use PRML encoding. Source: Oracle T10000 SCSI reference guide. MFC after: 3 days Sponsored by: Spectra Logic Modified: head/usr.bin/mt/mt.1 Modified: head/usr.bin/mt/mt.1 ============================================================================== --- head/usr.bin/mt/mt.1 Thu Aug 3 14:43:41 2017 (r322015) +++ head/usr.bin/mt/mt.1 Thu Aug 3 15:04:54 2017 (r322016) @@ -29,7 +29,7 @@ .\" @(#)mt.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd July 14, 2017 +.Dd August 3, 2017 .Dt MT 1 .Os .Sh NAME @@ -509,10 +509,10 @@ Value Width Tracks Density Code Typ 0x47 3.81 (0.25) ? 6,417 (163,000) CS DAT-72 0x48 12.7 (0.5) 448 5,236 (133,000) PRML C SDLTapeI(110) 6,8,13 0x49 12.7 (0.5) 448 7,598 (193,000) PRML C SDLTapeI(160) 6,8 -0x4A 12.7 (0.5) 768 ? C T10000A 10 -0x4B 12.7 (0.5) 1152 ? C T10000B 10 -0x4C 12.7 (0.5) 3584 ? C T10000C 10 -0x4D 12.7 (0.5) 4608 ? C T10000D 10 +0x4A 12.7 (0.5) 768 ? PRML C T10000A 10 +0x4B 12.7 (0.5) 1152 ? PRML C T10000B 10 +0x4C 12.7 (0.5) 3584 ? PRML C T10000C 10 +0x4D 12.7 (0.5) 4608 ? PRML C T10000D 10 0x51 12.7 (0.5) 512 11,800 (299,720) C 3592A1 (unencrypted) 0x52 12.7 (0.5) 896 11,800 (299,720) C 3592A2 (unencrypted) 0x53 12.7 (0.5) 1152 13,452 (341,681) C 3592A3 (unencrypted) From owner-svn-src-all@freebsd.org Thu Aug 3 15:43:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 751FFDC4900; Thu, 3 Aug 2017 15:43:22 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFA9483886; Thu, 3 Aug 2017 15:43:21 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v73FhLdw099251; Thu, 3 Aug 2017 15:43:21 GMT (envelope-from phil@FreeBSD.org) Received: (from phil@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73FhF9m099191; Thu, 3 Aug 2017 15:43:15 GMT (envelope-from phil@FreeBSD.org) Message-Id: <201708031543.v73FhF9m099191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phil set sender to phil@FreeBSD.org using -f From: Phil Shafer Date: Thu, 3 Aug 2017 15:43:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r322017 - in vendor/Juniper/libxo/dist: . doc libxo tests/core tests/core/saved tests/xo tests/xo/saved xo xohtml xolint xopo X-SVN-Group: vendor X-SVN-Commit-Author: phil X-SVN-Commit-Paths: in vendor/Juniper/libxo/dist: . doc libxo tests/core tests/core/saved tests/xo tests/xo/saved xo xohtml xolint xopo X-SVN-Commit-Revision: 322017 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 15:43:22 -0000 Author: phil Date: Thu Aug 3 15:43:14 2017 New Revision: 322017 URL: https://svnweb.freebsd.org/changeset/base/322017 Log: Import libxo 0.8.4 Modified: vendor/Juniper/libxo/dist/Makefile.am vendor/Juniper/libxo/dist/configure.ac vendor/Juniper/libxo/dist/doc/libxo-manual.html vendor/Juniper/libxo/dist/libxo/libxo.3 vendor/Juniper/libxo/dist/libxo/libxo.c vendor/Juniper/libxo/dist/libxo/xo_attr.3 vendor/Juniper/libxo/dist/libxo/xo_create.3 vendor/Juniper/libxo/dist/libxo/xo_emit.3 vendor/Juniper/libxo/dist/libxo/xo_emit_err.3 vendor/Juniper/libxo/dist/libxo/xo_emit_f.3 vendor/Juniper/libxo/dist/libxo/xo_err.3 vendor/Juniper/libxo/dist/libxo/xo_error.3 vendor/Juniper/libxo/dist/libxo/xo_finish.3 vendor/Juniper/libxo/dist/libxo/xo_flush.3 vendor/Juniper/libxo/dist/libxo/xo_format.5 vendor/Juniper/libxo/dist/libxo/xo_message.3 vendor/Juniper/libxo/dist/libxo/xo_no_setlocale.3 vendor/Juniper/libxo/dist/libxo/xo_open_container.3 vendor/Juniper/libxo/dist/libxo/xo_open_list.3 vendor/Juniper/libxo/dist/libxo/xo_open_marker.3 vendor/Juniper/libxo/dist/libxo/xo_options.7 vendor/Juniper/libxo/dist/libxo/xo_parse_args.3 vendor/Juniper/libxo/dist/libxo/xo_set_allocator.3 vendor/Juniper/libxo/dist/libxo/xo_set_flags.3 vendor/Juniper/libxo/dist/libxo/xo_set_info.3 vendor/Juniper/libxo/dist/libxo/xo_set_options.3 vendor/Juniper/libxo/dist/libxo/xo_set_style.3 vendor/Juniper/libxo/dist/libxo/xo_set_syslog_enterprise_id.3 vendor/Juniper/libxo/dist/libxo/xo_set_version.3 vendor/Juniper/libxo/dist/libxo/xo_set_writer.3 vendor/Juniper/libxo/dist/libxo/xo_syslog.3 vendor/Juniper/libxo/dist/tests/core/saved/test_01.E.out vendor/Juniper/libxo/dist/tests/core/saved/test_01.H.out vendor/Juniper/libxo/dist/tests/core/saved/test_01.HIPx.out vendor/Juniper/libxo/dist/tests/core/saved/test_01.HP.out vendor/Juniper/libxo/dist/tests/core/saved/test_01.J.out vendor/Juniper/libxo/dist/tests/core/saved/test_01.JP.out vendor/Juniper/libxo/dist/tests/core/saved/test_01.T.out vendor/Juniper/libxo/dist/tests/core/saved/test_01.X.out vendor/Juniper/libxo/dist/tests/core/saved/test_01.XP.out vendor/Juniper/libxo/dist/tests/core/saved/test_02.E.out vendor/Juniper/libxo/dist/tests/core/saved/test_02.J.out vendor/Juniper/libxo/dist/tests/core/saved/test_02.JP.out vendor/Juniper/libxo/dist/tests/core/saved/test_02.X.out vendor/Juniper/libxo/dist/tests/core/saved/test_02.XP.out vendor/Juniper/libxo/dist/tests/core/test_01.c vendor/Juniper/libxo/dist/tests/xo/saved/xo_01.H.out vendor/Juniper/libxo/dist/tests/xo/saved/xo_01.HIPx.out vendor/Juniper/libxo/dist/tests/xo/saved/xo_01.HP.out vendor/Juniper/libxo/dist/tests/xo/saved/xo_01.J.out vendor/Juniper/libxo/dist/tests/xo/saved/xo_01.JP.out vendor/Juniper/libxo/dist/tests/xo/saved/xo_01.T.out vendor/Juniper/libxo/dist/tests/xo/saved/xo_01.X.out vendor/Juniper/libxo/dist/tests/xo/saved/xo_01.XP.out vendor/Juniper/libxo/dist/tests/xo/xo_01.sh vendor/Juniper/libxo/dist/xo/xo.1 vendor/Juniper/libxo/dist/xohtml/xohtml.1 vendor/Juniper/libxo/dist/xohtml/xohtml.sh.in vendor/Juniper/libxo/dist/xolint/xolint.1 vendor/Juniper/libxo/dist/xopo/xopo.1 Modified: vendor/Juniper/libxo/dist/Makefile.am ============================================================================== --- vendor/Juniper/libxo/dist/Makefile.am Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/Makefile.am Thu Aug 3 15:43:14 2017 (r322017) @@ -38,7 +38,14 @@ GH_PAGES_DIR = gh-pages/ GH_PAGES_DIR_VER = gh-pages/${PACKAGE_VERSION} PACKAGE_FILE = ${PACKAGE_TARNAME}-${PACKAGE_VERSION}.tar.gz -upload: dist upload-docs +XOHTML_FILES = \ + ${top_srcdir}/xohtml/xohtml.css \ + ${top_srcdir}/xohtml/xohtml.js \ + ${top_srcdir}/xohtml/external/jquery.js \ + ${top_srcdir}/xohtml/external/jquery.qtip.css \ + ${top_srcdir}/xohtml/external/jquery.qtip.js + +upload: dist upload-docs upload-xohtml-files @echo "Remember to run:" @echo " gt tag ${PACKAGE_VERSION}" @@ -54,6 +61,18 @@ upload-docs: docs && git add libxo-manual.html \ && git commit -m 'new docs' \ libxo-manual.html ${PACKAGE_VERSION} \ + && git push origin gh-pages ) ; true + +upload-xohtml-files: + @echo "Uploading xohtml files ... " + @-[ -d ${GH_PAGES_DIR} ] \ + && echo "Updating xohtml files on gh-pages ..." \ + && mkdir -p ${GH_PAGES_DIR_VER}/xohtml \ + && cp ${XOHTML_FILES} ${GH_PAGES_DIR_VER}/xohtml \ + && (cd ${GH_PAGES_DIR} \ + && git add ${PACKAGE_VERSION}/xohtml \ + && git commit -m 'new xohtml files' \ + ${PACKAGE_VERSION}/xohtml \ && git push origin gh-pages ) ; true pkgconfigdir=$(libdir)/pkgconfig Modified: vendor/Juniper/libxo/dist/configure.ac ============================================================================== --- vendor/Juniper/libxo/dist/configure.ac Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/configure.ac Thu Aug 3 15:43:14 2017 (r322017) @@ -12,7 +12,7 @@ # AC_PREREQ(2.2) -AC_INIT([libxo], [0.8.1], [phil@juniper.net]) +AC_INIT([libxo], [0.8.4], [phil@juniper.net]) AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability]) # Support silent build rules. Requires at least automake-1.11. Modified: vendor/Juniper/libxo/dist/doc/libxo-manual.html ============================================================================== --- vendor/Juniper/libxo/dist/doc/libxo-manual.html Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/doc/libxo-manual.html Thu Aug 3 15:43:14 2017 (r322017) @@ -515,7 +515,7 @@ li.indline1 { } @top-right { - content: "June 2017"; + content: "August 2017"; } @top-center { @@ -22011,7 +22011,7 @@ jQuery(function ($) {
-June 14, 2017 +August 3, 2017

libxo: The Easy Way to Generate text, XML, JSON, and HTML output
libxo-manual

Modified: vendor/Juniper/libxo/dist/libxo/libxo.3 ============================================================================== --- vendor/Juniper/libxo/dist/libxo/libxo.3 Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/libxo/libxo.3 Thu Aug 3 15:43:14 2017 (r322017) @@ -311,3 +311,13 @@ to use an alternative set of low-level output function .Xr xo_set_style 3 , .Xr xo_set_writer 3 , .Xr xo_format 5 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: vendor/Juniper/libxo/dist/libxo/libxo.c ============================================================================== --- vendor/Juniper/libxo/dist/libxo/libxo.c Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/libxo/libxo.c Thu Aug 3 15:43:14 2017 (r322017) @@ -137,7 +137,7 @@ static const char xo_default_format[] = "%s"; #define XO_INDENT_BY 2 /* Amount to indent when pretty printing */ #define XO_DEPTH 128 /* Default stack depth */ -#define XO_MAX_ANCHOR_WIDTH (8*1024) /* Anything wider is just sillyb */ +#define XO_MAX_ANCHOR_WIDTH (8*1024) /* Anything wider is just silly */ #define XO_FAILURE_NAME "failure" @@ -5071,16 +5071,60 @@ xo_find_width (xo_handle_t *xop, xo_field_info_t *xfip bp[vlen] = '\0'; width = strtol(bp, &cp, 0); - if (width == LONG_MIN || width == LONG_MAX - || bp == cp || *cp != '\0' ) { + if (width == LONG_MIN || width == LONG_MAX || bp == cp || *cp != '\0') { width = 0; xo_failure(xop, "invalid width for anchor: '%s'", bp); } } else if (flen) { - if (flen != 2 || strncmp("%d", fmt, flen) != 0) - xo_failure(xop, "invalid width format: '%*.*s'", flen, flen, fmt); - if (!XOF_ISSET(xop, XOF_NO_VA_ARG)) - width = va_arg(xop->xo_vap, int); + /* + * We really expect the format for width to be "{:/%d}" or + * "{:/%u}", so if that's the case, we just grab our width off + * the argument list. But we need to avoid optimized logic if + * there's a custom formatter. + */ + if (xop->xo_formatter == NULL && flen == 2 + && strncmp("%d", fmt, flen) == 0) { + if (!XOF_ISSET(xop, XOF_NO_VA_ARG)) + width = va_arg(xop->xo_vap, int); + } else if (xop->xo_formatter == NULL && flen == 2 + && strncmp("%u", fmt, flen) == 0) { + if (!XOF_ISSET(xop, XOF_NO_VA_ARG)) + width = va_arg(xop->xo_vap, unsigned); + } else { + /* + * So we have a format and it's not a simple one like + * "{:/%d}". That means we need to format the field, + * extract the value from the formatted output, and then + * discard that output. + */ + int anchor_was_set = FALSE; + xo_buffer_t *xbp = &xop->xo_data; + ssize_t start_offset = xo_buf_offset(xbp); + bp = xo_buf_cur(xbp); /* Save start of the string */ + cp = NULL; + + if (XOIF_ISSET(xop, XOIF_ANCHOR)) { + XOIF_CLEAR(xop, XOIF_ANCHOR); + anchor_was_set = TRUE; + } + + ssize_t rc = xo_do_format_field(xop, xbp, fmt, flen, 0); + if (rc >= 0) { + xo_buf_append(xbp, "", 1); /* Append a NUL */ + + width = strtol(bp, &cp, 0); + if (width == LONG_MIN || width == LONG_MAX + || bp == cp || *cp != '\0') { + width = 0; + xo_failure(xop, "invalid width for anchor: '%s'", bp); + } + } + + /* Reset the cur pointer to where we found it */ + xbp->xb_curp = xbp->xb_bufp + start_offset; + if (anchor_was_set) + XOIF_SET(xop, XOIF_ANCHOR); + } } return width; @@ -5107,9 +5151,6 @@ static void xo_anchor_start (xo_handle_t *xop, xo_field_info_t *xfip, const char *value, ssize_t vlen) { - if (xo_style(xop) != XO_STYLE_TEXT && xo_style(xop) != XO_STYLE_HTML) - return; - if (XOIF_ISSET(xop, XOIF_ANCHOR)) xo_failure(xop, "the anchor already recording is discarded"); @@ -5129,9 +5170,6 @@ static void xo_anchor_stop (xo_handle_t *xop, xo_field_info_t *xfip, const char *value, ssize_t vlen) { - if (xo_style(xop) != XO_STYLE_TEXT && xo_style(xop) != XO_STYLE_HTML) - return; - if (!XOIF_ISSET(xop, XOIF_ANCHOR)) { xo_failure(xop, "no start anchor"); return; Modified: vendor/Juniper/libxo/dist/libxo/xo_attr.3 ============================================================================== --- vendor/Juniper/libxo/dist/libxo/xo_attr.3 Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/libxo/xo_attr.3 Thu Aug 3 15:43:14 2017 (r322017) @@ -58,3 +58,13 @@ already emitted in other form. .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: vendor/Juniper/libxo/dist/libxo/xo_create.3 ============================================================================== --- vendor/Juniper/libxo/dist/libxo/xo_create.3 Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/libxo/xo_create.3 Thu Aug 3 15:43:14 2017 (r322017) @@ -65,3 +65,13 @@ resources associated with the default handle. .Xr xo_emit 3 , .Xr xo_set_options 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: vendor/Juniper/libxo/dist/libxo/xo_emit.3 ============================================================================== --- vendor/Juniper/libxo/dist/libxo/xo_emit.3 Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/libxo/xo_emit.3 Thu Aug 3 15:43:14 2017 (r322017) @@ -102,3 +102,13 @@ then the number of display columns consumed by the out .Xr xo_open_list 3 , .Xr xo_format 5 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: vendor/Juniper/libxo/dist/libxo/xo_emit_err.3 ============================================================================== --- vendor/Juniper/libxo/dist/libxo/xo_emit_err.3 Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/libxo/xo_emit_err.3 Thu Aug 3 15:43:14 2017 (r322017) @@ -70,3 +70,13 @@ parameter. .Xr xo_format 5 , .Xr xo_err 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: vendor/Juniper/libxo/dist/libxo/xo_emit_f.3 ============================================================================== --- vendor/Juniper/libxo/dist/libxo/xo_emit_f.3 Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/libxo/xo_emit_f.3 Thu Aug 3 15:43:14 2017 (r322017) @@ -109,3 +109,13 @@ for details. .Xr xo_open_list 3 , .Xr xo_format 5 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: vendor/Juniper/libxo/dist/libxo/xo_err.3 ============================================================================== --- vendor/Juniper/libxo/dist/libxo/xo_err.3 Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/libxo/xo_err.3 Thu Aug 3 15:43:14 2017 (r322017) @@ -72,3 +72,13 @@ parameter. .Xr xo_emit 3 , .Xr xo_emit_err 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: vendor/Juniper/libxo/dist/libxo/xo_error.3 ============================================================================== --- vendor/Juniper/libxo/dist/libxo/xo_error.3 Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/libxo/xo_error.3 Thu Aug 3 15:43:14 2017 (r322017) @@ -39,3 +39,13 @@ calls. .Xr printf 3 , .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: vendor/Juniper/libxo/dist/libxo/xo_finish.3 ============================================================================== --- vendor/Juniper/libxo/dist/libxo/xo_finish.3 Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/libxo/xo_finish.3 Thu Aug 3 15:43:14 2017 (r322017) @@ -37,3 +37,13 @@ especially for the non-TEXT output styles. .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: vendor/Juniper/libxo/dist/libxo/xo_flush.3 ============================================================================== --- vendor/Juniper/libxo/dist/libxo/xo_flush.3 Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/libxo/xo_flush.3 Thu Aug 3 15:43:14 2017 (r322017) @@ -33,3 +33,13 @@ function is used for this. .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: vendor/Juniper/libxo/dist/libxo/xo_format.5 ============================================================================== --- vendor/Juniper/libxo/dist/libxo/xo_format.5 Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/libxo/xo_format.5 Thu Aug 3 15:43:14 2017 (r322017) @@ -965,3 +965,13 @@ names to make that difference more obvious. .Xr libxo 3 , .Xr xolint 1 , .Xr xo_emit 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: vendor/Juniper/libxo/dist/libxo/xo_message.3 ============================================================================== --- vendor/Juniper/libxo/dist/libxo/xo_message.3 Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/libxo/xo_message.3 Thu Aug 3 15:43:14 2017 (r322017) @@ -66,3 +66,13 @@ and .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: vendor/Juniper/libxo/dist/libxo/xo_no_setlocale.3 ============================================================================== --- vendor/Juniper/libxo/dist/libxo/xo_no_setlocale.3 Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/libxo/xo_no_setlocale.3 Thu Aug 3 15:43:14 2017 (r322017) @@ -41,3 +41,13 @@ function. .Xr xo_open_list 3 , .Xr xo_format 5 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: vendor/Juniper/libxo/dist/libxo/xo_open_container.3 ============================================================================== --- vendor/Juniper/libxo/dist/libxo/xo_open_container.3 Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/libxo/xo_open_container.3 Thu Aug 3 15:43:14 2017 (r322017) @@ -186,3 +186,13 @@ and the name recorded do not match. .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: vendor/Juniper/libxo/dist/libxo/xo_open_list.3 ============================================================================== --- vendor/Juniper/libxo/dist/libxo/xo_open_list.3 Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/libxo/xo_open_list.3 Thu Aug 3 15:43:14 2017 (r322017) @@ -156,3 +156,13 @@ are rendered as multiple leaf elements. .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: vendor/Juniper/libxo/dist/libxo/xo_open_marker.3 ============================================================================== --- vendor/Juniper/libxo/dist/libxo/xo_open_marker.3 Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/libxo/xo_open_marker.3 Thu Aug 3 15:43:14 2017 (r322017) @@ -103,3 +103,13 @@ properly. .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: vendor/Juniper/libxo/dist/libxo/xo_options.7 ============================================================================== --- vendor/Juniper/libxo/dist/libxo/xo_options.7 Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/libxo/xo_options.7 Thu Aug 3 15:43:14 2017 (r322017) @@ -145,3 +145,12 @@ The following are three example invocations of .Sh SEE ALSO .Xr libxo 3 , .Xr xo_format 5 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . Modified: vendor/Juniper/libxo/dist/libxo/xo_parse_args.3 ============================================================================== --- vendor/Juniper/libxo/dist/libxo/xo_parse_args.3 Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/libxo/xo_parse_args.3 Thu Aug 3 15:43:14 2017 (r322017) @@ -150,3 +150,13 @@ must be maintained by the caller. .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: vendor/Juniper/libxo/dist/libxo/xo_set_allocator.3 ============================================================================== --- vendor/Juniper/libxo/dist/libxo/xo_set_allocator.3 Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/libxo/xo_set_allocator.3 Thu Aug 3 15:43:14 2017 (r322017) @@ -52,3 +52,13 @@ functions are used. .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: vendor/Juniper/libxo/dist/libxo/xo_set_flags.3 ============================================================================== --- vendor/Juniper/libxo/dist/libxo/xo_set_flags.3 Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/libxo/xo_set_flags.3 Thu Aug 3 15:43:14 2017 (r322017) @@ -137,3 +137,13 @@ handle. .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: vendor/Juniper/libxo/dist/libxo/xo_set_info.3 ============================================================================== --- vendor/Juniper/libxo/dist/libxo/xo_set_info.3 Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/libxo/xo_set_info.3 Thu Aug 3 15:43:14 2017 (r322017) @@ -100,3 +100,13 @@ and "data-help" attributes: .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: vendor/Juniper/libxo/dist/libxo/xo_set_options.3 ============================================================================== --- vendor/Juniper/libxo/dist/libxo/xo_set_options.3 Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/libxo/xo_set_options.3 Thu Aug 3 15:43:14 2017 (r322017) @@ -29,3 +29,13 @@ The options are identical to those listed in .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: vendor/Juniper/libxo/dist/libxo/xo_set_style.3 ============================================================================== --- vendor/Juniper/libxo/dist/libxo/xo_set_style.3 Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/libxo/xo_set_style.3 Thu Aug 3 15:43:14 2017 (r322017) @@ -51,3 +51,13 @@ The name can be any of the styles: "text", "xml", "jso .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: vendor/Juniper/libxo/dist/libxo/xo_set_syslog_enterprise_id.3 ============================================================================== --- vendor/Juniper/libxo/dist/libxo/xo_set_syslog_enterprise_id.3 Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/libxo/xo_set_syslog_enterprise_id.3 Thu Aug 3 15:43:14 2017 (r322017) @@ -34,3 +34,13 @@ https://www.iana.org/assignments/enterprise-numbers/en .Sh SEE ALSO .Xr xo_syslog 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: vendor/Juniper/libxo/dist/libxo/xo_set_version.3 ============================================================================== --- vendor/Juniper/libxo/dist/libxo/xo_set_version.3 Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/libxo/xo_set_version.3 Thu Aug 3 15:43:14 2017 (r322017) @@ -32,3 +32,13 @@ is in use. .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: vendor/Juniper/libxo/dist/libxo/xo_set_writer.3 ============================================================================== --- vendor/Juniper/libxo/dist/libxo/xo_set_writer.3 Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/libxo/xo_set_writer.3 Thu Aug 3 15:43:14 2017 (r322017) @@ -54,3 +54,13 @@ flush any pending data associated with the opaque poin .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: vendor/Juniper/libxo/dist/libxo/xo_syslog.3 ============================================================================== --- vendor/Juniper/libxo/dist/libxo/xo_syslog.3 Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/libxo/xo_syslog.3 Thu Aug 3 15:43:14 2017 (r322017) @@ -77,3 +77,13 @@ function names. .Xr xo_set_syslog_enterprise_id 3 , .Xr xo_format 5 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_01.E.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_01.E.out Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_01.E.out Thu Aug 3 15:43:14 2017 (r322017) @@ -1,5 +1,11 @@ op create: [] [] [0] op open_container: [top] [] [0x810] +op content: [address] [0x0] [0] +op content: [port] [1] [0] +op content: [address] [0x0] [0] +op content: [port] [1] [0] +op content: [address] [0x0] [0] +op content: [port] [1] [0] op content: [used-percent] [12] [0] op content: [kve_start] [0xdeadbeef] [0x8] op content: [kve_end] [0xcabb1e] [0x8] Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_01.H.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_01.H.out Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_01.H.out Thu Aug 3 15:43:14 2017 (r322017) @@ -1,2 +1,2 @@ -
df
12
%
testing argument modifier
my-box
.
example.com
...
testing argument modifier with encoding to
.
example.com
...
Label text
value
very
42
42 +
anchor
0x0
..
1
anchor
0x0
..
1
anchor
0x0
..
1
df
12
%
testing argument modifier
my-box
.
example.com
...
testing argument modifier with encoding to
.
example.com
...
Label text
value
very
42
42
Connecting to
my-box
.
example.com
...
Item
Total Sold
In Stock
On Order
SKU
gum
1412
54
10
GRO-000-415
rope
85
4
2
HRD-000-212
ladder
0
2
1
HRD-000-517
bolt
4123
144
42
HRD-000-632
water
17
14
2
GRO-000-2331
Item
'
gum
':
Total sold
:
1412.0
In stock
:
54
On order
:
10
SKU
:
GRO-000-415
Item
'
rope
':
Total sold
:
85.0
In stock
:
4
On order
:
2
SKU
:
HRD-000-212
Item
'
ladder
':
Total sold
! :
0
In stock
:
2
On order
:
1
SKU
:
HRD-000-517
Item
'
bolt
':
Total sold
:
4123.0
In s tock
:
144
On order
:
42
SKU
:
HRD-000-632
Item
'
water
':
Total sold
:
17.0
In stock
:
14
On order
:
2
SKU
:
GRO-000-2331
Item
'
fish
':
Total sold
:
1321.0
In stock
:
45
On order
:
1
SKU
:
GRO-000-533
Item
:
gum
Item
:
rope
Item
:
ladder
Item
:
bolt
Item
:
water
X
X
X
X
X
X
X
X
X
X
Cost
:
425
X
X
Cost
:
455
links
user
group
3
this
/some/file
1
user
group
\ No newline at end of file Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_01.HIPx.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_01.HIPx.out Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_01.HIPx.out Thu Aug 3 15:43:14 2017 (r322017) @@ -1,4 +1,25 @@
+
anchor
+
+
0x0
+
..
+
1
+
+
+
anchor
+
+
0x0
+
..
+
1
+
+
+
anchor
+
+
0x0
+
..
+
1
+
+
df
12
%
Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_01.HP.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_01.HP.out Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_01.HP.out Thu Aug 3 15:43:14 2017 (r322017) @@ -1,4 +1,25 @@
+
anchor
+
+
0x0
+
..
+
1
+
+
+
anchor
+
+
0x0
+
..
+
1
+
+
+
anchor
+
+
0x0
+
..
+
1
+
+
df
12
%
Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_01.J.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_01.J.out Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_01.J.out Thu Aug 3 15:43:14 2017 (r322017) @@ -1,2 +1,2 @@ -{"top": {"used-percent":12,"kve_start":"0xdeadbeef","kve_end":"0xcabb1e","host":"my-box","domain":"example.com","host":"my-box","domain":"example.com","label":"value","max-chaos":"very","min-chaos":42,"some-chaos":"[42]","host":"my-box","domain":"example.com", "data": {"item": [{"sku":"GRO-000-415","name":"gum","sold":1412,"in-stock":54,"on-order":10}, {"sku":"HRD-000-212","name":"rope","sold":85,"in-stock":4,"on-order":2}, {"sku":"HRD-000-517","name":"ladder","sold":0,"in-stock":2,"on-order":1}, {"sku":"HRD-000-632","name":"bolt","sold":4123,"in-stock":144,"on-order":42}, {"sku":"GRO-000-2331","name":"water","sold":17,"in-stock":14,"on-order":2}]}, "data2": {"item": [{"sku":"GRO-000-415","name":"gum","sold":1412.0,"in-stock":54,"on-order":10}, {"sku":"HRD-000-212","name":"rope","sold":85.0,"in-stock":4,"on-order":2}, {"sku":"HRD-000-517","name":"ladder","sold":0,"in-stock":2,"on-order":1}, {"sku":"HRD-000-632","name":"bolt","sold":4123.0,"in-stock":144,"on-order":42}, {"sku":"GRO-0 00-2331","name":"water","sold":17.0,"in-stock":14,"on-order":2}]}, "data3": {"item": [{"sku":"GRO-000-533","name":"fish","sold":1321.0,"in-stock":45,"on-order":1}]}, "data4": {"item": ["gum","rope","ladder","bolt","water"]},"cost":425,"cost":455,"mode":"mode","mode_octal":"octal","links":"links","user":"user","group":"group","pre":"that","links":3,"post":"this","mode":"/some/file","mode_octal":640,"links":1,"user":"user","group":"group"} +{"top": {"address":"0x0","port":1,"address":"0x0","port":1,"address":"0x0","port":1,"used-percent":12,"kve_start":"0xdeadbeef","kve_end":"0xcabb1e","host":"my-box","domain":"example.com","host":"my-box","domain":"example.com","label":"value","max-chaos":"very","min-chaos":42,"some-chaos":"[42]","host":"my-box","domain":"example.com", "data": {"item": [{"sku":"GRO-000-415","name":"gum","sold":1412,"in-stock":54,"on-order":10}, {"sku":"HRD-000-212","name":"rope","sold":85,"in-stock":4,"on-order":2}, {"sku":"HRD-000-517","name":"ladder","sold":0,"in-stock":2,"on-order":1}, {"sku":"HRD-000-632","name":"bolt","sold":4123,"in-stock":144,"on-order":42}, {"sku":"GRO-000-2331","name":"water","sold":17,"in-stock":14,"on-order":2}]}, "data2": {"item": [{"sku":"GRO-000-415","name":"gum","sold":1412.0,"in-stock":54,"on-order":10}, {"sku":"HRD-000-212","name":"rope","sold":85.0,"in-stock":4,"on-order":2}, {"sku":"HRD-000-517","name":"ladder","sold":0,"in-stock":2,"on-order":1}, {"sku":"HRD-000-63 2","name":"bolt","sold":4123.0,"in-stock":144,"on-order":42}, {"sku":"GRO-000-2331","name":"water","sold":17.0,"in-stock":14,"on-order":2}]}, "data3": {"item": [{"sku":"GRO-000-533","name":"fish","sold":1321.0,"in-stock":45,"on-order":1}]}, "data4": {"item": ["gum","rope","ladder","bolt","water"]},"cost":425,"cost":455,"mode":"mode","mode_octal":"octal","links":"links","user":"user","group":"group","pre":"that","links":3,"post":"this","mode":"/some/file","mode_octal":640,"links":1,"user":"user","group":"group"} } Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_01.JP.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_01.JP.out Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_01.JP.out Thu Aug 3 15:43:14 2017 (r322017) @@ -1,5 +1,11 @@ { "top": { + "address": "0x0", + "port": 1, + "address": "0x0", + "port": 1, + "address": "0x0", + "port": 1, "used-percent": 12, "kve_start": "0xdeadbeef", "kve_end": "0xcabb1e", Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_01.T.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_01.T.out Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_01.T.out Thu Aug 3 15:43:14 2017 (r322017) @@ -1,3 +1,6 @@ +anchor 0x0..1 +anchor 0x0..1 +anchor 0x0..1 df 12% testing argument modifier my-box.example.com... testing argument modifier with encoding to .example.com... Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_01.X.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_01.X.out Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_01.X.out Thu Aug 3 15:43:14 2017 (r322017) @@ -1 +1 @@ -120xdeadbeef0xcabb1emy-boxexample.commy-boxexample.comvery42[42]my-boxexample.comGRO-000-415gum14125410HRD-000-212rope8542HRD-000-517ladder021HRD-000-632bolt412314442GRO-000-2331water17142GRO-000-415gum1412.05410HRD-000-212rope85.042HRD-000-517ladder021HRD-000-632bolt4123.014442GRO-000-2331water17.0142GRO-000-533fish1321.0451gum< /item>ropeladderboltwater425455modeoctallinksusergroup
that
3this/some/file6401usergroup
\ No newline at end of file +
0x0
1
0x0
1
0x0
1120xdeadbeef0xcabb1emy-boxexample.commy-boxexample.comvery42[42]my-boxexample.comGRO-000-415gum14125410HRD-000-212rope8542HRD-000-517ladder021HRD-000-632bolt412314442GRO-000-2331water17142GRO-000-415gum1412.05410HRD-000-212rope85.042HRD-000-517ladder021HRD-000-632bolt4123.014442GRO-000-2331water17.0142GRO-000-533fish1321.0451gumropeladderboltwater425455modeoctallinksusergroup
that
3this/some/file6401usergroup
\ No newline at end of file Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_01.XP.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_01.XP.out Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_01.XP.out Thu Aug 3 15:43:14 2017 (r322017) @@ -1,4 +1,10 @@ +
0x0
+ 1 +
0x0
+ 1 +
0x0
+ 1 12 0xdeadbeef 0xcabb1e Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_02.E.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_02.E.out Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_02.E.out Thu Aug 3 15:43:14 2017 (r322017) @@ -34,7 +34,7 @@ op content: [unknown] [1010] [0] op content: [unknown] [1010] [0] op content: [min] [15] [0x20] op content: [cur] [20] [0x20] -op content: [max] [30] [0] +op content: [max] [125] [0] op content: [min] [15] [0] op content: [cur] [20] [0] op content: [max] [125] [0] Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_02.J.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_02.J.out Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_02.J.out Thu Aug 3 15:43:14 2017 (r322017) @@ -1,2 +1,2 @@ -{"top": {"data": {"what":"braces","length":"abcdef","fd":-1,"error":"Bad file descriptor","test":"good","fd":-1,"error":"Bad fi","test":"good","lines":20,"words":30,"characters":40, "bytes": [0,1,2,3,4],"mbuf-current":10,"mbuf-cache":20,"mbuf-total":30,"distance":50,"location":"Boston","memory":64,"total":640,"memory":64,"total":640,"ten":10,"eleven":11,"unknown":1010,"unknown":1010,"min":15,"cur":20,"max":30,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"val1":21,"val2":58368,"val3":100663296,"val4":44470272,"val5":1342172800, "flag": ["one","two","three"],"works":null,"empty-tag":true,"t1":"1000","t2":"test5000","t3":"ten-longx","t4":"xtest", "__error": {"message":"this is an error"}, "__error": {"message":"two more errors"}, "__warning": {"message":"this is an warning"}, "__warning": {"message":"two more warnings"},"count":10,"test":4, "error": {"message":"Shut 'er down, Clancey! She's a-pumpin' mud! <>!,\"!<>\n"}}} +{"top": {"data": {"what":"braces","length":"abcdef","fd":-1,"error":"Bad file descriptor","test":"good","fd":-1,"error":"Bad fi","test":"good","lines":20,"words":30,"characters":40, "bytes": [0,1,2,3,4],"mbuf-current":10,"mbuf-cache":20,"mbuf-total":30,"distance":50,"location":"Boston","memory":64,"total":640,"memory":64,"total":640,"ten":10,"eleven":11,"unknown":1010,"unknown":1010,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"val1":21,"val2":58368,"val3":100663296,"val4":44470272,"val5":1342172800, "flag": ["one","two","three"],"works":null,"empty-tag":true,"t1":"1000","t2":"test5000","t3":"ten-longx","t4":"xtest", "__error": {"message":"this is an error"}, "__error": {"message":"two more errors"}, "__warning": {"message":"this is an warning"}, "__warning": {"message":"two more warnings"},"count":10,"test":4, "error": {"message":"Shut 'er down, Clancey! She's a-pumpin' mud! <>!,\"!<>\n"}}} } Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_02.JP.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_02.JP.out Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_02.JP.out Thu Aug 3 15:43:14 2017 (r322017) @@ -34,7 +34,7 @@ "unknown": 1010, "min": 15, "cur": 20, - "max": 30, + "max": 125, "min": 15, "cur": 20, "max": 125, Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_02.X.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_02.X.out Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_02.X.out Thu Aug 3 15:43:14 2017 (r322017) @@ -2,6 +2,6 @@ abcdef: Bad file descriptor improper use of profanity; ten yard penalty; first down abcdef-1Bad file descriptorgood-1Bad figoodimproper use of profanity; ten yard penalty; first down -2030400123410203050Boston64640646401011101010101520301520125152012515201252158368100663296444702721342172800onetwothreenull1000test5000ten-longxxtest<__error>this is an error<__error>two more err ors<__warning>this is an warning<__warning>two more warnings104improper use of profanity; ten yard penalty; first down +2030400123410203050Boston646406464010111010101015201251520125152012515201252158368100663296444702721342172800onetwothreenull1000test5000ten-longxxtest<__error>this is an error<__error>two more er rors<__warning>this is an warning<__warning>two more warnings104improper use of profanity; ten yard penalty; first down Shut 'er down, Clancey! She's a-pumpin' mud! <>!,"!<>
\ No newline at end of file Modified: vendor/Juniper/libxo/dist/tests/core/saved/test_02.XP.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/saved/test_02.XP.out Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/tests/core/saved/test_02.XP.out Thu Aug 3 15:43:14 2017 (r322017) @@ -39,7 +39,7 @@ 1010 15 20 - 30 + 125 15 20 125 Modified: vendor/Juniper/libxo/dist/tests/core/test_01.c ============================================================================== --- vendor/Juniper/libxo/dist/tests/core/test_01.c Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/tests/core/test_01.c Thu Aug 3 15:43:14 2017 (r322017) @@ -80,6 +80,10 @@ main (int argc, char **argv) xo_open_container_h(NULL, "top"); + xo_emit("anchor {[:/%d}{:address/%p}..{:port/%u}{]:}\n", 18, NULL, 1); + xo_emit("anchor {[:18}{:address/%p}..{:port/%u}{]:}\n", NULL, 1); + xo_emit("anchor {[:/18}{:address/%p}..{:port/%u}{]:}\n", NULL, 1); + xo_emit("df {:used-percent/%5.0f}{U:%%}\n", (double) 12); xo_emit("{e:kve_start/%#jx}", (uintmax_t) 0xdeadbeef); Modified: vendor/Juniper/libxo/dist/tests/xo/saved/xo_01.H.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/xo/saved/xo_01.H.out Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/tests/xo/saved/xo_01.H.out Thu Aug 3 15:43:14 2017 (r322017) @@ -1 +1 @@ -
Item
one
is
number
001
,
color
:
red
Item
two
is
number
002
,
color
:
blue
Item
three
is
number
003
< div class="text">,
color
:
green
Item
four
is
number
004
,
color
:
yellow
\ No newline at end of file +
Item
one
is
number
001
,
color
:
red
Item
two
is
number
002
,
color
:
blue
Item
three
is
number
003
< div class="text">,
color
:
green
Item
four
is
number
004
,
color
:
yellow
0xdeadbeef
..
1
0xdeadbeef
..
1
0xde adbeef
..
1
0xdeadbeef
..
1
\ No newline at end of file Modified: vendor/Juniper/libxo/dist/tests/xo/saved/xo_01.HIPx.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/xo/saved/xo_01.HIPx.out Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/tests/xo/saved/xo_01.HIPx.out Thu Aug 3 15:43:14 2017 (r322017) @@ -50,3 +50,27 @@
yellow
+
+
+
0xdeadbeef
+
..
+
1
+
+
+
+
0xdeadbeef
+
..
+
1
+
+
+
+
0xdeadbeef
+
..
+
1
+
+
+
+
0xdeadbeef
+
..
+
1
+
Modified: vendor/Juniper/libxo/dist/tests/xo/saved/xo_01.HP.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/xo/saved/xo_01.HP.out Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/tests/xo/saved/xo_01.HP.out Thu Aug 3 15:43:14 2017 (r322017) @@ -50,3 +50,27 @@
yellow
+
+
+
0xdeadbeef
+
..
+
1
+
+
+
+
0xdeadbeef
+
..
+
1
+
+
+
+
0xdeadbeef
+
..
+
1
+
+
+
+
0xdeadbeef
+
..
+
1
+
Modified: vendor/Juniper/libxo/dist/tests/xo/saved/xo_01.J.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/xo/saved/xo_01.J.out Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/tests/xo/saved/xo_01.J.out Thu Aug 3 15:43:14 2017 (r322017) @@ -1 +1 @@ -"top": {"item": {"name":"one","value":1,"color":"red"}, "item": {"name":"two","value":2,"color":"blue"}, "item": {"name":"three","value":3,"color":"green"}, "item": {"name":"four","value":4,"color":"yellow"}} +"top": {"item": {"name":"one","value":1,"color":"red"}, "item": {"name":"two","value":2,"color":"blue"}, "item": {"name":"three","value":3,"color":"green"}, "item": {"name":"four","value":4,"color":"yellow"}, "anchor": {"address":"0xdeadbeef","foo":1}, "anchor": {"address":"0xdeadbeef","foo":1}, "anchor": {"address":"0xdeadbeef","foo":1}, "anchor": {"address":"0xdeadbeef","foo":1}} Modified: vendor/Juniper/libxo/dist/tests/xo/saved/xo_01.JP.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/xo/saved/xo_01.JP.out Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/tests/xo/saved/xo_01.JP.out Thu Aug 3 15:43:14 2017 (r322017) @@ -18,5 +18,21 @@ "name": "four", "value": 4, "color": "yellow" + }, + "anchor": { + "address": "0xdeadbeef", + "foo": 1 + }, + "anchor": { + "address": "0xdeadbeef", + "foo": 1 + }, + "anchor": { + "address": "0xdeadbeef", + "foo": 1 + }, + "anchor": { + "address": "0xdeadbeef", + "foo": 1 } } Modified: vendor/Juniper/libxo/dist/tests/xo/saved/xo_01.T.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/xo/saved/xo_01.T.out Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/tests/xo/saved/xo_01.T.out Thu Aug 3 15:43:14 2017 (r322017) @@ -2,3 +2,7 @@ Item one is number 001, color: red Item two is number 002, color: blue Item three is number 003, color: green Item four is number 004, color: yellow + 0xdeadbeef..1 + 0xdeadbeef..1 + 0xdeadbeef..1 + 0xdeadbeef..1 Modified: vendor/Juniper/libxo/dist/tests/xo/saved/xo_01.X.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/xo/saved/xo_01.X.out Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/tests/xo/saved/xo_01.X.out Thu Aug 3 15:43:14 2017 (r322017) @@ -1 +1 @@ -one1redtwo2bluethree3greenfour4yellow \ No newline at end of file +one1redtwo2bluethree3greenfour4yellow
0xdeadbeef
1
0xdeadbeef
1
0xdeadbeef
1
0xdeadbeef
1
\ No newline at end of file Modified: vendor/Juniper/libxo/dist/tests/xo/saved/xo_01.XP.out ============================================================================== --- vendor/Juniper/libxo/dist/tests/xo/saved/xo_01.XP.out Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/tests/xo/saved/xo_01.XP.out Thu Aug 3 15:43:14 2017 (r322017) @@ -19,4 +19,20 @@ 4 yellow + +
0xdeadbeef
+ 1 +
+ +
0xdeadbeef
+ 1 +
+ +
0xdeadbeef
+ 1 +
+ +
0xdeadbeef
+ 1 +
Modified: vendor/Juniper/libxo/dist/tests/xo/xo_01.sh ============================================================================== --- vendor/Juniper/libxo/dist/tests/xo/xo_01.sh Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/tests/xo/xo_01.sh Thu Aug 3 15:43:14 2017 (r322017) @@ -24,4 +24,10 @@ for i in one:1:red two:2:blue three:3:green four:4:yel NF=--not-first done -${XO} --close top \ No newline at end of file +XOAN="${XO} --wrap anchor --not-first --warn --depth 1" +${XOAN} "{[:18}{:address/%p}..{:foo/%u}{]:}\n" 0xdeadbeef 1 +${XOAN} "{[:/18}{:address/%p}..{:foo/%u}{]:}\n" 0xdeadbeef 1 +${XOAN} "{[:/%d}{:address/%p}..{:foo/%u}{]:}\n" 18 0xdeadbeef 1 +${XOAN} "{[:/%s}{:address/%p}..{:foo/%u}{]:}\n" 18 0xdeadbeef 1 + +${XO} --close top Modified: vendor/Juniper/libxo/dist/xo/xo.1 ============================================================================== --- vendor/Juniper/libxo/dist/xo/xo.1 Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/xo/xo.1 Thu Aug 3 15:43:14 2017 (r322017) @@ -188,3 +188,13 @@ prepend data to the XPath values used for HTML output .Xr libxo 3 , .Xr xo_emit 3 , .Xr xo_options 7 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: vendor/Juniper/libxo/dist/xohtml/xohtml.1 ============================================================================== --- vendor/Juniper/libxo/dist/xohtml/xohtml.1 Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/xohtml/xohtml.1 Thu Aug 3 15:43:14 2017 (r322017) @@ -19,7 +19,8 @@ .Op Fl "b " .Op Fl "c" " .Op Fl "f" -.Op Ar command argument... +.Op Fl "w" +.Op Ar command [argument ...] .Sh DESCRIPTION .Nm is a tool for preparing @@ -69,6 +70,12 @@ command is used directly. .It Ic -f Ar file | Ic --file Ar file Output is saved to the given file, rather than to the standard output descriptor. +.It Ic -w | --web +Uses the official +.Nm libxo +website URL as the source path for the CSS and Javascript files +referenced in the output of +.Nm xohtml . .El .Pp .Sh EXAMPLES Modified: vendor/Juniper/libxo/dist/xohtml/xohtml.sh.in ============================================================================== --- vendor/Juniper/libxo/dist/xohtml/xohtml.sh.in Thu Aug 3 15:04:54 2017 (r322016) +++ vendor/Juniper/libxo/dist/xohtml/xohtml.sh.in Thu Aug 3 15:43:14 2017 (r322017) @@ -10,8 +10,10 @@ # BASE=@XO_SHAREDIR@ +VERSION=@LIBXO_VERSION@ CMD=cat DONE= +WEB=http://juniper.github.io/libxo/${VERSION}/xohtml do_help () { echo "xohtml: wrap libxo-enabled output in HTML" @@ -41,6 +43,11 @@ while [ -z "$DONE" -a ! -z "$1" ]; do shift; exec > "$FILE"; ;; + -w|--web) + shift; + BASE="${WEB}"; + ;; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Aug 3 15:43:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46E0EDC4919; Thu, 3 Aug 2017 15:43:31 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF0E0838B1; Thu, 3 Aug 2017 15:43:30 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v73FhTCZ099300; Thu, 3 Aug 2017 15:43:29 GMT (envelope-from phil@FreeBSD.org) Received: (from phil@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73FhTr2099299; Thu, 3 Aug 2017 15:43:29 GMT (envelope-from phil@FreeBSD.org) Message-Id: <201708031543.v73FhTr2099299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phil set sender to phil@FreeBSD.org using -f From: Phil Shafer Date: Thu, 3 Aug 2017 15:43:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r322018 - vendor/Juniper/libxo/0.8.4 X-SVN-Group: vendor X-SVN-Commit-Author: phil X-SVN-Commit-Paths: vendor/Juniper/libxo/0.8.4 X-SVN-Commit-Revision: 322018 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 15:43:31 -0000 Author: phil Date: Thu Aug 3 15:43:29 2017 New Revision: 322018 URL: https://svnweb.freebsd.org/changeset/base/322018 Log: Tag libxo 0.8.4 Added: - copied from r322017, vendor/Juniper/libxo/dist/ Directory Properties: vendor/Juniper/libxo/0.8.4/ (props changed) From owner-svn-src-all@freebsd.org Thu Aug 3 15:47:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1868ADC4BE8; Thu, 3 Aug 2017 15:47:50 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E38A83B8B; Thu, 3 Aug 2017 15:47:49 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v73FlmsL099590; Thu, 3 Aug 2017 15:47:48 GMT (envelope-from phil@FreeBSD.org) Received: (from phil@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73FlgBK099530; Thu, 3 Aug 2017 15:47:42 GMT (envelope-from phil@FreeBSD.org) Message-Id: <201708031547.v73FlgBK099530@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phil set sender to phil@FreeBSD.org using -f From: Phil Shafer Date: Thu, 3 Aug 2017 15:47:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322019 - in head: contrib/libxo contrib/libxo/doc contrib/libxo/libxo contrib/libxo/tests/core contrib/libxo/tests/core/saved contrib/libxo/tests/xo contrib/libxo/tests/xo/saved contri... X-SVN-Group: head X-SVN-Commit-Author: phil X-SVN-Commit-Paths: in head: contrib/libxo contrib/libxo/doc contrib/libxo/libxo contrib/libxo/tests/core contrib/libxo/tests/core/saved contrib/libxo/tests/xo contrib/libxo/tests/xo/saved contrib/libxo/xo contrib/libxo/... X-SVN-Commit-Revision: 322019 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 15:47:50 -0000 Author: phil Date: Thu Aug 3 15:47:42 2017 New Revision: 322019 URL: https://svnweb.freebsd.org/changeset/base/322019 Log: Update from libxo-0.8.1 to 0.8.4: 0.8.4: - void anchor width optimization when we have a custom formatter (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221130) - make "{[:/18}" do the right thing (also allows "{[:/%s}", wide ? 40 : 10) - Can't skip anchor formatting in non-display styles - add test case for {[:/18} - add upload-xohtml-files to 'make upload' 0.8.3: - xohtml: Add "-w" option to pull support files from gh_pages - Add "upload-xohtml-files" target to publish support files in gh_pages/ - add HISTORY/AUTHORS section to man pages 0.8.2: - xohtml: Add div.units as standard CSS text - Don't treat values as format strings; they are not - add "-p" to "mkdir -p build" in setup.sh - add test case for {U:%%} (from df.c) - detect end-of-string in '%' and '' escaping - make xo_simple_field, for common simple cases - xohtml: nuke "n" in "echo" commands - rename "format" to "fmt" for consistency; same for "str" to "value" Submitted by: phil Modified: head/contrib/libxo/Makefile.am head/contrib/libxo/configure.ac head/contrib/libxo/doc/libxo-manual.html head/contrib/libxo/libxo/libxo.3 head/contrib/libxo/libxo/libxo.c head/contrib/libxo/libxo/xo_attr.3 head/contrib/libxo/libxo/xo_create.3 head/contrib/libxo/libxo/xo_emit.3 head/contrib/libxo/libxo/xo_emit_err.3 head/contrib/libxo/libxo/xo_emit_f.3 head/contrib/libxo/libxo/xo_err.3 head/contrib/libxo/libxo/xo_error.3 head/contrib/libxo/libxo/xo_finish.3 head/contrib/libxo/libxo/xo_flush.3 head/contrib/libxo/libxo/xo_format.5 head/contrib/libxo/libxo/xo_message.3 head/contrib/libxo/libxo/xo_no_setlocale.3 head/contrib/libxo/libxo/xo_open_container.3 head/contrib/libxo/libxo/xo_open_list.3 head/contrib/libxo/libxo/xo_open_marker.3 head/contrib/libxo/libxo/xo_options.7 head/contrib/libxo/libxo/xo_parse_args.3 head/contrib/libxo/libxo/xo_set_allocator.3 head/contrib/libxo/libxo/xo_set_flags.3 head/contrib/libxo/libxo/xo_set_info.3 head/contrib/libxo/libxo/xo_set_options.3 head/contrib/libxo/libxo/xo_set_style.3 head/contrib/libxo/libxo/xo_set_syslog_enterprise_id.3 head/contrib/libxo/libxo/xo_set_version.3 head/contrib/libxo/libxo/xo_set_writer.3 head/contrib/libxo/libxo/xo_syslog.3 head/contrib/libxo/tests/core/saved/test_01.E.out head/contrib/libxo/tests/core/saved/test_01.H.out head/contrib/libxo/tests/core/saved/test_01.HIPx.out head/contrib/libxo/tests/core/saved/test_01.HP.out head/contrib/libxo/tests/core/saved/test_01.J.out head/contrib/libxo/tests/core/saved/test_01.JP.out head/contrib/libxo/tests/core/saved/test_01.T.out head/contrib/libxo/tests/core/saved/test_01.X.out head/contrib/libxo/tests/core/saved/test_01.XP.out head/contrib/libxo/tests/core/saved/test_02.E.out head/contrib/libxo/tests/core/saved/test_02.J.out head/contrib/libxo/tests/core/saved/test_02.JP.out head/contrib/libxo/tests/core/saved/test_02.X.out head/contrib/libxo/tests/core/saved/test_02.XP.out head/contrib/libxo/tests/core/test_01.c head/contrib/libxo/tests/xo/saved/xo_01.H.out head/contrib/libxo/tests/xo/saved/xo_01.HIPx.out head/contrib/libxo/tests/xo/saved/xo_01.HP.out head/contrib/libxo/tests/xo/saved/xo_01.J.out head/contrib/libxo/tests/xo/saved/xo_01.JP.out head/contrib/libxo/tests/xo/saved/xo_01.T.out head/contrib/libxo/tests/xo/saved/xo_01.X.out head/contrib/libxo/tests/xo/saved/xo_01.XP.out head/contrib/libxo/tests/xo/xo_01.sh head/contrib/libxo/xo/xo.1 head/contrib/libxo/xohtml/xohtml.1 head/contrib/libxo/xohtml/xohtml.sh.in head/contrib/libxo/xolint/xolint.1 head/contrib/libxo/xopo/xopo.1 head/lib/libxo/add.man head/lib/libxo/xo_config.h head/usr.bin/xohtml/xohtml.sh Directory Properties: head/contrib/libxo/ (props changed) Modified: head/contrib/libxo/Makefile.am ============================================================================== --- head/contrib/libxo/Makefile.am Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/Makefile.am Thu Aug 3 15:47:42 2017 (r322019) @@ -38,7 +38,14 @@ GH_PAGES_DIR = gh-pages/ GH_PAGES_DIR_VER = gh-pages/${PACKAGE_VERSION} PACKAGE_FILE = ${PACKAGE_TARNAME}-${PACKAGE_VERSION}.tar.gz -upload: dist upload-docs +XOHTML_FILES = \ + ${top_srcdir}/xohtml/xohtml.css \ + ${top_srcdir}/xohtml/xohtml.js \ + ${top_srcdir}/xohtml/external/jquery.js \ + ${top_srcdir}/xohtml/external/jquery.qtip.css \ + ${top_srcdir}/xohtml/external/jquery.qtip.js + +upload: dist upload-docs upload-xohtml-files @echo "Remember to run:" @echo " gt tag ${PACKAGE_VERSION}" @@ -54,6 +61,18 @@ upload-docs: docs && git add libxo-manual.html \ && git commit -m 'new docs' \ libxo-manual.html ${PACKAGE_VERSION} \ + && git push origin gh-pages ) ; true + +upload-xohtml-files: + @echo "Uploading xohtml files ... " + @-[ -d ${GH_PAGES_DIR} ] \ + && echo "Updating xohtml files on gh-pages ..." \ + && mkdir -p ${GH_PAGES_DIR_VER}/xohtml \ + && cp ${XOHTML_FILES} ${GH_PAGES_DIR_VER}/xohtml \ + && (cd ${GH_PAGES_DIR} \ + && git add ${PACKAGE_VERSION}/xohtml \ + && git commit -m 'new xohtml files' \ + ${PACKAGE_VERSION}/xohtml \ && git push origin gh-pages ) ; true pkgconfigdir=$(libdir)/pkgconfig Modified: head/contrib/libxo/configure.ac ============================================================================== --- head/contrib/libxo/configure.ac Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/configure.ac Thu Aug 3 15:47:42 2017 (r322019) @@ -12,7 +12,7 @@ # AC_PREREQ(2.2) -AC_INIT([libxo], [0.8.1], [phil@juniper.net]) +AC_INIT([libxo], [0.8.4], [phil@juniper.net]) AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability]) # Support silent build rules. Requires at least automake-1.11. Modified: head/contrib/libxo/doc/libxo-manual.html ============================================================================== --- head/contrib/libxo/doc/libxo-manual.html Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/doc/libxo-manual.html Thu Aug 3 15:47:42 2017 (r322019) @@ -515,7 +515,7 @@ li.indline1 { } @top-right { - content: "June 2017"; + content: "August 2017"; } @top-center { @@ -22011,7 +22011,7 @@ jQuery(function ($) { -June 14, 2017 +August 3, 2017

libxo: The Easy Way to Generate text, XML, JSON, and HTML output
libxo-manual

Modified: head/contrib/libxo/libxo/libxo.3 ============================================================================== --- head/contrib/libxo/libxo/libxo.3 Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/libxo/libxo.3 Thu Aug 3 15:47:42 2017 (r322019) @@ -311,3 +311,13 @@ to use an alternative set of low-level output function .Xr xo_set_style 3 , .Xr xo_set_writer 3 , .Xr xo_format 5 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: head/contrib/libxo/libxo/libxo.c ============================================================================== --- head/contrib/libxo/libxo/libxo.c Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/libxo/libxo.c Thu Aug 3 15:47:42 2017 (r322019) @@ -137,7 +137,7 @@ static const char xo_default_format[] = "%s"; #define XO_INDENT_BY 2 /* Amount to indent when pretty printing */ #define XO_DEPTH 128 /* Default stack depth */ -#define XO_MAX_ANCHOR_WIDTH (8*1024) /* Anything wider is just sillyb */ +#define XO_MAX_ANCHOR_WIDTH (8*1024) /* Anything wider is just silly */ #define XO_FAILURE_NAME "failure" @@ -5071,16 +5071,60 @@ xo_find_width (xo_handle_t *xop, xo_field_info_t *xfip bp[vlen] = '\0'; width = strtol(bp, &cp, 0); - if (width == LONG_MIN || width == LONG_MAX - || bp == cp || *cp != '\0' ) { + if (width == LONG_MIN || width == LONG_MAX || bp == cp || *cp != '\0') { width = 0; xo_failure(xop, "invalid width for anchor: '%s'", bp); } } else if (flen) { - if (flen != 2 || strncmp("%d", fmt, flen) != 0) - xo_failure(xop, "invalid width format: '%*.*s'", flen, flen, fmt); - if (!XOF_ISSET(xop, XOF_NO_VA_ARG)) - width = va_arg(xop->xo_vap, int); + /* + * We really expect the format for width to be "{:/%d}" or + * "{:/%u}", so if that's the case, we just grab our width off + * the argument list. But we need to avoid optimized logic if + * there's a custom formatter. + */ + if (xop->xo_formatter == NULL && flen == 2 + && strncmp("%d", fmt, flen) == 0) { + if (!XOF_ISSET(xop, XOF_NO_VA_ARG)) + width = va_arg(xop->xo_vap, int); + } else if (xop->xo_formatter == NULL && flen == 2 + && strncmp("%u", fmt, flen) == 0) { + if (!XOF_ISSET(xop, XOF_NO_VA_ARG)) + width = va_arg(xop->xo_vap, unsigned); + } else { + /* + * So we have a format and it's not a simple one like + * "{:/%d}". That means we need to format the field, + * extract the value from the formatted output, and then + * discard that output. + */ + int anchor_was_set = FALSE; + xo_buffer_t *xbp = &xop->xo_data; + ssize_t start_offset = xo_buf_offset(xbp); + bp = xo_buf_cur(xbp); /* Save start of the string */ + cp = NULL; + + if (XOIF_ISSET(xop, XOIF_ANCHOR)) { + XOIF_CLEAR(xop, XOIF_ANCHOR); + anchor_was_set = TRUE; + } + + ssize_t rc = xo_do_format_field(xop, xbp, fmt, flen, 0); + if (rc >= 0) { + xo_buf_append(xbp, "", 1); /* Append a NUL */ + + width = strtol(bp, &cp, 0); + if (width == LONG_MIN || width == LONG_MAX + || bp == cp || *cp != '\0') { + width = 0; + xo_failure(xop, "invalid width for anchor: '%s'", bp); + } + } + + /* Reset the cur pointer to where we found it */ + xbp->xb_curp = xbp->xb_bufp + start_offset; + if (anchor_was_set) + XOIF_SET(xop, XOIF_ANCHOR); + } } return width; @@ -5107,9 +5151,6 @@ static void xo_anchor_start (xo_handle_t *xop, xo_field_info_t *xfip, const char *value, ssize_t vlen) { - if (xo_style(xop) != XO_STYLE_TEXT && xo_style(xop) != XO_STYLE_HTML) - return; - if (XOIF_ISSET(xop, XOIF_ANCHOR)) xo_failure(xop, "the anchor already recording is discarded"); @@ -5129,9 +5170,6 @@ static void xo_anchor_stop (xo_handle_t *xop, xo_field_info_t *xfip, const char *value, ssize_t vlen) { - if (xo_style(xop) != XO_STYLE_TEXT && xo_style(xop) != XO_STYLE_HTML) - return; - if (!XOIF_ISSET(xop, XOIF_ANCHOR)) { xo_failure(xop, "no start anchor"); return; Modified: head/contrib/libxo/libxo/xo_attr.3 ============================================================================== --- head/contrib/libxo/libxo/xo_attr.3 Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/libxo/xo_attr.3 Thu Aug 3 15:47:42 2017 (r322019) @@ -58,3 +58,13 @@ already emitted in other form. .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: head/contrib/libxo/libxo/xo_create.3 ============================================================================== --- head/contrib/libxo/libxo/xo_create.3 Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/libxo/xo_create.3 Thu Aug 3 15:47:42 2017 (r322019) @@ -65,3 +65,13 @@ resources associated with the default handle. .Xr xo_emit 3 , .Xr xo_set_options 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: head/contrib/libxo/libxo/xo_emit.3 ============================================================================== --- head/contrib/libxo/libxo/xo_emit.3 Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/libxo/xo_emit.3 Thu Aug 3 15:47:42 2017 (r322019) @@ -102,3 +102,13 @@ then the number of display columns consumed by the out .Xr xo_open_list 3 , .Xr xo_format 5 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: head/contrib/libxo/libxo/xo_emit_err.3 ============================================================================== --- head/contrib/libxo/libxo/xo_emit_err.3 Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/libxo/xo_emit_err.3 Thu Aug 3 15:47:42 2017 (r322019) @@ -70,3 +70,13 @@ parameter. .Xr xo_format 5 , .Xr xo_err 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: head/contrib/libxo/libxo/xo_emit_f.3 ============================================================================== --- head/contrib/libxo/libxo/xo_emit_f.3 Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/libxo/xo_emit_f.3 Thu Aug 3 15:47:42 2017 (r322019) @@ -109,3 +109,13 @@ for details. .Xr xo_open_list 3 , .Xr xo_format 5 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: head/contrib/libxo/libxo/xo_err.3 ============================================================================== --- head/contrib/libxo/libxo/xo_err.3 Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/libxo/xo_err.3 Thu Aug 3 15:47:42 2017 (r322019) @@ -72,3 +72,13 @@ parameter. .Xr xo_emit 3 , .Xr xo_emit_err 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: head/contrib/libxo/libxo/xo_error.3 ============================================================================== --- head/contrib/libxo/libxo/xo_error.3 Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/libxo/xo_error.3 Thu Aug 3 15:47:42 2017 (r322019) @@ -39,3 +39,13 @@ calls. .Xr printf 3 , .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: head/contrib/libxo/libxo/xo_finish.3 ============================================================================== --- head/contrib/libxo/libxo/xo_finish.3 Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/libxo/xo_finish.3 Thu Aug 3 15:47:42 2017 (r322019) @@ -37,3 +37,13 @@ especially for the non-TEXT output styles. .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: head/contrib/libxo/libxo/xo_flush.3 ============================================================================== --- head/contrib/libxo/libxo/xo_flush.3 Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/libxo/xo_flush.3 Thu Aug 3 15:47:42 2017 (r322019) @@ -33,3 +33,13 @@ function is used for this. .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: head/contrib/libxo/libxo/xo_format.5 ============================================================================== --- head/contrib/libxo/libxo/xo_format.5 Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/libxo/xo_format.5 Thu Aug 3 15:47:42 2017 (r322019) @@ -965,3 +965,13 @@ names to make that difference more obvious. .Xr libxo 3 , .Xr xolint 1 , .Xr xo_emit 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: head/contrib/libxo/libxo/xo_message.3 ============================================================================== --- head/contrib/libxo/libxo/xo_message.3 Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/libxo/xo_message.3 Thu Aug 3 15:47:42 2017 (r322019) @@ -66,3 +66,13 @@ and .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: head/contrib/libxo/libxo/xo_no_setlocale.3 ============================================================================== --- head/contrib/libxo/libxo/xo_no_setlocale.3 Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/libxo/xo_no_setlocale.3 Thu Aug 3 15:47:42 2017 (r322019) @@ -41,3 +41,13 @@ function. .Xr xo_open_list 3 , .Xr xo_format 5 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: head/contrib/libxo/libxo/xo_open_container.3 ============================================================================== --- head/contrib/libxo/libxo/xo_open_container.3 Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/libxo/xo_open_container.3 Thu Aug 3 15:47:42 2017 (r322019) @@ -186,3 +186,13 @@ and the name recorded do not match. .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: head/contrib/libxo/libxo/xo_open_list.3 ============================================================================== --- head/contrib/libxo/libxo/xo_open_list.3 Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/libxo/xo_open_list.3 Thu Aug 3 15:47:42 2017 (r322019) @@ -156,3 +156,13 @@ are rendered as multiple leaf elements. .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: head/contrib/libxo/libxo/xo_open_marker.3 ============================================================================== --- head/contrib/libxo/libxo/xo_open_marker.3 Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/libxo/xo_open_marker.3 Thu Aug 3 15:47:42 2017 (r322019) @@ -103,3 +103,13 @@ properly. .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: head/contrib/libxo/libxo/xo_options.7 ============================================================================== --- head/contrib/libxo/libxo/xo_options.7 Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/libxo/xo_options.7 Thu Aug 3 15:47:42 2017 (r322019) @@ -145,3 +145,12 @@ The following are three example invocations of .Sh SEE ALSO .Xr libxo 3 , .Xr xo_format 5 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . Modified: head/contrib/libxo/libxo/xo_parse_args.3 ============================================================================== --- head/contrib/libxo/libxo/xo_parse_args.3 Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/libxo/xo_parse_args.3 Thu Aug 3 15:47:42 2017 (r322019) @@ -150,3 +150,13 @@ must be maintained by the caller. .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: head/contrib/libxo/libxo/xo_set_allocator.3 ============================================================================== --- head/contrib/libxo/libxo/xo_set_allocator.3 Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/libxo/xo_set_allocator.3 Thu Aug 3 15:47:42 2017 (r322019) @@ -52,3 +52,13 @@ functions are used. .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: head/contrib/libxo/libxo/xo_set_flags.3 ============================================================================== --- head/contrib/libxo/libxo/xo_set_flags.3 Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/libxo/xo_set_flags.3 Thu Aug 3 15:47:42 2017 (r322019) @@ -137,3 +137,13 @@ handle. .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: head/contrib/libxo/libxo/xo_set_info.3 ============================================================================== --- head/contrib/libxo/libxo/xo_set_info.3 Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/libxo/xo_set_info.3 Thu Aug 3 15:47:42 2017 (r322019) @@ -100,3 +100,13 @@ and "data-help" attributes: .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: head/contrib/libxo/libxo/xo_set_options.3 ============================================================================== --- head/contrib/libxo/libxo/xo_set_options.3 Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/libxo/xo_set_options.3 Thu Aug 3 15:47:42 2017 (r322019) @@ -29,3 +29,13 @@ The options are identical to those listed in .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: head/contrib/libxo/libxo/xo_set_style.3 ============================================================================== --- head/contrib/libxo/libxo/xo_set_style.3 Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/libxo/xo_set_style.3 Thu Aug 3 15:47:42 2017 (r322019) @@ -51,3 +51,13 @@ The name can be any of the styles: "text", "xml", "jso .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: head/contrib/libxo/libxo/xo_set_syslog_enterprise_id.3 ============================================================================== --- head/contrib/libxo/libxo/xo_set_syslog_enterprise_id.3 Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/libxo/xo_set_syslog_enterprise_id.3 Thu Aug 3 15:47:42 2017 (r322019) @@ -34,3 +34,13 @@ https://www.iana.org/assignments/enterprise-numbers/en .Sh SEE ALSO .Xr xo_syslog 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: head/contrib/libxo/libxo/xo_set_version.3 ============================================================================== --- head/contrib/libxo/libxo/xo_set_version.3 Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/libxo/xo_set_version.3 Thu Aug 3 15:47:42 2017 (r322019) @@ -32,3 +32,13 @@ is in use. .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: head/contrib/libxo/libxo/xo_set_writer.3 ============================================================================== --- head/contrib/libxo/libxo/xo_set_writer.3 Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/libxo/xo_set_writer.3 Thu Aug 3 15:47:42 2017 (r322019) @@ -54,3 +54,13 @@ flush any pending data associated with the opaque poin .Sh SEE ALSO .Xr xo_emit 3 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: head/contrib/libxo/libxo/xo_syslog.3 ============================================================================== --- head/contrib/libxo/libxo/xo_syslog.3 Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/libxo/xo_syslog.3 Thu Aug 3 15:47:42 2017 (r322019) @@ -77,3 +77,13 @@ function names. .Xr xo_set_syslog_enterprise_id 3 , .Xr xo_format 5 , .Xr libxo 3 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: head/contrib/libxo/tests/core/saved/test_01.E.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_01.E.out Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/tests/core/saved/test_01.E.out Thu Aug 3 15:47:42 2017 (r322019) @@ -1,5 +1,11 @@ op create: [] [] [0] op open_container: [top] [] [0x810] +op content: [address] [0x0] [0] +op content: [port] [1] [0] +op content: [address] [0x0] [0] +op content: [port] [1] [0] +op content: [address] [0x0] [0] +op content: [port] [1] [0] op content: [used-percent] [12] [0] op content: [kve_start] [0xdeadbeef] [0x8] op content: [kve_end] [0xcabb1e] [0x8] Modified: head/contrib/libxo/tests/core/saved/test_01.H.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_01.H.out Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/tests/core/saved/test_01.H.out Thu Aug 3 15:47:42 2017 (r322019) @@ -1,2 +1,2 @@ -
df
12
%
testing argument modifier
my-box
.
example.com
...
testing argument modifier with encoding to
.
example.com
...
Label text
value
very
42
42 +
anchor
0x0
..
1
anchor
0x0
..
1
anchor
0x0
..
1
df
12
%
testing argument modifier
my-box
.
example.com
...
testing argument modifier with encoding to
.
example.com
...
Label text
value
very
42
42
Connecting to
my-box
.
example.com
...
Item
Total Sold
In Stock
On Order
SKU
gum
1412
54
10
GRO-000-415
rope
85
4
2
HRD-000-212
ladder
0
2
1
HRD-000-517
bolt
4123
144
42
HRD-000-632
water
17
14
2
GRO-000-2331
Item
'
gum
':
Total sold
:
1412.0
In stock
:
54
On order
:
10
SKU
:
GRO-000-415
Item
'
rope
':
Total sold
:
85.0
In stock
:
4
On order
:
2
SKU
:
HRD-000-212
Item
'
ladder
':
Total sold
! :
0
In stock
:
2
On order
:
1
SKU
:
HRD-000-517
Item
'
bolt
':
Total sold
:
4123.0
In s tock
:
144
On order
:
42
SKU
:
HRD-000-632
Item
'
water
':
Total sold
:
17.0
In stock
:
14
On order
:
2
SKU
:
GRO-000-2331
Item
'
fish
':
Total sold
:
1321.0
In stock
:
45
On order
:
1
SKU
:
GRO-000-533
Item
:
gum
Item
:
rope
Item
:
ladder
Item
:
bolt
Item
:
water
X
X
X
X
X
X
X
X
X
X
Cost
:
425
X
X
Cost
:
455
links
user
group
3
this
/some/file
1
user
group
\ No newline at end of file Modified: head/contrib/libxo/tests/core/saved/test_01.HIPx.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_01.HIPx.out Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/tests/core/saved/test_01.HIPx.out Thu Aug 3 15:47:42 2017 (r322019) @@ -1,4 +1,25 @@
+
anchor
+
+
0x0
+
..
+
1
+
+
+
anchor
+
+
0x0
+
..
+
1
+
+
+
anchor
+
+
0x0
+
..
+
1
+
+
df
12
%
Modified: head/contrib/libxo/tests/core/saved/test_01.HP.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_01.HP.out Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/tests/core/saved/test_01.HP.out Thu Aug 3 15:47:42 2017 (r322019) @@ -1,4 +1,25 @@
+
anchor
+
+
0x0
+
..
+
1
+
+
+
anchor
+
+
0x0
+
..
+
1
+
+
+
anchor
+
+
0x0
+
..
+
1
+
+
df
12
%
Modified: head/contrib/libxo/tests/core/saved/test_01.J.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_01.J.out Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/tests/core/saved/test_01.J.out Thu Aug 3 15:47:42 2017 (r322019) @@ -1,2 +1,2 @@ -{"top": {"used-percent":12,"kve_start":"0xdeadbeef","kve_end":"0xcabb1e","host":"my-box","domain":"example.com","host":"my-box","domain":"example.com","label":"value","max-chaos":"very","min-chaos":42,"some-chaos":"[42]","host":"my-box","domain":"example.com", "data": {"item": [{"sku":"GRO-000-415","name":"gum","sold":1412,"in-stock":54,"on-order":10}, {"sku":"HRD-000-212","name":"rope","sold":85,"in-stock":4,"on-order":2}, {"sku":"HRD-000-517","name":"ladder","sold":0,"in-stock":2,"on-order":1}, {"sku":"HRD-000-632","name":"bolt","sold":4123,"in-stock":144,"on-order":42}, {"sku":"GRO-000-2331","name":"water","sold":17,"in-stock":14,"on-order":2}]}, "data2": {"item": [{"sku":"GRO-000-415","name":"gum","sold":1412.0,"in-stock":54,"on-order":10}, {"sku":"HRD-000-212","name":"rope","sold":85.0,"in-stock":4,"on-order":2}, {"sku":"HRD-000-517","name":"ladder","sold":0,"in-stock":2,"on-order":1}, {"sku":"HRD-000-632","name":"bolt","sold":4123.0,"in-stock":144,"on-order":42}, {"sku":"GRO-0 00-2331","name":"water","sold":17.0,"in-stock":14,"on-order":2}]}, "data3": {"item": [{"sku":"GRO-000-533","name":"fish","sold":1321.0,"in-stock":45,"on-order":1}]}, "data4": {"item": ["gum","rope","ladder","bolt","water"]},"cost":425,"cost":455,"mode":"mode","mode_octal":"octal","links":"links","user":"user","group":"group","pre":"that","links":3,"post":"this","mode":"/some/file","mode_octal":640,"links":1,"user":"user","group":"group"} +{"top": {"address":"0x0","port":1,"address":"0x0","port":1,"address":"0x0","port":1,"used-percent":12,"kve_start":"0xdeadbeef","kve_end":"0xcabb1e","host":"my-box","domain":"example.com","host":"my-box","domain":"example.com","label":"value","max-chaos":"very","min-chaos":42,"some-chaos":"[42]","host":"my-box","domain":"example.com", "data": {"item": [{"sku":"GRO-000-415","name":"gum","sold":1412,"in-stock":54,"on-order":10}, {"sku":"HRD-000-212","name":"rope","sold":85,"in-stock":4,"on-order":2}, {"sku":"HRD-000-517","name":"ladder","sold":0,"in-stock":2,"on-order":1}, {"sku":"HRD-000-632","name":"bolt","sold":4123,"in-stock":144,"on-order":42}, {"sku":"GRO-000-2331","name":"water","sold":17,"in-stock":14,"on-order":2}]}, "data2": {"item": [{"sku":"GRO-000-415","name":"gum","sold":1412.0,"in-stock":54,"on-order":10}, {"sku":"HRD-000-212","name":"rope","sold":85.0,"in-stock":4,"on-order":2}, {"sku":"HRD-000-517","name":"ladder","sold":0,"in-stock":2,"on-order":1}, {"sku":"HRD-000-63 2","name":"bolt","sold":4123.0,"in-stock":144,"on-order":42}, {"sku":"GRO-000-2331","name":"water","sold":17.0,"in-stock":14,"on-order":2}]}, "data3": {"item": [{"sku":"GRO-000-533","name":"fish","sold":1321.0,"in-stock":45,"on-order":1}]}, "data4": {"item": ["gum","rope","ladder","bolt","water"]},"cost":425,"cost":455,"mode":"mode","mode_octal":"octal","links":"links","user":"user","group":"group","pre":"that","links":3,"post":"this","mode":"/some/file","mode_octal":640,"links":1,"user":"user","group":"group"} } Modified: head/contrib/libxo/tests/core/saved/test_01.JP.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_01.JP.out Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/tests/core/saved/test_01.JP.out Thu Aug 3 15:47:42 2017 (r322019) @@ -1,5 +1,11 @@ { "top": { + "address": "0x0", + "port": 1, + "address": "0x0", + "port": 1, + "address": "0x0", + "port": 1, "used-percent": 12, "kve_start": "0xdeadbeef", "kve_end": "0xcabb1e", Modified: head/contrib/libxo/tests/core/saved/test_01.T.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_01.T.out Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/tests/core/saved/test_01.T.out Thu Aug 3 15:47:42 2017 (r322019) @@ -1,3 +1,6 @@ +anchor 0x0..1 +anchor 0x0..1 +anchor 0x0..1 df 12% testing argument modifier my-box.example.com... testing argument modifier with encoding to .example.com... Modified: head/contrib/libxo/tests/core/saved/test_01.X.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_01.X.out Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/tests/core/saved/test_01.X.out Thu Aug 3 15:47:42 2017 (r322019) @@ -1 +1 @@ -120xdeadbeef0xcabb1emy-boxexample.commy-boxexample.comvery42[42]my-boxexample.comGRO-000-415gum14125410HRD-000-212rope8542HRD-000-517ladder021HRD-000-632bolt412314442GRO-000-2331water17142GRO-000-415gum1412.05410HRD-000-212rope85.042HRD-000-517ladder021HRD-000-632bolt4123.014442GRO-000-2331water17.0142GRO-000-533fish1321.0451gum< /item>ropeladderboltwater425455modeoctallinksusergroup
that
3this/some/file6401usergroup
\ No newline at end of file +
0x0
1
0x0
1
0x0
1120xdeadbeef0xcabb1emy-boxexample.commy-boxexample.comvery42[42]my-boxexample.comGRO-000-415gum14125410HRD-000-212rope8542HRD-000-517ladder021HRD-000-632bolt412314442GRO-000-2331water17142GRO-000-415gum1412.05410HRD-000-212rope85.042HRD-000-517ladder021HRD-000-632bolt4123.014442GRO-000-2331water17.0142GRO-000-533fish1321.0451gumropeladderboltwater425455modeoctallinksusergroup
that
3this/some/file6401usergroup
\ No newline at end of file Modified: head/contrib/libxo/tests/core/saved/test_01.XP.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_01.XP.out Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/tests/core/saved/test_01.XP.out Thu Aug 3 15:47:42 2017 (r322019) @@ -1,4 +1,10 @@ +
0x0
+ 1 +
0x0
+ 1 +
0x0
+ 1 12 0xdeadbeef 0xcabb1e Modified: head/contrib/libxo/tests/core/saved/test_02.E.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_02.E.out Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/tests/core/saved/test_02.E.out Thu Aug 3 15:47:42 2017 (r322019) @@ -34,7 +34,7 @@ op content: [unknown] [1010] [0] op content: [unknown] [1010] [0] op content: [min] [15] [0x20] op content: [cur] [20] [0x20] -op content: [max] [30] [0] +op content: [max] [125] [0] op content: [min] [15] [0] op content: [cur] [20] [0] op content: [max] [125] [0] Modified: head/contrib/libxo/tests/core/saved/test_02.J.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_02.J.out Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/tests/core/saved/test_02.J.out Thu Aug 3 15:47:42 2017 (r322019) @@ -1,2 +1,2 @@ -{"top": {"data": {"what":"braces","length":"abcdef","fd":-1,"error":"Bad file descriptor","test":"good","fd":-1,"error":"Bad fi","test":"good","lines":20,"words":30,"characters":40, "bytes": [0,1,2,3,4],"mbuf-current":10,"mbuf-cache":20,"mbuf-total":30,"distance":50,"location":"Boston","memory":64,"total":640,"memory":64,"total":640,"ten":10,"eleven":11,"unknown":1010,"unknown":1010,"min":15,"cur":20,"max":30,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"val1":21,"val2":58368,"val3":100663296,"val4":44470272,"val5":1342172800, "flag": ["one","two","three"],"works":null,"empty-tag":true,"t1":"1000","t2":"test5000","t3":"ten-longx","t4":"xtest", "__error": {"message":"this is an error"}, "__error": {"message":"two more errors"}, "__warning": {"message":"this is an warning"}, "__warning": {"message":"two more warnings"},"count":10,"test":4, "error": {"message":"Shut 'er down, Clancey! She's a-pumpin' mud! <>!,\"!<>\n"}}} +{"top": {"data": {"what":"braces","length":"abcdef","fd":-1,"error":"Bad file descriptor","test":"good","fd":-1,"error":"Bad fi","test":"good","lines":20,"words":30,"characters":40, "bytes": [0,1,2,3,4],"mbuf-current":10,"mbuf-cache":20,"mbuf-total":30,"distance":50,"location":"Boston","memory":64,"total":640,"memory":64,"total":640,"ten":10,"eleven":11,"unknown":1010,"unknown":1010,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"min":15,"cur":20,"max":125,"val1":21,"val2":58368,"val3":100663296,"val4":44470272,"val5":1342172800, "flag": ["one","two","three"],"works":null,"empty-tag":true,"t1":"1000","t2":"test5000","t3":"ten-longx","t4":"xtest", "__error": {"message":"this is an error"}, "__error": {"message":"two more errors"}, "__warning": {"message":"this is an warning"}, "__warning": {"message":"two more warnings"},"count":10,"test":4, "error": {"message":"Shut 'er down, Clancey! She's a-pumpin' mud! <>!,\"!<>\n"}}} } Modified: head/contrib/libxo/tests/core/saved/test_02.JP.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_02.JP.out Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/tests/core/saved/test_02.JP.out Thu Aug 3 15:47:42 2017 (r322019) @@ -34,7 +34,7 @@ "unknown": 1010, "min": 15, "cur": 20, - "max": 30, + "max": 125, "min": 15, "cur": 20, "max": 125, Modified: head/contrib/libxo/tests/core/saved/test_02.X.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_02.X.out Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/tests/core/saved/test_02.X.out Thu Aug 3 15:47:42 2017 (r322019) @@ -2,6 +2,6 @@ abcdef: Bad file descriptor improper use of profanity; ten yard penalty; first down abcdef-1Bad file descriptorgood-1Bad figoodimproper use of profanity; ten yard penalty; first down -2030400123410203050Boston64640646401011101010101520301520125152012515201252158368100663296444702721342172800onetwothreenull1000test5000ten-longxxtest<__error>this is an error<__error>two more err ors<__warning>this is an warning<__warning>two more warnings104improper use of profanity; ten yard penalty; first down +2030400123410203050Boston646406464010111010101015201251520125152012515201252158368100663296444702721342172800onetwothreenull1000test5000ten-longxxtest<__error>this is an error<__error>two more er rors<__warning>this is an warning<__warning>two more warnings104improper use of profanity; ten yard penalty; first down Shut 'er down, Clancey! She's a-pumpin' mud! <>!,"!<>
\ No newline at end of file Modified: head/contrib/libxo/tests/core/saved/test_02.XP.out ============================================================================== --- head/contrib/libxo/tests/core/saved/test_02.XP.out Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/tests/core/saved/test_02.XP.out Thu Aug 3 15:47:42 2017 (r322019) @@ -39,7 +39,7 @@ 1010 15 20 - 30 + 125 15 20 125 Modified: head/contrib/libxo/tests/core/test_01.c ============================================================================== --- head/contrib/libxo/tests/core/test_01.c Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/tests/core/test_01.c Thu Aug 3 15:47:42 2017 (r322019) @@ -80,6 +80,10 @@ main (int argc, char **argv) xo_open_container_h(NULL, "top"); + xo_emit("anchor {[:/%d}{:address/%p}..{:port/%u}{]:}\n", 18, NULL, 1); + xo_emit("anchor {[:18}{:address/%p}..{:port/%u}{]:}\n", NULL, 1); + xo_emit("anchor {[:/18}{:address/%p}..{:port/%u}{]:}\n", NULL, 1); + xo_emit("df {:used-percent/%5.0f}{U:%%}\n", (double) 12); xo_emit("{e:kve_start/%#jx}", (uintmax_t) 0xdeadbeef); Modified: head/contrib/libxo/tests/xo/saved/xo_01.H.out ============================================================================== --- head/contrib/libxo/tests/xo/saved/xo_01.H.out Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/tests/xo/saved/xo_01.H.out Thu Aug 3 15:47:42 2017 (r322019) @@ -1 +1 @@ -
Item
one
is
number
001
,
color
:
red
Item
two
is
number
002
,
color
:
blue
Item
three
is
number
003
< div class="text">,
color
:
green
Item
four
is
number
004
,
color
:
yellow
\ No newline at end of file +
Item
one
is
number
001
,
color
:
red
Item
two
is
number
002
,
color
:
blue
Item
three
is
number
003
< div class="text">,
color
:
green
Item
four
is
number
004
,
color
:
yellow
0xdeadbeef
..
1
0xdeadbeef
..
1
0xde adbeef
..
1
0xdeadbeef
..
1
\ No newline at end of file Modified: head/contrib/libxo/tests/xo/saved/xo_01.HIPx.out ============================================================================== --- head/contrib/libxo/tests/xo/saved/xo_01.HIPx.out Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/tests/xo/saved/xo_01.HIPx.out Thu Aug 3 15:47:42 2017 (r322019) @@ -50,3 +50,27 @@
yellow
+
+
+
0xdeadbeef
+
..
+
1
+
+
+
+
0xdeadbeef
+
..
+
1
+
+
+
+
0xdeadbeef
+
..
+
1
+
+
+
+
0xdeadbeef
+
..
+
1
+
Modified: head/contrib/libxo/tests/xo/saved/xo_01.HP.out ============================================================================== --- head/contrib/libxo/tests/xo/saved/xo_01.HP.out Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/tests/xo/saved/xo_01.HP.out Thu Aug 3 15:47:42 2017 (r322019) @@ -50,3 +50,27 @@
yellow
+
+
+
0xdeadbeef
+
..
+
1
+
+
+
+
0xdeadbeef
+
..
+
1
+
+
+
+
0xdeadbeef
+
..
+
1
+
+
+
+
0xdeadbeef
+
..
+
1
+
Modified: head/contrib/libxo/tests/xo/saved/xo_01.J.out ============================================================================== --- head/contrib/libxo/tests/xo/saved/xo_01.J.out Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/tests/xo/saved/xo_01.J.out Thu Aug 3 15:47:42 2017 (r322019) @@ -1 +1 @@ -"top": {"item": {"name":"one","value":1,"color":"red"}, "item": {"name":"two","value":2,"color":"blue"}, "item": {"name":"three","value":3,"color":"green"}, "item": {"name":"four","value":4,"color":"yellow"}} +"top": {"item": {"name":"one","value":1,"color":"red"}, "item": {"name":"two","value":2,"color":"blue"}, "item": {"name":"three","value":3,"color":"green"}, "item": {"name":"four","value":4,"color":"yellow"}, "anchor": {"address":"0xdeadbeef","foo":1}, "anchor": {"address":"0xdeadbeef","foo":1}, "anchor": {"address":"0xdeadbeef","foo":1}, "anchor": {"address":"0xdeadbeef","foo":1}} Modified: head/contrib/libxo/tests/xo/saved/xo_01.JP.out ============================================================================== --- head/contrib/libxo/tests/xo/saved/xo_01.JP.out Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/tests/xo/saved/xo_01.JP.out Thu Aug 3 15:47:42 2017 (r322019) @@ -18,5 +18,21 @@ "name": "four", "value": 4, "color": "yellow" + }, + "anchor": { + "address": "0xdeadbeef", + "foo": 1 + }, + "anchor": { + "address": "0xdeadbeef", + "foo": 1 + }, + "anchor": { + "address": "0xdeadbeef", + "foo": 1 + }, + "anchor": { + "address": "0xdeadbeef", + "foo": 1 } } Modified: head/contrib/libxo/tests/xo/saved/xo_01.T.out ============================================================================== --- head/contrib/libxo/tests/xo/saved/xo_01.T.out Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/tests/xo/saved/xo_01.T.out Thu Aug 3 15:47:42 2017 (r322019) @@ -2,3 +2,7 @@ Item one is number 001, color: red Item two is number 002, color: blue Item three is number 003, color: green Item four is number 004, color: yellow + 0xdeadbeef..1 + 0xdeadbeef..1 + 0xdeadbeef..1 + 0xdeadbeef..1 Modified: head/contrib/libxo/tests/xo/saved/xo_01.X.out ============================================================================== --- head/contrib/libxo/tests/xo/saved/xo_01.X.out Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/tests/xo/saved/xo_01.X.out Thu Aug 3 15:47:42 2017 (r322019) @@ -1 +1 @@ -one1redtwo2bluethree3greenfour4yellow \ No newline at end of file +one1redtwo2bluethree3greenfour4yellow
0xdeadbeef
1
0xdeadbeef
1
0xdeadbeef
1
0xdeadbeef
1
\ No newline at end of file Modified: head/contrib/libxo/tests/xo/saved/xo_01.XP.out ============================================================================== --- head/contrib/libxo/tests/xo/saved/xo_01.XP.out Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/tests/xo/saved/xo_01.XP.out Thu Aug 3 15:47:42 2017 (r322019) @@ -19,4 +19,20 @@ 4 yellow + +
0xdeadbeef
+ 1 +
+ +
0xdeadbeef
+ 1 +
+ +
0xdeadbeef
+ 1 +
+ +
0xdeadbeef
+ 1 +
Modified: head/contrib/libxo/tests/xo/xo_01.sh ============================================================================== --- head/contrib/libxo/tests/xo/xo_01.sh Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/tests/xo/xo_01.sh Thu Aug 3 15:47:42 2017 (r322019) @@ -24,4 +24,10 @@ for i in one:1:red two:2:blue three:3:green four:4:yel NF=--not-first done -${XO} --close top \ No newline at end of file +XOAN="${XO} --wrap anchor --not-first --warn --depth 1" +${XOAN} "{[:18}{:address/%p}..{:foo/%u}{]:}\n" 0xdeadbeef 1 +${XOAN} "{[:/18}{:address/%p}..{:foo/%u}{]:}\n" 0xdeadbeef 1 +${XOAN} "{[:/%d}{:address/%p}..{:foo/%u}{]:}\n" 18 0xdeadbeef 1 +${XOAN} "{[:/%s}{:address/%p}..{:foo/%u}{]:}\n" 18 0xdeadbeef 1 + +${XO} --close top Modified: head/contrib/libxo/xo/xo.1 ============================================================================== --- head/contrib/libxo/xo/xo.1 Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/xo/xo.1 Thu Aug 3 15:47:42 2017 (r322019) @@ -188,3 +188,13 @@ prepend data to the XPath values used for HTML output .Xr libxo 3 , .Xr xo_emit 3 , .Xr xo_options 7 +.Sh HISTORY +The +.Nm libxo +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +.Nm libxo +was written by +.An Phil Shafer Aq Mt phil@freebsd.org . + Modified: head/contrib/libxo/xohtml/xohtml.1 ============================================================================== --- head/contrib/libxo/xohtml/xohtml.1 Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/xohtml/xohtml.1 Thu Aug 3 15:47:42 2017 (r322019) @@ -19,7 +19,8 @@ .Op Fl "b " .Op Fl "c" " .Op Fl "f" -.Op Ar command argument... +.Op Fl "w" +.Op Ar command [argument ...] .Sh DESCRIPTION .Nm is a tool for preparing @@ -69,6 +70,12 @@ command is used directly. .It Ic -f Ar file | Ic --file Ar file Output is saved to the given file, rather than to the standard output descriptor. +.It Ic -w | --web +Uses the official +.Nm libxo +website URL as the source path for the CSS and Javascript files +referenced in the output of +.Nm xohtml . .El .Pp .Sh EXAMPLES Modified: head/contrib/libxo/xohtml/xohtml.sh.in ============================================================================== --- head/contrib/libxo/xohtml/xohtml.sh.in Thu Aug 3 15:43:29 2017 (r322018) +++ head/contrib/libxo/xohtml/xohtml.sh.in Thu Aug 3 15:47:42 2017 (r322019) @@ -10,8 +10,10 @@ # BASE=@XO_SHAREDIR@ +VERSION=@LIBXO_VERSION@ CMD=cat DONE= +WEB=http://juniper.github.io/libxo/${VERSION}/xohtml do_help () { echo "xohtml: wrap libxo-enabled output in HTML" @@ -41,6 +43,11 @@ while [ -z "$DONE" -a ! -z "$1" ]; do shift; exec > "$FILE"; ;; + -w|--web) + shift; + BASE="${WEB}"; + ;; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Aug 3 17:53:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F3C2DCAE14; Thu, 3 Aug 2017 17:53:15 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D6BF64985; Thu, 3 Aug 2017 17:53:15 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v73HrEwt058857; Thu, 3 Aug 2017 17:53:14 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73HrEKJ058856; Thu, 3 Aug 2017 17:53:14 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201708031753.v73HrEKJ058856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 3 Aug 2017 17:53:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322023 - head/lib/libxo/tests X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/lib/libxo/tests X-SVN-Commit-Revision: 322023 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 17:53:15 -0000 Author: ngie Date: Thu Aug 3 17:53:14 2017 New Revision: 322023 URL: https://svnweb.freebsd.org/changeset/base/322023 Log: Remove special-case logic for running tests on host machines I'm not sure what process sjg@ was using, but using CHECKDIR=${.OBJDIR} with "make check" on ^/head is the correct thing to do. This unbreaks "make check" for me (unsandboxed, not using CHECKDIR=${.OBJDIR}). While here, fix a whitespace nit with LIBADD. MFC after: 1 week Modified: head/lib/libxo/tests/Makefile Modified: head/lib/libxo/tests/Makefile ============================================================================== --- head/lib/libxo/tests/Makefile Thu Aug 3 17:43:26 2017 (r322022) +++ head/lib/libxo/tests/Makefile Thu Aug 3 17:53:14 2017 (r322023) @@ -242,13 +242,8 @@ PROGS+= test_11 CFLAGS+= -I${LIBXOSRC}/libxo -I${.CURDIR:H} -LIBADD= xo util +LIBADD= xo util SUBDIR+= encoder - -.if ${MACHINE} == "host" -# make it easy to test without install -TESTSDIR= ${.OBJDIR} -.endif .include From owner-svn-src-all@freebsd.org Thu Aug 3 18:43:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE4ABDCD270; Thu, 3 Aug 2017 18:43:55 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 996DA6651C; Thu, 3 Aug 2017 18:43:55 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v73IhsrU079447; Thu, 3 Aug 2017 18:43:54 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73Ihsc0079446; Thu, 3 Aug 2017 18:43:54 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201708031843.v73Ihsc0079446@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 3 Aug 2017 18:43:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322025 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 322025 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 18:43:55 -0000 Author: ian Date: Thu Aug 3 18:43:54 2017 New Revision: 322025 URL: https://svnweb.freebsd.org/changeset/base/322025 Log: Switch to iicdev_readfrom/writeto() to do xfers with proper bus ownership. Tested by: manu@ Modified: head/sys/arm/allwinner/axp209.c Modified: head/sys/arm/allwinner/axp209.c ============================================================================== --- head/sys/arm/allwinner/axp209.c Thu Aug 3 18:07:01 2017 (r322024) +++ head/sys/arm/allwinner/axp209.c Thu Aug 3 18:43:54 2017 (r322025) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -59,7 +58,6 @@ __FBSDID("$FreeBSD$"); #include -#include "iicbus_if.h" #include "gpio_if.h" #include "regdev_if.h" @@ -602,7 +600,6 @@ enum AXP2XX_TYPE { struct axp2xx_softc { device_t dev; - uint32_t addr; struct resource * res[1]; void * intrcookie; struct intr_config_hook intr_hook; @@ -641,57 +638,15 @@ static struct resource_spec axp_res_spec[] = { static int axp2xx_read(device_t dev, uint8_t reg, uint8_t *data, uint8_t size) { - struct axp2xx_softc *sc = device_get_softc(dev); - struct iic_msg msg[2]; - msg[0].slave = sc->addr; - msg[0].flags = IIC_M_WR; - msg[0].len = 1; - msg[0].buf = ® - - msg[1].slave = sc->addr; - msg[1].flags = IIC_M_RD; - msg[1].len = size; - msg[1].buf = data; - - return (iicbus_transfer(dev, msg, 2)); + return (iicdev_readfrom(dev, reg, data, size, IIC_INTRWAIT)); } static int axp2xx_write(device_t dev, uint8_t reg, uint8_t data) { - uint8_t buffer[2]; - struct axp2xx_softc *sc = device_get_softc(dev); - struct iic_msg msg[2]; - int nmsgs = 0; - if (sc->type == AXP209) { - buffer[0] = reg; - buffer[1] = data; - - msg[0].slave = sc->addr; - msg[0].flags = IIC_M_WR; - msg[0].len = 2; - msg[0].buf = buffer; - - nmsgs = 1; - } - else if (sc->type == AXP221) { - msg[0].slave = sc->addr; - msg[0].flags = IIC_M_WR; - msg[0].len = 1; - msg[0].buf = ® - - msg[1].slave = sc->addr; - msg[1].flags = IIC_M_WR; - msg[1].len = 1; - msg[1].buf = &data; - nmsgs = 2; - } - else - return (EINVAL); - - return (iicbus_transfer(dev, msg, nmsgs)); + return (iicdev_writeto(dev, reg, &data, sizeof(data), IIC_INTRWAIT)); } static int @@ -1239,7 +1194,6 @@ axp2xx_start(void *pdev) dev = pdev; sc = device_get_softc(dev); - sc->addr = iicbus_get_addr(dev); sc->dev = dev; if (bootverbose) { @@ -1451,4 +1405,4 @@ EARLY_DRIVER_MODULE(ofw_gpiobus, axp2xx_pmu, ofw_gpiob DRIVER_MODULE(gpioc, axp2xx_pmu, gpioc_driver, gpioc_devclass, 0, 0); MODULE_VERSION(axp2xx, 1); -MODULE_DEPEND(axp2xx, iicbus, 1, 1, 1); +MODULE_DEPEND(axp2xx, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER); From owner-svn-src-all@freebsd.org Thu Aug 3 18:49:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69D41DCD863; Thu, 3 Aug 2017 18:49:16 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 38C1C669E0; Thu, 3 Aug 2017 18:49:16 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v73InF3g079677; Thu, 3 Aug 2017 18:49:15 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73InFc9079676; Thu, 3 Aug 2017 18:49:15 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201708031849.v73InFc9079676@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 3 Aug 2017 18:49:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322026 - head/sys/modules/i2c/nxprtc X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/modules/i2c/nxprtc X-SVN-Commit-Revision: 322026 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 18:49:16 -0000 Author: ian Date: Thu Aug 3 18:49:15 2017 New Revision: 322026 URL: https://svnweb.freebsd.org/changeset/base/322026 Log: Add missing header file to SRCS. Reported by: manu@ Modified: head/sys/modules/i2c/nxprtc/Makefile Modified: head/sys/modules/i2c/nxprtc/Makefile ============================================================================== --- head/sys/modules/i2c/nxprtc/Makefile Thu Aug 3 18:43:54 2017 (r322025) +++ head/sys/modules/i2c/nxprtc/Makefile Thu Aug 3 18:49:15 2017 (r322026) @@ -2,6 +2,6 @@ .PATH: ${SRCTOP}/sys/dev/iicbus KMOD = nxprtc -SRCS = nxprtc.c bus_if.h clock_if.h device_if.h iicbus_if.h +SRCS = nxprtc.c bus_if.h clock_if.h device_if.h iicbus_if.h ofw_bus_if.h .include From owner-svn-src-all@freebsd.org Thu Aug 3 19:01:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DF9DDCE311; Thu, 3 Aug 2017 19:01:47 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D264672EB; Thu, 3 Aug 2017 19:01:47 +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 v73J1k6K087530; Thu, 3 Aug 2017 19:01:46 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73J1ke9087529; Thu, 3 Aug 2017 19:01:46 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201708031901.v73J1ke9087529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 3 Aug 2017 19:01:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322027 - head/sys/arm/conf X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/conf X-SVN-Commit-Revision: 322027 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 19:01:47 -0000 Author: manu Date: Thu Aug 3 19:01:46 2017 New Revision: 322027 URL: https://svnweb.freebsd.org/changeset/base/322027 Log: arm: Add a GENERIC-NODEBUG kernel config Like amd64 or arm64 provide a GENERIC-NODEBUG configuration file that remove WITNESS and INVARIANTS etc ... Added: head/sys/arm/conf/GENERIC-NODEBUG (contents, props changed) Added: head/sys/arm/conf/GENERIC-NODEBUG ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/GENERIC-NODEBUG Thu Aug 3 19:01:46 2017 (r322027) @@ -0,0 +1,40 @@ +# +# GENERIC-NODEBUG -- WITNESS and INVARIANTS free kernel configuration file +# for FreeBSD/arm +# +# 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 GENERIC. +# 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: +# +# http://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 (http://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 GENERIC + +ident GENERIC-NODEBUG + +nooptions INVARIANTS +nooptions INVARIANT_SUPPORT +nooptions WITNESS +nooptions WITNESS_SKIPSPIN +nooptions BUF_TRACKING +nooptions DEADLKRES +nooptions FULL_BUF_TRACKING + From owner-svn-src-all@freebsd.org Thu Aug 3 21:14:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E181FDD3A59; Thu, 3 Aug 2017 21:14:47 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A23606B5BF; Thu, 3 Aug 2017 21:14:47 +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 v73LEkib041275; Thu, 3 Aug 2017 21:14:46 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73LEkr8041273; Thu, 3 Aug 2017 21:14:46 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201708032114.v73LEkr8041273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 3 Aug 2017 21:14:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322028 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 322028 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 21:14:48 -0000 Author: markj Date: Thu Aug 3 21:14:46 2017 New Revision: 322028 URL: https://svnweb.freebsd.org/changeset/base/322028 Log: Add subsystem vendor and device ID fields to struct pci_dev. MFC after: 1 week Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h head/sys/compat/linuxkpi/common/src/linux_pci.c Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/pci.h Thu Aug 3 19:01:46 2017 (r322027) +++ head/sys/compat/linuxkpi/common/include/linux/pci.h Thu Aug 3 21:14:46 2017 (r322028) @@ -202,6 +202,8 @@ struct pci_dev { uint64_t dma_mask; uint16_t device; uint16_t vendor; + uint16_t subsystem_vendor; + uint16_t subsystem_device; unsigned int irq; unsigned int devfn; uint32_t class; Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_pci.c Thu Aug 3 19:01:46 2017 (r322027) +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Thu Aug 3 21:14:46 2017 (r322028) @@ -119,10 +119,13 @@ linux_pci_attach(device_t dev) { struct resource_list_entry *rle; struct pci_dev *pdev; + struct pci_devinfo *dinfo; struct pci_driver *pdrv; const struct pci_device_id *id; int error; + dinfo = device_get_ivars(dev); + linux_set_current(curthread); pdrv = linux_pci_find(dev, &id); pdev = device_get_softc(dev); @@ -132,6 +135,8 @@ linux_pci_attach(device_t dev) pdev->devfn = PCI_DEVFN(pci_get_slot(dev), pci_get_function(dev)); pdev->device = id->device; pdev->vendor = id->vendor; + pdev->subsystem_vendor = dinfo->cfg.subvendor; + pdev->subsystem_device = dinfo->cfg.subdevice; pdev->class = pci_get_class(dev); pdev->revision = pci_get_revid(dev); pdev->dev.dma_mask = &pdev->dma_mask; From owner-svn-src-all@freebsd.org Thu Aug 3 21:30:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2875DD4334; Thu, 3 Aug 2017 21:30:13 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8011A6BC27; Thu, 3 Aug 2017 21:30:13 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v73LUCfx045640; Thu, 3 Aug 2017 21:30:12 GMT (envelope-from jlh@FreeBSD.org) Received: (from jlh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73LUC2H045637; Thu, 3 Aug 2017 21:30:12 GMT (envelope-from jlh@FreeBSD.org) Message-Id: <201708032130.v73LUC2H045637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jlh set sender to jlh@FreeBSD.org using -f From: Jeremie Le Hen Date: Thu, 3 Aug 2017 21:30:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322029 - in head: usr.bin usr.sbin X-SVN-Group: head X-SVN-Commit-Author: jlh X-SVN-Commit-Paths: in head: usr.bin usr.sbin X-SVN-Commit-Revision: 322029 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 21:30:13 -0000 Author: jlh Date: Thu Aug 3 21:30:12 2017 New Revision: 322029 URL: https://svnweb.freebsd.org/changeset/base/322029 Log: rwho/ruptime/rwhod shouldn't be gated by RCMDS. PR: 220953 Reported by: peter@ Differential Revision: https://reviews.freebsd.org/D11743 Modified: head/usr.bin/Makefile head/usr.sbin/Makefile Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Thu Aug 3 21:14:46 2017 (r322028) +++ head/usr.bin/Makefile Thu Aug 3 21:30:12 2017 (r322029) @@ -133,8 +133,10 @@ SUBDIR= alias \ rpcinfo \ rs \ rup \ + ruptime \ rusers \ rwall \ + rwho \ script \ sdiff \ sed \ @@ -251,8 +253,6 @@ SUBDIR.${MK_OPENSSL}+= newkey SUBDIR.${MK_QUOTAS}+= quota SUBDIR.${MK_RCMDS}+= rlogin SUBDIR.${MK_RCMDS}+= rsh -SUBDIR.${MK_RCMDS}+= ruptime -SUBDIR.${MK_RCMDS}+= rwho SUBDIR.${MK_SENDMAIL}+= vacation SUBDIR.${MK_TALK}+= talk SUBDIR.${MK_TELNET}+= telnet Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Thu Aug 3 21:14:46 2017 (r322028) +++ head/usr.sbin/Makefile Thu Aug 3 21:30:12 2017 (r322029) @@ -74,6 +74,7 @@ SUBDIR= adduser \ rpc.statd \ rpc.umntall \ rtprio \ + rwhod \ service \ services_mkdb \ sesutil \ @@ -191,7 +192,6 @@ SUBDIR.${MK_PPP}+= ppp SUBDIR.${MK_QUOTAS}+= edquota SUBDIR.${MK_QUOTAS}+= quotaon SUBDIR.${MK_QUOTAS}+= repquota -SUBDIR.${MK_RCMDS}+= rwhod SUBDIR.${MK_SENDMAIL}+= editmap SUBDIR.${MK_SENDMAIL}+= mailstats SUBDIR.${MK_SENDMAIL}+= makemap From owner-svn-src-all@freebsd.org Thu Aug 3 21:35:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEE69DD4749; Thu, 3 Aug 2017 21:35:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 894616C056; Thu, 3 Aug 2017 21:35:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v73LZrmC049614; Thu, 3 Aug 2017 21:35:53 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73LZr8I049613; Thu, 3 Aug 2017 21:35:53 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201708032135.v73LZr8I049613@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 3 Aug 2017 21:35:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322030 - head/sys/fs/pseudofs X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/fs/pseudofs X-SVN-Commit-Revision: 322030 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 21:35:54 -0000 Author: markj Date: Thu Aug 3 21:35:53 2017 New Revision: 322030 URL: https://svnweb.freebsd.org/changeset/base/322030 Log: Bump the maximum file name length in pseudofs filesystems to 48. The previous limit of 24 was somewhat restrictive, and with this change ceil(log2(sizeof(struct pfs_node))) is the same as before in both the ILP32 and LP64 models, so the malloc zone used for allocations of struct pfs_node is the same as before. Approved by: des Modified: head/sys/fs/pseudofs/pseudofs.h Modified: head/sys/fs/pseudofs/pseudofs.h ============================================================================== --- head/sys/fs/pseudofs/pseudofs.h Thu Aug 3 21:30:12 2017 (r322029) +++ head/sys/fs/pseudofs/pseudofs.h Thu Aug 3 21:35:53 2017 (r322030) @@ -50,7 +50,7 @@ struct vnode; /* * Limits and constants */ -#define PFS_NAMELEN 24 +#define PFS_NAMELEN 48 #define PFS_FSNAMELEN 16 /* equal to MFSNAMELEN */ #define PFS_DELEN (offsetof(struct dirent, d_name) + PFS_NAMELEN) From owner-svn-src-all@freebsd.org Thu Aug 3 21:37:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FD80DD4894; Thu, 3 Aug 2017 21:37:58 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5CC7D6C1F3; Thu, 3 Aug 2017 21:37:58 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v73LbvJe049729; Thu, 3 Aug 2017 21:37:57 GMT (envelope-from jlh@FreeBSD.org) Received: (from jlh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73LbvKZ049725; Thu, 3 Aug 2017 21:37:57 GMT (envelope-from jlh@FreeBSD.org) Message-Id: <201708032137.v73LbvKZ049725@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jlh set sender to jlh@FreeBSD.org using -f From: Jeremie Le Hen Date: Thu, 3 Aug 2017 21:37:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322031 - in head: usr.bin/ruptime usr.bin/rwho usr.sbin/rwhod X-SVN-Group: head X-SVN-Commit-Author: jlh X-SVN-Commit-Paths: in head: usr.bin/ruptime usr.bin/rwho usr.sbin/rwhod X-SVN-Commit-Revision: 322031 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 21:37:58 -0000 Author: jlh Date: Thu Aug 3 21:37:57 2017 New Revision: 322031 URL: https://svnweb.freebsd.org/changeset/base/322031 Log: Remove deprecation notice for ruptime/rwho/rwhod. PR: 220953 Reported by: peter Modified: head/usr.bin/ruptime/ruptime.1 head/usr.bin/rwho/rwho.1 head/usr.sbin/rwhod/rwhod.8 Modified: head/usr.bin/ruptime/ruptime.1 ============================================================================== --- head/usr.bin/ruptime/ruptime.1 Thu Aug 3 21:35:53 2017 (r322030) +++ head/usr.bin/ruptime/ruptime.1 Thu Aug 3 21:37:57 2017 (r322031) @@ -38,15 +38,6 @@ .Nm .Op Fl alrtu .Op Ar host ... -.Sh DEPRECATION NOTICE -.Nm -is deprecated and will be removed from future versions of the -.Fx -base system. -If -.Nm -is still required, it can be installed from ports or packages -(net/bsdrcmds). .Sh DESCRIPTION The .Nm Modified: head/usr.bin/rwho/rwho.1 ============================================================================== --- head/usr.bin/rwho/rwho.1 Thu Aug 3 21:35:53 2017 (r322030) +++ head/usr.bin/rwho/rwho.1 Thu Aug 3 21:37:57 2017 (r322031) @@ -37,15 +37,6 @@ .Sh SYNOPSIS .Nm .Op Fl a -.Sh DEPRECATION NOTICE -.Nm -is deprecated and will be removed from future versions of the -.Fx -base system. -If -.Nm -is still required, it can be installed from ports or packages -(net/bsdrcmds). .Sh DESCRIPTION The .Nm Modified: head/usr.sbin/rwhod/rwhod.8 ============================================================================== --- head/usr.sbin/rwhod/rwhod.8 Thu Aug 3 21:35:53 2017 (r322030) +++ head/usr.sbin/rwhod/rwhod.8 Thu Aug 3 21:37:57 2017 (r322031) @@ -40,15 +40,6 @@ .Op Fl p .Op Fl l .Op Fl m Op Ar ttl -.Sh DEPRECATION NOTICE -.Nm -is deprecated and will be removed from future versions of the -.Fx -base system. -If -.Nm -is still required, it can be installed from ports or packages -(net/bsdrcmds). .Sh DESCRIPTION The .Nm From owner-svn-src-all@freebsd.org Thu Aug 3 21:57:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02B01DD5643; Thu, 3 Aug 2017 21:57:44 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (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 D5B176CD13; Thu, 3 Aug 2017 21:57:43 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1354) id 2A66CFBBA; Thu, 3 Aug 2017 21:57:43 +0000 (UTC) From: Jan Beich To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r318780 - in head: include sys/sys References: <201705240925.v4O9PDsZ026682@repo.freebsd.org> Date: Thu, 03 Aug 2017 23:57:39 +0200 In-Reply-To: <201705240925.v4O9PDsZ026682@repo.freebsd.org> (Konstantin Belousov's message of "Wed, 24 May 2017 09:25:13 +0000 (UTC)") Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 21:57:44 -0000 Konstantin Belousov writes: > -#ifndef _POSIX_SOURCE > +#if __BSD_VISIBLE > #define ONLCR 0x00000002 /* map NL to CR-NL (ala CRMOD) */ This caused a regression for apps building with _XOPEN_SOURCE e.g., https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=220843 DragonFly uses __XSI_VISIBLE for ONLCR and other XSI extensions. https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/e08b3836c962 http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/termios.h.html From owner-svn-src-all@freebsd.org Thu Aug 3 22:28:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 075E5DD6808; Thu, 3 Aug 2017 22:28: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 mx1.freebsd.org (Postfix) with ESMTPS id D62D76E05E; Thu, 3 Aug 2017 22:28:31 +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 v73MSUOi070877; Thu, 3 Aug 2017 22:28:30 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73MSU4L070875; Thu, 3 Aug 2017 22:28:30 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201708032228.v73MSU4L070875@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 3 Aug 2017 22:28:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322032 - in head/sys: amd64/include i386/include X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys: amd64/include i386/include X-SVN-Commit-Revision: 322032 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 22:28:32 -0000 Author: cem Date: Thu Aug 3 22:28:30 2017 New Revision: 322032 URL: https://svnweb.freebsd.org/changeset/base/322032 Log: x86: Tag some intrinsics with __pure2 Some C wrappers for x86 instructions do not touch global memory and only act on their arguments; they can be marked __pure2, aka __const__. Without this annotation, Clang 3.9.1 is not intelligent enough on its own to grok that these functions are __const__. Submitted by: Anton Rang Sponsored by: Dell EMC Isilon Modified: head/sys/amd64/include/cpufunc.h head/sys/i386/include/cpufunc.h Modified: head/sys/amd64/include/cpufunc.h ============================================================================== --- head/sys/amd64/include/cpufunc.h Thu Aug 3 21:37:57 2017 (r322031) +++ head/sys/amd64/include/cpufunc.h Thu Aug 3 22:28:30 2017 (r322032) @@ -63,7 +63,7 @@ breakpoint(void) __asm __volatile("int $3"); } -static __inline u_int +static __inline __pure2 u_int bsfl(u_int mask) { u_int result; @@ -72,7 +72,7 @@ bsfl(u_int mask) return (result); } -static __inline u_long +static __inline __pure2 u_long bsfq(u_long mask) { u_long result; @@ -81,7 +81,7 @@ bsfq(u_long mask) return (result); } -static __inline u_int +static __inline __pure2 u_int bsrl(u_int mask) { u_int result; @@ -90,7 +90,7 @@ bsrl(u_int mask) return (result); } -static __inline u_long +static __inline __pure2 u_long bsrq(u_long mask) { u_long result; @@ -155,7 +155,7 @@ enable_intr(void) #define HAVE_INLINE_FFSL -static __inline int +static __inline __pure2 int ffsl(long mask) { return (mask == 0 ? mask : (int)bsfq((u_long)mask) + 1); @@ -163,7 +163,7 @@ ffsl(long mask) #define HAVE_INLINE_FFSLL -static __inline int +static __inline __pure2 int ffsll(long long mask) { return (ffsl((long)mask)); @@ -171,7 +171,7 @@ ffsll(long long mask) #define HAVE_INLINE_FLS -static __inline int +static __inline __pure2 int fls(int mask) { return (mask == 0 ? mask : (int)bsrl((u_int)mask) + 1); @@ -179,7 +179,7 @@ fls(int mask) #define HAVE_INLINE_FLSL -static __inline int +static __inline __pure2 int flsl(long mask) { return (mask == 0 ? mask : (int)bsrq((u_long)mask) + 1); @@ -187,7 +187,7 @@ flsl(long mask) #define HAVE_INLINE_FLSLL -static __inline int +static __inline __pure2 int flsll(long long mask) { return (flsl((long)mask)); Modified: head/sys/i386/include/cpufunc.h ============================================================================== --- head/sys/i386/include/cpufunc.h Thu Aug 3 21:37:57 2017 (r322031) +++ head/sys/i386/include/cpufunc.h Thu Aug 3 22:28:30 2017 (r322032) @@ -60,7 +60,7 @@ breakpoint(void) __asm __volatile("int $3"); } -static __inline u_int +static __inline __pure2 u_int bsfl(u_int mask) { u_int result; @@ -69,7 +69,7 @@ bsfl(u_int mask) return (result); } -static __inline u_int +static __inline __pure2 u_int bsrl(u_int mask) { u_int result; @@ -169,7 +169,7 @@ sfence(void) #define HAVE_INLINE_FFS -static __inline int +static __inline __pure2 int ffs(int mask) { /* @@ -183,7 +183,7 @@ ffs(int mask) #define HAVE_INLINE_FFSL -static __inline int +static __inline __pure2 int ffsl(long mask) { return (ffs((int)mask)); @@ -191,7 +191,7 @@ ffsl(long mask) #define HAVE_INLINE_FLS -static __inline int +static __inline __pure2 int fls(int mask) { return (mask == 0 ? mask : (int)bsrl((u_int)mask) + 1); @@ -199,7 +199,7 @@ fls(int mask) #define HAVE_INLINE_FLSL -static __inline int +static __inline __pure2 int flsl(long mask) { return (fls((int)mask)); From owner-svn-src-all@freebsd.org Thu Aug 3 22:41:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25A3EDAB163; Thu, 3 Aug 2017 22:41:36 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E4B866EB05; Thu, 3 Aug 2017 22:41:35 +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 v73MfYAk079945; Thu, 3 Aug 2017 22:41:34 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73MfY2o079944; Thu, 3 Aug 2017 22:41:34 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201708032241.v73MfY2o079944@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 3 Aug 2017 22:41:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322033 - head/usr.bin/procstat X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.bin/procstat X-SVN-Commit-Revision: 322033 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.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 22:41:36 -0000 Author: markj Date: Thu Aug 3 22:41:34 2017 New Revision: 322033 URL: https://svnweb.freebsd.org/changeset/base/322033 Log: Fix procstat --libxo -L. - Use the title role for column headers. - Fix a typo in a field name (lpwid -> lwpid). - Place the fields of different threads in separate containers. Modified: head/usr.bin/procstat/procstat_ptlwpinfo.c Modified: head/usr.bin/procstat/procstat_ptlwpinfo.c ============================================================================== --- head/usr.bin/procstat/procstat_ptlwpinfo.c Thu Aug 3 22:28:30 2017 (r322032) +++ head/usr.bin/procstat/procstat_ptlwpinfo.c Thu Aug 3 22:41:34 2017 (r322033) @@ -46,13 +46,15 @@ procstat_ptlwpinfo(struct procstat *prstat) return; if (!hflag) - xo_emit("{:/%6s %7s %5s %5s %5s %6s %5s} {[:/%d}{:/%s}{]:}" - " {:/%s}\n", + xo_emit( + "{T:/%6s %7s %5s %5s %5s %6s %5s} {[:/%d}{T:/%s}{]:} {T:/%s}\n", "LWPID", "EVENT", "SIGNO", "CODE", "ERRNO", "PID", "UID", 2 * sizeof(void *) + 2, "ADDR", "TDNAME"); + xo_open_container("threads"); for (i = 0; i < count; i++) { - xo_emit("{:lpwid/%6d} ", pl[i].pl_lwpid); + xo_open_container("thread"); + xo_emit("{:lwpid/%6d} ", pl[i].pl_lwpid); switch (pl[i].pl_event) { case PL_EVENT_NONE: xo_emit("{eq:event/none}{d:event/%7s} ", "none"); @@ -85,7 +87,9 @@ procstat_ptlwpinfo(struct procstat *prstat) 2 * sizeof(void *) + 2, "-"); } xo_emit("{:tdname/%s}\n", pl[i].pl_tdname); + xo_close_container("thread"); } + xo_close_container("threads"); procstat_freeptlwpinfo(prstat, pl); } From owner-svn-src-all@freebsd.org Thu Aug 3 22:42:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B1C4DAB2A9; Thu, 3 Aug 2017 22:42:43 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x230.google.com (mail-pg0-x230.google.com [IPv6:2607:f8b0:400e:c05::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A37E6EDF0; Thu, 3 Aug 2017 22:42:43 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x230.google.com with SMTP id v77so324597pgb.3; Thu, 03 Aug 2017 15:42:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=a/1Jfk+xdTlSIwvTo27xAX1nOEWrsBm9HSwwvYvh/hg=; b=iDv0t4AfCM5DnsmiViw2xh15fovUaDnDMeCVDTuwAV9vfxMoPmgPnP/0hiusK+OJF2 PDUbkVJOH7pjpYKK8OPUB1iRrk4oSj/xesVXYs8DBfYHVMjNztw69UqRCHW2MhU/9LXi C0Egl5n4O7sz2TzFZRdH/jqd3hVQNQVfqPMmLE1CcrUdXfTtrraKs+Lo/dAP1otlU808 RLBAX2/Nf3S3w01tW4NyfnMSF8j/qsZw+BupWqvpLqKKmxreF+xmxZqiHM4j6c0rt2Qa wowBeYj2vQqa2lqMqwTXM3ScwrjclPdQmR8GSpXXslNSJSUkFyBh1y/Sh9tPJ9Mc8HWg MYIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=a/1Jfk+xdTlSIwvTo27xAX1nOEWrsBm9HSwwvYvh/hg=; b=SD1E9i7j5u0/Wi3Hn+Tj6tkHYjexInhxQWc64YQ0aPFPFu3qeyVC5a1XOiTrTLWgmA t9KNN0LhpS84NleBWXIPpVyyQb7JJHgwYLmLayz0zRgrkxKURJykOG4k7VyNJGSu3Fbo qlTkF3kGYSGsG/jBn1aowX9OIpdi8/6zvL1xzvT7UzmOr+V6u+xnGBwUIvM2WN6M800D Sc+l/hZq5B3uPcH2Vhzu0qxndi/UmXktfOkc90Ym/asnTBE1YB6IFZNw+82tNczbBz+b Lfk53g27/TOCRATfTicfA1ateMN7tvUYQrdnI1LlOOaFoICVyNKWN4ObwIhAZqdCKf7e qDlg== X-Gm-Message-State: AIVw113opR5RDrERhN2F9NuB3FQWgVNS4xGEENKws5qF/PHATNVVfc5n IAvYrnHxGLumxkW3ZYo= X-Received: by 10.101.72.207 with SMTP id o15mr317806pgs.73.1501800162367; Thu, 03 Aug 2017 15:42:42 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id q88sm75430pfk.8.2017.08.03.15.42.41 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 03 Aug 2017 15:42:41 -0700 (PDT) Subject: Re: svn commit: r322029 - in head: usr.bin usr.sbin Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_27B38D4D-79EB-4BF3-9D1B-04B2842A9A4F"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201708032130.v73LUC2H045637@repo.freebsd.org> Date: Thu, 3 Aug 2017 15:42:40 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201708032130.v73LUC2H045637@repo.freebsd.org> To: Jeremie Le Hen X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 03 Aug 2017 22:42:43 -0000 --Apple-Mail=_27B38D4D-79EB-4BF3-9D1B-04B2842A9A4F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Aug 3, 2017, at 14:30, Jeremie Le Hen wrote: >=20 > Author: jlh > Date: Thu Aug 3 21:30:12 2017 > New Revision: 322029 > URL: https://svnweb.freebsd.org/changeset/base/322029 >=20 > Log: > rwho/ruptime/rwhod shouldn't be gated by RCMDS. The why in this commit and the next you made (r322031) would = have been incredibly helpful. If bugzilla disappears I only have the = commit history tracking the what. Cheers, -Ngie --Apple-Mail=_27B38D4D-79EB-4BF3-9D1B-04B2842A9A4F Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZg6bgAAoJEPWDqSZpMIYVcogP/18DY/FM8KPLSjUk5jexWFoT AZIjd2pgGVQTeL/0EvyL38RSjjCpmcpc6Cud8iMUvXWS9FlEoG+laQCIDcHpLekO 6O+0KSR8qK9LT0md3eUywSJ3h+mpu4jpsjh63LCsrbp/RwiMRQR8iqX/CroF3uA1 VTOBv+Gw43ZGtaq6caAdsosYoC3bgIPwIOKXhsM2se5dQi/6CspwuzvxSwYroaXp solgFpOmRhf0OKRudoM+d1C6qLwyRZCvgfeRNRA+NrfFjQUkAJP6dJx7gacjgzmk QAYCvRG9E4TkmTuGYIh1NoS13K78Oip44qk8bItUEFPnoqkkaQyWgYt47ySwQq6d nwrAxx8CzEI4sxxyh/MXGfPPH4dyYlSeOiI/nyQx0wKlImPBkfOdmdJbyC9EufW9 Tcc9zRXZ090agjfPsjJ6YaI+qacT5abgmxWMQrfrECklPkS48Ic5H7NxY7IdGaAI TdSk2ggzhwvixgGO15NgOQWGApxeohFffg/IsChxaeAeVUZwej3y7RuDWqvTrn+b JLEL0QTPaknzK+LsQ2fwthlgU5Or18yhsArGf9P8cTmjOj6O0XcONtfUHDNPG73h rffwxVCciDEmZiTqwdj2E0kK7mo61AA+QG4zQ5vAGha5oA+pca9STI1pnKCvXWSB xPKxlVicTd0bNXQGQ83y =2/Wt -----END PGP SIGNATURE----- --Apple-Mail=_27B38D4D-79EB-4BF3-9D1B-04B2842A9A4F-- From owner-svn-src-all@freebsd.org Fri Aug 4 01:28:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EACF4DBCC37; Fri, 4 Aug 2017 01:28: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 mx1.freebsd.org (Postfix) with ESMTPS id B79DE73AC3; Fri, 4 Aug 2017 01:28: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 v741S6DM049410; Fri, 4 Aug 2017 01:28:06 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v741S6jd049409; Fri, 4 Aug 2017 01:28:06 GMT (envelope-from np@FreeBSD.org) Message-Id: <201708040128.v741S6jd049409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 4 Aug 2017 01:28:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322034 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 322034 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.23 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2017 01:28:08 -0000 Author: np Date: Fri Aug 4 01:28:06 2017 New Revision: 322034 URL: https://svnweb.freebsd.org/changeset/base/322034 Log: cxgbe(4): Always use the first and not the last virtual interface associated with a port in begin_synchronized_op. MFC after: 3 days Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Aug 3 22:41:34 2017 (r322033) +++ head/sys/dev/cxgbe/t4_main.c Fri Aug 4 01:28:06 2017 (r322034) @@ -9236,12 +9236,13 @@ t4_os_portmod_changed(struct port_info *pi, int old_pt build_medialist(pi, &vi->media); } PORT_UNLOCK(pi); + vi = &pi->vi[0]; if (begin_synchronized_op(pi->adapter, vi, HOLD_LOCK, "t4mod") == 0) { init_l1cfg(pi); end_synchronized_op(pi->adapter, LOCK_HELD); } - ifp = pi->vi[0].ifp; + ifp = vi->ifp; if (pi->mod_type == FW_PORT_MOD_TYPE_NONE) if_printf(ifp, "transceiver unplugged.\n"); else if (pi->mod_type == FW_PORT_MOD_TYPE_UNKNOWN) From owner-svn-src-all@freebsd.org Fri Aug 4 01:52:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4B59DBDF5F; Fri, 4 Aug 2017 01:52:13 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 7A699747CE; Fri, 4 Aug 2017 01:52:12 +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 mail106.syd.optusnet.com.au (Postfix) with ESMTPS id E77823C2246; Fri, 4 Aug 2017 11:35:16 +1000 (AEST) Date: Fri, 4 Aug 2017 11:35:16 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Joerg Sonnenberger cc: Bruce Evans , Ngie Cooper , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r321969 - in head/sys/boot: arm/at91/libat91 arm/ixp425/boot2 i386/boot2 In-Reply-To: <20170803124627.GB2734@britannica.bec.de> Message-ID: <20170804111543.V1186@besplex.bde.org> References: <201708030527.v735R5dg041043@repo.freebsd.org> <20170803173421.C2203@besplex.bde.org> <20170803124627.GB2734@britannica.bec.de> 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=VbSHBBh9 c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=nW5l7S2qks2DyJoO6NEA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2017 01:52:13 -0000 On Thu, 3 Aug 2017, Joerg Sonnenberger wrote: > On Thu, Aug 03, 2017 at 05:53:43PM +1000, Bruce Evans wrote: >> Freestanding versions (static and otherwise) cause problems with builtins. >> -ffreestanding turns off all builtins. The static memcpy used to be >> ifdefed so as to use __builtin_memcpy instead of the static one if the >> compiler is gcc. That apparently broke with gcc-4.2, since the builtin >> will call libc memcpy() in some cases, although memcpy() is unavailable >> in the freestanding case. > > GCC always had a requirement that freestanding environment must provide > certain functions (memcpy, memmove, memset, memcmp). At least memcpy and > memset are regulary used for certain code constructs. While most calls > will be inlined, it is not required. I had forgotten about that bug. boot2 doesn't have many fancy code constructs, but it might have struct copying and gcc uses memcpy for copying large structs. clang-4.0 has the same bug. Testing showed 1 bug nearby: for newer CPUs, it generates large code with several movups's for small struct copies. The bug is that -Os doesn't turn this off. But boot2 uses -march=i386 which does turn this off. For not so new CPUs like core2 where movups is slower than movaps but movaps is unusable because the structs might not be aligned, it normally generates large code with moves through integer registers, but -Os works to turn this off. The change for gcc-4.2 was apparently to support this. The static memcpy is not quite compatible, but is close enough and you can check this in the generated code. The problem is that it should be re-checked for every change in the source code and compiler. Bruce From owner-svn-src-all@freebsd.org Fri Aug 4 03:20:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8AAADC1AB9; Fri, 4 Aug 2017 03:20:02 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A62CE76BBC; Fri, 4 Aug 2017 03:20:02 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v743K1Z1094702; Fri, 4 Aug 2017 03:20:01 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v743K1WG094701; Fri, 4 Aug 2017 03:20:01 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201708040320.v743K1WG094701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Fri, 4 Aug 2017 03:20:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322035 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 322035 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.23 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2017 03:20:03 -0000 Author: alc Date: Fri Aug 4 03:20:01 2017 New Revision: 322035 URL: https://svnweb.freebsd.org/changeset/base/322035 Log: Add myself. Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Fri Aug 4 01:28:06 2017 (r322034) +++ head/usr.bin/calendar/calendars/calendar.freebsd Fri Aug 4 03:20:01 2017 (r322035) @@ -423,6 +423,7 @@ 12/19 Stephen Hurd born in Estevan, Saskatchewan, Canada, 1975 12/19 Emmanuel Vadot born in Decines-Charpieu, France, 1983 12/21 Rong-En Fan born in Taipei, Taiwan, Republic of China, 1982 +12/22 Alan L. Cox born in Warren, Ohio, United States, 1964 12/22 Maxim Sobolev born in Dnepropetrovsk, Ukraine, 1976 12/23 Sean Chittenden born in Seattle, Washington, United States, 1979 12/23 Alejandro Pulver born in Buenos Aires, Argentina, 1989 From owner-svn-src-all@freebsd.org Fri Aug 4 03:40:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 767FCDC2885; Fri, 4 Aug 2017 03:40:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44D0677512; Fri, 4 Aug 2017 03:40:03 +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 v743e2JY002588; Fri, 4 Aug 2017 03:40:02 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v743e1h5002582; Fri, 4 Aug 2017 03:40:01 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201708040340.v743e1h5002582@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 4 Aug 2017 03:40:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322036 - in head/sys: conf dev/nvd dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: conf dev/nvd dev/nvme X-SVN-Commit-Revision: 322036 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.23 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2017 03:40:03 -0000 Author: imp Date: Fri Aug 4 03:40:01 2017 New Revision: 322036 URL: https://svnweb.freebsd.org/changeset/base/322036 Log: Make nvd vs nda choice boot-time rather than build-time Introduce hw.nvme.use_nvd tunable. This tunable allows both nvd and nda to be installed in the kernel, while allowing only one of them to create devices. This is an all-or-nothing setting, and you can't change it after boot-time. However, it will allow easier A/B testing. Differential Revision: https://reviews.freebsd.org/D11825 Modified: head/sys/conf/files head/sys/conf/files.amd64 head/sys/dev/nvd/nvd.c head/sys/dev/nvme/nvme.h head/sys/dev/nvme/nvme_sim.c head/sys/dev/nvme/nvme_sysctl.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Aug 4 03:20:01 2017 (r322035) +++ head/sys/conf/files Fri Aug 4 03:40:01 2017 (r322036) @@ -86,9 +86,9 @@ cam/cam_xpt.c optional scbus cam/ata/ata_all.c optional scbus cam/ata/ata_xpt.c optional scbus cam/ata/ata_pmp.c optional scbus -cam/nvme/nvme_all.c optional scbus nvme !nvd -cam/nvme/nvme_da.c optional scbus nvme da !nvd -cam/nvme/nvme_xpt.c optional scbus nvme !nvd +cam/nvme/nvme_all.c optional scbus nvme +cam/nvme/nvme_da.c optional scbus nvme da +cam/nvme/nvme_xpt.c optional scbus nvme cam/scsi/scsi_xpt.c optional scbus cam/scsi/scsi_all.c optional scbus cam/scsi/scsi_cd.c optional cd Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Fri Aug 4 03:20:01 2017 (r322035) +++ head/sys/conf/files.amd64 Fri Aug 4 03:40:01 2017 (r322036) @@ -341,7 +341,7 @@ dev/nvme/nvme_ctrlr_cmd.c optional nvme dev/nvme/nvme_ns.c optional nvme dev/nvme/nvme_ns_cmd.c optional nvme dev/nvme/nvme_qpair.c optional nvme -dev/nvme/nvme_sim.c optional nvme scbus !nvd +dev/nvme/nvme_sim.c optional nvme scbus dev/nvme/nvme_sysctl.c optional nvme dev/nvme/nvme_test.c optional nvme dev/nvme/nvme_util.c optional nvme Modified: head/sys/dev/nvd/nvd.c ============================================================================== --- head/sys/dev/nvd/nvd.c Fri Aug 4 03:20:01 2017 (r322035) +++ head/sys/dev/nvd/nvd.c Fri Aug 4 03:40:01 2017 (r322036) @@ -134,6 +134,8 @@ MODULE_DEPEND(nvd, nvme, 1, 1, 1); static int nvd_load() { + if (!nvme_use_nvd) + return 0; TAILQ_INIT(&ctrlr_head); TAILQ_INIT(&disk_head); @@ -149,6 +151,9 @@ nvd_unload() { struct nvd_controller *ctrlr; struct nvd_disk *disk; + + if (!nvme_use_nvd) + return; while (!TAILQ_EMPTY(&ctrlr_head)) { ctrlr = TAILQ_FIRST(&ctrlr_head); Modified: head/sys/dev/nvme/nvme.h ============================================================================== --- head/sys/dev/nvme/nvme.h Fri Aug 4 03:20:01 2017 (r322035) +++ head/sys/dev/nvme/nvme.h Fri Aug 4 03:40:01 2017 (r322036) @@ -1003,6 +1003,8 @@ void nvme_ns_trim_cmd(struct nvme_command *cmd, uint16 cmd->cdw11 = NVME_DSM_ATTR_DEALLOCATE; } +extern int nvme_use_nvd; + #endif /* _KERNEL */ #endif /* __NVME_H__ */ Modified: head/sys/dev/nvme/nvme_sim.c ============================================================================== --- head/sys/dev/nvme/nvme_sim.c Fri Aug 4 03:20:01 2017 (r322035) +++ head/sys/dev/nvme/nvme_sim.c Fri Aug 4 03:40:01 2017 (r322036) @@ -371,6 +371,8 @@ struct nvme_consumer *consumer_cookie; static void nvme_sim_init(void) { + if (nvme_use_nvd) + return; consumer_cookie = nvme_register_consumer(nvme_sim_new_ns, nvme_sim_new_controller, NULL, nvme_sim_controller_fail); @@ -382,6 +384,8 @@ SYSINIT(nvme_sim_register, SI_SUB_DRIVERS, SI_ORDER_AN static void nvme_sim_uninit(void) { + if (nvme_use_nvd) + return; /* XXX Cleanup */ nvme_unregister_consumer(consumer_cookie); Modified: head/sys/dev/nvme/nvme_sysctl.c ============================================================================== --- head/sys/dev/nvme/nvme_sysctl.c Fri Aug 4 03:20:01 2017 (r322035) +++ head/sys/dev/nvme/nvme_sysctl.c Fri Aug 4 03:40:01 2017 (r322036) @@ -33,6 +33,12 @@ __FBSDID("$FreeBSD$"); #include "nvme_private.h" +int nvme_use_nvd = 1; + +SYSCTL_NODE(_hw, OID_AUTO, nvme, CTLFLAG_RD, 0, "NVMe sysctl tunables"); +SYSCTL_INT(_hw_nvme, OID_AUTO, use_nvd, CTLFLAG_RDTUN, + &nvme_use_nvd, 1, "1 = Create NVD devices, 0 = Create NDA devices"); + /* * CTLTYPE_S64 and sysctl_handle_64 were added in r217616. Define these * explicitly here for older kernels that don't include the r217616 From owner-svn-src-all@freebsd.org Fri Aug 4 03:48:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53D28DC2E77; Fri, 4 Aug 2017 03:48:18 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 15D19779C9; Fri, 4 Aug 2017 03:48:18 +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 v743mHOQ006543; Fri, 4 Aug 2017 03:48:17 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v743mHaR006542; Fri, 4 Aug 2017 03:48:17 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201708040348.v743mHaR006542@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 4 Aug 2017 03:48:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322037 - head/lib/libstand X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/lib/libstand X-SVN-Commit-Revision: 322037 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.23 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2017 03:48:18 -0000 Author: imp Date: Fri Aug 4 03:48:17 2017 New Revision: 322037 URL: https://svnweb.freebsd.org/changeset/base/322037 Log: Add stpcpy and stpncpy to libstand This adds the stpcpy and stpncpy functions to libstand. Differential Revision: https://reviews.freebsd.org/D11844 Modified: head/lib/libstand/Makefile Modified: head/lib/libstand/Makefile ============================================================================== --- head/lib/libstand/Makefile Fri Aug 4 03:40:01 2017 (r322036) +++ head/lib/libstand/Makefile Fri Aug 4 03:48:17 2017 (r322037) @@ -41,7 +41,7 @@ SRCS+= ntoh.c .PATH: ${LIBC_SRC}/string SRCS+= bcmp.c bcopy.c bzero.c ffs.c fls.c \ memccpy.c memchr.c memcmp.c memcpy.c memmove.c memset.c \ - qdivrem.c strcat.c strchr.c strcmp.c strcpy.c \ + qdivrem.c strcat.c strchr.c strcmp.c strcpy.c stpcpy.c stpncpy.c \ strcspn.c strlcat.c strlcpy.c strlen.c strncat.c strncmp.c strncpy.c \ strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c .if ${MACHINE_CPUARCH} == "arm" From owner-svn-src-all@freebsd.org Fri Aug 4 04:16:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B4E7DC439C; Fri, 4 Aug 2017 04:16:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 660A07C9D2; Fri, 4 Aug 2017 04:16:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v744Ggl9018792; Fri, 4 Aug 2017 04:16:42 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v744GgFO018787; Fri, 4 Aug 2017 04:16:42 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201708040416.v744GgFO018787@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 4 Aug 2017 04:16:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322038 - in head/sys/boot/efi: include libefi X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot/efi: include libefi X-SVN-Commit-Revision: 322038 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.23 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2017 04:16:43 -0000 Author: imp Date: Fri Aug 4 04:16:41 2017 New Revision: 322038 URL: https://svnweb.freebsd.org/changeset/base/322038 Log: Add definitions and utilities for EFI drivers This patch adds definitions and utility code for creating EFI drivers using the EFI_DRIVER_BINDING_PROTOCOL. Submitted by: Eric McCorkle Differential Revision: https://reviews.freebsd.org/D11852 Added: head/sys/boot/efi/include/efi_driver_utils.h (contents, props changed) head/sys/boot/efi/include/efi_drivers.h (contents, props changed) head/sys/boot/efi/libefi/efi_driver_utils.c (contents, props changed) Modified: head/sys/boot/efi/include/efiprot.h head/sys/boot/efi/libefi/Makefile Added: head/sys/boot/efi/include/efi_driver_utils.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/efi/include/efi_driver_utils.h Fri Aug 4 04:16:41 2017 (r322038) @@ -0,0 +1,38 @@ +/*- + * Copyright (c) 2017 Eric McCorkle + * 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 _EFI_DRIVER_UTILS_H_ +#define _EFI_DRIVER_UTILS_H_ + +#include +#include + +extern EFI_STATUS install_driver(EFI_DRIVER_BINDING *driver); +extern EFI_STATUS connect_controllers(EFI_GUID *filter); + +#endif Added: head/sys/boot/efi/include/efi_drivers.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/efi/include/efi_drivers.h Fri Aug 4 04:16:41 2017 (r322038) @@ -0,0 +1,45 @@ +/*- + * Copyright (c) 2016 Eric McCorkle + * 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 _EFI_DRIVERS_H_ +#define _EFI_DRIVERS_H_ + +#include + +typedef struct efi_driver_t { + const char *name; + void (*init)(void); +} efi_driver_t; + +extern struct devsw efipart_dev; +extern int efipart_getdesc(struct devdesc *dev, char **out); + +/* EFI drivers. */ +extern const efi_driver_t fs_driver; + +#endif Modified: head/sys/boot/efi/include/efiprot.h ============================================================================== --- head/sys/boot/efi/include/efiprot.h Fri Aug 4 03:48:17 2017 (r322037) +++ head/sys/boot/efi/include/efiprot.h Fri Aug 4 04:16:41 2017 (r322038) @@ -27,6 +27,8 @@ Revision History --*/ +#include + // // Device Path protocol // @@ -554,5 +556,81 @@ typedef struct _EFI_UNICODE_COLLATION_INTERFACE { CHAR8 *SupportedLanguages; } EFI_UNICODE_COLLATION_INTERFACE; + +// +// Driver Binding protocol +// + +#define DRIVER_BINDING_PROTOCOL \ + { 0x18a031ab, 0xb443, 0x4d1a, {0xa5, 0xc0, 0x0c, 0x09, 0x26, 0x1e, 0x9f, 0x71} } + +INTERFACE_DECL(_EFI_DRIVER_BINDING); + +typedef +EFI_STATUS +(EFIAPI *EFI_DRIVER_BINDING_SUPPORTED) ( + IN struct _EFI_DRIVER_BINDING *This, + IN EFI_HANDLE ControllerHandle, + IN EFI_DEVICE_PATH *RemainingPath + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_DRIVER_BINDING_START) ( + IN struct _EFI_DRIVER_BINDING *This, + IN EFI_HANDLE ControllerHandle, + IN EFI_DEVICE_PATH *RemainingPath + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_DRIVER_BINDING_STOP) ( + IN struct _EFI_DRIVER_BINDING *This, + IN EFI_HANDLE ControllerHandle, + IN UINTN NumberOfChildren, + IN EFI_HANDLE *ChildHandleBuffer + ); + +typedef struct _EFI_DRIVER_BINDING { + EFI_DRIVER_BINDING_SUPPORTED Supported; + EFI_DRIVER_BINDING_START Start; + EFI_DRIVER_BINDING_STOP Stop; + UINT32 Version; + EFI_HANDLE ImageHandle; + EFI_HANDLE DriverBindingHandle; +} EFI_DRIVER_BINDING; + +// +// Component Name Protocol 2 +// + +#define COMPONENT_NAME2_PROTOCOL \ + { 0x6a7a5cff, 0xe8d9, 0x4f70, {0xba, 0xda, 0x75, 0xab, 0x30, 0x25, 0xce, 0x14 } } + +INTERFACE_DECL(_EFI_COMPONENT_NAME2); + +typedef +EFI_STATUS +(EFIAPI *EFI_COMPONENT_NAME_GET_DRIVER_NAME) ( + IN struct _EFI_COMPONENT_NAME2 *This, + IN CHAR8 * Language, + OUT CHAR16 **DriverName + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_COMPONENT_NAME_GET_CONTROLLER_NAME) ( + IN struct _EFI_COMPONENT_NAME2 *This, + IN EFI_HANDLE ControllerHandle, + IN EFI_HANDLE ChildHandle OPTIONAL, + IN CHAR8 *Language, + OUT CHAR16 **ControllerName + ); + +typedef struct _EFI_COMPONENT_NAME2 { + EFI_COMPONENT_NAME_GET_DRIVER_NAME GetDriverName; + EFI_COMPONENT_NAME_GET_CONTROLLER_NAME GetControllerName; + CHAR8 **SupportedLanguages; +} EFI_COMPONENT_NAME2; #endif Modified: head/sys/boot/efi/libefi/Makefile ============================================================================== --- head/sys/boot/efi/libefi/Makefile Fri Aug 4 03:48:17 2017 (r322037) +++ head/sys/boot/efi/libefi/Makefile Fri Aug 4 04:16:41 2017 (r322038) @@ -12,7 +12,7 @@ INTERNALLIB= WARNS?= 2 SRCS= delay.c devpath.c efi_console.c efinet.c efipart.c env.c errno.c \ - handles.c wchar.c libefi.c + handles.c wchar.c libefi.c efi_driver_utils.c .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" SRCS+= time.c Added: head/sys/boot/efi/libefi/efi_driver_utils.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/efi/libefi/efi_driver_utils.c Fri Aug 4 04:16:41 2017 (r322038) @@ -0,0 +1,91 @@ +/*- + * Copyright (c) 2017 Eric McCorkle + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include + +#include +#include + +#include "efi_driver_utils.h" + +static EFI_GUID DriverBindingProtocolGUID = DRIVER_BINDING_PROTOCOL; + +EFI_STATUS +connect_controllers(EFI_GUID *filter) +{ + EFI_STATUS status; + EFI_HANDLE *handles; + UINTN nhandles, i, hsize; + + nhandles = 0; + hsize = 0; + status = BS->LocateHandle(ByProtocol, filter, NULL, + &hsize, NULL); + + if(status != EFI_BUFFER_TOO_SMALL) { + return (status); + } + + handles = malloc(hsize); + nhandles = hsize / sizeof(EFI_HANDLE); + + status = BS->LocateHandle(ByProtocol, filter, NULL, + &hsize, handles); + + if(EFI_ERROR(status)) { + return (status); + } + + for(i = 0; i < nhandles; i++) { + BS->ConnectController(handles[i], NULL, NULL, true); + } + + free(handles); + + return (status); +} + +EFI_STATUS +install_driver(EFI_DRIVER_BINDING *driver) +{ + EFI_STATUS status; + + driver->ImageHandle = IH; + driver->DriverBindingHandle = NULL; + status = BS->InstallMultipleProtocolInterfaces( + &(driver->DriverBindingHandle), + &DriverBindingProtocolGUID, driver, + NULL); + + if (EFI_ERROR(status)) { + printf("Failed to install driver (%ld)!\n", + EFI_ERROR_CODE(status)); + } + + return (status); +} From owner-svn-src-all@freebsd.org Fri Aug 4 04:20:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E7F8DC4712; Fri, 4 Aug 2017 04:20:08 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7D0B7CBC5; Fri, 4 Aug 2017 04:20:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v744K7tA018986; Fri, 4 Aug 2017 04:20:07 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v744K60R018982; Fri, 4 Aug 2017 04:20:06 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201708040420.v744K60R018982@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 4 Aug 2017 04:20:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322039 - in head/sys/boot/efi: include libefi loader X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot/efi: include libefi loader X-SVN-Commit-Revision: 322039 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.23 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2017 04:20:08 -0000 Author: imp Date: Fri Aug 4 04:20:06 2017 New Revision: 322039 URL: https://svnweb.freebsd.org/changeset/base/322039 Log: Move EFI ZFS functions to libefi This patch moves some EFI ZFS functions from loader to libefi, allowing them to be used by anything that links against libefi. Submitted by: Eric McCorkle Differential Revision: https://reviews.freebsd.org/D11855 Added: head/sys/boot/efi/include/efizfs.h (contents, props changed) head/sys/boot/efi/libefi/efizfs.c (contents, props changed) Modified: head/sys/boot/efi/libefi/Makefile head/sys/boot/efi/loader/main.c Added: head/sys/boot/efi/include/efizfs.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/efi/include/efizfs.h Fri Aug 4 04:20:06 2017 (r322039) @@ -0,0 +1,51 @@ +/*- + * Copyright (c) 2016 Eric McCorkle + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include + +#ifndef _EFIZFS_H_ +#define _EFIZFS_H_ + +#ifdef EFI_ZFS_BOOT +typedef STAILQ_HEAD(zfsinfo_list, zfsinfo) zfsinfo_list_t; + +typedef struct zfsinfo +{ + STAILQ_ENTRY(zfsinfo) zi_link; + EFI_HANDLE zi_handle; + uint64_t zi_pool_guid; +} zfsinfo_t; + +extern uint64_t pool_guid; + +extern void efi_zfs_probe(void); +extern zfsinfo_list_t *efizfs_get_zfsinfo_list(void); + +#endif + +#endif Modified: head/sys/boot/efi/libefi/Makefile ============================================================================== --- head/sys/boot/efi/libefi/Makefile Fri Aug 4 04:16:41 2017 (r322038) +++ head/sys/boot/efi/libefi/Makefile Fri Aug 4 04:20:06 2017 (r322039) @@ -12,7 +12,7 @@ INTERNALLIB= WARNS?= 2 SRCS= delay.c devpath.c efi_console.c efinet.c efipart.c env.c errno.c \ - handles.c wchar.c libefi.c efi_driver_utils.c + handles.c wchar.c libefi.c efi_driver_utils.c efizfs.c .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" SRCS+= time.c @@ -38,6 +38,12 @@ CFLAGS+= -fPIC -mno-red-zone CFLAGS+= -I${.CURDIR}/../include CFLAGS+= -I${.CURDIR}/../include/${MACHINE} CFLAGS+= -I${.CURDIR}/../../../../lib/libstand +.if ${MK_ZFS} != "no" +CFLAGS+= -I${.CURDIR}/../../zfs +CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs +CFLAGS+= -I${.CURDIR}/../../../crypto/skein +CFLAGS+= -DEFI_ZFS_BOOT +.endif # Pick up the bootstrap header for some interface items CFLAGS+= -I${.CURDIR}/../../common Added: head/sys/boot/efi/libefi/efizfs.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/efi/libefi/efizfs.c Fri Aug 4 04:20:06 2017 (r322039) @@ -0,0 +1,112 @@ +/*- + * Copyright (c) 2008-2010 Rui Paulo + * Copyright (c) 2006 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#ifdef EFI_ZFS_BOOT +#include +#endif + +#include +#include + +#include "efizfs.h" + +#ifdef EFI_ZFS_BOOT +static zfsinfo_list_t zfsinfo; + +uint64_t pool_guid; + +zfsinfo_list_t * +efizfs_get_zfsinfo_list(void) +{ + return (&zfsinfo); +} + +static void +insert_zfs(EFI_HANDLE handle, uint64_t guid) +{ + zfsinfo_t *zi; + + zi = malloc(sizeof(zfsinfo_t)); + zi->zi_handle = handle; + zi->zi_pool_guid = guid; + STAILQ_INSERT_TAIL(&zfsinfo, zi, zi_link); +} + +void +efi_zfs_probe(void) +{ + pdinfo_list_t *hdi; + pdinfo_t *hd, *pd = NULL; + EFI_GUID imgid = LOADED_IMAGE_PROTOCOL; + EFI_LOADED_IMAGE *img; + char devname[SPECNAMELEN + 1]; + uint64_t guid; + + BS->HandleProtocol(IH, &imgid, (VOID**)&img); + hdi = efiblk_get_pdinfo_list(&efipart_hddev); + STAILQ_INIT(&zfsinfo); + + /* + * Find the handle for the boot device. The boot1 did find the + * device with loader binary, now we need to search for the + * same device and if it is part of the zfs pool, we record the + * pool GUID for currdev setup. + */ + STAILQ_FOREACH(hd, hdi, pd_link) { + STAILQ_FOREACH(pd, &hd->pd_part, pd_link) { + + snprintf(devname, sizeof(devname), "%s%dp%d:", + efipart_hddev.dv_name, hd->pd_unit, pd->pd_unit); + + if (zfs_probe_dev(devname, &guid) == 0) { + insert_zfs(pd->pd_handle, guid); + + if (pd->pd_handle == img->DeviceHandle) + pool_guid = guid; + } + + } + } +} + +uint64_t +ldi_get_size(void *priv) +{ + int fd = (uintptr_t) priv; + uint64_t size; + + ioctl(fd, DIOCGMEDIASIZE, &size); + return (size); +} +#endif Modified: head/sys/boot/efi/loader/main.c ============================================================================== --- head/sys/boot/efi/loader/main.c Fri Aug 4 04:16:41 2017 (r322038) +++ head/sys/boot/efi/loader/main.c Fri Aug 4 04:20:06 2017 (r322039) @@ -48,6 +48,8 @@ __FBSDID("$FreeBSD$"); #ifdef EFI_ZFS_BOOT #include + +#include "efizfs.h" #endif #include "loader_efi.h" @@ -70,11 +72,6 @@ EFI_GUID debugimg = DEBUG_IMAGE_INFO_TABLE_GUID; EFI_GUID fdtdtb = FDT_TABLE_GUID; EFI_GUID inputid = SIMPLE_TEXT_INPUT_PROTOCOL; -#ifdef EFI_ZFS_BOOT -static void efi_zfs_probe(void); -static uint64_t pool_guid; -#endif - static int has_keyboard(void) { @@ -83,7 +80,7 @@ has_keyboard(void) EFI_HANDLE *hin, *hin_end, *walker; UINTN sz; int retval = 0; - + /* * Find all the handles that support the SIMPLE_TEXT_INPUT_PROTOCOL and * do the typical dance to get the right sized buffer. @@ -140,7 +137,7 @@ has_keyboard(void) } else if (DevicePathType(path) == MESSAGING_DEVICE_PATH && DevicePathSubType(path) == MSG_USB_CLASS_DP) { USB_CLASS_DEVICE_PATH *usb; - + usb = (USB_CLASS_DEVICE_PATH *)(void *)path; if (usb->DeviceClass == 3 && /* HID */ usb->DeviceSubClass == 1 && /* Boot devices */ @@ -892,46 +889,3 @@ command_chain(int argc, char *argv[]) } COMMAND_SET(chain, "chain", "chain load file", command_chain); - -#ifdef EFI_ZFS_BOOT -static void -efi_zfs_probe(void) -{ - pdinfo_list_t *hdi; - pdinfo_t *hd, *pd = NULL; - EFI_GUID imgid = LOADED_IMAGE_PROTOCOL; - EFI_LOADED_IMAGE *img; - char devname[SPECNAMELEN + 1]; - - BS->HandleProtocol(IH, &imgid, (VOID**)&img); - hdi = efiblk_get_pdinfo_list(&efipart_hddev); - - /* - * Find the handle for the boot device. The boot1 did find the - * device with loader binary, now we need to search for the - * same device and if it is part of the zfs pool, we record the - * pool GUID for currdev setup. - */ - STAILQ_FOREACH(hd, hdi, pd_link) { - STAILQ_FOREACH(pd, &hd->pd_part, pd_link) { - - snprintf(devname, sizeof(devname), "%s%dp%d:", - efipart_hddev.dv_name, hd->pd_unit, pd->pd_unit); - if (pd->pd_handle == img->DeviceHandle) - (void) zfs_probe_dev(devname, &pool_guid); - else - (void) zfs_probe_dev(devname, NULL); - } - } -} - -uint64_t -ldi_get_size(void *priv) -{ - int fd = (uintptr_t) priv; - uint64_t size; - - ioctl(fd, DIOCGMEDIASIZE, &size); - return (size); -} -#endif From owner-svn-src-all@freebsd.org Fri Aug 4 04:20:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57418DC473C; Fri, 4 Aug 2017 04:20:13 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FB727CBD9; Fri, 4 Aug 2017 04:20:13 +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 v744KCjr019039; Fri, 4 Aug 2017 04:20:12 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v744KCJL019036; Fri, 4 Aug 2017 04:20:12 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201708040420.v744KCJL019036@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 4 Aug 2017 04:20:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322040 - in head/sys/boot/efi: include libefi X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot/efi: include libefi X-SVN-Commit-Revision: 322040 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.23 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2017 04:20:13 -0000 Author: imp Date: Fri Aug 4 04:20:11 2017 New Revision: 322040 URL: https://svnweb.freebsd.org/changeset/base/322040 Log: Add EFI utility functions to libefi This patch adds additional EFI utility functions to convert errno values to EFI_STATUS errors, as well as EFI times to UNIX times. Submitted by: Eric McCorkle Differential Revision: https://reviews.freebsd.org/D11858 Modified: head/sys/boot/efi/include/efilib.h head/sys/boot/efi/libefi/errno.c head/sys/boot/efi/libefi/time.c Modified: head/sys/boot/efi/include/efilib.h ============================================================================== --- head/sys/boot/efi/include/efilib.h Fri Aug 4 04:20:06 2017 (r322039) +++ head/sys/boot/efi/include/efilib.h Fri Aug 4 04:20:11 2017 (r322040) @@ -79,6 +79,7 @@ CHAR16 *efi_devpath_name(EFI_DEVICE_PATH *); void efi_free_devpath_name(CHAR16 *); int efi_status_to_errno(EFI_STATUS); +EFI_STATUS errno_to_efi_status(int errno); void efi_time_init(void); void efi_time_fini(void); Modified: head/sys/boot/efi/libefi/errno.c ============================================================================== --- head/sys/boot/efi/libefi/errno.c Fri Aug 4 04:20:06 2017 (r322039) +++ head/sys/boot/efi/libefi/errno.c Fri Aug 4 04:20:11 2017 (r322040) @@ -30,6 +30,69 @@ __FBSDID("$FreeBSD$"); #include #include +EFI_STATUS +errno_to_efi_status(int errno) +{ + EFI_STATUS status; + + switch (errno) { + case EPERM: + status = EFI_ACCESS_DENIED; + break; + + case EOVERFLOW: + status = EFI_BUFFER_TOO_SMALL; + break; + + case EIO: + status = EFI_DEVICE_ERROR; + break; + + case EINVAL: + status = EFI_INVALID_PARAMETER; + break; + + case ESTALE: + status = EFI_MEDIA_CHANGED; + break; + + case ENXIO: + status = EFI_NO_MEDIA; + break; + + case ENOENT: + status = EFI_NOT_FOUND; + break; + + case ENOMEM: + status = EFI_OUT_OF_RESOURCES; + break; + + case ENOTSUP: + case ENODEV: + status = EFI_UNSUPPORTED; + break; + + case ENOSPC: + status = EFI_VOLUME_FULL; + break; + + case EACCES: + status = EFI_WRITE_PROTECTED; + break; + + case 0: + status = EFI_SUCCESS; + break; + + default: + status = EFI_DEVICE_ERROR; + break; + } + + return (status); +} + int efi_status_to_errno(EFI_STATUS status) { Modified: head/sys/boot/efi/libefi/time.c ============================================================================== --- head/sys/boot/efi/libefi/time.c Fri Aug 4 04:20:06 2017 (r322039) +++ head/sys/boot/efi/libefi/time.c Fri Aug 4 04:20:11 2017 (r322040) @@ -58,6 +58,41 @@ __FBSDID("$FreeBSD$"); #define SECSPERHOUR ( 60*60 ) #define SECSPERDAY (24 * SECSPERHOUR) +/* +// These arrays give the cumulative number of days up to the first of the +// month number used as the index (1 -> 12) for regular and leap years. +// The value at index 13 is for the whole year. +*/ +static const time_t CumulativeDays[2][14] = { + {0, + 0, + 31, + 31 + 28, + 31 + 28 + 31, + 31 + 28 + 31 + 30, + 31 + 28 + 31 + 30 + 31, + 31 + 28 + 31 + 30 + 31 + 30, + 31 + 28 + 31 + 30 + 31 + 30 + 31, + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31, + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30, + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31, + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30, + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31 }, + {0, + 0, + 31, + 31 + 29, + 31 + 29 + 31, + 31 + 29 + 31 + 30, + 31 + 29 + 31 + 30 + 31, + 31 + 29 + 31 + 30 + 31 + 30, + 31 + 29 + 31 + 30 + 31 + 30 + 31, + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31, + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30, + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31, + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30, + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31 }}; + void efi_time_init(void) { @@ -68,45 +103,46 @@ efi_time_fini(void) { } -static time_t -efi_time(EFI_TIME *ETime) +void +to_efi_time(EFI_TIME *efi_time, time_t time) { - /* - // These arrays give the cumulative number of days up to the first of the - // month number used as the index (1 -> 12) for regular and leap years. - // The value at index 13 is for the whole year. - */ - static time_t CumulativeDays[2][14] = { - {0, - 0, - 31, - 31 + 28, - 31 + 28 + 31, - 31 + 28 + 31 + 30, - 31 + 28 + 31 + 30 + 31, - 31 + 28 + 31 + 30 + 31 + 30, - 31 + 28 + 31 + 30 + 31 + 30 + 31, - 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31, - 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30, - 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31, - 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30, - 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31 }, - {0, - 0, - 31, - 31 + 29, - 31 + 29 + 31, - 31 + 29 + 31 + 30, - 31 + 29 + 31 + 30 + 31, - 31 + 29 + 31 + 30 + 31 + 30, - 31 + 29 + 31 + 30 + 31 + 30 + 31, - 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31, - 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30, - 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31, - 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30, - 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31 }}; + if (time >= 0) { + for (efi_time->Year = 1970; + time > CumulativeDays[isleap(efi_time->Year)][13] * SECSPERDAY; + time -= CumulativeDays[isleap(efi_time->Year)][13] * SECSPERDAY, + efi_time->Year++); - time_t UTime; + for (efi_time->Month = 0; + time > CumulativeDays[isleap(efi_time->Year)][efi_time->Month] * + SECSPERDAY; + efi_time->Month++); + + time -= CumulativeDays[isleap(efi_time->Year)][efi_time->Month - 1] * + SECSPERDAY; + + for (efi_time->Day = 0; time > SECSPERDAY; + time -= SECSPERDAY, efi_time->Day++); + + for (efi_time->Hour = 0; time > SECSPERHOUR; + time -= SECSPERHOUR, efi_time->Hour++); + + for (efi_time->Minute = 0; time > 60; + time -= 60, efi_time->Minute++); + + efi_time->Second = time; + efi_time->Nanosecond = 0; + efi_time->TimeZone = 0; + efi_time->Daylight = 0; + } else { + memset(efi_time, 0, sizeof(EFI_TIME)); + } +} + +time_t +from_efi_time(EFI_TIME *ETime) +{ + + time_t UTime; int Year; /* @@ -196,7 +232,7 @@ EFI_GetTimeOfDay( // Convert to UNIX time (ie seconds since the epoch */ - tp->tv_sec = efi_time( &EfiTime ); + tp->tv_sec = from_efi_time( &EfiTime ); tp->tv_usec = 0; /* EfiTime.Nanosecond * 1000; */ /* From owner-svn-src-all@freebsd.org Fri Aug 4 04:23:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E321DC4ACD; Fri, 4 Aug 2017 04:23:25 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE2937D0D5; Fri, 4 Aug 2017 04:23:24 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v744NOn8023000; Fri, 4 Aug 2017 04:23:24 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v744NOix022999; Fri, 4 Aug 2017 04:23:24 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201708040423.v744NOix022999@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Fri, 4 Aug 2017 04:23:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322041 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 322041 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.23 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2017 04:23:25 -0000 Author: alc Date: Fri Aug 4 04:23:23 2017 New Revision: 322041 URL: https://svnweb.freebsd.org/changeset/base/322041 Log: In case readers are misled by expressions that combine multiplication and division, add parentheses to make the precedence explicit. Submitted by: Doug Moore Requested by: imp Reviewed by: imp MFC after: 1 week X-MFC after: r321840 Differential Revision: https://reviews.freebsd.org/D11815 Modified: head/sys/kern/subr_blist.c Modified: head/sys/kern/subr_blist.c ============================================================================== --- head/sys/kern/subr_blist.c Fri Aug 4 04:20:11 2017 (r322040) +++ head/sys/kern/subr_blist.c Fri Aug 4 04:23:23 2017 (r322041) @@ -110,6 +110,7 @@ __FBSDID("$FreeBSD$"); #define bitcount64(x) __bitcount64((uint64_t)(x)) #define malloc(a,b,c) calloc(a, 1) #define free(a,b) free(a) +#define CTASSERT(expr) #include @@ -142,6 +143,8 @@ static void blst_radix_print(blmeta_t *scan, daddr_t b static MALLOC_DEFINE(M_SWAP, "SWAP", "Swap space"); #endif +CTASSERT(BLIST_BMAP_RADIX % BLIST_META_RADIX == 0); + /* * For a subtree that can represent the state of up to 'radix' blocks, the * number of leaf nodes of the subtree is L=radix/BLIST_BMAP_RADIX. If 'm' @@ -151,17 +154,19 @@ static MALLOC_DEFINE(M_SWAP, "SWAP", "Swap space"); * in the 'meta' functions that process subtrees. Since integer division * discards remainders, we can express this computation as * skip = (m * m**h) / (m - 1) - * skip = (m * radix / BLIST_BMAP_RADIX) / (m - 1) - * and if m divides BLIST_BMAP_RADIX, we can simplify further to - * skip = radix / (BLIST_BMAP_RADIX / m * (m - 1)) - * so that a simple integer division is enough for the calculation. + * skip = (m * (radix / BLIST_BMAP_RADIX)) / (m - 1) + * and since m divides BLIST_BMAP_RADIX, we can simplify further to + * skip = (radix / (BLIST_BMAP_RADIX / m)) / (m - 1) + * skip = radix / ((BLIST_BMAP_RADIX / m) * (m - 1)) + * so that simple integer division by a constant can safely be used for the + * calculation. */ static inline daddr_t radix_to_skip(daddr_t radix) { return (radix / - (BLIST_BMAP_RADIX / BLIST_META_RADIX * (BLIST_META_RADIX - 1))); + ((BLIST_BMAP_RADIX / BLIST_META_RADIX) * (BLIST_META_RADIX - 1))); } /* From owner-svn-src-all@freebsd.org Fri Aug 4 06:30:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D67DBDC91C9; Fri, 4 Aug 2017 06:30:54 +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 9EFD980112; Fri, 4 Aug 2017 06:30:54 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 65E0826015A; Fri, 4 Aug 2017 08:30:52 +0200 (CEST) Subject: Re: svn commit: r321985 - head/sys/ofed/drivers/infiniband/core To: cem@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201708030918.v739IPVY034866@repo.freebsd.org> From: Hans Petter Selasky Message-ID: Date: Fri, 4 Aug 2017 08:28:41 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: 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.23 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2017 06:30:54 -0000 On 08/03/17 16:37, Conrad Meyer wrote: > Hey Hans, > > Is it not important that the subtraction and result are evaluated > without truncation? Hi, ticks is a circular counter. Assuming time = 0 and jiffies = -1U, then "delay" becomes a very large negative value, because long is used, and the delay <= 0 check, is no longer working like expected. Casting to "int" or truncating is the right thing to do in this case. --HPS > > Thanks, > Conrad > > On Thu, Aug 3, 2017 at 2:18 AM, Hans Petter Selasky > wrote: >> Author: hselasky >> Date: Thu Aug 3 09:18:25 2017 >> New Revision: 321985 >> URL: https://svnweb.freebsd.org/changeset/base/321985 >> >> Log: >> Ticks are 32-bit in FreeBSD. >> >> MFC after: 3 days >> Sponsored by: Mellanox Technologies >> >> Modified: >> head/sys/ofed/drivers/infiniband/core/addr.c >> >> Modified: head/sys/ofed/drivers/infiniband/core/addr.c >> ============================================================================== >> --- head/sys/ofed/drivers/infiniband/core/addr.c Thu Aug 3 09:14:43 2017 (r321984) >> +++ head/sys/ofed/drivers/infiniband/core/addr.c Thu Aug 3 09:18:25 2017 (r321985) >> @@ -187,10 +187,10 @@ EXPORT_SYMBOL(rdma_translate_ip); >> >> static void set_timeout(unsigned long time) >> { >> - unsigned long delay; >> + int delay; /* under FreeBSD ticks are 32-bit */ >> >> delay = time - jiffies; >> - if ((long)delay <= 0) >> + if (delay <= 0) >> delay = 1; >> >> mod_delayed_work(addr_wq, &work, delay); >> > > From owner-svn-src-all@freebsd.org Fri Aug 4 06:40:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70273DC956B for ; Fri, 4 Aug 2017 06:40:50 +0000 (UTC) (envelope-from 0100015dabf984e6-3c13133c-5b52-493d-b25a-3a93cfa74020-000000@amazonses.com) Received: from a8-176.smtp-out.amazonses.com (a8-176.smtp-out.amazonses.com [54.240.8.176]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 33AB78059E for ; Fri, 4 Aug 2017 06:40:49 +0000 (UTC) (envelope-from 0100015dabf984e6-3c13133c-5b52-493d-b25a-3a93cfa74020-000000@amazonses.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ae7m2yrxjw65l2cqdpjxuucyrvy564tn; d=tarsnap.com; t=1501828843; h=Subject:To:References:Cc:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=J8uQtE9lnLLaxxKHLhZHcnoZXRb134blpCUNBAfuQ/s=; b=mIwVBRF4GuteOO8GAgW8TOsyp0jRJXmAxy5Q4r+kDxyQ52MeQenVXXD3j6IZuplW 2zvi3DlvCOxAo5tn/QJ7OHn16/Q2EjuRsk4sHqp3xz32PS5Es61LougR0dfGwPf50Xr j/u6hK1ENtrFU0dcsgrdLkZactxBBkErpwhxyT/w= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=224i4yxa5dv7c2xz3womw6peuasteono; d=amazonses.com; t=1501828843; h=Subject:To:References:Cc:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=J8uQtE9lnLLaxxKHLhZHcnoZXRb134blpCUNBAfuQ/s=; b=YEwSsaw5zru9KNQqIqTQ6T9VfWxsb61d6YzL+7PPYTZqqmMRfZBjBERBOJVtg6bn 77odDYP9xhsRZJUv9Z71I+C7rlUm+8WlrUJGeJ0CF2EqpE+PmKnZFmNBm4gxAkcD2BF WIRxElQMGrAwQOMBNXjm9bpjQA/vGA3GsNynSSMg= Subject: Re: svn commit: r321985 - head/sys/ofed/drivers/infiniband/core To: Hans Petter Selasky , cem@freebsd.org References: <201708030918.v739IPVY034866@repo.freebsd.org> Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Colin Percival Message-ID: <0100015dabf984e6-3c13133c-5b52-493d-b25a-3a93cfa74020-000000@email.amazonses.com> Date: Fri, 4 Aug 2017 06:40:42 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SES-Outgoing: 2017.08.04-54.240.8.176 Feedback-ID: 1.us-east-1.Lv9FVjaNvvR5llaqfLoOVbo2VxOELl7cjN0AOyXnPlk=:AmazonSES X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2017 06:40:50 -0000 On 08/03/17 23:28, Hans Petter Selasky wrote: > On 08/03/17 16:37, Conrad Meyer wrote: >> Is it not important that the subtraction and result are evaluated >> without truncation? > > ticks is a circular counter. Assuming time = 0 and jiffies = -1U, then "delay" > becomes a very large negative value, because long is used, and the delay <= 0 > check, is no longer working like expected. > > Casting to "int" or truncating is the right thing to do in this case. Signed integer overflow is undefined. Using 'int' is liable to cause problems after 2^32 ticks. Colin Percival >>> Log: >>> Ticks are 32-bit in FreeBSD. >>> >>> MFC after: 3 days >>> Sponsored by: Mellanox Technologies >>> >>> Modified: >>> head/sys/ofed/drivers/infiniband/core/addr.c >>> >>> Modified: head/sys/ofed/drivers/infiniband/core/addr.c >>> ============================================================================== >>> --- head/sys/ofed/drivers/infiniband/core/addr.c Thu Aug 3 09:14:43 >>> 2017 (r321984) >>> +++ head/sys/ofed/drivers/infiniband/core/addr.c Thu Aug 3 09:18:25 >>> 2017 (r321985) >>> @@ -187,10 +187,10 @@ EXPORT_SYMBOL(rdma_translate_ip); >>> >>> static void set_timeout(unsigned long time) >>> { >>> - unsigned long delay; >>> + int delay; /* under FreeBSD ticks are 32-bit */ >>> >>> delay = time - jiffies; >>> - if ((long)delay <= 0) >>> + if (delay <= 0) >>> delay = 1; >>> >>> mod_delayed_work(addr_wq, &work, delay); -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-svn-src-all@freebsd.org Fri Aug 4 06:47:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A968DC9B2F; Fri, 4 Aug 2017 06:47:36 +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 13CD280C3D; Fri, 4 Aug 2017 06:47:36 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 72E3026015A; Fri, 4 Aug 2017 08:47:34 +0200 (CEST) Subject: Re: svn commit: r321985 - head/sys/ofed/drivers/infiniband/core To: Colin Percival , cem@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201708030918.v739IPVY034866@repo.freebsd.org> <0100015dabf99670-4b6c3f74-5f86-49a2-a3d5-85dee9e16f91-000000@email.amazonses.com> From: Hans Petter Selasky Message-ID: Date: Fri, 4 Aug 2017 08:45:23 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <0100015dabf99670-4b6c3f74-5f86-49a2-a3d5-85dee9e16f91-000000@email.amazonses.com> 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.23 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2017 06:47:36 -0000 On 08/04/17 08:40, Colin Percival wrote: >> Casting to "int" or truncating is the right thing to do in this case. > Signed integer overflow is undefined. Using 'int' is liable to cause problems > after 2^32 ticks. > Hi, If you check the code how this function is used, you'll see that the argument passed is computed from: jiffies + n, where "n" is a relatively small value. The <= 0 check is basically there to catch cases where the jiffies value has changed between the point where it was set and the point where the relative ticks timeout value "n" was extracted. Basically the code is doing like this, reading the value of "jiffies" twice. delay = (jiffies0 + n) - jiffies1; if (delay <= 0) delay = 1; And then "delay" should be "int", because we are usually not dealing with timeouts greater than a few hundred seconds or so. --HPS From owner-svn-src-all@freebsd.org Fri Aug 4 07:57:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 740BBDCB88E for ; Fri, 4 Aug 2017 07:57:14 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-vk0-x235.google.com (mail-vk0-x235.google.com [IPv6:2607:f8b0:400c:c05::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2A8498260C for ; Fri, 4 Aug 2017 07:57:14 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-vk0-x235.google.com with SMTP id n125so3294700vke.1 for ; Fri, 04 Aug 2017 00:57:14 -0700 (PDT) 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=3cDoNpd7MRlqrHmgXoSEqI2O5G3XxwKv12EtIjFMHi0=; b=jtXIy3Psvq3b2kEfi0GhLwJOhhX50rF+weoH1xWV0orgGBYVK5U0RWEqhDLHX5Bneu CaLnfAbovWvSMLkIv7KjmXmGA+1kjggCQvWbanVlc3u9oLDZ6qHLzfu6fDlMm9Tc4lTX Hui8pCBrxVaiyguZ8sQVmxYZMtgMLvxccmEjO0ngklExJN5NU8Y6EJShGy73BNOf/l6x eWJ5q7zoXNooXPFsW3Vv0qC1zpCu37QoS2dFHBCc0L56174Lai4TCi7M5kvst1jZWjBT aWh/Nh5V/sZFK+SpXEKMxVTzdffL5Fpi2nqeT9lRtaRbE3QfzO1D8tDK7utMtVtxp438 vYtQ== 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=3cDoNpd7MRlqrHmgXoSEqI2O5G3XxwKv12EtIjFMHi0=; b=A/QvAol6cBN+Z2hdL4szCbiqJ3eW0FDGixAKHJWuf5JAGfOVxY2wOX/d6JH+WDE/Hp xvWp4P46sy4cou5Cmg0YPsImmkkVTwM+MS2vnh5Rx3azchC/cscLrzLDrYJpSPVxmE/l R8eQ9Y9PhCvqBDz8jPAAGqlBqVFdOlZldUlQTZw6CA4GoTFE8LtFq8Y54W3PmlGOHfMf Y/SUEfaMZaThcBo2Q9Bukrf7AGLSqSXlwu8iVh3s2qtIG4xw9YoZWUfbit+xK/eK2Rvg cKxeVK/1LYfAjrhepvTi0NQUxKForY+9vq1myc+jzeN+MI2SBpXc+CQUVASrXUFUcTXl 8xhQ== X-Gm-Message-State: AHYfb5hp+Fa1QFrsuEwbAJV0V2sV7u5XSODCcQ9gZd7wsSLitD+Q+sn6 3IL0Eny5hneBFaJ357Z/Y8K2nW7Ba2AM X-Received: by 10.31.106.129 with SMTP id f123mr930880vkc.74.1501833433203; Fri, 04 Aug 2017 00:57:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.8.70 with HTTP; Fri, 4 Aug 2017 00:57:12 -0700 (PDT) In-Reply-To: <201708040423.v744NOix022999@repo.freebsd.org> References: <201708040423.v744NOix022999@repo.freebsd.org> From: Oliver Pinter Date: Fri, 4 Aug 2017 09:57:12 +0200 Message-ID: Subject: Re: svn commit: r322041 - head/sys/kern To: Alan Cox Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2017 07:57:14 -0000 On Friday, August 4, 2017, Alan Cox wrote: > Author: alc > Date: Fri Aug 4 04:23:23 2017 > New Revision: 322041 > URL: https://svnweb.freebsd.org/changeset/base/322041 > > Log: > In case readers are misled by expressions that combine multiplication and > division, add parentheses to make the precedence explicit. > > Submitted by: Doug Moore > > Requested by: imp > Reviewed by: imp > MFC after: 1 week > X-MFC after: r321840 > Differential Revision: https://reviews.freebsd.org/D11815 > > Modified: > head/sys/kern/subr_blist.c > > Modified: head/sys/kern/subr_blist.c > ============================================================ > ================== > --- head/sys/kern/subr_blist.c Fri Aug 4 04:20:11 2017 (r322040) > +++ head/sys/kern/subr_blist.c Fri Aug 4 04:23:23 2017 (r322041) > @@ -110,6 +110,7 @@ __FBSDID("$FreeBSD$"); > #define bitcount64(x) __bitcount64((uint64_t)(x)) > #define malloc(a,b,c) calloc(a, 1) > #define free(a,b) free(a) > +#define CTASSERT(expr) Is this dummy define intended? > > #include > > @@ -142,6 +143,8 @@ static void blst_radix_print(blmeta_t *scan, daddr_t b > static MALLOC_DEFINE(M_SWAP, "SWAP", "Swap space"); > #endif > > +CTASSERT(BLIST_BMAP_RADIX % BLIST_META_RADIX == 0); > + > /* > * For a subtree that can represent the state of up to 'radix' blocks, the > * number of leaf nodes of the subtree is L=radix/BLIST_BMAP_RADIX. If > 'm' > @@ -151,17 +154,19 @@ static MALLOC_DEFINE(M_SWAP, "SWAP", "Swap space"); > * in the 'meta' functions that process subtrees. Since integer division > * discards remainders, we can express this computation as > * skip = (m * m**h) / (m - 1) > - * skip = (m * radix / BLIST_BMAP_RADIX) / (m - 1) > - * and if m divides BLIST_BMAP_RADIX, we can simplify further to > - * skip = radix / (BLIST_BMAP_RADIX / m * (m - 1)) > - * so that a simple integer division is enough for the calculation. > + * skip = (m * (radix / BLIST_BMAP_RADIX)) / (m - 1) > + * and since m divides BLIST_BMAP_RADIX, we can simplify further to > + * skip = (radix / (BLIST_BMAP_RADIX / m)) / (m - 1) > + * skip = radix / ((BLIST_BMAP_RADIX / m) * (m - 1)) > + * so that simple integer division by a constant can safely be used for > the > + * calculation. > */ > static inline daddr_t > radix_to_skip(daddr_t radix) > { > > return (radix / > - (BLIST_BMAP_RADIX / BLIST_META_RADIX * (BLIST_META_RADIX - > 1))); > + ((BLIST_BMAP_RADIX / BLIST_META_RADIX) * (BLIST_META_RADIX - > 1))); > } > > /* > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org > " > From owner-svn-src-all@freebsd.org Fri Aug 4 08:12:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC139DCC479; Fri, 4 Aug 2017 08:12: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 mx1.freebsd.org (Postfix) with ESMTPS id AA02282EE3; Fri, 4 Aug 2017 08:12: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 v748CJDE015961; Fri, 4 Aug 2017 08:12:19 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v748CJIZ015960; Fri, 4 Aug 2017 08:12:19 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708040812.v748CJIZ015960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 4 Aug 2017 08:12: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: r322042 - stable/11/lib/libc/x86/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/lib/libc/x86/sys X-SVN-Commit-Revision: 322042 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.23 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2017 08:12:21 -0000 Author: kib Date: Fri Aug 4 08:12:19 2017 New Revision: 322042 URL: https://svnweb.freebsd.org/changeset/base/322042 Log: MFC r321652: Simplify flow control. Modified: stable/11/lib/libc/x86/sys/__vdso_gettc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/x86/sys/__vdso_gettc.c ============================================================================== --- stable/11/lib/libc/x86/sys/__vdso_gettc.c Fri Aug 4 04:23:23 2017 (r322041) +++ stable/11/lib/libc/x86/sys/__vdso_gettc.c Fri Aug 4 08:12:19 2017 (r322042) @@ -146,25 +146,24 @@ __vdso_init_hpet(uint32_t u) if (old_map != NULL) return; - if (cap_getmode(&mode) == 0 && mode != 0) - goto fail; + /* + * Explicitely check for the capability mode to avoid + * triggering trap_enocap on the device open by absolute path. + */ + if ((cap_getmode(&mode) == 0 && mode != 0) || + (fd = _open(devname, O_RDONLY)) == -1) { + /* Prevent the caller from re-entering. */ + atomic_cmpset_rel_ptr((volatile uintptr_t *)&hpet_dev_map[u], + (uintptr_t)old_map, (uintptr_t)MAP_FAILED); + return; + } - fd = _open(devname, O_RDONLY); - if (fd == -1) - goto fail; - new_map = mmap(NULL, PAGE_SIZE, PROT_READ, MAP_SHARED, fd, 0); _close(fd); if (atomic_cmpset_rel_ptr((volatile uintptr_t *)&hpet_dev_map[u], (uintptr_t)old_map, (uintptr_t)new_map) == 0 && new_map != MAP_FAILED) munmap((void *)new_map, PAGE_SIZE); - - return; -fail: - /* Prevent the caller from re-entering. */ - atomic_cmpset_rel_ptr((volatile uintptr_t *)&hpet_dev_map[u], - (uintptr_t)old_map, (uintptr_t)MAP_FAILED); } #ifdef WANT_HYPERV From owner-svn-src-all@freebsd.org Fri Aug 4 08:16:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC1D5DCC6DC; Fri, 4 Aug 2017 08:16:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A82C7830CC; Fri, 4 Aug 2017 08:16:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v748G5s6016166; Fri, 4 Aug 2017 08:16:05 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v748G5iV016165; Fri, 4 Aug 2017 08:16:05 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708040816.v748G5iV016165@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 4 Aug 2017 08:16: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: r322043 - stable/11/sys/ufs/ffs X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/ufs/ffs X-SVN-Commit-Revision: 322043 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.23 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2017 08:16:07 -0000 Author: kib Date: Fri Aug 4 08:16:05 2017 New Revision: 322043 URL: https://svnweb.freebsd.org/changeset/base/322043 Log: MFC r321347: Account for lock recursion when transfering snaplock to the vnode lock in ffs_snapremove(). Modified: stable/11/sys/ufs/ffs/ffs_snapshot.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- stable/11/sys/ufs/ffs/ffs_snapshot.c Fri Aug 4 08:12:19 2017 (r322042) +++ stable/11/sys/ufs/ffs/ffs_snapshot.c Fri Aug 4 08:16:05 2017 (r322043) @@ -1607,7 +1607,7 @@ ffs_snapremove(vp) struct buf *ibp; struct fs *fs; ufs2_daddr_t numblks, blkno, dblk; - int error, loc, last; + int error, i, last, loc; struct snapdata *sn; ip = VTOI(vp); @@ -1627,10 +1627,14 @@ ffs_snapremove(vp) ip->i_nextsnap.tqe_prev = 0; VI_UNLOCK(devvp); lockmgr(&vp->v_lock, LK_EXCLUSIVE, NULL); + for (i = 0; i < sn->sn_lock.lk_recurse; i++) + lockmgr(&vp->v_lock, LK_EXCLUSIVE, NULL); KASSERT(vp->v_vnlock == &sn->sn_lock, ("ffs_snapremove: lost lock mutation")); vp->v_vnlock = &vp->v_lock; VI_LOCK(devvp); + while (sn->sn_lock.lk_recurse > 0) + lockmgr(&sn->sn_lock, LK_RELEASE, NULL); lockmgr(&sn->sn_lock, LK_RELEASE, NULL); try_free_snapdata(devvp); } else From owner-svn-src-all@freebsd.org Fri Aug 4 08:18:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85870DCC86F; Fri, 4 Aug 2017 08:18:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 548CC83267; Fri, 4 Aug 2017 08:18:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v748IHkQ016292; Fri, 4 Aug 2017 08:18:17 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v748IHN9016291; Fri, 4 Aug 2017 08:18:17 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708040818.v748IHN9016291@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 4 Aug 2017 08:18:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r322044 - stable/11/sys/ufs/ffs X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/ufs/ffs X-SVN-Commit-Revision: 322044 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.23 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2017 08:18:18 -0000 Author: kib Date: Fri Aug 4 08:18:17 2017 New Revision: 322044 URL: https://svnweb.freebsd.org/changeset/base/322044 Log: MFC r321348: Unlock correct lock in ffs_snapblkfree(). Modified: stable/11/sys/ufs/ffs/ffs_snapshot.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- stable/11/sys/ufs/ffs/ffs_snapshot.c Fri Aug 4 08:16:05 2017 (r322043) +++ stable/11/sys/ufs/ffs/ffs_snapshot.c Fri Aug 4 08:18:17 2017 (r322044) @@ -1944,7 +1944,7 @@ retry: */ if (error != 0 && wkhd != NULL) softdep_freework(wkhd); - lockmgr(vp->v_vnlock, LK_RELEASE, NULL); + lockmgr(&sn->sn_lock, LK_RELEASE, NULL); return (error); } From owner-svn-src-all@freebsd.org Fri Aug 4 08:20:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92CD0DCCA5A; Fri, 4 Aug 2017 08:20:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 619C0833E4; Fri, 4 Aug 2017 08:20:27 +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 v748KQiD016432; Fri, 4 Aug 2017 08:20:26 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v748KQCY016431; Fri, 4 Aug 2017 08:20:26 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708040820.v748KQCY016431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 4 Aug 2017 08:20:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r322045 - stable/11/sys/ufs/ffs X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/ufs/ffs X-SVN-Commit-Revision: 322045 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.23 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2017 08:20:27 -0000 Author: kib Date: Fri Aug 4 08:20:26 2017 New Revision: 322045 URL: https://svnweb.freebsd.org/changeset/base/322045 Log: MFC r321349: Improve publication of the newly allocated snapdata. Modified: stable/11/sys/ufs/ffs/ffs_snapshot.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- stable/11/sys/ufs/ffs/ffs_snapshot.c Fri Aug 4 08:18:17 2017 (r322044) +++ stable/11/sys/ufs/ffs/ffs_snapshot.c Fri Aug 4 08:20:26 2017 (r322045) @@ -2647,8 +2647,8 @@ try_free_snapdata(struct vnode *devvp) static struct snapdata * ffs_snapdata_acquire(struct vnode *devvp) { - struct snapdata *nsn; - struct snapdata *sn; + struct snapdata *nsn, *sn; + int error; /* * Allocate a free snapdata. This is done before acquiring the @@ -2656,23 +2656,37 @@ ffs_snapdata_acquire(struct vnode *devvp) * held. */ nsn = ffs_snapdata_alloc(); - /* - * If there snapshots already exist on this filesystem grab a - * reference to the shared lock. Otherwise this is the first - * snapshot on this filesystem and we need to use our - * pre-allocated snapdata. - */ - VI_LOCK(devvp); - if (devvp->v_rdev->si_snapdata == NULL) { - devvp->v_rdev->si_snapdata = nsn; - nsn = NULL; + + for (;;) { + VI_LOCK(devvp); + sn = devvp->v_rdev->si_snapdata; + if (sn == NULL) { + /* + * This is the first snapshot on this + * filesystem and we use our pre-allocated + * snapdata. Publish sn with the sn_lock + * owned by us, to avoid the race. + */ + error = lockmgr(&nsn->sn_lock, LK_EXCLUSIVE | + LK_NOWAIT, NULL); + if (error != 0) + panic("leaked sn, lockmgr error %d", error); + sn = devvp->v_rdev->si_snapdata = nsn; + VI_UNLOCK(devvp); + nsn = NULL; + break; + } + + /* + * There is a snapshots which already exists on this + * filesystem, grab a reference to the common lock. + */ + error = lockmgr(&sn->sn_lock, LK_INTERLOCK | + LK_EXCLUSIVE | LK_SLEEPFAIL, VI_MTX(devvp)); + if (error == 0) + break; } - sn = devvp->v_rdev->si_snapdata; - /* - * Acquire the snapshot lock. - */ - lockmgr(&sn->sn_lock, - LK_INTERLOCK | LK_EXCLUSIVE | LK_RETRY, VI_MTX(devvp)); + /* * Free any unused snapdata. */ From owner-svn-src-all@freebsd.org Fri Aug 4 08:25:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C728DCCEA8; Fri, 4 Aug 2017 08:25:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 43332837F2; Fri, 4 Aug 2017 08:25:04 +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 v748P3oL020262; Fri, 4 Aug 2017 08:25:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v748P3HP020261; Fri, 4 Aug 2017 08:25:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708040825.v748P3HP020261@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 4 Aug 2017 08:25:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322046 - stable/10/sys/ufs/ffs X-SVN-Group: stable-10 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/10/sys/ufs/ffs X-SVN-Commit-Revision: 322046 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.23 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2017 08:25:04 -0000 Author: kib Date: Fri Aug 4 08:25:03 2017 New Revision: 322046 URL: https://svnweb.freebsd.org/changeset/base/322046 Log: MFC r321347: Account for lock recursion when transfering snaplock to the vnode lock in ffs_snapremove(). Modified: stable/10/sys/ufs/ffs/ffs_snapshot.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- stable/10/sys/ufs/ffs/ffs_snapshot.c Fri Aug 4 08:20:26 2017 (r322045) +++ stable/10/sys/ufs/ffs/ffs_snapshot.c Fri Aug 4 08:25:03 2017 (r322046) @@ -1607,7 +1607,7 @@ ffs_snapremove(vp) struct buf *ibp; struct fs *fs; ufs2_daddr_t numblks, blkno, dblk; - int error, loc, last; + int error, i, last, loc; struct snapdata *sn; ip = VTOI(vp); @@ -1627,10 +1627,14 @@ ffs_snapremove(vp) ip->i_nextsnap.tqe_prev = 0; VI_UNLOCK(devvp); lockmgr(&vp->v_lock, LK_EXCLUSIVE, NULL); + for (i = 0; i < sn->sn_lock.lk_recurse; i++) + lockmgr(&vp->v_lock, LK_EXCLUSIVE, NULL); KASSERT(vp->v_vnlock == &sn->sn_lock, ("ffs_snapremove: lost lock mutation")); vp->v_vnlock = &vp->v_lock; VI_LOCK(devvp); + while (sn->sn_lock.lk_recurse > 0) + lockmgr(&sn->sn_lock, LK_RELEASE, NULL); lockmgr(&sn->sn_lock, LK_RELEASE, NULL); try_free_snapdata(devvp); } else From owner-svn-src-all@freebsd.org Fri Aug 4 08:26:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE962DCCFAD; Fri, 4 Aug 2017 08:26: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 mx1.freebsd.org (Postfix) with ESMTPS id 7C33E83950; Fri, 4 Aug 2017 08:26: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 v748QJ66020356; Fri, 4 Aug 2017 08:26:19 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v748QJmk020355; Fri, 4 Aug 2017 08:26:19 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708040826.v748QJmk020355@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 4 Aug 2017 08:26:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322047 - stable/10/sys/ufs/ffs X-SVN-Group: stable-10 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/10/sys/ufs/ffs X-SVN-Commit-Revision: 322047 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.23 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2017 08:26:20 -0000 Author: kib Date: Fri Aug 4 08:26:19 2017 New Revision: 322047 URL: https://svnweb.freebsd.org/changeset/base/322047 Log: MFC r321348: Unlock correct lock in ffs_snapblkfree(). Modified: stable/10/sys/ufs/ffs/ffs_snapshot.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- stable/10/sys/ufs/ffs/ffs_snapshot.c Fri Aug 4 08:25:03 2017 (r322046) +++ stable/10/sys/ufs/ffs/ffs_snapshot.c Fri Aug 4 08:26:19 2017 (r322047) @@ -1944,7 +1944,7 @@ retry: */ if (error != 0 && wkhd != NULL) softdep_freework(wkhd); - lockmgr(vp->v_vnlock, LK_RELEASE, NULL); + lockmgr(&sn->sn_lock, LK_RELEASE, NULL); return (error); } From owner-svn-src-all@freebsd.org Fri Aug 4 08:27:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEACDDCD09C; Fri, 4 Aug 2017 08:27:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8BC7D83A91; Fri, 4 Aug 2017 08:27:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v748RYiN020450; Fri, 4 Aug 2017 08:27:34 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v748RYQV020449; Fri, 4 Aug 2017 08:27:34 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708040827.v748RYQV020449@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 4 Aug 2017 08:27: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: r322048 - stable/10/sys/ufs/ffs X-SVN-Group: stable-10 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/10/sys/ufs/ffs X-SVN-Commit-Revision: 322048 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.23 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2017 08:27:35 -0000 Author: kib Date: Fri Aug 4 08:27:34 2017 New Revision: 322048 URL: https://svnweb.freebsd.org/changeset/base/322048 Log: MFC r321349: Improve publication of the newly allocated snapdata. Modified: stable/10/sys/ufs/ffs/ffs_snapshot.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- stable/10/sys/ufs/ffs/ffs_snapshot.c Fri Aug 4 08:26:19 2017 (r322047) +++ stable/10/sys/ufs/ffs/ffs_snapshot.c Fri Aug 4 08:27:34 2017 (r322048) @@ -2643,8 +2643,8 @@ try_free_snapdata(struct vnode *devvp) static struct snapdata * ffs_snapdata_acquire(struct vnode *devvp) { - struct snapdata *nsn; - struct snapdata *sn; + struct snapdata *nsn, *sn; + int error; /* * Allocate a free snapdata. This is done before acquiring the @@ -2652,23 +2652,37 @@ ffs_snapdata_acquire(struct vnode *devvp) * held. */ nsn = ffs_snapdata_alloc(); - /* - * If there snapshots already exist on this filesystem grab a - * reference to the shared lock. Otherwise this is the first - * snapshot on this filesystem and we need to use our - * pre-allocated snapdata. - */ - VI_LOCK(devvp); - if (devvp->v_rdev->si_snapdata == NULL) { - devvp->v_rdev->si_snapdata = nsn; - nsn = NULL; + + for (;;) { + VI_LOCK(devvp); + sn = devvp->v_rdev->si_snapdata; + if (sn == NULL) { + /* + * This is the first snapshot on this + * filesystem and we use our pre-allocated + * snapdata. Publish sn with the sn_lock + * owned by us, to avoid the race. + */ + error = lockmgr(&nsn->sn_lock, LK_EXCLUSIVE | + LK_NOWAIT, NULL); + if (error != 0) + panic("leaked sn, lockmgr error %d", error); + sn = devvp->v_rdev->si_snapdata = nsn; + VI_UNLOCK(devvp); + nsn = NULL; + break; + } + + /* + * There is a snapshots which already exists on this + * filesystem, grab a reference to the common lock. + */ + error = lockmgr(&sn->sn_lock, LK_INTERLOCK | + LK_EXCLUSIVE | LK_SLEEPFAIL, VI_MTX(devvp)); + if (error == 0) + break; } - sn = devvp->v_rdev->si_snapdata; - /* - * Acquire the snapshot lock. - */ - lockmgr(&sn->sn_lock, - LK_INTERLOCK | LK_EXCLUSIVE | LK_RETRY, VI_MTX(devvp)); + /* * Free any unused snapdata. */ From owner-svn-src-all@freebsd.org Fri Aug 4 08:56:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE12EDCE400; Fri, 4 Aug 2017 08:56:33 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5CC3A37; Fri, 4 Aug 2017 08:56:33 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v748uW2d032563; Fri, 4 Aug 2017 08:56:32 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v748uVss032550; Fri, 4 Aug 2017 08:56:31 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201708040856.v748uVss032550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Fri, 4 Aug 2017 08:56:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322049 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 322049 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.23 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2017 08:56:33 -0000 Author: brd (doc,ports committer) Date: Fri Aug 4 08:56:31 2017 New Revision: 322049 URL: https://svnweb.freebsd.org/changeset/base/322049 Log: Document usb verbosity levels Submitted by: Tom Jones Approved by: hselasky MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D11850 Modified: head/share/man/man4/ehci.4 head/share/man/man4/ohci.4 head/share/man/man4/ucom.4 head/share/man/man4/ugen.4 head/share/man/man4/uhci.4 head/share/man/man4/uhid.4 head/share/man/man4/ukbd.4 head/share/man/man4/ums.4 head/share/man/man4/uplcom.4 head/share/man/man4/usb.4 head/share/man/man4/xhci.4 Modified: head/share/man/man4/ehci.4 ============================================================================== --- head/share/man/man4/ehci.4 Fri Aug 4 08:27:34 2017 (r322048) +++ head/share/man/man4/ehci.4 Fri Aug 4 08:56:31 2017 (r322049) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 15, 2017 +.Dd August 3, 2017 .Dt EHCI 4 .Os .Sh NAME @@ -69,16 +69,6 @@ but can be noticed since .Tn USB 2.0 devices plugged in to the same connector appear to connect to different USB buses. -.Sh SEE ALSO -.Xr ohci 4 , -.Xr uhci 4 , -.Xr usb 4 , -.Xr xhci 4 -.Sh HISTORY -The -.Nm -device driver first appeared in -.Fx 5.1 . .Sh LOADER TUNABLES When the kernel has been compiled with .Cd options USB_DEBUG , @@ -98,4 +88,27 @@ The default value is 0 (off). .It Va hw.usb.ehci.no_hs This tunable disables USB devices to attach like HIGH-speed ones and will force all attached devices to attach to the FULL- or LOW-speed companion controller. The default value is 0 (off). +.Sh MIB Variables +The +.Nm +driver exposes the following variables in the +.Va hw.usb.ehci +branch of the +.Xr sysctl 3 +MIB: +.Bl -tag -width ".Va debug" +.It Va debug +Debug output level, where 0 is debugging disabled and larger values increase +debug message verbosity. +Default is 0. .El +.Sh SEE ALSO +.Xr ohci 4 , +.Xr uhci 4 , +.Xr usb 4 , +.Xr xhci 4 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 5.1 . Modified: head/share/man/man4/ohci.4 ============================================================================== --- head/share/man/man4/ohci.4 Fri Aug 4 08:27:34 2017 (r322048) +++ head/share/man/man4/ohci.4 Fri Aug 4 08:56:31 2017 (r322049) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 23, 2005 +.Dd August 3, 2017 .Dt OHCI 4 .Os .Sh NAME @@ -59,6 +59,19 @@ NVIDIA nForce3 .It Sun PCIO-2 (RIO USB) .El +.Sh MIB Variables +The +.Nm +driver exposes the following variables in the +.Va hw.usb.ohci +branch of the +.Xr sysctl 3 +MIB: +.Bl -tag -width ".Va debug" +.It Va debug +Debug output level, where 0 is debugging disabled and larger values increase +debug message verbosity. +Default is 0. .Sh SEE ALSO .Xr ehci 4 , .Xr uhci 4 , Modified: head/share/man/man4/ucom.4 ============================================================================== --- head/share/man/man4/ucom.4 Fri Aug 4 08:27:34 2017 (r322048) +++ head/share/man/man4/ucom.4 Fri Aug 4 08:56:31 2017 (r322049) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 26, 2017 +.Dd August 3, 2017 .Dt UCOM 4 .Os .Sh NAME @@ -63,6 +63,21 @@ This means that normal programs such as or .Xr ppp 8 can be used to access the device. +.Sh MIB Variables +The +.Nm +driver exposes the following variables in the +.Va hw.usb.ucom +branch of the +.Xr sysctl 3 +MIB: +.Bl -tag -width ".Va pps_mode" +.It Va debug +Debug output level, where 0 is debugging disabled and larger values increase +debug message verbosity. +Default is 0. +.It Va pps_mode +Enables and configure PPS capture mode as described below. .Sh Pulse Per Second (PPS) Timing Interface The .Nm Modified: head/share/man/man4/ugen.4 ============================================================================== --- head/share/man/man4/ugen.4 Fri Aug 4 08:27:34 2017 (r322048) +++ head/share/man/man4/ugen.4 Fri Aug 4 08:56:31 2017 (r322049) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 16, 2014 +.Dd August 3, 2017 .Dt UGEN 4 .Os .Sh NAME @@ -291,6 +291,19 @@ and .Va alt_index should be set to .Dv USB_CURRENT_ALT_INDEX . +.Sh MIB Variables +The +.Nm +driver exposes the following variables in the +.Va hw.usb.ugen +branch of the +.Xr sysctl 3 +MIB: +.Bl -tag -width ".Va debug" +.It Va debug +Debug output level, where 0 is debugging disabled and larger values increase +debug message verbosity. +Default is 0. .Sh FILES .Bl -tag -width ".Pa /dev/ugen Ns Ar N Ns Pa \&. Ns Ar E" -compact .It Pa /dev/ugen Ns Ar N Ns Pa \&. Ns Ar E Modified: head/share/man/man4/uhci.4 ============================================================================== --- head/share/man/man4/uhci.4 Fri Aug 4 08:27:34 2017 (r322048) +++ head/share/man/man4/uhci.4 Fri Aug 4 08:56:31 2017 (r322049) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 20, 2005 +.Dd August 3, 2017 .Dt UHCI 4 .Os .Sh NAME @@ -49,6 +49,19 @@ Intel 82371SB (PIIX3) .It VIA 83C572 .El +.Sh MIB Variables +The +.Nm +driver exposes the following variables in the +.Va hw.usb.uhci +branch of the +.Xr sysctl 3 +MIB: +.Bl -tag -width ".Va debug" +.It Va debug +Debug output level, where 0 is debugging disabled and larger values increase +debug message verbosity. +Default is 0. .Sh SEE ALSO .Xr ehci 4 , .Xr ohci 4 , Modified: head/share/man/man4/uhid.4 ============================================================================== --- head/share/man/man4/uhid.4 Fri Aug 4 08:27:34 2017 (r322048) +++ head/share/man/man4/uhid.4 Fri Aug 4 08:56:31 2017 (r322049) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 22, 2006 +.Dd August 3, 2017 .Dt UHID 4 .Os .Sh NAME @@ -127,6 +127,19 @@ Use to send data to the device. Data should be written in chunks of the size prescribed by the report descriptor. +.Sh MIB Variables +The +.Nm +driver exposes the following variables in the +.Va hw.usb.uhid +branch of the +.Xr sysctl 3 +MIB: +.Bl -tag -width ".Va debug" +.It Va debug +Debug output level, where 0 is debugging disabled and larger values increase +debug message verbosity. +Default is 0. .Sh FILES .Bl -tag -width ".Pa /dev/uhid?" .It Pa /dev/uhid? Modified: head/share/man/man4/ukbd.4 ============================================================================== --- head/share/man/man4/ukbd.4 Fri Aug 4 08:27:34 2017 (r322048) +++ head/share/man/man4/ukbd.4 Fri Aug 4 08:56:31 2017 (r322049) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 22, 2006 +.Dd August 3, 2017 .Dt UKBD 4 .Os .Sh NAME @@ -136,6 +136,19 @@ or Do not allow the user to change the keymap. Note that these options also affect the AT keyboard driver, .Xr atkbd 4 . +.Sh MIB Variables +The +.Nm +driver exposes the following variables in the +.Va hw.usb.ukbd +branch of the +.Xr sysctl 3 +MIB: +.Bl -tag -width ".Va debug" +.It Va debug +Debug output level, where 0 is debugging disabled and larger values increase +debug message verbosity. +Default is 0. .Sh FILES .Bl -tag -width ".Pa /dev/kbd*" -compact .It Pa /dev/kbd* Modified: head/share/man/man4/ums.4 ============================================================================== --- head/share/man/man4/ums.4 Fri Aug 4 08:27:34 2017 (r322048) +++ head/share/man/man4/ums.4 Fri Aug 4 08:56:31 2017 (r322049) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 27, 2006 +.Dd August 3, 2017 .Dt UMS 4 .Os .Sh NAME @@ -64,6 +64,19 @@ type device. See .Xr moused 8 for an explanation of these mouse types. +.Sh MIB Variables +The +.Nm +driver exposes the following variables in the +.Va hw.usb.ums +branch of the +.Xr sysctl 3 +MIB: +.Bl -tag -width ".Va debug" +.It Va debug +Debug output level, where 0 is debugging disabled and larger values increase +debug message verbosity. +Default is 0. .Sh FILES .Bl -tag -width /dev/ums0 -compact .It Pa /dev/ums0 Modified: head/share/man/man4/uplcom.4 ============================================================================== --- head/share/man/man4/uplcom.4 Fri Aug 4 08:27:34 2017 (r322048) +++ head/share/man/man4/uplcom.4 Fri Aug 4 08:56:31 2017 (r322049) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 26, 2017 +.Dd August 3, 2017 .Dt UPLCOM 4 .Os .Sh NAME @@ -180,6 +180,19 @@ YC-Cable USB-Serial Adapter .It Zeagle N2iTion3 Diving Computer .El +.Sh MIB Variables +The +.Nm +driver exposes the following variables in the +.Va hw.usb.uplcom +branch of the +.Xr sysctl 3 +MIB: +.Bl -tag -width ".Va debug" +.It Va debug +Debug output level, where 0 is debugging disabled and larger values increase +debug message verbosity. +Default is 0. .Sh FILES .Bl -tag -width "/dev/ttyU*.init" -compact .It Pa /dev/ttyU* Modified: head/share/man/man4/usb.4 ============================================================================== --- head/share/man/man4/usb.4 Fri Aug 4 08:27:34 2017 (r322048) +++ head/share/man/man4/usb.4 Fri Aug 4 08:56:31 2017 (r322049) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 29, 2017 +.Dd August 3, 2017 .Dt USB 4 .Os .Sh NAME @@ -131,6 +131,19 @@ Any interface specific driver can attach to the device .It If none is found, generic interface class drivers can attach. .El +.Sh MIB Variables +The +.Nm +driver exposes the following variables in the +.Va hw.usb +branch of the +.Xr sysctl 3 +MIB: +.Bl -tag -width ".Va debug" +.It Va debug +Debug output level, where 0 is debugging disabled and larger values increase +debug message verbosity. +Default is 0. .Sh SEE ALSO The .Tn USB Modified: head/share/man/man4/xhci.4 ============================================================================== --- head/share/man/man4/xhci.4 Fri Aug 4 08:27:34 2017 (r322048) +++ head/share/man/man4/xhci.4 Fri Aug 4 08:56:31 2017 (r322049) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 17, 2011 +.Dd August 3, 2017 .Dt XHCI 4 .Os .Sh NAME @@ -56,6 +56,19 @@ driver supports .Tn XHCI compatible controllers having PCI class 12 (serial bus), subclass 3 (USB) and programming interface 48 (XHCI). +.Sh MIB Variables +The +.Nm +driver exposes the following variables in the +.Va hw.usb.xhci +branch of the +.Xr sysctl 3 +MIB: +.Bl -tag -width ".Va debug" +.It Va debug +Debug output level, where 0 is debugging disabled and larger values increase +debug message verbosity. +Default is 0. .Sh SEE ALSO .Xr ehci 4 , .Xr ohci 4 , From owner-svn-src-all@freebsd.org Fri Aug 4 09:45:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A2D2DD054C; Fri, 4 Aug 2017 09:45:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5AC7920F3; Fri, 4 Aug 2017 09:45:41 +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 v749jebN052800; Fri, 4 Aug 2017 09:45:40 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v749jefW052799; Fri, 4 Aug 2017 09:45:40 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708040945.v749jefW052799@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 4 Aug 2017 09:45:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322050 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 322050 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.23 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2017 09:45:41 -0000 Author: kib Date: Fri Aug 4 09:45:40 2017 New Revision: 322050 URL: https://svnweb.freebsd.org/changeset/base/322050 Log: Relax visibility for some termios symbols. They are defined by XSI or newer SUS. This is a follow-up to r318780. Reported by: jbeich Obtained from: DragonflyBSD commit e08b3836c962 Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/sys/_termios.h Modified: head/sys/sys/_termios.h ============================================================================== --- head/sys/sys/_termios.h Fri Aug 4 08:56:31 2017 (r322049) +++ head/sys/sys/_termios.h Fri Aug 4 09:45:40 2017 (r322050) @@ -91,8 +91,10 @@ #define ICRNL 0x00000100 /* map CR to NL (ala CRMOD) */ #define IXON 0x00000200 /* enable output flow control */ #define IXOFF 0x00000400 /* enable input flow control */ -#if __BSD_VISIBLE +#if __XSI_VISIBLE || __POSIX_VISIBLE >= 200809 #define IXANY 0x00000800 /* any char will restart after stop */ +#endif +#if __BSD_VISIBLE #define IMAXBEL 0x00002000 /* ring bell on input queue full */ #endif @@ -100,12 +102,16 @@ * Output flags - software output processing */ #define OPOST 0x00000001 /* enable following output processing */ -#if __BSD_VISIBLE +#if __XSI_VISIBLE #define ONLCR 0x00000002 /* map NL to CR-NL (ala CRMOD) */ +#endif +#if __BSD_VISIBLE #define TABDLY 0x00000004 /* tab delay mask */ #define TAB0 0x00000000 /* no tab delay and expansion */ #define TAB3 0x00000004 /* expand tabs to spaces */ #define ONOEOT 0x00000008 /* discard EOT's (^D) on output) */ +#endif +#if __XSI_VISIBLE #define OCRNL 0x00000010 /* map CR to NL on output */ #define ONOCR 0x00000020 /* no CR output at column 0 */ #define ONLRET 0x00000040 /* NL performs CR function */ From owner-svn-src-all@freebsd.org Fri Aug 4 10:33:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E53D7DD226C; Fri, 4 Aug 2017 10:33:23 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A4E683803; Fri, 4 Aug 2017 10:33:23 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v74AXMSQ073121; Fri, 4 Aug 2017 10:33:22 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v74AXMQf073120; Fri, 4 Aug 2017 10:33:22 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201708041033.v74AXMQf073120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 4 Aug 2017 10:33:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322051 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 322051 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.23 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2017 10:33:24 -0000 Author: andrew Date: Fri Aug 4 10:33:22 2017 New Revision: 322051 URL: https://svnweb.freebsd.org/changeset/base/322051 Log: Read the numa-node-id property from each CPU node. This will initially be used to support the dual package ThunderX where we need to send MSI/MSI-X interrupts to the same package as the device the interrupt came from. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/mp_machdep.c Modified: head/sys/arm64/arm64/mp_machdep.c ============================================================================== --- head/sys/arm64/arm64/mp_machdep.c Fri Aug 4 09:45:40 2017 (r322050) +++ head/sys/arm64/arm64/mp_machdep.c Fri Aug 4 10:33:22 2017 (r322051) @@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$"); #ifdef FDT #include +#include #include #endif @@ -196,6 +197,10 @@ arm64_cpu_attach(device_t dev) /* Set the device to start it later */ cpu_list[cpuid] = dev; + + /* Try to read the numa node of this cpu */ + OF_getencprop(ofw_bus_get_node(dev), "numa-node-id", + &__pcpu[cpuid].pc_domain, sizeof(__pcpu[cpuid].pc_domain)); return (0); } From owner-svn-src-all@freebsd.org Fri Aug 4 12:57:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53618DD8476; Fri, 4 Aug 2017 12:57:26 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B96B67173; Fri, 4 Aug 2017 12:57:26 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v74CvPgC030138; Fri, 4 Aug 2017 12:57:25 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v74CvPSb030136; Fri, 4 Aug 2017 12:57:25 GMT (envelope-from des@FreeBSD.org) Message-Id: <201708041257.v74CvPSb030136@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Fri, 4 Aug 2017 12:57:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322052 - in head/crypto/openssh: . contrib/cygwin contrib/redhat contrib/suse openbsd-compat regress regress/unittests regress/unittests/conversion regress/unittests/match regress/unit... X-SVN-Group: head X-SVN-Commit-Author: des X-SVN-Commit-Paths: in head/crypto/openssh: . contrib/cygwin contrib/redhat contrib/suse openbsd-compat regress regress/unittests regress/unittests/conversion regress/unittests/match regress/unittests/test_helper regress... X-SVN-Commit-Revision: 322052 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.23 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2017 12:57:26 -0000 Author: des Date: Fri Aug 4 12:57:24 2017 New Revision: 322052 URL: https://svnweb.freebsd.org/changeset/base/322052 Log: Upgrade to OpenSSH 7.5p1. Added: head/crypto/openssh/regress/unittests/conversion/ - copied from r321987, vendor-crypto/openssh/dist/regress/unittests/conversion/ Deleted: head/crypto/openssh/auth1.c Modified: head/crypto/openssh/ChangeLog head/crypto/openssh/INSTALL head/crypto/openssh/Makefile.in head/crypto/openssh/README head/crypto/openssh/auth-pam.c head/crypto/openssh/auth2-pubkey.c head/crypto/openssh/auth2.c head/crypto/openssh/channels.c head/crypto/openssh/channels.h head/crypto/openssh/clientloop.c head/crypto/openssh/compat.c head/crypto/openssh/config.h head/crypto/openssh/configure.ac head/crypto/openssh/contrib/cygwin/ssh-host-config head/crypto/openssh/contrib/redhat/openssh.spec head/crypto/openssh/contrib/suse/openssh.spec head/crypto/openssh/digest-openssl.c head/crypto/openssh/freebsd-configure.sh head/crypto/openssh/hostfile.c head/crypto/openssh/kex.c head/crypto/openssh/krl.c head/crypto/openssh/log.c head/crypto/openssh/match.c head/crypto/openssh/match.h head/crypto/openssh/misc.c head/crypto/openssh/monitor.c head/crypto/openssh/mux.c head/crypto/openssh/openbsd-compat/bsd-misc.c head/crypto/openssh/openbsd-compat/bsd-misc.h head/crypto/openssh/openbsd-compat/fmt_scaled.c head/crypto/openssh/packet.c head/crypto/openssh/packet.h head/crypto/openssh/pathnames.h head/crypto/openssh/readconf.c head/crypto/openssh/regress/Makefile head/crypto/openssh/regress/agent-getpeereid.sh head/crypto/openssh/regress/allow-deny-users.sh head/crypto/openssh/regress/cert-file.sh head/crypto/openssh/regress/forwarding.sh head/crypto/openssh/regress/integrity.sh head/crypto/openssh/regress/test-exec.sh head/crypto/openssh/regress/unittests/Makefile head/crypto/openssh/regress/unittests/match/tests.c head/crypto/openssh/regress/unittests/test_helper/test_helper.c head/crypto/openssh/regress/unittests/test_helper/test_helper.h head/crypto/openssh/regress/unittests/utf8/tests.c head/crypto/openssh/sandbox-seccomp-filter.c head/crypto/openssh/servconf.c head/crypto/openssh/serverloop.c head/crypto/openssh/session.c head/crypto/openssh/sftp-client.c head/crypto/openssh/sftp.c head/crypto/openssh/ssh-agent.c head/crypto/openssh/ssh-keygen.c head/crypto/openssh/ssh-keyscan.c head/crypto/openssh/ssh.c head/crypto/openssh/ssh_config head/crypto/openssh/ssh_config.5 head/crypto/openssh/ssh_namespace.h head/crypto/openssh/sshconnect.c head/crypto/openssh/sshconnect1.c head/crypto/openssh/sshconnect2.c head/crypto/openssh/sshd.8 head/crypto/openssh/sshd.c head/crypto/openssh/sshd_config head/crypto/openssh/sshd_config.5 head/crypto/openssh/sshkey.c head/crypto/openssh/sshkey.h head/crypto/openssh/utf8.c head/crypto/openssh/version.h Directory Properties: head/crypto/openssh/ (props changed) Modified: head/crypto/openssh/ChangeLog ============================================================================== --- head/crypto/openssh/ChangeLog Fri Aug 4 10:33:22 2017 (r322051) +++ head/crypto/openssh/ChangeLog Fri Aug 4 12:57:24 2017 (r322052) @@ -1,3 +1,1174 @@ +commit d38f05dbdd291212bc95ea80648b72b7177e9f4e +Author: Darren Tucker +Date: Mon Mar 20 13:38:27 2017 +1100 + + Add llabs() implementation. + +commit 72536316a219b7394996a74691a5d4ec197480f7 +Author: Damien Miller +Date: Mon Mar 20 12:23:04 2017 +1100 + + crank version numbers + +commit 3be52bc36bdfd24ded7e0f46999e7db520fb4e3f +Author: djm@openbsd.org +Date: Mon Mar 20 01:18:59 2017 +0000 + + upstream commit + + openssh-7.5 + + Upstream-ID: b8b9a4a949427c393cd868215e1724ceb3467ee5 + +commit db84e52fe9cfad57f22e7e23c5fbf00092385129 +Author: Damien Miller +Date: Mon Mar 20 12:07:20 2017 +1100 + + I'm a doofus. + + Unbreak obvious syntax error. + +commit 89f04852db27643717c9c3a2b0dde97ae50099ee +Author: Damien Miller +Date: Mon Mar 20 11:53:34 2017 +1100 + + on Cygwin, check paths from server for backslashes + + Pointed out by Jann Horn of Google Project Zero + +commit 7ef1f9bafc2cc8d97ff2fbd4f280002b6e8ea5d9 +Author: Damien Miller +Date: Mon Mar 20 11:48:34 2017 +1100 + + Yet another synonym for ASCII: "646" + + Used by NetBSD; this unbreaks mprintf() and friends there for the C + locale (caught by dtucker@ and his menagerie of test systems). + +commit 9165abfea3f68a0c684a6ed2e575e59bc31a3a6b +Author: Damien Miller +Date: Mon Mar 20 09:58:34 2017 +1100 + + create test mux socket in /tmp + + Creating the socket in $OBJ could blow past the (quite limited) + path limit for Unix domain sockets. As a bandaid for bz#2660, + reported by Colin Watson; ok dtucker@ + +commit 2adbe1e63bc313d03e8e84e652cc623af8ebb163 +Author: markus@openbsd.org +Date: Wed Mar 15 07:07:39 2017 +0000 + + upstream commit + + disallow KEXINIT before NEWKEYS; ok djm; report by + vegard.nossum at oracle.com + + Upstream-ID: 3668852d1f145050e62f1da08917de34cb0c5234 + +commit 2fbf91684d76d38b9cf06550b69c9e41bca5a71c +Author: Darren Tucker +Date: Thu Mar 16 14:05:46 2017 +1100 + + Include includes.h for compat bits. + +commit b55f634e96b9c5b0cd991e23a9ca181bec4bdbad +Author: Darren Tucker +Date: Thu Mar 16 13:45:17 2017 +1100 + + Wrap stdint.h in #ifdef HAVE_STDINT_H + +commit 55a1117d7342a0bf8b793250cf314bab6b482b99 +Author: Damien Miller +Date: Thu Mar 16 11:22:42 2017 +1100 + + Adapt Cygwin config script to privsep knob removal + + Patch from Corinna Vinschen. + +commit 1a321bfdb91defe3c4d9cca5651724ae167e5436 +Author: deraadt@openbsd.org +Date: Wed Mar 15 03:52:30 2017 +0000 + + upstream commit + + accidents happen to the best of us; ok djm + + Upstream-ID: b7a9dbd71011ffde95e06f6945fe7197dedd1604 + +commit 25f837646be8c2017c914d34be71ca435dfc0e07 +Author: djm@openbsd.org +Date: Wed Mar 15 02:25:09 2017 +0000 + + upstream commit + + fix regression in 7.4: deletion of PKCS#11-hosted keys + would fail unless they were specified by full physical pathname. Report and + fix from Jakub Jelen via bz#2682; ok dtucker@ + + Upstream-ID: 5b5bc20ca11cacb5d5eb29c3f93fd18425552268 + +commit a8c5eeacf032a7d3408957e45dd7603cc1baf55f +Author: djm@openbsd.org +Date: Wed Mar 15 02:19:09 2017 +0000 + + upstream commit + + Fix segfault when sshd attempts to load RSA1 keys (can + only happen when protocol v.1 support is enabled for the client). Reported by + Jakub Jelen in bz#2686; ok dtucker + + Upstream-ID: 8fdaec2ba4b5f65db1d094f6714ce64b25d871d7 + +commit 66705948c0639a7061a0d0753266da7685badfec +Author: djm@openbsd.org +Date: Tue Mar 14 07:19:07 2017 +0000 + + upstream commit + + Mark the sshd_config UsePrivilegeSeparation option as + deprecated, effectively making privsep mandatory in sandboxing mode. ok + markus@ deraadt@ + + (note: this doesn't remove the !privsep code paths, though that will + happen eventually). + + Upstream-ID: b4c52666256c4dd865f8ce9431af5d6ce2d74a0a + +commit f86586b03fe6cd8f595289bde200a94bc2c191af +Author: Damien Miller +Date: Tue Mar 14 18:26:29 2017 +1100 + + Make seccomp-bpf sandbox work on Linux/X32 + + Allow clock_gettime syscall with X32 bit masked off. Apparently + this is required for at least some kernel versions. bz#2142 + Patch mostly by Colin Watson. ok dtucker@ + +commit 2429cf78dd2a9741ce27ba25ac41c535274a0af6 +Author: Damien Miller +Date: Tue Mar 14 18:01:52 2017 +1100 + + require OpenSSL >=1.0.1 + +commit e3ea335abeab731c68f2b2141bee85a4b0bf680f +Author: Damien Miller +Date: Tue Mar 14 17:48:43 2017 +1100 + + Remove macro trickery; no binary change + + This stops the SC_ALLOW(), SC_ALLOW_ARG() and SC_DENY() macros + prepending __NR_ to the syscall number parameter and just makes + them explicit in the macro invocations. + + No binary change in stripped object file before/after. + +commit 5f1596e11d55539678c41f68aed358628d33d86f +Author: Damien Miller +Date: Tue Mar 14 13:15:18 2017 +1100 + + support ioctls for ICA crypto card on Linux/s390 + + Based on patch from Eduardo Barretto; ok dtucker@ + +commit b1b22dd0df2668b322dda174e501dccba2cf5c44 +Author: Darren Tucker +Date: Tue Mar 14 14:19:36 2017 +1100 + + Plumb conversion test into makefile. + +commit f57783f1ddfb4cdfbd612c6beb5ec01cb5b9a6b9 +Author: dtucker@openbsd.org +Date: Tue Mar 14 01:20:29 2017 +0000 + + upstream commit + + Add unit test for convtime(). + + Upstream-Regress-ID: 8717bc0ca4c21120f6dd3a1d3b7a363f707c31e1 + +commit 8884b7247d094cd11ff9e39c325ba928c5bdbc6c +Author: dtucker@openbsd.org +Date: Tue Mar 14 01:10:07 2017 +0000 + + upstream commit + + Add ASSERT_LONG_* helpers. + + Upstream-Regress-ID: fe15beaea8f5063c7f21b0660c722648e3d76431 + +commit c6774d21185220c0ba11e8fd204bf0ad1a432071 +Author: dtucker@openbsd.org +Date: Tue Mar 14 00:55:37 2017 +0000 + + upstream commit + + Fix convtime() overflow test on boundary condition, + spotted by & ok djm. + + Upstream-ID: 51f14c507ea87a3022e63f574100613ab2ba5708 + +commit f5746b40cfe6d767c8e128fe50c43274b31cd594 +Author: dtucker@openbsd.org +Date: Tue Mar 14 00:25:03 2017 +0000 + + upstream commit + + Check for integer overflow when parsing times in + convtime(). Reported by nicolas.iooss at m4x.org, ok djm@ + + Upstream-ID: 35e6a4e98f6fa24df50bfb8ba1307cf70e966f13 + +commit f5907982f42a8d88a430b8a46752cbb7859ba979 +Author: Darren Tucker +Date: Tue Mar 14 13:38:15 2017 +1100 + + Add a "unit" target to run only unit tests. + +commit 9e96b41682aed793fadbea5ccd472f862179fb02 +Author: Damien Miller +Date: Tue Mar 14 12:24:47 2017 +1100 + + Fix weakness in seccomp-bpf sandbox arg inspection + + Syscall arguments are passed via an array of 64-bit values in struct + seccomp_data, but we were only inspecting the bottom 32 bits and not + even those correctly for BE systems. + + Fortunately, the only case argument inspection was used was in the + socketcall filtering so using this for sandbox escape seems + impossible. + + ok dtucker + +commit 8ff3fc3f2f7c13e8968717bc2b895ee32c441275 +Author: djm@openbsd.org +Date: Sat Mar 11 23:44:16 2017 +0000 + + upstream commit + + regress tests for loading certificates without public keys; + bz#2617 based on patch from Adam Eijdenberg; ok markus@ dtucker@ + + Upstream-Regress-ID: 0145d19328ed995b73fe2d9da33596b17429d0d0 + +commit 1e24552716194db8f2f620587b876158a9ef56ad +Author: djm@openbsd.org +Date: Sat Mar 11 23:40:26 2017 +0000 + + upstream commit + + allow ssh to use certificates accompanied by a private + key file but no corresponding plain *.pub public key. bz#2617 based on patch + from Adam Eijdenberg; ok dtucker@ markus@ + + Upstream-ID: 295668dca2c39505281577217583ddd2bd4b00b9 + +commit 0fb1a617a07b8df5de188dd5a0c8bf293d4bfc0e +Author: markus@openbsd.org +Date: Sat Mar 11 13:07:35 2017 +0000 + + upstream commit + + Don't count the initial block twice when computing how + many bytes to discard for the work around for the attacks against CBC-mode. + ok djm@; report from Jean Paul, Kenny, Martin and Torben @ RHUL + + Upstream-ID: f445f509a4e0a7ba3b9c0dae7311cb42458dc1e2 + +commit ef653dd5bd5777132d9f9ee356225f9ee3379504 +Author: dtucker@openbsd.org +Date: Fri Mar 10 07:18:32 2017 +0000 + + upstream commit + + krl.c + + Upstream-ID: fc5e695d5d107d730182e2da7b23f00b489e0ee1 + +commit d94c1dfef2ea30ca67b1204ada7c3b537c54f4d0 +Author: Damien Miller +Date: Sun Mar 12 10:48:14 2017 +1100 + + sync fmt_scaled.c with OpenBSD + + revision 1.13 + date: 2017/03/11 23:37:23; author: djm; state: Exp; lines: +14 -1; commitid: jnFKyHkB3CEiEZ2R; + fix signed integer overflow in scan_scaled. Found by Nicolas Iooss + using AFL against ssh_config. ok deraadt@ millert@ + ---------------------------- + revision 1.12 + date: 2013/11/29 19:00:51; author: deraadt; state: Exp; lines: +6 -5; + fairly simple unsigned char casts for ctype + ok krw + ---------------------------- + revision 1.11 + date: 2012/11/12 14:07:20; author: halex; state: Exp; lines: +4 -2; + make scan_scaled set errno to EINVAL rather than ERANGE if it encounters + an invalid multiplier, like the man page says it should + + "looks sensible" deraadt@, ok ian@ + ---------------------------- + revision 1.10 + date: 2009/06/20 15:00:04; author: martynas; state: Exp; lines: +4 -4; + use llabs instead of the home-grown version; and some comment changes + ok ian@, millert@ + ---------------------------- + +commit 894221a63fa061e52e414ca58d47edc5fe645968 +Author: djm@openbsd.org +Date: Fri Mar 10 05:01:13 2017 +0000 + + upstream commit + + When updating hostkeys, accept RSA keys if + HostkeyAlgorithms contains any RSA keytype. Previously, ssh could ignore RSA + keys when any of the ssh-rsa-sha2-* methods was enabled in HostkeyAlgorithms + nit ssh-rsa (SHA1 signatures) was not. bz#2650 reported by Luis Ressel; ok + dtucker@ + + Upstream-ID: c5e8cfee15c42f4a05d126158a0766ea06da79d2 + +commit dd3e2298663f4cc1a06bc69582d00dcfee27d73c +Author: djm@openbsd.org +Date: Fri Mar 10 04:24:55 2017 +0000 + + upstream commit + + make hostname matching really insensitive to case; + bz#2685, reported by Petr Cerny; ok dtucker@ + + Upstream-ID: e467622ff154269e36ba8b6c9e3d105e1c4a9253 + +commit 77a9be9446697fe8b5499fe651f4a82a71a4b51f +Author: djm@openbsd.org +Date: Fri Mar 10 03:52:48 2017 +0000 + + upstream commit + + reword a comment to make it fit 80 columns + + Upstream-ID: 4ef509a66b96c7314bbcc87027c2af71fa9d0ba4 + +commit 61b8ef6a66efaec07e023342cb94a10bdc2254dc +Author: djm@openbsd.org +Date: Fri Mar 10 04:27:32 2017 +0000 + + upstream commit + + better match sshd config parser behaviour: fatal() if + line is overlong, increase line buffer to match sshd's; bz#2651 reported by + Don Fong; ok dtucker@ + + Upstream-ID: b175ae7e0ba403833f1ee566edf10f67443ccd18 + +commit db2597207e69912f2592cd86a1de8e948a9d7ffb +Author: djm@openbsd.org +Date: Fri Mar 10 04:26:06 2017 +0000 + + upstream commit + + ensure hostname is lower-case before hashing it; + bz#2591 reported by Griff Miller II; ok dtucker@ + + Upstream-ID: c3b8b93804f376bd00d859b8bcd9fc0d86b4db17 + +commit df9936936c695f85c1038bd706d62edf752aca4b +Author: djm@openbsd.org +Date: Fri Mar 10 04:24:55 2017 +0000 + + upstream commit + + make hostname matching really insensitive to case; + bz#2685, reported by Petr Cerny; ok dtucker@ + + Upstream-ID: e632b7a9bf0d0558d5ff56dab98b7cca6c3db549 + +commit 67eed24bfa7645d88fa0b883745fccb22a0e527e +Author: dtucker@openbsd.org +Date: Fri Mar 10 04:11:00 2017 +0000 + + upstream commit + + Remove old null check from config dumper. Patch from + jjelen at redhat.com vi bz#2687, ok djm@ + + Upstream-ID: 824ab71467b78c4bab0dd1b3a38e8bc5f63dd528 + +commit 183ba55aaaecca0206184b854ad6155df237adbe +Author: djm@openbsd.org +Date: Fri Mar 10 04:07:20 2017 +0000 + + upstream commit + + fix regression in 7.4 server-sig-algs, where we were + accidentally excluding SHA2 RSA signature methods. bz#2680, patch from Nuno + Goncalves; ok dtucker@ + + Upstream-ID: 81ac8bfb30960447740b9b8f6a214dcf322f12e8 + +commit 66be4fe8c4435af5bbc82998501a142a831f1181 +Author: dtucker@openbsd.org +Date: Fri Mar 10 03:53:11 2017 +0000 + + upstream commit + + Check for NULL return value from key_new. Patch from + jjelen at redhat.com via bz#2687, ok djm@ + + Upstream-ID: 059e33cd43cba88dc8caf0b1936fd4dd88fd5b8e + +commit ec2892b5c7fea199914cb3a6afb3af38f84990bf +Author: djm@openbsd.org +Date: Fri Mar 10 03:52:48 2017 +0000 + + upstream commit + + reword a comment to make it fit 80 columns + + Upstream-ID: b4b48b4487c0821d16e812c40c9b09f03b28e349 + +commit 7fadbb6da3f4122de689165651eb39985e1cba85 +Author: dtucker@openbsd.org +Date: Fri Mar 10 03:48:57 2017 +0000 + + upstream commit + + Check for NULL argument to sshkey_read. Patch from + jjelen at redhat.com via bz#2687, ok djm@ + + Upstream-ID: c2d00c2ea50c4861d271d0a586f925cc64a87e0e + +commit 5a06b9e019e2b0b0f65a223422935b66f3749de3 +Author: dtucker@openbsd.org +Date: Fri Mar 10 03:45:40 2017 +0000 + + upstream commit + + Plug some mem leaks mostly on error paths. From jjelen + at redhat.com via bz#2687, ok djm@ + + Upstream-ID: 3fb030149598957a51b7c8beb32bf92cf30c96f2 + +commit f6edbe9febff8121f26835996b1229b5064d31b7 +Author: dtucker@openbsd.org +Date: Fri Mar 10 03:24:48 2017 +0000 + + upstream commit + + Plug mem leak on GLOB_NOMATCH case. From jjelen at + redhat.com via bz#2687, ok djm@ + + Upstream-ID: 8016a7ae97719d3aa55fb723fc2ad3200058340d + +commit 566b3a46e89a2fda2db46f04f2639e92da64a120 +Author: dtucker@openbsd.org +Date: Fri Mar 10 03:22:40 2017 +0000 + + upstream commit + + Plug descriptor leaks of auth_sock. From jjelen at + redhat.com via bz#2687, ok djm@ + + Upstream-ID: 248acb99a5ed2fdca37d1aa33c0fcee7be286d88 + +commit 8a2834454c73dfc1eb96453c0e97690595f3f4c2 +Author: djm@openbsd.org +Date: Fri Mar 10 03:18:24 2017 +0000 + + upstream commit + + correctly hash hosts with a port number. Reported by Josh + Powers in bz#2692; ok dtucker@ + + Upstream-ID: 468e357ff143e00acc05bdd2803a696b3d4b6442 + +commit 9747b9c742de409633d4753bf1a752cbd211e2d3 +Author: djm@openbsd.org +Date: Fri Mar 10 03:15:58 2017 +0000 + + upstream commit + + don't truncate off \r\n from long stderr lines; bz#2688, + reported by Brian Dyson; ok dtucker@ + + Upstream-ID: cdfdc4ba90639af807397ce996153c88af046ca4 + +commit 4a4b75adac862029a1064577eb5af299b1580cdd +Author: dtucker@openbsd.org +Date: Fri Mar 10 02:59:51 2017 +0000 + + upstream commit + + Validate digest arg in ssh_digest_final; from jjelen at + redhat.com via bz#2687, ok djm@ + + Upstream-ID: dbe5494dfddfe523fab341a3dab5a79e7338f878 + +commit bee0167be2340d8de4bdc1ab1064ec957c85a447 +Author: Darren Tucker +Date: Fri Mar 10 13:40:18 2017 +1100 + + Check for NULL from malloc. + + Part of bz#2687, from jjelen at redhat.com. + +commit da39b09d43b137a5a3d071b51589e3efb3701238 +Author: Darren Tucker +Date: Fri Mar 10 13:22:32 2017 +1100 + + If OSX is using launchd, remove screen no. + + Check for socket with and without screen number. From Apple and Jakob + Schlyter via bz#2341, with contributions from Ron Frederick, ok djm@ + +commit 8fb15311a011517eb2394bb95a467c209b8b336c +Author: djm@openbsd.org +Date: Wed Mar 8 12:07:47 2017 +0000 + + upstream commit + + quote [host]:port in generated ProxyJump commandline; the + [ / ] characters can confuse some shells (e.g. zsh). Reported by Lauri + Tirkkonen via bugs@ + + Upstream-ID: 65cdd161460e1351c3d778e974c1c2a4fa4bc182 + +commit 18501151cf272a15b5f2c5e777f2e0933633c513 +Author: dtucker@openbsd.org +Date: Mon Mar 6 02:03:20 2017 +0000 + + upstream commit + + Check l->hosts before dereferencing; fixes potential null + pointer deref. ok djm@ + + Upstream-ID: 81c0327c6ec361da794b5c680601195cc23d1301 + +commit d072370793f1a20f01ad827ba8fcd3b8f2c46165 +Author: dtucker@openbsd.org +Date: Mon Mar 6 00:44:51 2017 +0000 + + upstream commit + + linenum is unsigned long so use %lu in log formats. ok + deraadt@ + + Upstream-ID: 9dc582d9bb887ebe0164e030d619fc20b1a4ea08 + +commit 12d3767ba4c84c32150cbe6ff6494498780f12c9 +Author: djm@openbsd.org +Date: Fri Mar 3 06:13:11 2017 +0000 + + upstream commit + + fix ssh-keygen -H accidentally corrupting known_hosts that + contained already-hashed entries. HKF_MATCH_HOST_HASHED is only set by + hostkeys_foreach() when hostname matching is in use, so we need to look for + the hash marker explicitly. + + Upstream-ID: da82ad653b93e8a753580d3cf5cd448bc2520528 + +commit d7abb771bd5a941b26144ba400a34563a1afa589 +Author: djm@openbsd.org +Date: Tue Feb 28 06:10:08 2017 +0000 + + upstream commit + + small memleak: free fd_set on connection timeout (though + we are heading to exit anyway). From Tom Rix in bz#2683 + + Upstream-ID: 10e3dadbb8199845b66581473711642d9e6741c4 + +commit 78142e3ab3887e53a968d6e199bcb18daaf2436e +Author: jmc@openbsd.org +Date: Mon Feb 27 14:30:33 2017 +0000 + + upstream commit + + errant dot; from klemens nanni + + Upstream-ID: 83d93366a5acf47047298c5d3ebc5e7426f37921 + +commit 8071a6924c12bb51406a9a64a4b2892675112c87 +Author: djm@openbsd.org +Date: Fri Feb 24 03:16:34 2017 +0000 + + upstream commit + + might as well set the listener socket CLOEXEC + + Upstream-ID: 9c538433d6a0ca79f5f21decc5620e46fb68ab57 + +commit d5499190559ebe374bcdfa8805408646ceffad64 +Author: djm@openbsd.org +Date: Sun Feb 19 00:11:29 2017 +0000 + + upstream commit + + add test cases for C locale; ok schwarze@ + + Upstream-Regress-ID: 783d75de35fbc923d46e2a5e6cee30f8f381ba87 + +commit 011c8ffbb0275281a0cf330054cf21be10c43e37 +Author: djm@openbsd.org +Date: Sun Feb 19 00:10:57 2017 +0000 + + upstream commit + + Add a common nl_langinfo(CODESET) alias for US-ASCII + "ANSI_X3.4-1968" that is used by Linux. Fixes mprintf output truncation for + non-UTF-8 locales on Linux spotted by dtucker@; ok deraadt@ schwarze@ + + Upstream-ID: c6808956ebffd64066f9075d839f74ff0dd60719 + +commit 0c4430a19b73058a569573492f55e4c9eeaae67b +Author: dtucker@openbsd.org +Date: Tue Feb 7 23:03:11 2017 +0000 + + upstream commit + + Remove deprecated SSH1 options RSAAuthentication and + RhostsRSAAuthentication from regression test sshd_config. + + Upstream-Regress-ID: 8066b753d9dce7cf02ff87af5c727ff680d99491 + +commit 3baa4cdd197c95d972ec3d07f1c0d08f2d7d9199 +Author: dtucker@openbsd.org +Date: Fri Feb 17 02:32:05 2017 +0000 + + upstream commit + + Do not show rsa1 key type in usage when compiled without + SSH1 support. + + Upstream-ID: 068b5c41357a02f319957746fa4e84ea73960f57 + +commit ecc35893715f969e98fee118481f404772de4132 +Author: dtucker@openbsd.org +Date: Fri Feb 17 02:31:14 2017 +0000 + + upstream commit + + ifdef out "rsa1" from the list of supported keytypes when + compiled without SSH1 support. Found by kdunlop at guralp.com, ok djm@ + + Upstream-ID: cea93a26433d235bb1d64b1d990f19a9c160a70f + +commit 10577c6d96a55b877a960b2d0b75edef1b9945af +Author: djm@openbsd.org +Date: Fri Feb 17 02:04:15 2017 +0000 + + upstream commit + + For ProxyJump/-J, surround host name with brackets to + allow literal IPv6 addresses. From Dick Visser; ok dtucker@ + + Upstream-ID: 3a5d3b0171250daf6a5235e91bce09c1d5746bf1 + +commit b2afdaf1b52231aa23d2153f4a8c5a60a694dda4 +Author: jsg@openbsd.org +Date: Wed Feb 15 23:38:31 2017 +0000 + + upstream commit + + Fix memory leaks in match_filter_list() error paths. + + ok dtucker@ markus@ + + Upstream-ID: c7f96ac0877f6dc9188bbc908100a8d246cc7f0e + +commit 6d5a41b38b55258213ecfaae9df7a758caa752a1 +Author: djm@openbsd.org +Date: Wed Feb 15 01:46:47 2017 +0000 + + upstream commit + + fix division by zero crash in "df" output when server + returns zero total filesystem blocks/inodes. Spotted by Guido Vranken; ok + dtucker@ + + Upstream-ID: 6fb6c2ae6b289aa07b6232dbc0be54682ef5419f + +commit bd5d7d239525d595ecea92765334af33a45d9d63 +Author: Darren Tucker +Date: Sun Feb 12 15:45:15 2017 +1100 + + ifdef out EVP_R_PRIVATE_KEY_DECODE_ERROR + + EVP_R_PRIVATE_KEY_DECODE_ERROR was added in OpenSSL 1.0.0 so ifdef out + for the benefit of OpenSSL versions prior to that. + +commit 155d540d00ff55f063421ec182ec8ff2b7ab6cbe +Author: djm@openbsd.org +Date: Fri Feb 10 04:34:50 2017 +0000 + + upstream commit + + bring back r1.34 that was backed out for problems loading + public keys: + + translate OpenSSL error codes to something more + meaninful; bz#2522 reported by Jakub Jelen, ok dtucker@ + + with additional fix from Jakub Jelen to solve the backout. + bz#2525 bz#2523 re-ok dtucker@ + + Upstream-ID: a9d5bc0306f4473d9b4f4484f880e95f3c1cc031 + +commit a287c5ad1e0bf9811c7b9221979b969255076019 +Author: djm@openbsd.org +Date: Fri Feb 10 03:36:40 2017 +0000 + + upstream commit + + Sanitise escape sequences in key comments sent to printf + but preserve valid UTF-8 when the locale supports it; bz#2520 ok dtucker@ + + Upstream-ID: e8eed28712ba7b22d49be534237eed019875bd1e + +commit e40269be388972848aafcca7060111c70aab5b87 +Author: millert@openbsd.org +Date: Wed Feb 8 20:32:43 2017 +0000 + + upstream commit + + Avoid printf %s NULL. From semarie@, OK djm@ + + Upstream-ID: 06beef7344da0208efa9275d504d60d2a5b9266c + +commit 5b90709ab8704dafdb31e5651073b259d98352bc +Author: djm@openbsd.org +Date: Mon Feb 6 09:22:51 2017 +0000 + + upstream commit + + Restore \r\n newline sequence for server ident string. The CR + got lost in the flensing of SSHv1. Pointed out by Stef Bon + + Upstream-ID: 5333fd43ce5396bf5999496096fac5536e678fac + +commit 97c31c46ee2e6b46dfffdfc4f90bbbf188064cbc +Author: djm@openbsd.org +Date: Fri Feb 3 23:01:42 2017 +0000 + + upstream commit + + unit test for match_filter_list() function; still want a + better name for this... + + Upstream-Regress-ID: 840ad6118552c35111f0a897af9c8d93ab8de92a + +commit f1a193464a7b77646f0d0cedc929068e4a413ab4 +Author: djm@openbsd.org +Date: Fri Feb 3 23:05:57 2017 +0000 + + upstream commit + + use ssh_packet_set_log_preamble() to include connection + username in packet log messages, e.g. + + Connection closed by invalid user foo 10.1.1.1 port 44056 [preauth] + + ok markus@ bz#113 + + Upstream-ID: 3591b88bdb5416d6066fb3d49d8fff2375bf1a15 + +commit 07edd7e9537ab32aa52abb5fb2a915c350fcf441 +Author: djm@openbsd.org +Date: Fri Feb 3 23:03:33 2017 +0000 + + upstream commit + + add ssh_packet_set_log_preamble() to allow inclusion of a + preamble string in disconnect messages; ok markus@ + + Upstream-ID: 34cb41182cd76d414c214ccb01c01707849afead + +commit 68bc8cfa7642d3ccbf2cd64281c16b8b9205be59 +Author: djm@openbsd.org +Date: Fri Feb 3 23:01:19 2017 +0000 + + upstream commit + + support =- for removing methods from algorithms lists, + e.g. Ciphers=-*cbc; suggested by Cristian Ionescu-Idbohrn in bz#2671 "I like + it" markus@ + + Upstream-ID: c78c38f9f81a963b33d0eade559f6048add24a6d + +commit c924b2ef941028a1f31e6e94f54dfeeeef462a4e +Author: djm@openbsd.org +Date: Fri Feb 3 05:05:56 2017 +0000 + + upstream commit + + allow form-feed characters at EOL; bz#2431 ok dtucker@ + + Upstream-ID: 1f453afaba6da2ae69d6afdf1ae79a917552f1a2 + +commit 523db8540b720c4d21ab0ff6f928476c70c38aab +Author: Damien Miller +Date: Fri Feb 3 16:01:22 2017 +1100 + + prefer to use ldns-config to find libldns + + Should fix bz#2603 - "Build with ldns and without kerberos support + fails if ldns compiled with kerberos support" by including correct + cflags/libs + + ok dtucker@ + +commit c998bf0afa1a01257a53793eba57941182e9e0b7 +Author: dtucker@openbsd.org +Date: Fri Feb 3 02:56:00 2017 +0000 + + upstream commit + + Make ssh_packet_set_rekey_limits take u32 for the number of + seconds until rekeying (negative values are rejected at config parse time). + This allows the removal of some casts and a signed vs unsigned comparison + warning. + + rekey_time is cast to int64 for the comparison which is a no-op + on OpenBSD, but should also do the right thing in -portable on + anything still using 32bit time_t (until the system time actually + wraps, anyway). + + some early guidance deraadt@, ok djm@ + + Upstream-ID: c9f18613afb994a07e7622eb326f49de3d123b6c + +commit 3ec5fa4ba97d4c4853620daea26a33b9f1fe3422 +Author: jsg@openbsd.org +Date: Thu Feb 2 10:54:25 2017 +0000 + + upstream commit + + In vasnmprintf() return an error if malloc fails and + don't set a function argument to the address of free'd memory. + + ok djm@ + + Upstream-ID: 1efffffff2f51d53c9141f245b90ac23d33b9779 + +commit 858252fb1d451ebb0969cf9749116c8f0ee42753 +Author: dtucker@openbsd.org +Date: Wed Feb 1 02:59:09 2017 +0000 + + upstream commit + + Return true reason for port forwarding failures where + feasible rather than always "administratively prohibited". bz#2674, ok djm@ + + Upstream-ID: d901d9887951774e604ca970e1827afaaef9e419 + +commit 6ba9f893838489add6ec4213c7a997b425e4a9e0 +Author: dtucker@openbsd.org +Date: Mon Jan 30 23:27:39 2017 +0000 + + upstream commit + + Small correction to the known_hosts section on when it is + updated. Patch from lkppo at free.fr some time ago, pointed out by smallm at + sdf.org + + Upstream-ID: 1834d7af179dea1a12ad2137f84566664af225d5 + +commit c61d5ec3c11e7ff9779b6127421d9f166cf10915 +Author: Darren Tucker +Date: Fri Feb 3 14:10:34 2017 +1100 + + Remove _XOPEN_SOURCE from wide char detection. + + Having _XOPEN_SOURCE unconditionally causes problems on some platforms + and configurations, notably Solaris 64-bit binaries. It was there for + the benefit of Linux put the required bits in the *-*linux* section. + + Patch from yvoinov at gmail.com. + +commit f25ee13b3e81fd80efeb871dc150fe49d7fc8afd +Author: djm@openbsd.org +Date: Mon Jan 30 05:22:14 2017 +0000 + + upstream commit + + fully unbreak: some $SSH invocations did not have -F + specified and could pick up the ~/.ssh/config of the user running the tests + + Upstream-Regress-ID: f362d1892c0d3e66212d5d3fc02d915c58ef6b89 + +commit 6956e21fb26652887475fe77ea40d2efcf25908b +Author: djm@openbsd.org +Date: Mon Jan 30 04:54:07 2017 +0000 + + upstream commit + + partially unbreak: was not specifying hostname on some + $SSH invocations + + Upstream-Regress-ID: bc8a5e98e57bad0a92ef4f34ed91c1d18294e2cc + +commit 52763dd3fe0a4678dafdf7aeb32286e514130afc +Author: djm@openbsd.org +Date: Mon Jan 30 01:03:00 2017 +0000 + + upstream commit + + revise keys/principals command hang fix (bz#2655) to + consume entire output, avoiding sending SIGPIPE to subprocesses early; ok + dtucker@ + + Upstream-ID: 7cb04b31a61f8c78c4e48ceededcd2fd5c4ee1bc + +commit 381a2615a154a82c4c53b787f4a564ef894fe9ac +Author: djm@openbsd.org +Date: Mon Jan 30 00:38:50 2017 +0000 + + upstream commit + + small cleanup post SSHv1 removal: + + remove SSHv1-isms in commented examples + + reorder token table to group deprecated and compile-time conditional tokens + better + + fix config dumping code for some compile-time conditional options that + weren't being correctly skipped (SSHv1 and PKCS#11) + + Upstream-ID: f2e96b3cb3158d857c5a91ad2e15925df3060105 + +commit 4833d01591b7eb049489d9558b65f5553387ed43 +Author: djm@openbsd.org +Date: Mon Jan 30 00:34:01 2017 +0000 + + upstream commit + + some explicit NULL tests when dumping configured + forwardings; from Karsten Weiss + + Upstream-ID: 40957b8dea69672b0e50df6b4a91a94e3e37f72d + +commit 326e2fae9f2e3e067b5651365eba86b35ee5a6b2 +Author: djm@openbsd.org +Date: Mon Jan 30 00:32:28 2017 +0000 + + upstream commit + + misplaced braces in test; from Karsten Weiss + + Upstream-ID: f7b794074d3aae8e35b69a91d211c599c94afaae + +commit 3e032a95e46bfaea9f9e857678ac8fa5f63997fb +Author: djm@openbsd.org +Date: Mon Jan 30 00:32:03 2017 +0000 + + upstream commit + + don't dereference authctxt before testing != NULL, it + causes compilers to make assumptions; from Karsten Weiss + + Upstream-ID: 794243aad1e976ebc717885b7a97a25e00c031b2 + +commit 01cfaa2b1cfb84f3cdd32d1bf82b120a8d30e057 +Author: djm@openbsd.org +Date: Fri Jan 6 02:51:16 2017 +0000 + + upstream commit + + use correct ssh-add program; bz#2654, from Colin Watson + + Upstream-Regress-ID: 7042a36e1bdaec6562f6e57e9d047efe9c7a6030 + +commit e5c7ec67cdc42ae2584085e0fc5cc5ee91133cf5 +Author: dtucker@openbsd.org +Date: Fri Jan 6 02:26:10 2017 +0000 + + upstream commit + + Account for timeouts in the integrity tests as failures. + + If the first test in a series for a given MAC happens to modify the low + bytes of a packet length, then ssh will time out and this will be + interpreted as a test failure. Patch from cjwatson at debian.org via + bz#2658. + + Upstream-Regress-ID: e7467613b0badedaa300bc6fc7495ec2f44e2fb9 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Aug 4 13:08:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5CEADD8B97; Fri, 4 Aug 2017 13:08:47 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 744A467652; Fri, 4 Aug 2017 13:08:47 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v74D8k6I034334; Fri, 4 Aug 2017 13:08:46 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v74D8kDd034330; Fri, 4 Aug 2017 13:08:46 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201708041308.v74D8kDd034330@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 4 Aug 2017 13:08:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322053 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 322053 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.23 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2017 13:08:47 -0000 Author: andrew Date: Fri Aug 4 13:08:45 2017 New Revision: 322053 URL: https://svnweb.freebsd.org/changeset/base/322053 Log: Start to teach the GICv3 driver about NUMA. On ThunderX we may have multiple ITS devices, however we only want a single ITS device to be configured on each CPU. To fix this only enable ITS when the node matches the CPUs node. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/gic_v3.c head/sys/arm64/arm64/gic_v3_fdt.c head/sys/arm64/arm64/gic_v3_var.h head/sys/arm64/arm64/gicv3_its.c Modified: head/sys/arm64/arm64/gic_v3.c ============================================================================== --- head/sys/arm64/arm64/gic_v3.c Fri Aug 4 12:57:24 2017 (r322052) +++ head/sys/arm64/arm64/gic_v3.c Fri Aug 4 13:08:45 2017 (r322053) @@ -69,6 +69,7 @@ __FBSDID("$FreeBSD$"); #include "gic_v3_reg.h" #include "gic_v3_var.h" +static bus_get_domain_t gic_v3_get_domain; static bus_read_ivar_t gic_v3_read_ivar; static pic_disable_intr_t gic_v3_disable_intr; @@ -97,6 +98,7 @@ static device_method_t gic_v3_methods[] = { DEVMETHOD(device_detach, gic_v3_detach), /* Bus interface */ + DEVMETHOD(bus_get_domain, gic_v3_get_domain), DEVMETHOD(bus_read_ivar, gic_v3_read_ivar), /* Interrupt controller interface */ @@ -347,6 +349,19 @@ gic_v3_detach(device_t dev) free(sc->gic_res, M_GIC_V3); free(sc->gic_redists.regions, M_GIC_V3); + return (0); +} + +static int +gic_v3_get_domain(device_t dev, device_t child, int *domain) +{ + struct gic_v3_devinfo *di; + + di = device_get_ivars(child); + if (di->gic_domain < 0) + return (ENOENT); + + *domain = di->gic_domain; return (0); } Modified: head/sys/arm64/arm64/gic_v3_fdt.c ============================================================================== --- head/sys/arm64/arm64/gic_v3_fdt.c Fri Aug 4 12:57:24 2017 (r322052) +++ head/sys/arm64/arm64/gic_v3_fdt.c Fri Aug 4 13:08:45 2017 (r322053) @@ -186,6 +186,7 @@ error: /* OFW bus interface */ struct gic_v3_ofw_devinfo { + struct gic_v3_devinfo di_gic_dinfo; struct ofw_bus_devinfo di_dinfo; struct resource_list di_rl; }; @@ -281,6 +282,14 @@ gic_v3_ofw_bus_attach(device_t dev) for (node = OF_child(parent); node > 0; node = OF_peer(node)) { /* Allocate and populate devinfo. */ di = malloc(sizeof(*di), M_GIC_V3, M_WAITOK | M_ZERO); + + /* Read the numa node, or -1 if there is none */ + if (OF_getencprop(node, "numa-node-id", + &di->di_gic_dinfo.gic_domain, + sizeof(di->di_gic_dinfo.gic_domain)) <= 0) { + di->di_gic_dinfo.gic_domain = -1; + } + if (ofw_bus_gen_setup_devinfo(&di->di_dinfo, node)) { if (bootverbose) { device_printf(dev, Modified: head/sys/arm64/arm64/gic_v3_var.h ============================================================================== --- head/sys/arm64/arm64/gic_v3_var.h Fri Aug 4 12:57:24 2017 (r322052) +++ head/sys/arm64/arm64/gic_v3_var.h Fri Aug 4 13:08:45 2017 (r322053) @@ -82,6 +82,11 @@ struct gic_v3_softc { struct gic_v3_irqsrc *gic_irqs; }; + +struct gic_v3_devinfo { + int gic_domain; +}; + #define GIC_INTR_ISRC(sc, irq) (&sc->gic_irqs[irq].gi_isrc) MALLOC_DECLARE(M_GIC_V3); Modified: head/sys/arm64/arm64/gicv3_its.c ============================================================================== --- head/sys/arm64/arm64/gicv3_its.c Fri Aug 4 12:57:24 2017 (r322052) +++ head/sys/arm64/arm64/gicv3_its.c Fri Aug 4 13:08:45 2017 (r322053) @@ -576,6 +576,12 @@ its_init_cpu(device_t dev, struct gicv3_its_softc *sc) uint64_t xbaser, tmp; uint32_t ctlr; u_int cpuid; + int domain; + + if (bus_get_domain(dev, &domain) == 0) { + if (PCPU_GET(domain) != domain) + return (0); + } gicv3 = device_get_parent(dev); cpuid = PCPU_GET(cpuid); From owner-svn-src-all@freebsd.org Fri Aug 4 13:47:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35024DAB9EE; Fri, 4 Aug 2017 13:47:52 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-pf0-f195.google.com (mail-pf0-f195.google.com [209.85.192.195]) (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 06E65690CF; Fri, 4 Aug 2017 13:47:51 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-pf0-f195.google.com with SMTP id h75so1936046pfh.5; Fri, 04 Aug 2017 06:47:51 -0700 (PDT) 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=+cUnZPtf8F5i7i1U3WidRZhzJa9Arua31+BW4wA4yDE=; b=Vyd70VTDDJspAOc/+CNO8uYvd9En9mvxFTstQ381ytjyQcNjKiJgsYTgaDTlkb3gmu VFQiY0ThdrVmBy/xYFD6JAAkXmGUIl/sUVWUPD5hmdQZDHCAB4yiqrWV8ymurDGPUMra mPZ1XSs5qiEsoNqOI6UuE3y3/XeZU4N9CvJ9ljdGnRC3jIN8423fBsF605wjW1Z306rY YhYuw3Gh+jm5BFZHhsXQRfeKbD+hLR0nGbhfqUr4ExGz59DpR5gmpyU/hBcadrgpcYpF YhSAye2XTIJP7r8I1jz9UdYkV/1d34g2cBQwUB2+rNk+q7ZrBNwR6vvQaBHOrgHRUZZX b9gw== X-Gm-Message-State: AIVw112nuBnHWQf9ltib+jzgtMHvkmR79ms0eObf2iFhcksv51KJvn1n HRGsFx9W4Gg0Sye8/8c= X-Received: by 10.84.167.2 with SMTP id c2mr2848681plb.366.1501854470648; Fri, 04 Aug 2017 06:47:50 -0700 (PDT) Received: from mail-pg0-f43.google.com (mail-pg0-f43.google.com. [74.125.83.43]) by smtp.gmail.com with ESMTPSA id 80sm3372081pfr.90.2017.08.04.06.47.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Aug 2017 06:47:50 -0700 (PDT) Received: by mail-pg0-f43.google.com with SMTP id l64so8236676pge.5; Fri, 04 Aug 2017 06:47:50 -0700 (PDT) X-Received: by 10.101.90.7 with SMTP id y7mr2363885pgs.29.1501854470200; Fri, 04 Aug 2017 06:47:50 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.100.169.8 with HTTP; Fri, 4 Aug 2017 06:47:49 -0700 (PDT) In-Reply-To: <0100015dabf99099-b39e4e26-cd45-4099-aa91-49820f55aacd-000000@email.amazonses.com> References: <201708030918.v739IPVY034866@repo.freebsd.org> <0100015dabf99099-b39e4e26-cd45-4099-aa91-49820f55aacd-000000@email.amazonses.com> From: Conrad Meyer Date: Fri, 4 Aug 2017 06:47:49 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r321985 - head/sys/ofed/drivers/infiniband/core To: Colin Percival Cc: Hans Petter Selasky , 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.23 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2017 13:47:52 -0000 On Thu, Aug 3, 2017 at 11:40 PM, Colin Percival wrote: > On 08/03/17 23:28, Hans Petter Selasky wrote: >> On 08/03/17 16:37, Conrad Meyer wrote: >>> Is it not important that the subtraction and result are evaluated >>> without truncation? >> >> ticks is a circular counter. Assuming time = 0 and jiffies = -1U, then "delay" >> becomes a very large negative value, because long is used, and the delay <= 0 >> check, is no longer working like expected. >> >> Casting to "int" or truncating is the right thing to do in this case. > > Signed integer overflow is undefined. Using 'int' is liable to cause problems > after 2^32 ticks. It is undefined in C, but defined in practice with -fwrapv, which the kernel relies upon already. Best, Conrad From owner-svn-src-all@freebsd.org Fri Aug 4 14:24:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52389DB2AC6; Fri, 4 Aug 2017 14:24:26 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 28DE56A5FF; Fri, 4 Aug 2017 14:24:26 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v74EOPq5067804; Fri, 4 Aug 2017 14:24:25 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v74EOOcm067800; Fri, 4 Aug 2017 14:24:24 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201708041424.v74EOOcm067800@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Fri, 4 Aug 2017 14:24:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322054 - head/lib/libutil X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/lib/libutil X-SVN-Commit-Revision: 322054 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.23 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2017 14:24:26 -0000 Author: oshogbo Date: Fri Aug 4 14:24:24 2017 New Revision: 322054 URL: https://svnweb.freebsd.org/changeset/base/322054 Log: Introduce the flopenat(3) function. Reviewed by: des, emaste Differential Revision: https://reviews.freebsd.org/D11690 Modified: head/lib/libutil/Makefile head/lib/libutil/flopen.3 head/lib/libutil/flopen.c head/lib/libutil/libutil.h Modified: head/lib/libutil/Makefile ============================================================================== --- head/lib/libutil/Makefile Fri Aug 4 13:08:45 2017 (r322053) +++ head/lib/libutil/Makefile Fri Aug 4 14:24:24 2017 (r322054) @@ -35,6 +35,7 @@ MAN+= expand_number.3 flopen.3 fparseln.3 hexdump.3 \ property.3 pty.3 quotafile.3 realhostname.3 realhostname_sa.3 \ _secure_path.3 trimdomain.3 uucplock.3 pw_util.3 MAN+= login.conf.5 +MLINKS+=flopen.3 flopenat.3 MLINKS+=kld.3 kld_isloaded.3 kld.3 kld_load.3 MLINKS+=login_auth.3 auth_cat.3 login_auth.3 auth_checknologin.3 MLINKS+=login_cap.3 login_close.3 login_cap.3 login_getcapbool.3 \ Modified: head/lib/libutil/flopen.3 ============================================================================== --- head/lib/libutil/flopen.3 Fri Aug 4 13:08:45 2017 (r322053) +++ head/lib/libutil/flopen.3 Fri Aug 4 14:24:24 2017 (r322054) @@ -25,11 +25,12 @@ .\" .\" $FreeBSD$ .\" -.Dd June 6, 2009 +.Dd July 28, 2017 .Dt FLOPEN 3 .Os .Sh NAME -.Nm flopen +.Nm flopen , +.Nm flopenat .Nd "Reliably open and lock a file" .Sh LIBRARY .Lb libutil @@ -40,6 +41,10 @@ .Fn flopen "const char *path" "int flags" .Ft int .Fn flopen "const char *path" "int flags" "mode_t mode" +.Ft int +.Fn flopenat "int fd" "const char *path" "int flags" +.Ft int +.Fn flopenat "int fd" "const char *path" "int flags" "mode_t mode" .Sh DESCRIPTION The .Fn flopen @@ -79,6 +84,27 @@ argument is required if .Va flags includes .Dv O_CREAT . +.Pp +The +.Fn flopenat +function is equivalent to the +.Fn flopen +function except in the case where the +.Fa path +specifies a relative path. +In this case the file to be opened is determined relative to the directory +associated with the file descriptor +.Fa fd +instead of the current working directory. +If +.Fn flopenat +is passed the special value +.Dv AT_FDCWD +in the +.Fa fd +parameter, the current working directory is used +and the behavior is identical to a call to +.Fn flopen . .Sh RETURN VALUES If successful, .Fn flopen Modified: head/lib/libutil/flopen.c ============================================================================== --- head/lib/libutil/flopen.c Fri Aug 4 13:08:45 2017 (r322053) +++ head/lib/libutil/flopen.c Fri Aug 4 14:24:24 2017 (r322054) @@ -45,8 +45,8 @@ __FBSDID("$FreeBSD$"); * code's apparent simplicity; there would be no need for this function if it * was easy to get right. */ -int -flopen(const char *path, int flags, ...) +static int +vflopenat(int dirfd, const char *path, int flags, va_list ap) { int fd, operation, serrno, trunc; struct stat sb, fsb; @@ -58,11 +58,7 @@ flopen(const char *path, int flags, ...) mode = 0; if (flags & O_CREAT) { - va_list ap; - - va_start(ap, flags); mode = (mode_t)va_arg(ap, int); /* mode_t promoted to int */ - va_end(ap); } operation = LOCK_EX; @@ -73,7 +69,7 @@ flopen(const char *path, int flags, ...) flags &= ~O_TRUNC; for (;;) { - if ((fd = open(path, flags, mode)) == -1) + if ((fd = openat(dirfd, path, flags, mode)) == -1) /* non-existent or no access */ return (-1); if (flock(fd, operation) == -1) { @@ -83,7 +79,7 @@ flopen(const char *path, int flags, ...) errno = serrno; return (-1); } - if (stat(path, &sb) == -1) { + if (fstatat(dirfd, path, &sb, 0) == -1) { /* disappeared from under our feet */ (void)close(fd); continue; @@ -122,4 +118,28 @@ flopen(const char *path, int flags, ...) #endif return (fd); } +} + +int +flopen(const char *path, int flags, ...) +{ + va_list ap; + int ret; + + va_start(ap, flags); + ret = vflopenat(AT_FDCWD, path, flags, ap); + va_end(ap); + return (ret); +} + +int +flopenat(int dirfd, const char *path, int flags, ...) +{ + va_list ap; + int ret; + + va_start(ap, flags); + ret = vflopenat(dirfd, path, flags, ap); + va_end(ap); + return (ret); } Modified: head/lib/libutil/libutil.h ============================================================================== --- head/lib/libutil/libutil.h Fri Aug 4 13:08:45 2017 (r322053) +++ head/lib/libutil/libutil.h Fri Aug 4 14:24:24 2017 (r322054) @@ -93,6 +93,7 @@ int expand_number(const char *_buf, uint64_t *_num); int extattr_namespace_to_string(int _attrnamespace, char **_string); int extattr_string_to_namespace(const char *_string, int *_attrnamespace); int flopen(const char *_path, int _flags, ...); +int flopenat(int _dirfd, const char *_path, int _flags, ...); int forkpty(int *_amaster, char *_name, struct termios *_termp, struct winsize *_winp); void hexdump(const void *_ptr, int _length, const char *_hdr, int _flags); From owner-svn-src-all@freebsd.org Fri Aug 4 14:50:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E8D4DB4451; Fri, 4 Aug 2017 14:50:34 +0000 (UTC) (envelope-from jlehen@gmail.com) Received: from mail-qk0-x22c.google.com (mail-qk0-x22c.google.com [IPv6:2607:f8b0:400d:c09::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 CD8726B804; Fri, 4 Aug 2017 14:50:33 +0000 (UTC) (envelope-from jlehen@gmail.com) Received: by mail-qk0-x22c.google.com with SMTP id a77so10267357qkb.0; Fri, 04 Aug 2017 07:50:33 -0700 (PDT) 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=D6CqvYbvyuxKXdJhOpWfpLQjEcmf+axEdk+NOihaap8=; b=jQ8GbLeqVAlKfJ4wXrUvQ186uacgYdod+8IBvHwj26bPv+9y3e7UBf0bMQ9588d19O h9w+MBon1PpWJ8JFszXPyS9W0m5CHlN6chiu5KPcGEgowdOOfRbzrewQRWM/Lq+DsL+6 n/2SyLSJqIh7scrFaPkD4znHu0/oLMiOTzImQ/MKOMC8wW2rYWcBotnOTxiw7xqEbSdy 0+OVgqntYV8Ytbzf1ZVEDaELigRCRRhwjPug2sjmUyB2ZlLTeZBjZSiA7NcIAlMKAAqN pVvTkqQwczomK/xp/iVHF+TkK4G0GwTwogtNtI7qE4ODOGahOWfBn4CNwjEHAI4of0VE HClA== 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=D6CqvYbvyuxKXdJhOpWfpLQjEcmf+axEdk+NOihaap8=; b=cF5iXqgxmifP8xIVIYOU6kdtXw7l+6fF37wh7SWb0ZgFMkhNA9RA11nysatjUaaQXN k1eAsgoZwesa2xG+vTemDQO6ncos40WevSPfQ3tc/b0ETsyeGIkXxp1x4Ie3PyqiebOb Xx+lNOc8YoFNZdr4lvuhNT7Yr1do+X9DvDcQ5sHFd1tkK7liQCJT3MqoNkCMlgzp4yMP M8/0ZgIlNmZBSmafvmVaT6xXw/l2rN1uJFG+BSf9ZhRtfIbgK4cy/m4qlFuXZB+mbC6Z FIxb3rposOrt8FUglwiBCllRHlR/pXxtR5fEawaxDvGTpZmd2F8bHZO1y/O+3KoZN/oM ktDg== X-Gm-Message-State: AHYfb5jodbAun3Pieo2vp4fKgsu0KlYclSkYVv6FvCB1c+/GHGRCczsv lsf7PLTO2cMpiVC8wCX5mPKG/knN2S13 X-Received: by 10.55.2.193 with SMTP id v62mr3077864qkg.231.1501858233057; Fri, 04 Aug 2017 07:50:33 -0700 (PDT) MIME-Version: 1.0 Sender: jlehen@gmail.com Received: by 10.12.180.155 with HTTP; Fri, 4 Aug 2017 07:50:32 -0700 (PDT) In-Reply-To: References: <201708032130.v73LUC2H045637@repo.freebsd.org> From: Jeremie Le Hen Date: Fri, 4 Aug 2017 16:50:32 +0200 X-Google-Sender-Auth: vr10i75qdgKD_i9LY9FU8nK8ito Message-ID: Subject: Re: svn commit: r322029 - in head: usr.bin usr.sbin To: "Ngie Cooper (yaneurabeya)" 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.23 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2017 14:50:34 -0000 On Fri, Aug 4, 2017 at 12:42 AM, Ngie Cooper (yaneurabeya) wrote: > >> On Aug 3, 2017, at 14:30, Jeremie Le Hen wrote: >> >> Author: jlh >> Date: Thu Aug 3 21:30:12 2017 >> New Revision: 322029 >> URL: https://svnweb.freebsd.org/changeset/base/322029 >> >> Log: >> rwho/ruptime/rwhod shouldn't be gated by RCMDS. > > The why in this commit and the next you made (r322031) would have been incredibly helpful. If bugzilla disappears I only have the commit history tracking the what. I agree, I realized this only afterwards. I don't know how to fix this though. > Cheers, > -Ngie -- Jeremie Le Hen jlh@FreeBSD.org From owner-svn-src-all@freebsd.org Fri Aug 4 15:25:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC6C4DB611D; Fri, 4 Aug 2017 15:25:53 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pp2.rice.edu (proofpoint2.mail.rice.edu [128.42.201.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B64BB6CC12; Fri, 4 Aug 2017 15:25:52 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pps.filterd (pp2.rice.edu [127.0.0.1]) by pp2.rice.edu (8.16.0.17/8.16.0.17) with SMTP id v74CpF4P006502; Fri, 4 Aug 2017 10:25:50 -0500 Received: from mh1.mail.rice.edu (mh1.mail.rice.edu [128.42.201.20]) by pp2.rice.edu with ESMTP id 2c486u8a7m-1; Fri, 04 Aug 2017 10:25:50 -0500 X-Virus-Scanned: by amavis-2.7.0 at mh1.mail.rice.edu, auth channel Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net (108-254-203-201.lightspeed.hstntx.sbcglobal.net [108.254.203.201]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh1.mail.rice.edu (Postfix) with ESMTPSA id 08C70460CF1; Fri, 4 Aug 2017 10:25:49 -0500 (CDT) Subject: Re: svn commit: r322041 - head/sys/kern To: Oliver Pinter , Alan Cox Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <201708040423.v744NOix022999@repo.freebsd.org> From: Alan Cox Message-ID: <773de469-dc2f-d335-2506-bdf0a4db848a@rice.edu> Date: Fri, 4 Aug 2017 10:25:49 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=35 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1611190142 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2017 15:25:54 -0000 On 08/04/2017 02:57, Oliver Pinter wrote: > > > On Friday, August 4, 2017, Alan Cox > wrote: > > Author: alc > Date: Fri Aug 4 04:23:23 2017 > New Revision: 322041 > URL: https://svnweb.freebsd.org/changeset/base/322041 > > > Log: > In case readers are misled by expressions that combine > multiplication and > division, add parentheses to make the precedence explicit. > > Submitted by: Doug Moore > > Requested by: imp > Reviewed by: imp > MFC after: 1 week > X-MFC after: r321840 > Differential Revision: https://reviews.freebsd.org/D11815 > > > Modified: > head/sys/kern/subr_blist.c > > Modified: head/sys/kern/subr_blist.c > ============================================================================== > --- head/sys/kern/subr_blist.c Fri Aug 4 04:20:11 2017 > (r322040) > +++ head/sys/kern/subr_blist.c Fri Aug 4 04:23:23 2017 > (r322041) > @@ -110,6 +110,7 @@ __FBSDID("$FreeBSD$"); > #define bitcount64(x) __bitcount64((uint64_t)(x)) > #define malloc(a,b,c) calloc(a, 1) > #define free(a,b) free(a) > +#define CTASSERT(expr) > > > Is this dummy define intended? > Yes, it is for user-space, stand-alone compilation of this file. > > #include > > @@ -142,6 +143,8 @@ static void blst_radix_print(blmeta_t *scan, > daddr_t b > static MALLOC_DEFINE(M_SWAP, "SWAP", "Swap space"); > #endif > > +CTASSERT(BLIST_BMAP_RADIX % BLIST_META_RADIX == 0); > + > /* > * For a subtree that can represent the state of up to 'radix' > blocks, the > * number of leaf nodes of the subtree is > L=radix/BLIST_BMAP_RADIX. If 'm' > @@ -151,17 +154,19 @@ static MALLOC_DEFINE(M_SWAP, "SWAP", "Swap > space"); > * in the 'meta' functions that process subtrees. Since integer > division > * discards remainders, we can express this computation as > * skip = (m * m**h) / (m - 1) > - * skip = (m * radix / BLIST_BMAP_RADIX) / (m - 1) > - * and if m divides BLIST_BMAP_RADIX, we can simplify further to > - * skip = radix / (BLIST_BMAP_RADIX / m * (m - 1)) > - * so that a simple integer division is enough for the calculation. > + * skip = (m * (radix / BLIST_BMAP_RADIX)) / (m - 1) > + * and since m divides BLIST_BMAP_RADIX, we can simplify further to > + * skip = (radix / (BLIST_BMAP_RADIX / m)) / (m - 1) > + * skip = radix / ((BLIST_BMAP_RADIX / m) * (m - 1)) > + * so that simple integer division by a constant can safely be > used for the > + * calculation. > */ > static inline daddr_t > radix_to_skip(daddr_t radix) > { > > return (radix / > - (BLIST_BMAP_RADIX / BLIST_META_RADIX * > (BLIST_META_RADIX - 1))); > + ((BLIST_BMAP_RADIX / BLIST_META_RADIX) * > (BLIST_META_RADIX - 1))); > } > > /* > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > > To unsubscribe, send any mail to > "svn-src-head-unsubscribe@freebsd.org " > From owner-svn-src-all@freebsd.org Fri Aug 4 15:57:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B51F7DB7A2B; Fri, 4 Aug 2017 15:57:11 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 91E316DA60; Fri, 4 Aug 2017 15:57:11 +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 v74FvA0Y005560; Fri, 4 Aug 2017 15:57:10 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v74FvAW8005558; Fri, 4 Aug 2017 15:57:10 GMT (envelope-from np@FreeBSD.org) Message-Id: <201708041557.v74FvAW8005558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 4 Aug 2017 15:57:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322055 - in head/sys/dev/cxgbe: . common X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys/dev/cxgbe: . common X-SVN-Commit-Revision: 322055 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.23 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2017 15:57:11 -0000 Author: np Date: Fri Aug 4 15:57:10 2017 New Revision: 322055 URL: https://svnweb.freebsd.org/changeset/base/322055 Log: cxgbe(4): Allow the TOE timer tunables to be set with microsecond precision. These timers are already displayed in microseconds in the sysctl MIB. Add variables to track these tunables while here. MFC after: 3 days Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Fri Aug 4 14:24:24 2017 (r322054) +++ head/sys/dev/cxgbe/common/common.h Fri Aug 4 15:57:10 2017 (r322055) @@ -501,13 +501,10 @@ static inline unsigned int dack_ticks_to_usec(const st return (ticks << adap->params.tp.dack_re) / core_ticks_per_usec(adap); } -static inline u_int ms_to_tcp_ticks(const struct adapter *adap, u_int ms) +static inline u_int us_to_tcp_ticks(const struct adapter *adap, u_long us) { - u_long l; - l = (u_long)ms * adap->params.vpd.cclk >> adap->params.tp.tre; - - return (l); + return (us * adap->params.vpd.cclk / 1000 >> adap->params.tp.tre); } void t4_set_reg_field(struct adapter *adap, unsigned int addr, u32 mask, u32 val); Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Fri Aug 4 14:24:24 2017 (r322054) +++ head/sys/dev/cxgbe/t4_main.c Fri Aug 4 15:57:10 2017 (r322055) @@ -294,6 +294,51 @@ TUNABLE_INT("hw.cxgbe.nofldtxq_vi", &t4_nofldtxq_vi); #define NOFLDRXQ_VI 1 static int t4_nofldrxq_vi = -NOFLDRXQ_VI; TUNABLE_INT("hw.cxgbe.nofldrxq_vi", &t4_nofldrxq_vi); + +/* 0 means chip/fw default, non-zero number is value in microseconds */ +static u_long t4_toe_keepalive_idle = 0; +TUNABLE_ULONG("hw.cxgbe.toe.keepalive_idle", &t4_toe_keepalive_idle); + +/* 0 means chip/fw default, non-zero number is value in microseconds */ +static u_long t4_toe_keepalive_interval = 0; +TUNABLE_ULONG("hw.cxgbe.toe.keepalive_interval", &t4_toe_keepalive_interval); + +/* 0 means chip/fw default, non-zero number is # of keepalives before abort */ +static int t4_toe_keepalive_count = 0; +TUNABLE_INT("hw.cxgbe.toe.keepalive_count", &t4_toe_keepalive_count); + +/* 0 means chip/fw default, non-zero number is value in microseconds */ +static u_long t4_toe_rexmt_min = 0; +TUNABLE_ULONG("hw.cxgbe.toe.rexmt_min", &t4_toe_rexmt_min); + +/* 0 means chip/fw default, non-zero number is value in microseconds */ +static u_long t4_toe_rexmt_max = 0; +TUNABLE_ULONG("hw.cxgbe.toe.rexmt_max", &t4_toe_rexmt_max); + +/* 0 means chip/fw default, non-zero number is # of rexmt before abort */ +static int t4_toe_rexmt_count = 0; +TUNABLE_INT("hw.cxgbe.toe.rexmt_count", &t4_toe_rexmt_count); + +/* -1 means chip/fw default, other values are raw backoff values to use */ +static int t4_toe_rexmt_backoff[16] = { + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 +}; +TUNABLE_INT("hw.cxgbe.toe.rexmt_backoff.0", &t4_toe_rexmt_backoff[0]); +TUNABLE_INT("hw.cxgbe.toe.rexmt_backoff.1", &t4_toe_rexmt_backoff[1]); +TUNABLE_INT("hw.cxgbe.toe.rexmt_backoff.2", &t4_toe_rexmt_backoff[2]); +TUNABLE_INT("hw.cxgbe.toe.rexmt_backoff.3", &t4_toe_rexmt_backoff[3]); +TUNABLE_INT("hw.cxgbe.toe.rexmt_backoff.4", &t4_toe_rexmt_backoff[4]); +TUNABLE_INT("hw.cxgbe.toe.rexmt_backoff.5", &t4_toe_rexmt_backoff[5]); +TUNABLE_INT("hw.cxgbe.toe.rexmt_backoff.6", &t4_toe_rexmt_backoff[6]); +TUNABLE_INT("hw.cxgbe.toe.rexmt_backoff.7", &t4_toe_rexmt_backoff[7]); +TUNABLE_INT("hw.cxgbe.toe.rexmt_backoff.8", &t4_toe_rexmt_backoff[8]); +TUNABLE_INT("hw.cxgbe.toe.rexmt_backoff.9", &t4_toe_rexmt_backoff[9]); +TUNABLE_INT("hw.cxgbe.toe.rexmt_backoff.10", &t4_toe_rexmt_backoff[10]); +TUNABLE_INT("hw.cxgbe.toe.rexmt_backoff.11", &t4_toe_rexmt_backoff[11]); +TUNABLE_INT("hw.cxgbe.toe.rexmt_backoff.12", &t4_toe_rexmt_backoff[12]); +TUNABLE_INT("hw.cxgbe.toe.rexmt_backoff.13", &t4_toe_rexmt_backoff[13]); +TUNABLE_INT("hw.cxgbe.toe.rexmt_backoff.14", &t4_toe_rexmt_backoff[14]); +TUNABLE_INT("hw.cxgbe.toe.rexmt_backoff.15", &t4_toe_rexmt_backoff[15]); #endif #ifdef DEV_NETMAP @@ -3611,62 +3656,70 @@ static int set_params__post_init(struct adapter *sc) { uint32_t param, val; +#ifdef TCP_OFFLOAD int i, v, shift; - char s[32]; +#endif /* ask for encapsulated CPLs */ param = FW_PARAM_PFVF(CPLFW4MSG_ENCAP); val = 1; (void)t4_set_params(sc, sc->mbox, sc->pf, 0, 1, ¶m, &val); +#ifdef TCP_OFFLOAD /* * Override the TOE timers with user provided tunables. This is not the * recommended way to change the timers (the firmware config file is) so * these tunables are not documented. * - * All the timer tunables are in milliseconds. + * All the timer tunables are in microseconds. */ - if (TUNABLE_INT_FETCH("hw.cxgbe.toe.keepalive_idle", &v)) { + if (t4_toe_keepalive_idle != 0) { + v = us_to_tcp_ticks(sc, t4_toe_keepalive_idle); + v &= M_KEEPALIVEIDLE; t4_set_reg_field(sc, A_TP_KEEP_IDLE, - V_KEEPALIVEIDLE(M_KEEPALIVEIDLE), - V_KEEPALIVEIDLE(ms_to_tcp_ticks(sc, v))); + V_KEEPALIVEIDLE(M_KEEPALIVEIDLE), V_KEEPALIVEIDLE(v)); } - if (TUNABLE_INT_FETCH("hw.cxgbe.toe.keepalive_interval", &v)) { + if (t4_toe_keepalive_interval != 0) { + v = us_to_tcp_ticks(sc, t4_toe_keepalive_interval); + v &= M_KEEPALIVEINTVL; t4_set_reg_field(sc, A_TP_KEEP_INTVL, - V_KEEPALIVEINTVL(M_KEEPALIVEINTVL), - V_KEEPALIVEINTVL(ms_to_tcp_ticks(sc, v))); + V_KEEPALIVEINTVL(M_KEEPALIVEINTVL), V_KEEPALIVEINTVL(v)); } - if (TUNABLE_INT_FETCH("hw.cxgbe.toe.keepalive_count", &v)) { - v &= M_KEEPALIVEMAXR1; + if (t4_toe_keepalive_count != 0) { + v = t4_toe_keepalive_count & M_KEEPALIVEMAXR2; t4_set_reg_field(sc, A_TP_SHIFT_CNT, V_KEEPALIVEMAXR1(M_KEEPALIVEMAXR1) | V_KEEPALIVEMAXR2(M_KEEPALIVEMAXR2), V_KEEPALIVEMAXR1(1) | V_KEEPALIVEMAXR2(v)); } - if (TUNABLE_INT_FETCH("hw.cxgbe.toe.rexmt_min", &v)) { + if (t4_toe_rexmt_min != 0) { + v = us_to_tcp_ticks(sc, t4_toe_rexmt_min); + v &= M_RXTMIN; t4_set_reg_field(sc, A_TP_RXT_MIN, - V_RXTMIN(M_RXTMIN), V_RXTMIN(ms_to_tcp_ticks(sc, v))); + V_RXTMIN(M_RXTMIN), V_RXTMIN(v)); } - if (TUNABLE_INT_FETCH("hw.cxgbe.toe.rexmt_max", &v)) { + if (t4_toe_rexmt_max != 0) { + v = us_to_tcp_ticks(sc, t4_toe_rexmt_max); + v &= M_RXTMAX; t4_set_reg_field(sc, A_TP_RXT_MAX, - V_RXTMAX(M_RXTMAX), V_RXTMAX(ms_to_tcp_ticks(sc, v))); + V_RXTMAX(M_RXTMAX), V_RXTMAX(v)); } - if (TUNABLE_INT_FETCH("hw.cxgbe.toe.rexmt_count", &v)) { - v &= M_RXTSHIFTMAXR1; + if (t4_toe_rexmt_count != 0) { + v = t4_toe_rexmt_count & M_RXTSHIFTMAXR2; t4_set_reg_field(sc, A_TP_SHIFT_CNT, V_RXTSHIFTMAXR1(M_RXTSHIFTMAXR1) | V_RXTSHIFTMAXR2(M_RXTSHIFTMAXR2), V_RXTSHIFTMAXR1(1) | V_RXTSHIFTMAXR2(v)); } - for (i = 0; i < 16; i++) { - snprintf(s, sizeof(s), "hw.cxgbe.toe.rexmt_backoff.%d", i); - if (TUNABLE_INT_FETCH(s, &v)) { - v &= M_TIMERBACKOFFINDEX0; + for (i = 0; i < nitems(t4_toe_rexmt_backoff); i++) { + if (t4_toe_rexmt_backoff[i] != -1) { + v = t4_toe_rexmt_backoff[i] & M_TIMERBACKOFFINDEX0; shift = (i & 3) << 3; t4_set_reg_field(sc, A_TP_TCP_BACKOFF_REG0 + (i & ~3), M_TIMERBACKOFFINDEX0 << shift, v << shift); } } +#endif return (0); } From owner-svn-src-all@freebsd.org Fri Aug 4 16:33:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B693DBD68E; Fri, 4 Aug 2017 16:33:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54D966F078; Fri, 4 Aug 2017 16:33:38 +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 v74GXbLP021697; Fri, 4 Aug 2017 16:33:37 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v74GXb8T021692; Fri, 4 Aug 2017 16:33:37 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201708041633.v74GXb8T021692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 4 Aug 2017 16:33:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322056 - in head/sys/boot/efi: include libefi loader X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot/efi: include libefi loader X-SVN-Commit-Revision: 322056 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.23 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2017 16:33:38 -0000 Author: imp Date: Fri Aug 4 16:33:36 2017 New Revision: 322056 URL: https://svnweb.freebsd.org/changeset/base/322056 Log: Move EFI fmtdev functionality to libefi This patch moves code necessary for the fmtdev functionality from loader to libefi, allowing other applications to make use of it Submitted by: Eric McCorkle Differential Revision: https://reviews.freebsd.org/D11862 Added: head/sys/boot/efi/libefi/devicename.c (contents, props changed) - copied, changed from r322055, head/sys/boot/efi/loader/devicename.c Deleted: head/sys/boot/efi/loader/devicename.c Modified: head/sys/boot/efi/include/efilib.h head/sys/boot/efi/libefi/Makefile head/sys/boot/efi/loader/Makefile head/sys/boot/efi/loader/loader_efi.h Modified: head/sys/boot/efi/include/efilib.h ============================================================================== --- head/sys/boot/efi/include/efilib.h Fri Aug 4 15:57:10 2017 (r322055) +++ head/sys/boot/efi/include/efilib.h Fri Aug 4 16:33:36 2017 (r322056) @@ -64,6 +64,11 @@ pdinfo_list_t *efiblk_get_pdinfo_list(struct devsw *de void *efi_get_table(EFI_GUID *tbl); +int efi_getdev(void **vdev, const char *devspec, const char **path); +char *efi_fmtdev(void *vdev); +int efi_setcurrdev(struct env_var *ev, int flags, const void *value); + + int efi_register_handles(struct devsw *, EFI_HANDLE *, EFI_HANDLE *, int); EFI_HANDLE efi_find_handle(struct devsw *, int); int efi_handle_lookup(EFI_HANDLE, struct devsw **, int *, uint64_t *); Modified: head/sys/boot/efi/libefi/Makefile ============================================================================== --- head/sys/boot/efi/libefi/Makefile Fri Aug 4 15:57:10 2017 (r322055) +++ head/sys/boot/efi/libefi/Makefile Fri Aug 4 16:33:36 2017 (r322056) @@ -12,7 +12,7 @@ INTERNALLIB= WARNS?= 2 SRCS= delay.c devpath.c efi_console.c efinet.c efipart.c env.c errno.c \ - handles.c wchar.c libefi.c efi_driver_utils.c efizfs.c + handles.c wchar.c libefi.c efi_driver_utils.c efizfs.c devicename.c .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" SRCS+= time.c Copied and modified: head/sys/boot/efi/libefi/devicename.c (from r322055, head/sys/boot/efi/loader/devicename.c) ============================================================================== --- head/sys/boot/efi/loader/devicename.c Fri Aug 4 15:57:10 2017 (r322055, copy source) +++ head/sys/boot/efi/libefi/devicename.c Fri Aug 4 16:33:36 2017 (r322056) @@ -41,8 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include "loader_efi.h" - static int efi_parsedev(struct devdesc **, const char *, const char **); /* Modified: head/sys/boot/efi/loader/Makefile ============================================================================== --- head/sys/boot/efi/loader/Makefile Fri Aug 4 15:57:10 2017 (r322055) +++ head/sys/boot/efi/loader/Makefile Fri Aug 4 16:33:36 2017 (r322056) @@ -16,7 +16,6 @@ SRCS= autoload.c \ bootinfo.c \ conf.c \ copy.c \ - devicename.c \ main.c \ self_reloc.c \ smbios.c \ Modified: head/sys/boot/efi/loader/loader_efi.h ============================================================================== --- head/sys/boot/efi/loader/loader_efi.h Fri Aug 4 15:57:10 2017 (r322055) +++ head/sys/boot/efi/loader/loader_efi.h Fri Aug 4 16:33:36 2017 (r322056) @@ -35,10 +35,6 @@ int efi_autoload(void); -int efi_getdev(void **vdev, const char *devspec, const char **path); -char *efi_fmtdev(void *vdev); -int efi_setcurrdev(struct env_var *ev, int flags, const void *value); - int efi_copy_init(void); ssize_t efi_copyin(const void *src, vm_offset_t dest, const size_t len); From owner-svn-src-all@freebsd.org Fri Aug 4 17:46:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5C2EDC083E; Fri, 4 Aug 2017 17:46:18 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x234.google.com (mail-pg0-x234.google.com [IPv6:2607:f8b0:400e:c05::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A962171211; Fri, 4 Aug 2017 17:46:18 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x234.google.com with SMTP id u185so10629772pgb.1; Fri, 04 Aug 2017 10:46:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=6qD/8itDQ2+UqhIbC6HshJgvrqkYL5rDdY7efey3yxU=; b=a9k0Tiqpr2306iCHlR9Er5OGa/1zDC3j9Sriie1Ofi19WmVCKbZ42SXW8EPb2Grs+0 FgIe+hwi27Yt61vhrUu5zutOMmnLJJapC4EEHEQHgi7q7xYxKp40shUbUarE5JZ5vn/R 1fO020d7/OSd/8HkcQLH5EFRieMfl9IuTQDd7F+medihrtdLD2+4iitXB58pVtNHtt6W +r77G0YxLabK35V2JRUpQsYt8e0wil0rdCxg9tN5kwxDlcgOTgeox7FiXAPdbgZ755xn Feuivq6MRkXwxqZRWPBMfuCcEnyjasT9vBus+F7dO77PgwDQ2BVigDMQvsUGoecvYvzq jr3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=6qD/8itDQ2+UqhIbC6HshJgvrqkYL5rDdY7efey3yxU=; b=d/z94J6jBQ5m7qBHY7tMUS7m/BgQ8y/rfl3v7rDOdRcQCNl7+hS3VFMGRlEM20PC9q GB8dKtH3cpD+X3nYIYl5teDoUdk3cfvVJpZs+u+PmW14hafHgjPTlJuS5uUaOQpb6mwX lZQHPhzZfJxekQNhvgPpSJ4Oj4B8VeDJP1jcgXotN0DmDM8WMgCy4lyCmhzkMfJhCv9R 36C6IwKbtw+sop+IdTTKIVSub+878rIrFZ5DpKc3qrqSmp8aPp4HZlDTmqnWQxNIz9JR eQ8DNZXLaZkrJEyCSv+pSwxB4+NRw78FVF0qEYtAN/oIf786tdUh/ltheh732ekmq/qb xqQQ== X-Gm-Message-State: AIVw11157cpAi4VH0EZtjYD2JiI6UDN/Wn8xVoHyisfYGFjdqvjWBOpa C8OXLe7j4h+I5e4/NEM= X-Received: by 10.99.54.201 with SMTP id d192mr3081282pga.310.1501868777421; Fri, 04 Aug 2017 10:46:17 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id s8sm3837560pfd.77.2017.08.04.10.46.16 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 04 Aug 2017 10:46:16 -0700 (PDT) Subject: Re: svn commit: r321369 - in head: . contrib/compiler-rt/include/sanitizer contrib/compiler-rt/include/xray contrib/compiler-rt/lib/asan contrib/compiler-rt/lib/builtins contrib/compiler-rt/lib/builtin... Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_3D808D7A-5A7C-460E-8991-621C5542CB37"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201707221108.v6MB8UWB068088@repo.freebsd.org> Date: Fri, 4 Aug 2017 10:46:15 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201707221108.v6MB8UWB068088@repo.freebsd.org> To: Dimitry Andric X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2017 17:46:19 -0000 --Apple-Mail=_3D808D7A-5A7C-460E-8991-621C5542CB37 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jul 22, 2017, at 04:08, Dimitry Andric wrote: >=20 > Author: dim > Date: Sat Jul 22 11:08:25 2017 > New Revision: 321369 > URL: https://svnweb.freebsd.org/changeset/base/321369 >=20 > Log: > Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ = to > 5.0.0 (trunk r308421). Upstream has branched for the 5.0.0 release, > which should be in about a month. Please report bugs and = regressions, > so we can get them into the release. >=20 > Please note that from 3.5.0 onwards, clang, llvm and lldb require = C++11 > support to build; see UPDATING for more information. >=20 > MFC after: 2 months Hi Dmitry, This commit changed a lot of mergeinfo under contrib/ and = sys/contrib unnecessarily =E2=80=94 could you please revert those = changes before merging back to ^/head next time? Thank you! -Ngie --Apple-Mail=_3D808D7A-5A7C-460E-8991-621C5542CB37 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZhLLnAAoJEPWDqSZpMIYVObYP/2wW12sPTmrOZT+xwQFiso6Q kE0JhotL0kfal9ByvW3D30MuSz/QySIiAx7z0yCeDRqhNN+jO5EFofq9T7hB+wAR qC0n79jxivQo1PWr/EuXAsb8Cd1NqB+dH2haU1YNyOpFvocYpkUkkiUC8wWfMb4l sdOigmU+Bsr49i2NUW0Ml3M9hFVXEgA4RbUYM6wAVob6UpTch5Xdbo7UI+kdz5/A XBSqwLCkUoYxqUYr8NNpDcwsotPcHZYnOXoiqfAddNCjifcW3FN8znA2HOktc5g9 kgaXd2M7SsW+gvs20kmG3r0WMpPzn4LSE9OLYtNM8J3v4QMVvXssWPkGWzqcby6M Io2qTtyToQ1BSEkqIqVMabOjrp1ax2XXJQH/In4W3x7g25IJQ1F+7qW+/t2gjZfZ Oa7xnl9EEhIo0WEoN0ftopp5IKhFno3EXnjRV1i2rBJR8Pf6fC4+GY0MiJ6Y9HaU wnO6c4YMoTvCVxAghf3zCTQWqAvWI+CM4KQ9HHFBHMZnFxH16a0xuRj8VJ0eJz+O Ny3PwgUFVAK3caiPl5yAglivQoX6BcoAvEyZxOgvsZ46tKxxLDW7rghrpKWtwXhY 7uy1WdLzVJYfKWBrde+U9MmkuvKkKbCAhXViXeWqIkBp7a9MBxdoXlV9stgCHO9b s33YityCOCtdidQpSdtX =dA8O -----END PGP SIGNATURE----- --Apple-Mail=_3D808D7A-5A7C-460E-8991-621C5542CB37-- From owner-svn-src-all@freebsd.org Fri Aug 4 18:02:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B7ADDC13D4; Fri, 4 Aug 2017 18:02:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D1F8371B57; Fri, 4 Aug 2017 18:02:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v74I2sUQ057920; Fri, 4 Aug 2017 18:02:54 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v74I2suo057919; Fri, 4 Aug 2017 18:02:54 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708041802.v74I2suo057919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 4 Aug 2017 18:02:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322059 - head/usr.sbin/pmcstat X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/usr.sbin/pmcstat X-SVN-Commit-Revision: 322059 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.23 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2017 18:02:56 -0000 Author: kib Date: Fri Aug 4 18:02:54 2017 New Revision: 322059 URL: https://svnweb.freebsd.org/changeset/base/322059 Log: Fix off by one in calculation of the number of buckets for the pc addresses. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D11864 Modified: head/usr.sbin/pmcstat/pmcpl_gprof.c Modified: head/usr.sbin/pmcstat/pmcpl_gprof.c ============================================================================== --- head/usr.sbin/pmcstat/pmcpl_gprof.c Fri Aug 4 17:41:49 2017 (r322058) +++ head/usr.sbin/pmcstat/pmcpl_gprof.c Fri Aug 4 18:02:54 2017 (r322059) @@ -468,8 +468,8 @@ pmcpl_gmon_process(struct pmcstat_process *pp, struct image, pmcid); pgf->pgf_pmcid = pmcid; assert(image->pi_end > image->pi_start); - pgf->pgf_nbuckets = (image->pi_end - image->pi_start) / - FUNCTION_ALIGNMENT; /* see */ + pgf->pgf_nbuckets = howmany(image->pi_end - image->pi_start, + FUNCTION_ALIGNMENT); /* see */ pgf->pgf_ndatabytes = sizeof(struct gmonhdr) + pgf->pgf_nbuckets * hc_sz; pgf->pgf_nsamples = 0; From owner-svn-src-all@freebsd.org Fri Aug 4 18:26:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AAC1DC22FB; Fri, 4 Aug 2017 18:26:16 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 579EA7282E; Fri, 4 Aug 2017 18:26:15 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 5FBAF10AB01; Fri, 4 Aug 2017 14:26:07 -0400 (EDT) From: John Baldwin To: Jeremie Le Hen Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r322029 - in head: usr.bin usr.sbin Date: Fri, 04 Aug 2017 11:19:32 -0700 Message-ID: <9401348.cv7bYOMymL@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201708032130.v73LUC2H045637@repo.freebsd.org> References: <201708032130.v73LUC2H045637@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, 04 Aug 2017 14:26:07 -0400 (EDT) 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.23 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2017 18:26:16 -0000 On Thursday, August 03, 2017 09:30:12 PM Jeremie Le Hen wrote: > Author: jlh > Date: Thu Aug 3 21:30:12 2017 > New Revision: 322029 > URL: https://svnweb.freebsd.org/changeset/base/322029 > > Log: > rwho/ruptime/rwhod shouldn't be gated by RCMDS. > > PR: 220953 > Reported by: peter@ > Differential Revision: https://reviews.freebsd.org/D11743 > > Modified: > head/usr.bin/Makefile > head/usr.sbin/Makefile Don't forget to update tools/build/mk/OptionalObsoleteFiles.inc so that 'make delete-old' doesn't incorrectly remove these. The /etc/rc.d/rwhod script is also curently conditional on rcmds (see etc/rc.d/Makefile) as is the 140.clean-rwho periodic script (see etc/periodic/daily/Makefile). -- John Baldwin From owner-svn-src-all@freebsd.org Fri Aug 4 18:38:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04D3FDC2A5B; Fri, 4 Aug 2017 18:38:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:470:7a58:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C08B872E17; Fri, 4 Aug 2017 18:38:16 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:470:7a58::5dcc:fb68:7f41:b95e] (unknown [IPv6:2001:470:7a58:0:5dcc:fb68:7f41:b95e]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 877B02D708; Fri, 4 Aug 2017 20:38:06 +0200 (CEST) From: Dimitry Andric Message-Id: Content-Type: multipart/signed; boundary="Apple-Mail=_CC560F7F-4ECA-44F4-A36C-E57F3BB99160"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r321369 - in head: . contrib/compiler-rt/include/sanitizer contrib/compiler-rt/include/xray contrib/compiler-rt/lib/asan contrib/compiler-rt/lib/builtins contrib/compiler-rt/lib/builtin... Date: Fri, 4 Aug 2017 20:38:03 +0200 In-Reply-To: Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org To: "Ngie Cooper (yaneurabeya)" References: <201707221108.v6MB8UWB068088@repo.freebsd.org> X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2017 18:38:17 -0000 --Apple-Mail=_CC560F7F-4ECA-44F4-A36C-E57F3BB99160 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 On 4 Aug 2017, at 19:46, Ngie Cooper (yaneurabeya) = wrote: >=20 >> On Jul 22, 2017, at 04:08, Dimitry Andric wrote: >>=20 >> Author: dim >> Date: Sat Jul 22 11:08:25 2017 >> New Revision: 321369 >> URL: https://svnweb.freebsd.org/changeset/base/321369 >>=20 >> Log: >> Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ = to >> 5.0.0 (trunk r308421). Upstream has branched for the 5.0.0 release, >> which should be in about a month. Please report bugs and = regressions, >> so we can get them into the release. >>=20 >> Please note that from 3.5.0 onwards, clang, llvm and lldb require = C++11 >> support to build; see UPDATING for more information. >>=20 >> MFC after: 2 months >=20 > Hi Dmitry, > This commit changed a lot of mergeinfo under contrib/ and = sys/contrib unnecessarily =E2=80=94 could you please revert those = changes before merging back to ^/head next time? I would probably have liked to, but every time I merge back stuff from a project branch, Subversion dies in interesting ways, because some sort of mergeinfo is missing. I would rather not mess with the mergeinfo properties it has automatically added, I have *very* bad experiences with that. Of course, mergeinfo can always be removed later on from head, if it is absolutely necessary. But I would rather not touch it at all. If the Subversion authors think some mergeinfo must be automatically added, they are probably right? -Dimitry --Apple-Mail=_CC560F7F-4ECA-44F4-A36C-E57F3BB99160 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.1 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCWYS/CwAKCRCwXqMKLiCW o+YDAKDzk1H+qjfwHL+jJitomFIuGeeF2QCdHeKHc3Xw1yuN1BqBzgrC40PgIWU= =lS9A -----END PGP SIGNATURE----- --Apple-Mail=_CC560F7F-4ECA-44F4-A36C-E57F3BB99160-- From owner-svn-src-all@freebsd.org Fri Aug 4 20:22:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F09DADC72F8; Fri, 4 Aug 2017 20:22:44 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B9BB276E48; Fri, 4 Aug 2017 20:22:44 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v74KMhlp017999; Fri, 4 Aug 2017 20:22:43 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v74KMhqe017997; Fri, 4 Aug 2017 20:22:43 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201708042022.v74KMhqe017997@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 4 Aug 2017 20:22: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: r322060 - stable/11/sys/net80211 X-SVN-Group: stable-11 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: stable/11/sys/net80211 X-SVN-Commit-Revision: 322060 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.23 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2017 20:22:45 -0000 Author: pfg Date: Fri Aug 4 20:22:43 2017 New Revision: 322060 URL: https://svnweb.freebsd.org/changeset/base/322060 Log: MFC r321838: sys/net8021: Add missing braces in setcurchan(). Also fix some indentation. Obtained from: DragonFlyBSD (git c69e37d6) Modified: stable/11/sys/net80211/ieee80211_ioctl.c stable/11/sys/net80211/ieee80211_mesh.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net80211/ieee80211_ioctl.c ============================================================================== --- stable/11/sys/net80211/ieee80211_ioctl.c Fri Aug 4 18:02:54 2017 (r322059) +++ stable/11/sys/net80211/ieee80211_ioctl.c Fri Aug 4 20:22:43 2017 (r322060) @@ -1964,9 +1964,10 @@ setcurchan(struct ieee80211vap *vap, struct ieee80211_ /* XXX need state machine for other vap's to follow */ ieee80211_setcurchan(ic, vap->iv_des_chan); vap->iv_bss->ni_chan = ic->ic_curchan; - } else + } else { ic->ic_curchan = vap->iv_des_chan; ic->ic_rt = ieee80211_get_ratetable(ic->ic_curchan); + } } else { /* * Need to go through the state machine in case we Modified: stable/11/sys/net80211/ieee80211_mesh.c ============================================================================== --- stable/11/sys/net80211/ieee80211_mesh.c Fri Aug 4 18:02:54 2017 (r322059) +++ stable/11/sys/net80211/ieee80211_mesh.c Fri Aug 4 20:22:43 2017 (r322060) @@ -2630,7 +2630,7 @@ mesh_recv_action_meshgate(struct ieee80211_node *ni, /* popagate only if decremented ttl >= 1 && forwarding is enabled */ if ((ie.gann_ttl - 1) < 1 && !(ms->ms_flags & IEEE80211_MESHFLAGS_FWD)) return 0; - pgann.gann_flags = ie.gann_flags; /* Reserved */ + pgann.gann_flags = ie.gann_flags; /* Reserved */ pgann.gann_hopcount = ie.gann_hopcount + 1; pgann.gann_ttl = ie.gann_ttl - 1; IEEE80211_ADDR_COPY(pgann.gann_addr, ie.gann_addr); From owner-svn-src-all@freebsd.org Fri Aug 4 20:24:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74F64DC7421; Fri, 4 Aug 2017 20:24:24 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 41EA276F94; Fri, 4 Aug 2017 20:24:24 +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 v74KONV3018118; Fri, 4 Aug 2017 20:24:23 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v74KON0t018115; Fri, 4 Aug 2017 20:24:23 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201708042024.v74KON0t018115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 4 Aug 2017 20:24:23 +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: r322061 - stable/10/sys/net80211 X-SVN-Group: stable-10 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: stable/10/sys/net80211 X-SVN-Commit-Revision: 322061 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.23 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2017 20:24:24 -0000 Author: pfg Date: Fri Aug 4 20:24:23 2017 New Revision: 322061 URL: https://svnweb.freebsd.org/changeset/base/322061 Log: MFC r321838: sys/net8021: Add missing braces in setcurchan(). Also fix some indentation. Obtained from: DragonFlyBSD (git c69e37d6) Modified: stable/10/sys/net80211/ieee80211_ioctl.c stable/10/sys/net80211/ieee80211_mesh.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net80211/ieee80211_ioctl.c ============================================================================== --- stable/10/sys/net80211/ieee80211_ioctl.c Fri Aug 4 20:22:43 2017 (r322060) +++ stable/10/sys/net80211/ieee80211_ioctl.c Fri Aug 4 20:24:23 2017 (r322061) @@ -1970,9 +1970,10 @@ setcurchan(struct ieee80211vap *vap, struct ieee80211_ /* XXX need state machine for other vap's to follow */ ieee80211_setcurchan(ic, vap->iv_des_chan); vap->iv_bss->ni_chan = ic->ic_curchan; - } else + } else { ic->ic_curchan = vap->iv_des_chan; ic->ic_rt = ieee80211_get_ratetable(ic->ic_curchan); + } } else { /* * Need to go through the state machine in case we Modified: stable/10/sys/net80211/ieee80211_mesh.c ============================================================================== --- stable/10/sys/net80211/ieee80211_mesh.c Fri Aug 4 20:22:43 2017 (r322060) +++ stable/10/sys/net80211/ieee80211_mesh.c Fri Aug 4 20:24:23 2017 (r322061) @@ -2653,7 +2653,7 @@ mesh_recv_action_meshgate(struct ieee80211_node *ni, /* popagate only if decremented ttl >= 1 && forwarding is enabled */ if ((ie.gann_ttl - 1) < 1 && !(ms->ms_flags & IEEE80211_MESHFLAGS_FWD)) return 0; - pgann.gann_flags = ie.gann_flags; /* Reserved */ + pgann.gann_flags = ie.gann_flags; /* Reserved */ pgann.gann_hopcount = ie.gann_hopcount + 1; pgann.gann_ttl = ie.gann_ttl - 1; IEEE80211_ADDR_COPY(pgann.gann_addr, ie.gann_addr); From owner-svn-src-all@freebsd.org Fri Aug 4 21:06:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD31DDC8F4D; Fri, 4 Aug 2017 21:06:48 +0000 (UTC) (envelope-from mjoras@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9AA587C326; Fri, 4 Aug 2017 21:06:48 +0000 (UTC) (envelope-from mjoras@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v74L6l5i034689; Fri, 4 Aug 2017 21:06:47 GMT (envelope-from mjoras@FreeBSD.org) Received: (from mjoras@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v74L6lwo034688; Fri, 4 Aug 2017 21:06:47 GMT (envelope-from mjoras@FreeBSD.org) Message-Id: <201708042106.v74L6lwo034688@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjoras set sender to mjoras@FreeBSD.org using -f From: Matt Joras Date: Fri, 4 Aug 2017 21:06:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322062 - head/sbin/ifconfig X-SVN-Group: head X-SVN-Commit-Author: mjoras X-SVN-Commit-Paths: head/sbin/ifconfig X-SVN-Commit-Revision: 322062 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.23 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2017 21:06:48 -0000 Author: mjoras Date: Fri Aug 4 21:06:47 2017 New Revision: 322062 URL: https://svnweb.freebsd.org/changeset/base/322062 Log: Selectively print "hwaddr" from ifconfig(8). ifconfig(8) printing the hwaddr is only really useful if it differs from the link layer address. Reported by: jhb Reviewed by: rpokala Approved by: rstone (mentor) Differential Revision: https://reviews.freebsd.org/D11777 Modified: head/sbin/ifconfig/af_link.c Modified: head/sbin/ifconfig/af_link.c ============================================================================== --- head/sbin/ifconfig/af_link.c Fri Aug 4 20:24:23 2017 (r322061) +++ head/sbin/ifconfig/af_link.c Fri Aug 4 21:06:47 2017 (r322062) @@ -108,7 +108,15 @@ link_status(int s __unused, const struct ifaddrs *ifa) if (rc != 0) { return; } - if (memcmp(ifr.ifr_addr.sa_data, laggaddr, sdl->sdl_alen) == 0) { + + /* + * If this is definitely a lagg device or the hwaddr + * matches the link addr, don't bother. + */ + if (memcmp(ifr.ifr_addr.sa_data, laggaddr, + sdl->sdl_alen) == 0 || + memcmp(ifr.ifr_addr.sa_data, LLADDR(sdl), + sdl->sdl_alen) == 0) { return; } ether_format = ether_ntoa((const struct ether_addr *) From owner-svn-src-all@freebsd.org Fri Aug 4 21:38:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C333DCA42B; Fri, 4 Aug 2017 21:38:35 +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 mx1.freebsd.org (Postfix) with ESMTPS id 4B8147CFBA; Fri, 4 Aug 2017 21:38:35 +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 v74LcYpT046694; Fri, 4 Aug 2017 21:38:34 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v74LcYBd046693; Fri, 4 Aug 2017 21:38:34 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201708042138.v74LcYBd046693@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Fri, 4 Aug 2017 21:38: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: r322063 - stable/10/sys/amd64/amd64 X-SVN-Group: stable-10 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: stable/10/sys/amd64/amd64 X-SVN-Commit-Revision: 322063 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.23 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2017 21:38:35 -0000 Author: marius Date: Fri Aug 4 21:38:34 2017 New Revision: 322063 URL: https://svnweb.freebsd.org/changeset/base/322063 Log: MFC: r290156, r318354 pmap_change_attr: Only fixup DMAP for DMAPed ranges Modified: stable/10/sys/amd64/amd64/pmap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/pmap.c ============================================================================== --- stable/10/sys/amd64/amd64/pmap.c Fri Aug 4 21:06:47 2017 (r322062) +++ stable/10/sys/amd64/amd64/pmap.c Fri Aug 4 21:38:34 2017 (r322063) @@ -6559,7 +6559,7 @@ pmap_change_attr_locked(vm_offset_t va, vm_size_t size */ for (tmpva = base; tmpva < base + size; ) { pdpe = pmap_pdpe(kernel_pmap, tmpva); - if (*pdpe == 0) + if (pdpe == NULL || *pdpe == 0) return (EINVAL); if (*pdpe & PG_PS) { /* @@ -6632,7 +6632,8 @@ pmap_change_attr_locked(vm_offset_t va, vm_size_t size X86_PG_PDE_CACHE); changed = TRUE; } - if (tmpva >= VM_MIN_KERNEL_ADDRESS) { + if (tmpva >= VM_MIN_KERNEL_ADDRESS && + (*pdpe & PG_PS_FRAME) < dmaplimit) { if (pa_start == pa_end) { /* Start physical address run. */ pa_start = *pdpe & PG_PS_FRAME; @@ -6661,7 +6662,8 @@ pmap_change_attr_locked(vm_offset_t va, vm_size_t size X86_PG_PDE_CACHE); changed = TRUE; } - if (tmpva >= VM_MIN_KERNEL_ADDRESS) { + if (tmpva >= VM_MIN_KERNEL_ADDRESS && + (*pde & PG_PS_FRAME) < dmaplimit) { if (pa_start == pa_end) { /* Start physical address run. */ pa_start = *pde & PG_PS_FRAME; @@ -6688,7 +6690,8 @@ pmap_change_attr_locked(vm_offset_t va, vm_size_t size X86_PG_PTE_CACHE); changed = TRUE; } - if (tmpva >= VM_MIN_KERNEL_ADDRESS) { + if (tmpva >= VM_MIN_KERNEL_ADDRESS && + (*pte & PG_FRAME) < dmaplimit) { if (pa_start == pa_end) { /* Start physical address run. */ pa_start = *pte & PG_FRAME; From owner-svn-src-all@freebsd.org Fri Aug 4 23:34:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D68EDCEE01; Fri, 4 Aug 2017 23:34:26 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51F6A80429; Fri, 4 Aug 2017 23:34:26 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v74NYPKk095333; Fri, 4 Aug 2017 23:34:25 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v74NYPgK095331; Fri, 4 Aug 2017 23:34:25 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201708042334.v74NYPgK095331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Fri, 4 Aug 2017 23:34:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r322071 - stable/11/contrib/libarchive/libarchive X-SVN-Group: stable-11 X-SVN-Commit-Author: mm X-SVN-Commit-Paths: stable/11/contrib/libarchive/libarchive X-SVN-Commit-Revision: 322071 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.23 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2017 23:34:26 -0000 Author: mm Date: Fri Aug 4 23:34:25 2017 New Revision: 322071 URL: https://svnweb.freebsd.org/changeset/base/322071 Log: MFH r321674: Sync libarchive with vendor. Relevant vendor changes: PR #926: ensure ar strtab is null terminated PR: 220462 Modified: stable/11/contrib/libarchive/libarchive/archive_cryptor_private.h stable/11/contrib/libarchive/libarchive/archive_write_set_format_ar.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/libarchive/libarchive/archive_cryptor_private.h ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_cryptor_private.h Fri Aug 4 23:04:24 2017 (r322070) +++ stable/11/contrib/libarchive/libarchive/archive_cryptor_private.h Fri Aug 4 23:34:25 2017 (r322071) @@ -64,7 +64,7 @@ typedef struct { } archive_crypto_ctx; #elif defined(_WIN32) && !defined(__CYGWIN__) && defined(HAVE_BCRYPT_H) -#include +#include /* Common in other bcrypt implementations, but missing from VS2008. */ #ifndef BCRYPT_SUCCESS Modified: stable/11/contrib/libarchive/libarchive/archive_write_set_format_ar.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_write_set_format_ar.c Fri Aug 4 23:04:24 2017 (r322070) +++ stable/11/contrib/libarchive/libarchive/archive_write_set_format_ar.c Fri Aug 4 23:34:25 2017 (r322071) @@ -374,13 +374,14 @@ archive_write_ar_data(struct archive_write *a, const v return (ARCHIVE_WARN); } - ar->strtab = (char *)malloc(s); + ar->strtab = (char *)malloc(s + 1); if (ar->strtab == NULL) { archive_set_error(&a->archive, ENOMEM, "Can't allocate strtab buffer"); return (ARCHIVE_FATAL); } - strncpy(ar->strtab, buff, s); + memcpy(ar->strtab, buff, s); + ar->strtab[s] = '\0'; ar->has_strtab = 1; } From owner-svn-src-all@freebsd.org Fri Aug 4 23:34:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FD5DDCEE50; Fri, 4 Aug 2017 23:34:41 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B009804E3; Fri, 4 Aug 2017 23:34:41 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v74NYewo095400; Fri, 4 Aug 2017 23:34:40 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v74NYeEV095398; Fri, 4 Aug 2017 23:34:40 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201708042334.v74NYeEV095398@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Fri, 4 Aug 2017 23:34:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322072 - stable/10/contrib/libarchive/libarchive X-SVN-Group: stable-10 X-SVN-Commit-Author: mm X-SVN-Commit-Paths: stable/10/contrib/libarchive/libarchive X-SVN-Commit-Revision: 322072 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.23 Precedence: list List-Id: "SVN commit messages 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, 04 Aug 2017 23:34:41 -0000 Author: mm Date: Fri Aug 4 23:34:39 2017 New Revision: 322072 URL: https://svnweb.freebsd.org/changeset/base/322072 Log: MFH r321674: Sync libarchive with vendor. Relevant vendor changes: PR #926: ensure ar strtab is null terminated PR: 220462 Modified: stable/10/contrib/libarchive/libarchive/archive_cryptor_private.h stable/10/contrib/libarchive/libarchive/archive_write_set_format_ar.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/libarchive/libarchive/archive_cryptor_private.h ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_cryptor_private.h Fri Aug 4 23:34:25 2017 (r322071) +++ stable/10/contrib/libarchive/libarchive/archive_cryptor_private.h Fri Aug 4 23:34:39 2017 (r322072) @@ -64,7 +64,7 @@ typedef struct { } archive_crypto_ctx; #elif defined(_WIN32) && !defined(__CYGWIN__) && defined(HAVE_BCRYPT_H) -#include +#include /* Common in other bcrypt implementations, but missing from VS2008. */ #ifndef BCRYPT_SUCCESS Modified: stable/10/contrib/libarchive/libarchive/archive_write_set_format_ar.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_write_set_format_ar.c Fri Aug 4 23:34:25 2017 (r322071) +++ stable/10/contrib/libarchive/libarchive/archive_write_set_format_ar.c Fri Aug 4 23:34:39 2017 (r322072) @@ -374,13 +374,14 @@ archive_write_ar_data(struct archive_write *a, const v return (ARCHIVE_WARN); } - ar->strtab = (char *)malloc(s); + ar->strtab = (char *)malloc(s + 1); if (ar->strtab == NULL) { archive_set_error(&a->archive, ENOMEM, "Can't allocate strtab buffer"); return (ARCHIVE_FATAL); } - strncpy(ar->strtab, buff, s); + memcpy(ar->strtab, buff, s); + ar->strtab[s] = '\0'; ar->has_strtab = 1; } From owner-svn-src-all@freebsd.org Sat Aug 5 00:28:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79EB4DD13F3; Sat, 5 Aug 2017 00:28:43 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4906981B72; Sat, 5 Aug 2017 00:28:43 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v750SgJi015801; Sat, 5 Aug 2017 00:28:42 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v750Sgsj015800; Sat, 5 Aug 2017 00:28:42 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201708050028.v750Sgsj015800@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 5 Aug 2017 00:28:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322073 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 322073 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.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 00:28:43 -0000 Author: cy Date: Sat Aug 5 00:28:42 2017 New Revision: 322073 URL: https://svnweb.freebsd.org/changeset/base/322073 Log: Fix matchcing of NATed ICMP queries (resolving NATed MTU discovery). MFC after: 1 month Modified: head/sys/contrib/ipfilter/netinet/ip_nat.c Modified: head/sys/contrib/ipfilter/netinet/ip_nat.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_nat.c Fri Aug 4 23:34:39 2017 (r322072) +++ head/sys/contrib/ipfilter/netinet/ip_nat.c Sat Aug 5 00:28:42 2017 (r322073) @@ -4100,13 +4100,8 @@ ipf_nat_inlookup(fin, flags, p, src, mapdst) dport = htons(fin->fin_data[1]); break; case IPPROTO_ICMP : - if (flags & IPN_ICMPERR) { - sport = fin->fin_data[1]; - dport = 0; - } else { - dport = fin->fin_data[1]; - sport = 0; - } + sport = 0; + dport = fin->fin_data[1]; break; default : sport = 0; @@ -4426,8 +4421,6 @@ ipf_nat_outlookup(fin, flags, p, src, dst) ifp = fin->fin_ifp; sflags = flags & IPN_TCPUDPICMP; - sport = 0; - dport = 0; switch (p) { @@ -4437,12 +4430,12 @@ ipf_nat_outlookup(fin, flags, p, src, dst) dport = htons(fin->fin_data[1]); break; case IPPROTO_ICMP : - if (flags & IPN_ICMPERR) - sport = fin->fin_data[1]; - else - dport = fin->fin_data[1]; + sport = 0; + dport = fin->fin_data[1]; break; default : + sport = 0; + dport = 0; break; } From owner-svn-src-all@freebsd.org Sat Aug 5 00:35:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7ED1BDD18BB; Sat, 5 Aug 2017 00:35:14 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 2970181F72; Sat, 5 Aug 2017 00:35:13 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id dn3Ydvvg8M9gtdn3Zd1oxO; Fri, 04 Aug 2017 18:35:07 -0600 X-Authority-Analysis: v=2.2 cv=a+JAzQaF c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=KeKAF7QvOSUA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=6Vuxsx63iLNc-3tpRSQA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 2088FB3; Fri, 4 Aug 2017 17:35:04 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id v750Xm3F076876; Fri, 4 Aug 2017 17:33:48 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201708050033.v750Xm3F076876@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Cy Schubert cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r322073 - head/sys/contrib/ipfilter/netinet In-Reply-To: Message from Cy Schubert of "Sat, 05 Aug 2017 00:28:42 -0000." <201708050028.v750Sgsj015800@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 04 Aug 2017 17:33:48 -0700 X-CMAE-Envelope: MS4wfBHRIHGHDfo9MsUYbPRMiHNudLdy5VxSCw32+oRcXjgJlxC5iuhimk3V1Wnur1Tl8zN126FMH72JHmL4m0RHYzdPVcGm2yo3naiL9v+Jwcwv4canmjeW B/bHLWv5h7uT5eA0l6B7dcm486M8SB9DTTpeF0+uEMXZr3PJGU1C/E1Uc2nIdZ6pYJmlH/onUhH8bSwl7SFFMV2m+OiHUM3lVRO8iqYVWO8g4EB7UqTJ3+OL IleOOYvjMQhPK5l+QhsUf3GGoL2FEq0dBId+Sd0LC9wJdgiOS5SaY1uxW2VvYJ5P X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 00:35:14 -0000 In message <201708050028.v750Sgsj015800@repo.freebsd.org>, Cy Schubert writes: > Author: cy > Date: Sat Aug 5 00:28:42 2017 > New Revision: 322073 > URL: https://svnweb.freebsd.org/changeset/base/322073 > > Log: > Fix matchcing of NATed ICMP queries (resolving NATed MTU discovery). > > MFC after: 1 month Obtained from: NetBSD r1.16 > > Modified: > head/sys/contrib/ipfilter/netinet/ip_nat.c > > Modified: head/sys/contrib/ipfilter/netinet/ip_nat.c > ============================================================================= > = > --- head/sys/contrib/ipfilter/netinet/ip_nat.c Fri Aug 4 23:34:39 201 > 7 (r322072) > +++ head/sys/contrib/ipfilter/netinet/ip_nat.c Sat Aug 5 00:28:42 201 > 7 (r322073) > @@ -4100,13 +4100,8 @@ ipf_nat_inlookup(fin, flags, p, src, mapdst) > dport = htons(fin->fin_data[1]); > break; > case IPPROTO_ICMP : > - if (flags & IPN_ICMPERR) { > - sport = fin->fin_data[1]; > - dport = 0; > - } else { > - dport = fin->fin_data[1]; > - sport = 0; > - } > + sport = 0; > + dport = fin->fin_data[1]; > break; > default : > sport = 0; > @@ -4426,8 +4421,6 @@ ipf_nat_outlookup(fin, flags, p, src, dst) > > ifp = fin->fin_ifp; > sflags = flags & IPN_TCPUDPICMP; > - sport = 0; > - dport = 0; > > switch (p) > { > @@ -4437,12 +4430,12 @@ ipf_nat_outlookup(fin, flags, p, src, dst) > dport = htons(fin->fin_data[1]); > break; > case IPPROTO_ICMP : > - if (flags & IPN_ICMPERR) > - sport = fin->fin_data[1]; > - else > - dport = fin->fin_data[1]; > + sport = 0; > + dport = fin->fin_data[1]; > break; > default : > + sport = 0; > + dport = 0; > break; > } > -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Sat Aug 5 02:00:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1535DDD59AF; Sat, 5 Aug 2017 02:00:18 +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 9F903845AB; Sat, 5 Aug 2017 02:00:17 +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 5320CD65BDB; Sat, 5 Aug 2017 11:28:49 +1000 (AEST) Date: Sat, 5 Aug 2017 11:28:48 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Colin Percival cc: Hans Petter Selasky , cem@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r321985 - head/sys/ofed/drivers/infiniband/core In-Reply-To: <0100015dabf98abb-dde34a5d-d5bf-4dab-ae6f-897cd12526dc-000000@email.amazonses.com> Message-ID: <20170805105048.J1055@besplex.bde.org> References: <201708030918.v739IPVY034866@repo.freebsd.org> <0100015dabf98abb-dde34a5d-d5bf-4dab-ae6f-897cd12526dc-000000@email.amazonses.com> 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=KeqiiUQD c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=6eer1yf4SQJKv7TV9SgA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 02:00:18 -0000 On Fri, 4 Aug 2017, Colin Percival wrote: > On 08/03/17 23:28, Hans Petter Selasky wrote: >> On 08/03/17 16:37, Conrad Meyer wrote: >>> Is it not important that the subtraction and result are evaluated >>> without truncation? >> >> ticks is a circular counter. Assuming time = 0 and jiffies = -1U, then "delay" >> becomes a very large negative value, because long is used, and the delay <= 0 >> check, is no longer working like expected. >> >> Casting to "int" or truncating is the right thing to do in this case. > > Signed integer overflow is undefined. Using 'int' is liable to cause problems > after 2^32 ticks. There is no (new) overflow here. Converting a higher rank type to int has implementation-defined behaviour. I have yet to see an implementation that defines its behaviour except in its source code, but all implementations that I have seen do the right thing of truncating 2's complement integers. Perverse implementations would produce specific garbage values or perhaps rand(). They just have to document this. 'int overflows after 2^31-1 ticks if int is 32 bits. It is using u_int that is liable to cause problems after 2^32 ticks. Using long and u_long causes exactly the same problems if long is 32 bits. >>>> Modified: head/sys/ofed/drivers/infiniband/core/addr.c >>>> ============================================================================== >>>> --- head/sys/ofed/drivers/infiniband/core/addr.c Thu Aug 3 09:14:43 >>>> 2017 (r321984) >>>> +++ head/sys/ofed/drivers/infiniband/core/addr.c Thu Aug 3 09:18:25 >>>> 2017 (r321985) >>>> @@ -187,10 +187,10 @@ EXPORT_SYMBOL(rdma_translate_ip); >>>> >>>> static void set_timeout(unsigned long time) >>>> { >>>> - unsigned long delay; >>>> + int delay; /* under FreeBSD ticks are 32-bit */ >>>> >>>> delay = time - jiffies; There is no overflow here. The RHS is calculated in u_long arithmetic which has truncation instead of overflow. First, jiffies is converted to u_long in a standards-defined way. If jiffies is non-negative, then its value is unchanged by the conversion. I think jiffies can't be negative, but if it is then there are complications -- the value must be changed; it is changed by adding a multiple of ULONG_MAX which is normally 1, but it not easy to see that the multiple is always 1 (if that uis the case). Then the subtraction can't overflow, but it produces a garbage result of time < jiffies. As usual, using unsigned is a bug. Here it breaks calculations of negative differences. >>>> - if ((long)delay <= 0) >>>> + if (delay <= 0) >>>> delay = 1; Then we cast to long in the old code, and assign the RHS to int in the new code. Both are implementation-defined. The cast does nothing different from assignment except it might change compiler warnings. The old code seems to be correct enough. Suppose time is 59 and jiffies is 60. Then time - jiffies is 0xffffffffLU on 32-bit systems and 0xffffffffffffffffLU on 64-bit systems. If the implementation-defined behaviour were documented, then we would know that the result of casting either of these to long is -1L. This is < 0, so delay gets fixed up to +1. Similarly with the new code -- the assignment converts the huge unsigned values to -1. Problems with the type mismatch might occur later, but I don't see any. On 64-bit systems, the difference can be really huge without tripping the (long)delay <= 0 test. Above INT_MAX, later truncation to int in APIs using ticks will give garbage (possibly 0 or negative). I guess that is the problem. But even on 32-bit systems, the difference can be INT_MAX and that seems too large to be correct. If jiffies are 1/1000 seconds, then it is thewell-known magic number 24+ days. User code might generate that, but kernel driver code shouldn't. Bruce From owner-svn-src-all@freebsd.org Sat Aug 5 02:26:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D6A8DD74AF; Sat, 5 Aug 2017 02:26:12 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id E59E28D3; Sat, 5 Aug 2017 02:26:11 +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 mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 62CF71045ED9; Sat, 5 Aug 2017 12:26:03 +1000 (AEST) Date: Sat, 5 Aug 2017 12:26:03 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: Bruce Evans , Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r321920 - head/sys/sys In-Reply-To: <20170803120729.GO1700@kib.kiev.ua> Message-ID: <20170805112924.W1055@besplex.bde.org> References: <201708021014.v72AEHEk061037@repo.freebsd.org> <37abc595-c80e-a8da-04a8-815f42c634de@selasky.org> <20170802135455.GG1700@kib.kiev.ua> <20170803122015.Q1093@besplex.bde.org> <20170803075747.GJ1700@kib.kiev.ua> <20170803180419.R2314@besplex.bde.org> <20170803120729.GO1700@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=KeqiiUQD c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=HLF2S318A8q7yMrcC8QA:9 a=rz2QiUMzXMD4j6UH:21 a=fJpQLJjFt_BGb_za:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 02:26:12 -0000 On Thu, 3 Aug 2017, Konstantin Belousov wrote: > On Thu, Aug 03, 2017 at 07:34:56PM +1000, Bruce Evans wrote: >> I see another problem. Masking with 0xfffffffff and casting to unsigned >> are gratuitously different spellings for extracting the low 32 bits. >> I prefer the cast. > > Below is one more update. I reformulated the man page text, but not too > deep. Also I replaced masking with the cast. OK. > diff --git a/sys/sys/types.h b/sys/sys/types.h > index 30a08724443..eacbc1ba0c4 100644 > --- a/sys/sys/types.h > +++ b/sys/sys/types.h > @@ -364,9 +364,9 @@ __bitcount64(__uint64_t _x) > > #include > > -#define major(x) ((int)((dev_t)(x) >> 32)) /* major number */ > -#define minor(x) ((int)((x) & 0xffffffff)) /* minor number */ > -#define makedev(x, y) (((dev_t)(x) << 32) | (unsigned)(y)) /* create dev_t */ > +#define major(x) ((int)((dev_t)(x) >> 32)) > +#define minor(x) ((int)(x)) Another nice simplification. Strictly, it should be (int)(dev_t)(x) since the pseudo-prototype says that the arg is converted to dev_t, but yesterday I couldn't see any differences even for exotic x and exotic arches. Today I can see some difference for exotic x and perverse implementations. E.g., x with extra bits in a large signed integer type to invoke implementation-defined behaviour, and a perverse implementation that truncates to 0 for direct conversion to int but does the right thing for indirect conversion). But we depend on the implementation doing the right thing for other casts to int. Also, if dev_t == uintptr_t, it is valid for the caller to keep dev_t's in void *'s internally but not to pass void * to minor() or major() according to the prototype. However, casting in the macros breaks the warning for this. I think pure macros should not cast their args or pretend to have prototypes, but require callers to pass args of supported types. The old dev_t macros were closer to this -- they have expressions like ((x) << 8) which will fail if x is not an integral type or give wrong results ix x has extra bits. POSIX had to fix related problems for the ntohl() family. The result seems to be that the APIs act as if they are functions. So even if they are implemented as macros, the macros can't just cast their args, but must be wrapped by functions (which can be inline) to get less forceful conversions. FreeBSD's implementation does almost exactly this. It has to cast args for optimizing const args, but seems to get this right by not casting in the non-const case. However, I have uncommitted "fixes" which do cast in the non-const case. Apparently my fixes are backwards. > +#define makedev(x, y) (((dev_t)(x) << 32) | (unsigned)(y)) > > /* > * These declarations belong elsewhere, but are repeated here and in Bruce From owner-svn-src-all@freebsd.org Sat Aug 5 03:45:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAF6ADB55AF; Sat, 5 Aug 2017 03:45:49 +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 A35703C6D; Sat, 5 Aug 2017 03:45:49 +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 F3428D43442; Sat, 5 Aug 2017 13:22:10 +1000 (AEST) Date: Sat, 5 Aug 2017 13:22:10 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Alan Cox cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r322041 - head/sys/kern In-Reply-To: <201708040423.v744NOix022999@repo.freebsd.org> Message-ID: <20170805123249.K1377@besplex.bde.org> References: <201708040423.v744NOix022999@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=VbSHBBh9 c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=DUQRlfxLKrqfm2yATDEA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 03:45:50 -0000 On Fri, 4 Aug 2017, Alan Cox wrote: > Log: > In case readers are misled by expressions that combine multiplication and > division, add parentheses to make the precedence explicit. > > Submitted by: Doug Moore > Requested by: imp > Reviewed by: imp > MFC after: 1 week > X-MFC after: r321840 > Differential Revision: https://reviews.freebsd.org/D11815 This obfuscates the necessary parentheses. > Modified: head/sys/kern/subr_blist.c > ... > static inline daddr_t > radix_to_skip(daddr_t radix) > { > > return (radix / > - (BLIST_BMAP_RADIX / BLIST_META_RADIX * (BLIST_META_RADIX - 1))); > + ((BLIST_BMAP_RADIX / BLIST_META_RADIX) * (BLIST_META_RADIX - 1))); > } Readers now have to do a more complete parse to find the interesting parts, and writers have to count to a large number to get the count right when the parantheses pile up at the right. This expression is relatively simple to parse to remove the obfuscation, but consider more complicated cases: (1) (a + b + c + d + e) + (f + g + h + i + j) in floating point so that addition is not associative and the order matters. The order is left to right in C, and this expression uses 2 sets of parentheses to not use left to right for all terms. Full parentheses gives the good obfuscation: ((((a + b) + c) + d) + e) + ((((f + g) + h) + i) + j) (2) Similarly with +- instead of all +. The order matters much more, but I don't remember ever seeing expressions with only +- being obfuscated by parentheses, except in floating point code where the author wants to emphasize the left to right evaluation. I guess there are also examples with integer types. Even with all + operations, the order is critical with plain ints, since different orders might cause overflow, and with mixed signed/unsigned/small/large integer types, the promotions depend on the order. (3) Similarly with */ instead of +-. These are even more similar in programming uses than in math structures, since + is always associative and commutative in math structures, but it is not even commutative in programming. Bruce From owner-svn-src-all@freebsd.org Sat Aug 5 03:55:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92C8ADB5D05 for ; Sat, 5 Aug 2017 03:55:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x232.google.com (mail-io0-x232.google.com [IPv6:2607:f8b0:4001:c06::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5BCB663431 for ; Sat, 5 Aug 2017 03:55:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x232.google.com with SMTP id j32so11945609iod.0 for ; Fri, 04 Aug 2017 20:55:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=fZFbPWEzrlHZNB7ND2VEwCDbWwgVRkA0kkezJMfVeEQ=; b=V987beTTQ63tExRITY1AAKGIm2dESvElKHkFxg+p0C/C1XswWG4BhaxarrEuthTIih WAeNO7xPjeWQnNjXE5/JxrlzpLXQr2nlqjO96MuWOBR73ZfqRq7P91flxGadZzVuOQcC xaxFeBTdebD/iYq5xnNCKToALM3YrAvexQn2eT1WARJyaWkdDevopS3c2tIzrSC5c9wK vSwM2qJExPhe8iLa8gUcd0R+GaJBgT53QE+G5cDwFH8UL3Kyqsvuc2NG4jvTTcnkB3kD xxtzYfekUJ0Xuw7ldyz/5c+Hwbjo9v4TUW4ckkSUV+Wp9Za8zBFjG5xUYAB/x9n75iBf UhAg== 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=fZFbPWEzrlHZNB7ND2VEwCDbWwgVRkA0kkezJMfVeEQ=; b=haCnXP3GlMm5K4sNPIV3UEWURkSfvkC/VoY2uUQyonCBRkmtg1IBvmGRn442xLpNYB 3jwWyWCRduJYP0yHy5g3NWEncoxjtx8ZpaeYRUWkWmfuNyxVu6eefhMQp5UJoyFTNtSD /Oshng4cV0Hy6RyYMP/Va2iTSdfbLf45knssz02FlsTpwrlHwt8kuKXRL65KbPpa2d3D P6oKxy0pRWzEAgCSoLo/rKX3njshRbeqnqHD6CSwYAmh0GznP4ZARsFwYI2i94sSA6ro PKk25wB8XClkfAV1cdxMavIA4j871JowZL2Plw39LGsMkOwVZCkNX1jeLxkQXmamqx1y 22MA== X-Gm-Message-State: AHYfb5gsov3PTfXQJAled7eQzPH8fglmQU30Vm9W0DZDzxVeI6OSoMAJ JEWTfPZtMvZcmwN7qXVy0EUpGo7wYruY X-Received: by 10.107.190.197 with SMTP id o188mr4742802iof.160.1501905338668; Fri, 04 Aug 2017 20:55:38 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.58.17 with HTTP; Fri, 4 Aug 2017 20:55:38 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:d916:ea3b:9e7d:6b51] In-Reply-To: <20170805123249.K1377@besplex.bde.org> References: <201708040423.v744NOix022999@repo.freebsd.org> <20170805123249.K1377@besplex.bde.org> From: Warner Losh Date: Fri, 4 Aug 2017 21:55:38 -0600 X-Google-Sender-Auth: 0f4UTYpGde1x-n_2DglaHjnp8xE Message-ID: Subject: Re: svn commit: r322041 - head/sys/kern To: Bruce Evans Cc: Alan Cox , 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.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 03:55:39 -0000 On Fri, Aug 4, 2017 at 9:22 PM, Bruce Evans wrote: > On Fri, 4 Aug 2017, Alan Cox wrote: > > Log: >> In case readers are misled by expressions that combine multiplication and >> division, add parentheses to make the precedence explicit. >> >> Submitted by: Doug Moore >> Requested by: imp >> Reviewed by: imp >> MFC after: 1 week >> X-MFC after: r321840 >> Differential Revision: https://reviews.freebsd.org/D11815 >> > > This obfuscates the necessary parentheses. > > Modified: head/sys/kern/subr_blist.c >> ... >> static inline daddr_t >> radix_to_skip(daddr_t radix) >> { >> >> return (radix / >> - (BLIST_BMAP_RADIX / BLIST_META_RADIX * (BLIST_META_RADIX - >> 1))); >> + ((BLIST_BMAP_RADIX / BLIST_META_RADIX) * (BLIST_META_RADIX - >> 1))); >> } >> > > Readers now have to do a more complete parse to find the interesting parts, > and writers have to count to a large number to get the count right when > the parantheses pile up at the right. > > This expression is relatively simple to parse to remove the obfuscation, > but consider more complicated cases: > > (1) > (a + b + c + d + e) + (f + g + h + i + j) > > in floating point so that addition is not associative and the order > matters. > The order is left to right in C, and this expression uses 2 sets of > parentheses to not use left to right for all terms. Full parentheses gives > the good obfuscation: > > ((((a + b) + c) + d) + e) + ((((f + g) + h) + i) + j) > > (2) Similarly with +- instead of all +. The order matters much more, but I > don't remember ever seeing expressions with only +- being obfuscated by > parentheses, except in floating point code where the author wants to > emphasize the left to right evaluation. I guess there are also examples > with integer types. Even with all + operations, the order is critical > with plain ints, since different orders might cause overflow, and with > mixed signed/unsigned/small/large integer types, the promotions depend > on the order. > > (3) Similarly with */ instead of +-. These are even more similar in > programming uses than in math structures, since + is always associative > and commutative in math structures, but it is not even commutative in > programming. You know, for this case, it's totally cool. Warner From owner-svn-src-all@freebsd.org Sat Aug 5 05:20:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A2A8DBE036; Sat, 5 Aug 2017 05:20:05 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E81DC65BB6; Sat, 5 Aug 2017 05:20:04 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v755K4t8036124; Sat, 5 Aug 2017 05:20:04 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v755K4JN036123; Sat, 5 Aug 2017 05:20:04 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201708050520.v755K4JN036123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sat, 5 Aug 2017 05:20:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322074 - head/sys/boot/efi/libefi X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/sys/boot/efi/libefi X-SVN-Commit-Revision: 322074 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.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 05:20:05 -0000 Author: tsoome Date: Sat Aug 5 05:20:03 2017 New Revision: 322074 URL: https://svnweb.freebsd.org/changeset/base/322074 Log: libefi/time.c cstyle cleanup libefi/time.c is mix of different styles, this update does cleanup. Also fix 0 versus NULL, and zero the tv structure for case we get error from UEFI firmware. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D11861 Modified: head/sys/boot/efi/libefi/time.c Modified: head/sys/boot/efi/libefi/time.c ============================================================================== --- head/sys/boot/efi/libefi/time.c Sat Aug 5 00:28:42 2017 (r322073) +++ head/sys/boot/efi/libefi/time.c Sat Aug 5 05:20:03 2017 (r322074) @@ -2,28 +2,28 @@ * Copyright (c) 1999, 2000 * Intel Corporation. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: - * + * * This product includes software developed by Intel Corporation and * its contributors. - * + * * 4. Neither the name of Intel Corporation or its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION 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 @@ -35,7 +35,7 @@ * 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 @@ -48,50 +48,51 @@ __FBSDID("$FreeBSD$"); #include /* -// Accurate only for the past couple of centuries; -// that will probably do. -// -// (#defines From FreeBSD 3.2 lib/libc/stdtime/tzfile.h) -*/ + * Accurate only for the past couple of centuries; + * that will probably do. + * + * (#defines From FreeBSD 3.2 lib/libc/stdtime/tzfile.h) + */ -#define isleap(y) (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0)) -#define SECSPERHOUR ( 60*60 ) -#define SECSPERDAY (24 * SECSPERHOUR) +#define isleap(y) (((y) % 4) == 0 && \ + (((y) % 100) != 0 || ((y) % 400) == 0)) +#define SECSPERHOUR (60*60) +#define SECSPERDAY (24 * SECSPERHOUR) /* -// These arrays give the cumulative number of days up to the first of the -// month number used as the index (1 -> 12) for regular and leap years. -// The value at index 13 is for the whole year. -*/ + * These arrays give the cumulative number of days up to the first of the + * month number used as the index (1 -> 12) for regular and leap years. + * The value at index 13 is for the whole year. + */ static const time_t CumulativeDays[2][14] = { - {0, - 0, - 31, - 31 + 28, - 31 + 28 + 31, - 31 + 28 + 31 + 30, - 31 + 28 + 31 + 30 + 31, - 31 + 28 + 31 + 30 + 31 + 30, - 31 + 28 + 31 + 30 + 31 + 30 + 31, - 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31, - 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30, - 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31, - 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30, - 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31 }, - {0, - 0, - 31, - 31 + 29, - 31 + 29 + 31, - 31 + 29 + 31 + 30, - 31 + 29 + 31 + 30 + 31, - 31 + 29 + 31 + 30 + 31 + 30, - 31 + 29 + 31 + 30 + 31 + 30 + 31, - 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31, - 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30, - 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31, - 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30, - 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31 }}; + {0, + 0, + 31, + 31 + 28, + 31 + 28 + 31, + 31 + 28 + 31 + 30, + 31 + 28 + 31 + 30 + 31, + 31 + 28 + 31 + 30 + 31 + 30, + 31 + 28 + 31 + 30 + 31 + 30 + 31, + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31, + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30, + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31, + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30, + 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31 }, + {0, + 0, + 31, + 31 + 29, + 31 + 29 + 31, + 31 + 29 + 31 + 30, + 31 + 29 + 31 + 30 + 31, + 31 + 29 + 31 + 30 + 31 + 30, + 31 + 29 + 31 + 30 + 31 + 30 + 31, + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31, + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30, + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31, + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30, + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31 }}; void efi_time_init(void) @@ -106,145 +107,154 @@ efi_time_fini(void) void to_efi_time(EFI_TIME *efi_time, time_t time) { - if (time >= 0) { - for (efi_time->Year = 1970; - time > CumulativeDays[isleap(efi_time->Year)][13] * SECSPERDAY; - time -= CumulativeDays[isleap(efi_time->Year)][13] * SECSPERDAY, - efi_time->Year++); + int lyear, month; + time_t seconds; - for (efi_time->Month = 0; - time > CumulativeDays[isleap(efi_time->Year)][efi_time->Month] * - SECSPERDAY; - efi_time->Month++); + if (time >= 0) { + efi_time->Year = 1970; + lyear = isleap(efi_time->Year); + month = 13; + seconds = CumulativeDays[lyear][month] * SECSPERDAY; + while (time > seconds) { + time -= seconds; + efi_time->Year++; + lyear = isleap(efi_time->Year); + seconds = CumulativeDays[lyear][month] * SECSPERDAY; + } - time -= CumulativeDays[isleap(efi_time->Year)][efi_time->Month - 1] * - SECSPERDAY; + efi_time->Month = 0; + while (time > + CumulativeDays[lyear][month] * SECSPERDAY) { + efi_time->Month++; + } - for (efi_time->Day = 0; time > SECSPERDAY; - time -= SECSPERDAY, efi_time->Day++); + month = efi_time->Month - 1; + time -= CumulativeDays[lyear][month] * SECSPERDAY; - for (efi_time->Hour = 0; time > SECSPERHOUR; - time -= SECSPERHOUR, efi_time->Hour++); + for (efi_time->Day = 0; time > SECSPERDAY; efi_time->Day++) + time -= SECSPERDAY; - for (efi_time->Minute = 0; time > 60; - time -= 60, efi_time->Minute++); + for (efi_time->Hour = 0; time > SECSPERHOUR; efi_time->Hour++) + time -= SECSPERHOUR; - efi_time->Second = time; - efi_time->Nanosecond = 0; - efi_time->TimeZone = 0; - efi_time->Daylight = 0; - } else { - memset(efi_time, 0, sizeof(EFI_TIME)); - } + for (efi_time->Minute = 0; time > 60; efi_time->Minute++) + time -= 60; + + efi_time->Second = time; + efi_time->Nanosecond = 0; + efi_time->TimeZone = 0; + efi_time->Daylight = 0; + } else { + memset(efi_time, 0, sizeof(EFI_TIME)); + } } time_t from_efi_time(EFI_TIME *ETime) { + time_t UTime; + int Year; - time_t UTime; - int Year; + /* + * Do a santity check + */ + if (ETime->Year < 1998 || ETime->Year > 2099 || + ETime->Month == 0 || ETime->Month > 12 || + ETime->Day == 0 || ETime->Month > 31 || + ETime->Hour > 23 || ETime->Minute > 59 || + ETime->Second > 59 || ETime->TimeZone < -1440 || + (ETime->TimeZone > 1440 && ETime->TimeZone != 2047)) { + return (0); + } - /* - // Do a santity check - */ - if ( ETime->Year < 1998 || ETime->Year > 2099 || - ETime->Month == 0 || ETime->Month > 12 || - ETime->Day == 0 || ETime->Month > 31 || - ETime->Hour > 23 || - ETime->Minute > 59 || - ETime->Second > 59 || - ETime->TimeZone < -1440 || - (ETime->TimeZone > 1440 && ETime->TimeZone != 2047) ) { - return (0); - } + /* + * Years + */ + UTime = 0; + for (Year = 1970; Year != ETime->Year; ++Year) { + UTime += (CumulativeDays[isleap(Year)][13] * SECSPERDAY); + } - /* - // Years - */ - UTime = 0; - for (Year = 1970; Year != ETime->Year; ++Year) { - UTime += (CumulativeDays[isleap(Year)][13] * SECSPERDAY); - } + /* + * UTime should now be set to 00:00:00 on Jan 1 of the file's year. + * + * Months + */ + UTime += (CumulativeDays[isleap(ETime->Year)][ETime->Month] * + SECSPERDAY); - /* - // UTime should now be set to 00:00:00 on Jan 1 of the file's year. - // - // Months - */ - UTime += (CumulativeDays[isleap(ETime->Year)][ETime->Month] * SECSPERDAY); + /* + * UTime should now be set to 00:00:00 on the first of the file's + * month and year. + * + * Days -- Don't count the file's day + */ + UTime += (((ETime->Day > 0) ? ETime->Day-1:0) * SECSPERDAY); - /* - // UTime should now be set to 00:00:00 on the first of the file's month and year - // - // Days -- Don't count the file's day - */ - UTime += (((ETime->Day > 0) ? ETime->Day-1:0) * SECSPERDAY); + /* + * Hours + */ + UTime += (ETime->Hour * SECSPERHOUR); - /* - // Hours - */ - UTime += (ETime->Hour * SECSPERHOUR); + /* + * Minutes + */ + UTime += (ETime->Minute * 60); - /* - // Minutes - */ - UTime += (ETime->Minute * 60); + /* + * Seconds + */ + UTime += ETime->Second; - /* - // Seconds - */ - UTime += ETime->Second; + /* + * EFI time is repored in local time. Adjust for any time zone + * offset to get true UT + */ + if (ETime->TimeZone != EFI_UNSPECIFIED_TIMEZONE) { + /* + * TimeZone is kept in minues... + */ + UTime += (ETime->TimeZone * 60); + } - /* - // EFI time is repored in local time. Adjust for any time zone offset to - // get true UT - */ - if ( ETime->TimeZone != EFI_UNSPECIFIED_TIMEZONE ) { - /* - // TimeZone is kept in minues... - */ - UTime += (ETime->TimeZone * 60); - } - - return UTime; + return (UTime); } static int -EFI_GetTimeOfDay( - OUT struct timeval *tp, - OUT struct timezone *tzp - ) +EFI_GetTimeOfDay(OUT struct timeval *tp, OUT struct timezone *tzp) { EFI_TIME EfiTime; EFI_TIME_CAPABILITIES Capabilities; EFI_STATUS Status; /* - // Get time from EFI - */ + * Get time from EFI + */ Status = RS->GetTime(&EfiTime, &Capabilities); if (EFI_ERROR(Status)) return (-1); /* - // Convert to UNIX time (ie seconds since the epoch - */ + * Convert to UNIX time (ie seconds since the epoch + */ - tp->tv_sec = from_efi_time( &EfiTime ); + tp->tv_sec = from_efi_time(&EfiTime); tp->tv_usec = 0; /* EfiTime.Nanosecond * 1000; */ /* - // Do something with the timezone if needed - */ + * Do something with the timezone if needed + */ - if (tzp) { - tzp->tz_minuteswest = - EfiTime.TimeZone == EFI_UNSPECIFIED_TIMEZONE ? 0 : EfiTime.TimeZone; + if (tzp != NULL) { + if (EfiTime.TimeZone == EFI_UNSPECIFIED_TIMEZONE) + tzp->tz_minuteswest = 0; + else + tzp->tz_minuteswest = EfiTime.TimeZone; /* - // This isn't quit right since it doesn't deal with EFI_TIME_IN_DAYLIGHT - */ + * This isn't quit right since it doesn't deal with + * EFI_TIME_IN_DAYLIGHT + */ tzp->tz_dsttime = EfiTime.Daylight & EFI_TIME_ADJUST_DAYLIGHT ? 1 : 0; } @@ -256,15 +266,18 @@ time_t time(time_t *tloc) { struct timeval tv; - EFI_GetTimeOfDay(&tv, 0); - + + memset(&tv, 0, sizeof(tv)); + EFI_GetTimeOfDay(&tv, NULL); + if (tloc) *tloc = tv.tv_sec; - return tv.tv_sec; + return (tv.tv_sec); } time_t getsecs(void) { - return time(NULL); + + return (time(NULL)); } From owner-svn-src-all@freebsd.org Sat Aug 5 06:46:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D998DC1AEC; Sat, 5 Aug 2017 06:46:07 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B48F67E0F; Sat, 5 Aug 2017 06:46:07 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v756k6A4072192; Sat, 5 Aug 2017 06:46:06 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v756k6og072191; Sat, 5 Aug 2017 06:46:06 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201708050646.v756k6og072191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 5 Aug 2017 06:46:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322075 - head/contrib/ipfilter/tools X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/contrib/ipfilter/tools X-SVN-Commit-Revision: 322075 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.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 06:46:07 -0000 Author: cy Date: Sat Aug 5 06:46:06 2017 New Revision: 322075 URL: https://svnweb.freebsd.org/changeset/base/322075 Log: loadpoolfile() implements a -R (NORESOLVE) option which is not listed in usage(). This commit trues up usage() with loadpoolfile(). Modified: head/contrib/ipfilter/tools/ippool.c Modified: head/contrib/ipfilter/tools/ippool.c ============================================================================== --- head/contrib/ipfilter/tools/ippool.c Sat Aug 5 05:20:03 2017 (r322074) +++ head/contrib/ipfilter/tools/ippool.c Sat Aug 5 06:46:06 2017 (r322075) @@ -77,7 +77,7 @@ usage(prog) fprintf(stderr, "Usage:\t%s\n", prog); fprintf(stderr, "\t-a [-dnv] -m [-o ] [-t type] [-T ttl] -i [/netmask]\n"); fprintf(stderr, "\t-A [-dnv] [-m ] [-o ] [-S ] [-t ]\n"); - fprintf(stderr, "\t-f [-dnuv]\n"); + fprintf(stderr, "\t-f [-dnuvR]\n"); fprintf(stderr, "\t-F [-dv] [-o ] [-t ]\n"); fprintf(stderr, "\t-l [-dv] [-m ] [-t ] [-o ] [-M ] [-N ]\n"); fprintf(stderr, "\t-r [-dnv] [-m ] [-o ] [-t type] -i [/netmask]\n"); From owner-svn-src-all@freebsd.org Sat Aug 5 06:56:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C043EDC2209; Sat, 5 Aug 2017 06:56:47 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D05C684BD; Sat, 5 Aug 2017 06:56:47 +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 v756ukbd076260; Sat, 5 Aug 2017 06:56:46 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v756uk48076256; Sat, 5 Aug 2017 06:56:46 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201708050656.v756uk48076256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Sat, 5 Aug 2017 06:56:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322076 - in head/sys: amd64/amd64 i386/i386 x86/include x86/x86 X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 x86/include x86/x86 X-SVN-Commit-Revision: 322076 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.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 06:56:47 -0000 Author: jkim Date: Sat Aug 5 06:56:46 2017 New Revision: 322076 URL: https://svnweb.freebsd.org/changeset/base/322076 Log: Detect hypervisors early. We used to set lower hz on hypervisors by default but it was broken since r273800 (and r278522, its MFC to stable/10) because identify_cpu() is called too late, i.e., after init_param1(). MFC after: 3 days Modified: head/sys/amd64/amd64/machdep.c head/sys/i386/i386/machdep.c head/sys/x86/include/x86_var.h head/sys/x86/x86/identcpu.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Sat Aug 5 06:46:06 2017 (r322075) +++ head/sys/amd64/amd64/machdep.c Sat Aug 5 06:56:46 2017 (r322076) @@ -1537,6 +1537,8 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) kmdp = init_ops.parse_preload_data(modulep); + identify_hypervisor(); + /* Init basic tunables, hz etc */ init_param1(); Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Sat Aug 5 06:46:06 2017 (r322075) +++ head/sys/i386/i386/machdep.c Sat Aug 5 06:56:46 2017 (r322076) @@ -2185,6 +2185,8 @@ init386(int first) else init_static_kenv(NULL, 0); + identify_hypervisor(); + /* Init basic tunables, hz etc */ init_param1(); Modified: head/sys/x86/include/x86_var.h ============================================================================== --- head/sys/x86/include/x86_var.h Sat Aug 5 06:46:06 2017 (r322075) +++ head/sys/x86/include/x86_var.h Sat Aug 5 06:56:46 2017 (r322076) @@ -116,6 +116,7 @@ void cpu_setregs(void); void dump_add_page(vm_paddr_t); void dump_drop_page(vm_paddr_t); void identify_cpu(void); +void identify_hypervisor(void); void initializecpu(void); void initializecpucache(void); bool fix_cpuid(void); Modified: head/sys/x86/x86/identcpu.c ============================================================================== --- head/sys/x86/x86/identcpu.c Sat Aug 5 06:46:06 2017 (r322075) +++ head/sys/x86/x86/identcpu.c Sat Aug 5 06:56:46 2017 (r322076) @@ -1252,7 +1252,7 @@ static const char *const vm_pnames[] = { NULL }; -static void +void identify_hypervisor(void) { u_int regs[4]; @@ -1403,7 +1403,6 @@ identify_cpu(void) cpu_feature2 = regs[2]; #endif - identify_hypervisor(); cpu_vendor_id = find_cpu_vendor_id(); if (fix_cpuid()) { From owner-svn-src-all@freebsd.org Sat Aug 5 07:42:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 239FBDC40DF; Sat, 5 Aug 2017 07:42:55 +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 AAF4669A05; Sat, 5 Aug 2017 07:42:54 +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 v757giLO034595 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 5 Aug 2017 10:42:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v757giLO034595 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v757ghK5034594; Sat, 5 Aug 2017 10:42:43 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 5 Aug 2017 10:42:43 +0300 From: Konstantin Belousov To: Bruce Evans Cc: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r321920 - head/sys/sys Message-ID: <20170805074243.GX1700@kib.kiev.ua> References: <201708021014.v72AEHEk061037@repo.freebsd.org> <37abc595-c80e-a8da-04a8-815f42c634de@selasky.org> <20170802135455.GG1700@kib.kiev.ua> <20170803122015.Q1093@besplex.bde.org> <20170803075747.GJ1700@kib.kiev.ua> <20170803180419.R2314@besplex.bde.org> <20170803120729.GO1700@kib.kiev.ua> <20170805112924.W1055@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170805112924.W1055@besplex.bde.org> User-Agent: Mutt/1.8.3 (2017-05-23) 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.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 07:42:55 -0000 On Sat, Aug 05, 2017 at 12:26:03PM +1000, Bruce Evans wrote: > > +#define minor(x) ((int)(x)) > > Another nice simplification. Strictly, it should be (int)(dev_t)(x) since > the pseudo-prototype says that the arg is converted to dev_t, but yesterday > I couldn't see any differences even for exotic x and exotic arches. > > Today I can see some difference for exotic x and perverse implementations. > E.g., x with extra bits in a large signed integer type to invoke > implementation-defined behaviour, and a perverse implementation that > truncates to 0 for direct conversion to int but does the right thing > for indirect conversion). But we depend on the implementation doing > the right thing for other casts to int. > > Also, if dev_t == uintptr_t, it is valid for the caller to keep dev_t's > in void *'s internally but not to pass void * to minor() or major() > according to the prototype. However, casting in the macros breaks the > warning for this. I think pure macros should not cast their args or > pretend to have prototypes, but require callers to pass args of supported > types. The old dev_t macros were closer to this -- they have expressions > like ((x) << 8) which will fail if x is not an integral type or give > wrong results ix x has extra bits. So you are arguing to keep the & 0xffffffff operation ? I think this is not needed, since your note about cast being equivalent holds for all supported architectures and I do not see anywhere a contract for the operations to work on non-dev_t. So are you fine with the posted patch to sys/types.h ? From owner-svn-src-all@freebsd.org Sat Aug 5 07:52:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8352DC465C; Sat, 5 Aug 2017 07:52:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9762869E2C; Sat, 5 Aug 2017 07:52:16 +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 v757qFCO099895; Sat, 5 Aug 2017 07:52:15 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v757qF24099894; Sat, 5 Aug 2017 07:52:15 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708050752.v757qF24099894@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 5 Aug 2017 07:52:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322077 - head/share/man/man3 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/share/man/man3 X-SVN-Commit-Revision: 322077 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.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 07:52:16 -0000 Author: kib Date: Sat Aug 5 07:52:15 2017 New Revision: 322077 URL: https://svnweb.freebsd.org/changeset/base/322077 Log: Provide more detailed specification for major(), minor() and makedev(). Remove some statements which are no longer correct after ino64, and clarify other. The rewording is not in fact specific to ino64 and improvements are useful on the stable branches. Noted and reviewed by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/share/man/man3/makedev.3 Modified: head/share/man/man3/makedev.3 ============================================================================== --- head/share/man/man3/makedev.3 Sat Aug 5 06:56:46 2017 (r322076) +++ head/share/man/man3/makedev.3 Sat Aug 5 07:52:15 2017 (r322077) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 28, 2008 +.Dd August 3, 2017 .Dt MAKEDEV 3 .Os .Sh NAME @@ -43,7 +43,7 @@ .Sh DESCRIPTION The .Fn makedev -macro allows a unique device number to be generated based on its +macro returns a device number created from the provided .Fa major and .Fa minor @@ -52,13 +52,26 @@ The .Fn major and .Fn minor -macros can be used to obtain the original numbers from the device number +macros return the original numbers from the device number .Fa dev . +In other words, for a value +.Va dev +of the type +.Vt dev_t , +and values +.Va ma , mi +of the type +.Vt int , +the assertions +.Dl dev == makedev(major(dev), minor(dev)) +.Dl ma == major(makedev(ma, mi)) +.Dl mi == minor(makedev(ma, mi)) +are valid. .Pp In previous implementations of .Fx all block and character devices were uniquely identified by a pair of -major and minor numbers. +stable major and minor numbers. The major number referred to a certain device class (e.g. disks, TTYs) while the minor number identified an instance within the device class. Later versions of @@ -66,7 +79,8 @@ Later versions of automatically generate a unique device number for each character device visible in .Pa /dev/ . -These numbers are not divided in device classes. +These numbers are not divided in device classes and are not guaranteed +to be stable upon reboot or driver reload. .Pp On .Fx @@ -78,11 +92,9 @@ conventional way. .Sh RETURN VALUES The .Fn major -macro returns a device major number that has a value between 0 and 255. -The +and .Fn minor -macro returns a device minor number whose value can span the complete -range of an +macros return numbers whose value can span the complete range of an .Vt int . .Sh SEE ALSO .Xr mknod 2 , From owner-svn-src-all@freebsd.org Sat Aug 5 08:35:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD663DC648A; Sat, 5 Aug 2017 08:35:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BEF26B065; Sat, 5 Aug 2017 08:35:14 +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 v758ZD8J017579; Sat, 5 Aug 2017 08:35:13 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v758ZD6H017578; Sat, 5 Aug 2017 08:35:13 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201708050835.v758ZD6H017578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 5 Aug 2017 08:35: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: r322078 - stable/11/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Commit-Revision: 322078 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.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 08:35:14 -0000 Author: mav Date: Sat Aug 5 08:35:13 2017 New Revision: 322078 URL: https://svnweb.freebsd.org/changeset/base/322078 Log: MFC r321921: Add compat shim part missed at r305197. This fixes compatibility between old kernel and new ZFS tools. It seems to be tradition to forget it. PR: 221112 Modified: stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c ============================================================================== --- stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c Sat Aug 5 07:52:15 2017 (r322077) +++ stable/11/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c Sat Aug 5 08:35:13 2017 (r322078) @@ -74,6 +74,9 @@ zcmd_ioctl(int fd, int request, zfs_cmd_t *zc) if (zfs_ioctl_version >= ZFS_IOCVER_DEADMAN) { switch (zfs_ioctl_version) { + case ZFS_IOCVER_INLANES: + cflag = ZFS_CMD_COMPAT_INLANES; + break; case ZFS_IOCVER_RESUME: cflag = ZFS_CMD_COMPAT_RESUME; break; From owner-svn-src-all@freebsd.org Sat Aug 5 08:36:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3287DC659B; Sat, 5 Aug 2017 08:36:05 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A17946B23F; Sat, 5 Aug 2017 08:36:05 +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 v758a4Xi017696; Sat, 5 Aug 2017 08:36:04 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v758a45b017695; Sat, 5 Aug 2017 08:36:04 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201708050836.v758a45b017695@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 5 Aug 2017 08:36:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322079 - stable/10/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: stable-10 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/10/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Commit-Revision: 322079 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.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 08:36:05 -0000 Author: mav Date: Sat Aug 5 08:36:04 2017 New Revision: 322079 URL: https://svnweb.freebsd.org/changeset/base/322079 Log: MFC r321921: Add compat shim part missed at r305197. This fixes compatibility between old kernel and new ZFS tools. It seems to be tradition to forget it. PR: 221112 Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c Sat Aug 5 08:35:13 2017 (r322078) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c Sat Aug 5 08:36:04 2017 (r322079) @@ -74,6 +74,9 @@ zcmd_ioctl(int fd, int request, zfs_cmd_t *zc) if (zfs_ioctl_version >= ZFS_IOCVER_DEADMAN) { switch (zfs_ioctl_version) { + case ZFS_IOCVER_INLANES: + cflag = ZFS_CMD_COMPAT_INLANES; + break; case ZFS_IOCVER_RESUME: cflag = ZFS_CMD_COMPAT_RESUME; break; From owner-svn-src-all@freebsd.org Sat Aug 5 08:37:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FD0BDC674A; Sat, 5 Aug 2017 08:37:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2C276B442; Sat, 5 Aug 2017 08:37:09 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v758b9Z1017819; Sat, 5 Aug 2017 08:37:09 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v758b9oa017818; Sat, 5 Aug 2017 08:37:09 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201708050837.v758b9oa017818@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 5 Aug 2017 08:37:09 +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: r322080 - stable/11/sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/sys X-SVN-Commit-Revision: 322080 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.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 08:37:10 -0000 Author: mav Date: Sat Aug 5 08:37:08 2017 New Revision: 322080 URL: https://svnweb.freebsd.org/changeset/base/322080 Log: MFC r321685: Fix IORDY bits definition. According to the ATA specs, IORDYDIS should be bit 10, IORDY -- bit 11. PR: 221049 Submitted by: aaron.styx@baesystems.com Modified: stable/11/sys/sys/ata.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/sys/ata.h ============================================================================== --- stable/11/sys/sys/ata.h Sat Aug 5 08:36:04 2017 (r322079) +++ stable/11/sys/sys/ata.h Sat Aug 5 08:37:08 2017 (r322080) @@ -68,8 +68,8 @@ struct ata_params { /*049*/ u_int16_t capabilities1; #define ATA_SUPPORT_DMA 0x0100 #define ATA_SUPPORT_LBA 0x0200 -#define ATA_SUPPORT_IORDY 0x0400 -#define ATA_SUPPORT_IORDYDIS 0x0800 +#define ATA_SUPPORT_IORDYDIS 0x0400 +#define ATA_SUPPORT_IORDY 0x0800 #define ATA_SUPPORT_OVERLAP 0x4000 /*050*/ u_int16_t capabilities2; From owner-svn-src-all@freebsd.org Sat Aug 5 08:37:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE644DC67EA; Sat, 5 Aug 2017 08:37:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7DD0E6B576; Sat, 5 Aug 2017 08:37:39 +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 v758bcQe017903; Sat, 5 Aug 2017 08:37:38 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v758bc2Q017902; Sat, 5 Aug 2017 08:37:38 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201708050837.v758bc2Q017902@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 5 Aug 2017 08:37:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322081 - stable/10/sys/sys X-SVN-Group: stable-10 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/10/sys/sys X-SVN-Commit-Revision: 322081 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.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 08:37:39 -0000 Author: mav Date: Sat Aug 5 08:37:38 2017 New Revision: 322081 URL: https://svnweb.freebsd.org/changeset/base/322081 Log: MFC r321685: Fix IORDY bits definition. According to the ATA specs, IORDYDIS should be bit 10, IORDY -- bit 11. PR: 221049 Submitted by: aaron.styx@baesystems.com Modified: stable/10/sys/sys/ata.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/ata.h ============================================================================== --- stable/10/sys/sys/ata.h Sat Aug 5 08:37:08 2017 (r322080) +++ stable/10/sys/sys/ata.h Sat Aug 5 08:37:38 2017 (r322081) @@ -68,8 +68,8 @@ struct ata_params { /*049*/ u_int16_t capabilities1; #define ATA_SUPPORT_DMA 0x0100 #define ATA_SUPPORT_LBA 0x0200 -#define ATA_SUPPORT_IORDY 0x0400 -#define ATA_SUPPORT_IORDYDIS 0x0800 +#define ATA_SUPPORT_IORDYDIS 0x0400 +#define ATA_SUPPORT_IORDY 0x0800 #define ATA_SUPPORT_OVERLAP 0x4000 /*050*/ u_int16_t capabilities2; From owner-svn-src-all@freebsd.org Sat Aug 5 09:32:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5545DC9627; Sat, 5 Aug 2017 09:32:04 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92C3B6D1F1; Sat, 5 Aug 2017 09:32:04 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v759W3Fe042001; Sat, 5 Aug 2017 09:32:03 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v759W3sm042000; Sat, 5 Aug 2017 09:32:03 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201708050932.v759W3sm042000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 5 Aug 2017 09:32: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: r322082 - stable/11/share/man/man7 X-SVN-Group: stable-11 X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: stable/11/share/man/man7 X-SVN-Commit-Revision: 322082 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.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 09:32:04 -0000 Author: trasz Date: Sat Aug 5 09:32:03 2017 New Revision: 322082 URL: https://svnweb.freebsd.org/changeset/base/322082 Log: MFC r318182: Improve build(7): add missing "buildkernel" and "installkernel" to the example, change the architectures to something more common, and improve description of defaults for TARGET. Modified: stable/11/share/man/man7/build.7 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man7/build.7 ============================================================================== --- stable/11/share/man/man7/build.7 Sat Aug 5 08:37:38 2017 (r322081) +++ stable/11/share/man/man7/build.7 Sat Aug 5 09:32:03 2017 (r322082) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 22, 2017 +.Dd May 11, 2017 .Dt BUILD 7 .Os .Sh NAME @@ -518,7 +518,10 @@ and .Va TARGET Ns = Ns Li pc98 . If not set, .Va TARGET -defaults to the current hardware platform. +defaults to the current hardware platform, unless +.Va TARGET_ARCH +is also set, in which case it defaults to the appropriate +value for that architecture. .It Va TARGET_ARCH The target machine processor architecture. This is analogous to the @@ -663,11 +666,11 @@ section in .Pa src/UPDATING . .Pp The following sequence of commands can be used to cross-build the -system for the sparc64 architecture on an i386 host: +system for the armv6 architecture on an amd64 host: .Bd -literal -offset indent cd /usr/src -make TARGET=sparc64 buildworld -make TARGET=sparc64 DESTDIR=/clients/sparc64 installworld +make TARGET_ARCH=armv6 buildworld buildkernel +make TARGET_ARCH=armv6 DESTDIR=/clients/arm64 installworld installkernel .Ed .Sh SEE ALSO .Xr cc 1 , @@ -676,6 +679,7 @@ make TARGET=sparc64 DESTDIR=/clients/sparc64 installwo .Xr svn 1 , .Xr make.conf 5 , .Xr src.conf 5 , +.Xr arch 7 , .Xr ports 7 , .Xr release 7 , .Xr tests 7 , From owner-svn-src-all@freebsd.org Sat Aug 5 09:34:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9ADFDC9850; Sat, 5 Aug 2017 09:34:10 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8837A6D3A0; Sat, 5 Aug 2017 09:34:10 +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 v759Y9Tq042160; Sat, 5 Aug 2017 09:34:09 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v759Y9Mm042159; Sat, 5 Aug 2017 09:34:09 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201708050934.v759Y9Mm042159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 5 Aug 2017 09:34:09 +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: r322083 - stable/11/sys/geom X-SVN-Group: stable-11 X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: stable/11/sys/geom X-SVN-Commit-Revision: 322083 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.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 09:34:10 -0000 Author: trasz Date: Sat Aug 5 09:34:09 2017 New Revision: 322083 URL: https://svnweb.freebsd.org/changeset/base/322083 Log: MFC r318444: Fix typo. Modified: stable/11/sys/geom/geom_vfs.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/geom/geom_vfs.c ============================================================================== --- stable/11/sys/geom/geom_vfs.c Sat Aug 5 09:32:03 2017 (r322082) +++ stable/11/sys/geom/geom_vfs.c Sat Aug 5 09:34:09 2017 (r322083) @@ -168,7 +168,7 @@ g_vfs_strategy(struct bufobj *bo, struct buf *bp) sc = cp->geom->softc; /* - * If the provider has orphaned us, just return EXIO. + * If the provider has orphaned us, just return ENXIO. */ mtx_lock(&sc->sc_mtx); if (sc->sc_orphaned) { From owner-svn-src-all@freebsd.org Sat Aug 5 09:38:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFE89DC9B83; Sat, 5 Aug 2017 09:38:16 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9CA5A6D569; Sat, 5 Aug 2017 09:38:16 +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 v759cFcv042466; Sat, 5 Aug 2017 09:38:15 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v759cFLv042465; Sat, 5 Aug 2017 09:38:15 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201708050938.v759cFLv042465@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 5 Aug 2017 09:38: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: r322084 - stable/11/share/man/man7 X-SVN-Group: stable-11 X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: stable/11/share/man/man7 X-SVN-Commit-Revision: 322084 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.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 09:38:16 -0000 Author: trasz Date: Sat Aug 5 09:38:15 2017 New Revision: 322084 URL: https://svnweb.freebsd.org/changeset/base/322084 Log: MFC r319499: Consistently use lowercase hex numbers in ascii(7). Modified: stable/11/share/man/man7/ascii.7 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man7/ascii.7 ============================================================================== --- stable/11/share/man/man7/ascii.7 Sat Aug 5 09:34:09 2017 (r322083) +++ stable/11/share/man/man7/ascii.7 Sat Aug 5 09:38:15 2017 (r322084) @@ -64,9 +64,9 @@ The set: .Bd -literal -offset left 00 NUL 01 SOH 02 STX 03 ETX 04 EOT 05 ENQ 06 ACK 07 BEL -08 BS 09 HT 0A LF 0B VT 0C FF 0D CR 0E SO 0F SI +08 BS 09 HT 0a LF 0b VT 0c FF 0d CR 0e SO 0f SI 10 DLE 11 DC1 12 DC2 13 DC3 14 DC4 15 NAK 16 SYN 17 ETB -18 CAN 19 EM 1A SUB 1B ESC 1C FS 1D GS 1E RS 1F US +18 CAN 19 EM 1a SUB 1b ESC 1c FS 1d GS 1e RS 1f US 20 SP 21 ! 22 " 23 # 24 $ 25 % 26 & 27 ' 28 ( 29 ) 2a * 2b + 2c , 2d - 2e . 2f / 30 0 31 1 32 2 33 3 34 4 35 5 36 6 37 7 From owner-svn-src-all@freebsd.org Sat Aug 5 09:39:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38A71DC9C63; Sat, 5 Aug 2017 09:39:17 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 05B0A6D6B1; Sat, 5 Aug 2017 09:39:16 +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 v759dG2L042559; Sat, 5 Aug 2017 09:39:16 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v759dGVu042558; Sat, 5 Aug 2017 09:39:16 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201708050939.v759dGVu042558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 5 Aug 2017 09:39:16 +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: r322085 - stable/11/share/man/man7 X-SVN-Group: stable-11 X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: stable/11/share/man/man7 X-SVN-Commit-Revision: 322085 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.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 09:39:17 -0000 Author: trasz Date: Sat Aug 5 09:39:15 2017 New Revision: 322085 URL: https://svnweb.freebsd.org/changeset/base/322085 Log: MFC r319775: /usr/share/doc/bind is gone since 20040925. Modified: stable/11/share/man/man7/hier.7 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man7/hier.7 ============================================================================== --- stable/11/share/man/man7/hier.7 Sat Aug 5 09:38:15 2017 (r322084) +++ stable/11/share/man/man7/hier.7 Sat Aug 5 09:39:15 2017 (r322085) @@ -488,8 +488,6 @@ association) Frequently Asked Questions .It Pa IPv6/ implementation notes for IPv6 -.It Pa bind/ -documents pertaining to BIND (the Berkeley Internet Name Domain) .It Pa es/ Spanish translations of documents in /usr/share/doc .It Pa handbook/ From owner-svn-src-all@freebsd.org Sat Aug 5 09:40:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 544AFDC9D73; Sat, 5 Aug 2017 09:40: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 mx1.freebsd.org (Postfix) with ESMTPS id 213716D7F9; Sat, 5 Aug 2017 09:40: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 v759e4Jo042671; Sat, 5 Aug 2017 09:40:04 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v759e4xf042670; Sat, 5 Aug 2017 09:40:04 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201708050940.v759e4xf042670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 5 Aug 2017 09:40:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r322086 - stable/11/share/man/man7 X-SVN-Group: stable-11 X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: stable/11/share/man/man7 X-SVN-Commit-Revision: 322086 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.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 09:40:05 -0000 Author: trasz Date: Sat Aug 5 09:40:04 2017 New Revision: 322086 URL: https://svnweb.freebsd.org/changeset/base/322086 Log: MFC r319774: Improve formatting by removing yet another case of '-width ".Pa'. Modified: stable/11/share/man/man7/hier.7 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man7/hier.7 ============================================================================== --- stable/11/share/man/man7/hier.7 Sat Aug 5 09:39:15 2017 (r322085) +++ stable/11/share/man/man7/hier.7 Sat Aug 5 09:40:04 2017 (r322086) @@ -693,7 +693,7 @@ source for files in .Pa /usr/share .It Pa sys/ kernel source code -.Bl -tag -width ".Pa opencrypto/" -compact +.Bl -tag -width "opencrypto/" -compact .It Pa amd64/ AMD64 architecture support .It Pa arm/ From owner-svn-src-all@freebsd.org Sat Aug 5 09:40:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 609CCDC9E63; Sat, 5 Aug 2017 09:40:57 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2DD276D98E; Sat, 5 Aug 2017 09:40:57 +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 v759eupr042754; Sat, 5 Aug 2017 09:40:56 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v759euac042753; Sat, 5 Aug 2017 09:40:56 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201708050940.v759euac042753@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 5 Aug 2017 09: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: r322087 - stable/11/sys/boot/forth X-SVN-Group: stable-11 X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: stable/11/sys/boot/forth X-SVN-Commit-Revision: 322087 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.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 09:40:57 -0000 Author: trasz Date: Sat Aug 5 09:40:56 2017 New Revision: 322087 URL: https://svnweb.freebsd.org/changeset/base/322087 Log: MFC r319798: Switch the example name for variables controlling loading memory images in /boot/defaults/loader.conf to something that's actually commonly used, "mdroot". It's arbitrary, but it's easier to find this way. Modified: stable/11/sys/boot/forth/loader.conf Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/forth/loader.conf ============================================================================== --- stable/11/sys/boot/forth/loader.conf Sat Aug 5 09:40:04 2017 (r322086) +++ stable/11/sys/boot/forth/loader.conf Sat Aug 5 09:40:56 2017 (r322087) @@ -70,9 +70,9 @@ ram_blacklist_type="ram_blacklist" # Required for the ### Initial memory disk settings ########################### ############################################################## -#initmd_load="YES" # The "initmd" prefix is arbitrary. -#initmd_type="md_image" # Create md(4) disk at boot. -#initmd_name="/boot/root.img" # Path to a file containing the image. +#mdroot_load="YES" # The "mdroot" prefix is arbitrary. +#mdroot_type="md_image" # Create md(4) disk at boot. +#mdroot_name="/boot/root.img" # Path to a file containing the image. #rootdev="ufs:/dev/md0" # Set the root filesystem to md(4) device. From owner-svn-src-all@freebsd.org Sat Aug 5 09:42:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92FD9DCA11D; Sat, 5 Aug 2017 09:42:45 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 600456DE4A; Sat, 5 Aug 2017 09:42:45 +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 v759gi5n046682; Sat, 5 Aug 2017 09:42:44 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v759giOH046681; Sat, 5 Aug 2017 09:42:44 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201708050942.v759giOH046681@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 5 Aug 2017 09:42: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: r322088 - stable/11/share/man/man4 X-SVN-Group: stable-11 X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: stable/11/share/man/man4 X-SVN-Commit-Revision: 322088 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.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 09:42:45 -0000 Author: trasz Date: Sat Aug 5 09:42:44 2017 New Revision: 322088 URL: https://svnweb.freebsd.org/changeset/base/322088 Log: MFC r320671: Use more canonical .Dt for vt(4). Modified: stable/11/share/man/man4/vt.4 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/vt.4 ============================================================================== --- stable/11/share/man/man4/vt.4 Sat Aug 5 09:40:56 2017 (r322087) +++ stable/11/share/man/man4/vt.4 Sat Aug 5 09:42:44 2017 (r322088) @@ -25,7 +25,7 @@ .\" $FreeBSD$ .\" .Dd July 19, 2016 -.Dt "VIRTUAL TERMINALS" 4 +.Dt "VT" 4 .Os .Sh NAME .Nm vt From owner-svn-src-all@freebsd.org Sat Aug 5 09:44:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF964DCA24B; Sat, 5 Aug 2017 09:44:22 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E3676E01A; Sat, 5 Aug 2017 09:44:22 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v759iLo9046810; Sat, 5 Aug 2017 09:44:21 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v759iLuV046809; Sat, 5 Aug 2017 09:44:21 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201708050944.v759iLuV046809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 5 Aug 2017 09:44:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r322089 - stable/11/usr.bin/ktrace X-SVN-Group: stable-11 X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: stable/11/usr.bin/ktrace X-SVN-Commit-Revision: 322089 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.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 09:44:22 -0000 Author: trasz Date: Sat Aug 5 09:44:21 2017 New Revision: 322089 URL: https://svnweb.freebsd.org/changeset/base/322089 Log: MFC r321327: Use more usual formatting for the EXAMPLES section of ktrace(1). Modified: stable/11/usr.bin/ktrace/ktrace.1 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/ktrace/ktrace.1 ============================================================================== --- stable/11/usr.bin/ktrace/ktrace.1 Sat Aug 5 09:42:44 2017 (r322088) +++ stable/11/usr.bin/ktrace/ktrace.1 Sat Aug 5 09:44:21 2017 (r322089) @@ -28,7 +28,7 @@ .\" @(#)ktrace.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd March 31, 2016 +.Dd July 24, 2017 .Dt KTRACE 1 .Os .Sh NAME @@ -148,31 +148,31 @@ and .Ar command options are mutually exclusive. .Sh EXAMPLES -# trace all kernel operations of process id 34 +Trace all kernel operations of process id 34: .Dl $ ktrace -p 34 .Pp -# trace all kernel operations of processes in process group 15 and -# pass the trace flags to all current and future children +Trace all kernel operations of processes in process group 15 and +pass the trace flags to all current and future children: .Dl $ ktrace -idg 15 .Pp -# disable all tracing of process 65 +Disable all tracing of process 65: .Dl $ ktrace -cp 65 .Pp -# disable tracing signals on process 70 and all current children +Disable tracing signals on process 70 and all current children: .Dl $ ktrace -t s -cdp 70 .Pp -# enable tracing of +Enable tracing of .Tn I/O -on process 67 +on process 67: .Dl $ ktrace -ti -p 67 .Pp -# run the command "w", tracing only system calls +Run the command "w", tracing only system calls: .Dl $ ktrace -tc w .Pp -# disable all tracing to the file "tracedata" +Disable all tracing to the file "tracedata": .Dl $ ktrace -c -f tracedata .Pp -# disable tracing of all user-owned processes +Disable tracing of all user-owned processes: .Dl $ ktrace -C .Sh SEE ALSO .Xr kdump 1 , From owner-svn-src-all@freebsd.org Sat Aug 5 09:45:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A11C3DCA34E; Sat, 5 Aug 2017 09:45:09 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6FB9B6E15F; Sat, 5 Aug 2017 09:45:09 +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 v759j8A4046902; Sat, 5 Aug 2017 09:45:08 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v759j8pD046901; Sat, 5 Aug 2017 09:45:08 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201708050945.v759j8pD046901@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 5 Aug 2017 09:45: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: r322090 - stable/11/usr.bin/truss X-SVN-Group: stable-11 X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: stable/11/usr.bin/truss X-SVN-Commit-Revision: 322090 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.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 09:45:09 -0000 Author: trasz Date: Sat Aug 5 09:45:08 2017 New Revision: 322090 URL: https://svnweb.freebsd.org/changeset/base/322090 Log: MFC r321328: Use more usual formatting for the EXAMPLES section of truss(1). Modified: stable/11/usr.bin/truss/truss.1 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/truss/truss.1 ============================================================================== --- stable/11/usr.bin/truss/truss.1 Sat Aug 5 09:44:21 2017 (r322089) +++ stable/11/usr.bin/truss/truss.1 Sat Aug 5 09:45:08 2017 (r322090) @@ -92,11 +92,13 @@ and options are mutually exclusive.) .El .Sh EXAMPLES -# Follow the system calls used in echoing "hello" +Follow the system calls used in echoing "hello": .Dl $ truss /bin/echo hello -# Do the same, but put the output into a file +.Pp +Do the same, but put the output into a file: .Dl $ truss -o /tmp/truss.out /bin/echo hello -# Follow an already-running process +.Pp +Follow an already-running process: .Dl $ truss -p 34 .Sh SEE ALSO .Xr kdump 1 , From owner-svn-src-all@freebsd.org Sat Aug 5 09:45:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11FEDDCA42F; Sat, 5 Aug 2017 09:45:50 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D49B16E291; Sat, 5 Aug 2017 09:45:49 +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 v759jnFq046978; Sat, 5 Aug 2017 09:45:49 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v759jn0q046977; Sat, 5 Aug 2017 09:45:49 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201708050945.v759jn0q046977@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 5 Aug 2017 09:45:49 +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: r322091 - stable/11/usr.bin/truss X-SVN-Group: stable-11 X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: stable/11/usr.bin/truss X-SVN-Commit-Revision: 322091 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.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 09:45:50 -0000 Author: trasz Date: Sat Aug 5 09:45:48 2017 New Revision: 322091 URL: https://svnweb.freebsd.org/changeset/base/322091 Log: MFC r321329: Make truss(1) cross-reference dtrace(1) and bump .Dd. Modified: stable/11/usr.bin/truss/truss.1 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/truss/truss.1 ============================================================================== --- stable/11/usr.bin/truss/truss.1 Sat Aug 5 09:45:08 2017 (r322090) +++ stable/11/usr.bin/truss/truss.1 Sat Aug 5 09:45:48 2017 (r322091) @@ -1,6 +1,6 @@ .\" $FreeBSD$ .\" -.Dd February 23, 2016 +.Dd July 24, 2017 .Dt TRUSS 1 .Os .Sh NAME @@ -101,6 +101,7 @@ Do the same, but put the output into a file: Follow an already-running process: .Dl $ truss -p 34 .Sh SEE ALSO +.Xr dtrace 1 , .Xr kdump 1 , .Xr ktrace 1 , .Xr ptrace 2 , From owner-svn-src-all@freebsd.org Sat Aug 5 09:48:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75817DCA698; Sat, 5 Aug 2017 09:48: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 mx1.freebsd.org (Postfix) with ESMTPS id 443A06E435; Sat, 5 Aug 2017 09:48:59 +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 v759mwNZ047161; Sat, 5 Aug 2017 09:48:58 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v759mwFE047160; Sat, 5 Aug 2017 09:48:58 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201708050948.v759mwFE047160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 5 Aug 2017 09:48: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: r322092 - stable/11/bin/ps X-SVN-Group: stable-11 X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: stable/11/bin/ps X-SVN-Commit-Revision: 322092 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.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 09:48:59 -0000 Author: trasz Date: Sat Aug 5 09:48:58 2017 New Revision: 322092 URL: https://svnweb.freebsd.org/changeset/base/322092 Log: MFC r321368: Use the "tree" word in ps(1) -d option description, to make it easier to find. Modified: stable/11/bin/ps/ps.1 Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/ps/ps.1 ============================================================================== --- stable/11/bin/ps/ps.1 Sat Aug 5 09:45:48 2017 (r322091) +++ stable/11/bin/ps/ps.1 Sat Aug 5 09:48:58 2017 (r322092) @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd August 12, 2016 +.Dd July 25, 2017 .Dt PS 1 .Os .Sh NAME @@ -129,7 +129,7 @@ time (this normally has no effect). .It Fl d Arrange processes into descendancy order and prefix each command with -indentation text showing sibling and parent/child relationships. +indentation text showing sibling and parent/child relationships as a tree. If either of the .Fl m and From owner-svn-src-all@freebsd.org Sat Aug 5 10:03:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CC06DCB4B9; Sat, 5 Aug 2017 10:03:49 +0000 (UTC) (envelope-from cmt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD6306EDB4; Sat, 5 Aug 2017 10:03:48 +0000 (UTC) (envelope-from cmt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v75A3lVs054958; Sat, 5 Aug 2017 10:03:47 GMT (envelope-from cmt@FreeBSD.org) Received: (from cmt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v75A3lYc054957; Sat, 5 Aug 2017 10:03:47 GMT (envelope-from cmt@FreeBSD.org) Message-Id: <201708051003.v75A3lYc054957@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cmt set sender to cmt@FreeBSD.org using -f From: Christoph Moench-Tegeder Date: Sat, 5 Aug 2017 10:03:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322093 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: cmt X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 322093 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.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 10:03:49 -0000 Author: cmt (ports committer) Date: Sat Aug 5 10:03:47 2017 New Revision: 322093 URL: https://svnweb.freebsd.org/changeset/base/322093 Log: add myself to calendar.freebsd Reported by: mckusick Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Sat Aug 5 09:48:58 2017 (r322092) +++ head/usr.bin/calendar/calendars/calendar.freebsd Sat Aug 5 10:03:47 2017 (r322093) @@ -74,6 +74,7 @@ 02/15 Hiren Panchasara born in Ahmedabad, Gujarat, India, 1984 02/16 Justin Hibbits born in Toledo, Ohio, United States, 1983 02/16 Tobias Christian Berner born in Bern, Switzerland, 1985 +02/18 Christoph Moench-Tegeder born in Hannover, Niedersachsen, Germany, 1980 02/19 Murray Stokely born in Jacksonville, Florida, United States, 1979 02/20 Anders Nordby born in Oslo, Norway, 1976 02/21 Alexey Zelkin born in Simferopol, Ukraine, 1978 From owner-svn-src-all@freebsd.org Sat Aug 5 12:33:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB244DD39D4; Sat, 5 Aug 2017 12:33:02 +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 mx1.freebsd.org (Postfix) with ESMTPS id B4B1573A87; Sat, 5 Aug 2017 12:33:02 +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 v75CX1Pi016179; Sat, 5 Aug 2017 12:33:01 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v75CX1GJ016171; Sat, 5 Aug 2017 12:33:01 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201708051233.v75CX1GJ016171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sat, 5 Aug 2017 12:33:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322094 - in stable/10: . gnu/usr.bin lib share/mk tools/build/mk tools/build/options usr.bin usr.sbin X-SVN-Group: stable-10 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: in stable/10: . gnu/usr.bin lib share/mk tools/build/mk tools/build/options usr.bin usr.sbin X-SVN-Commit-Revision: 322094 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.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 12:33:03 -0000 Author: marius Date: Sat Aug 5 12:33:00 2017 New Revision: 322094 URL: https://svnweb.freebsd.org/changeset/base/322094 Log: MFC: r306375 Add a WITHOUT_DIALOG src.conf(5) knob. It also turns off dependencies (bsdinstall, bsdconfig, dpv, tzsetup). Added: stable/10/tools/build/options/WITHOUT_DIALOG - copied unchanged from r306375, head/tools/build/options/WITHOUT_DIALOG Modified: stable/10/Makefile.inc1 stable/10/gnu/usr.bin/Makefile stable/10/lib/Makefile stable/10/share/mk/bsd.own.mk stable/10/tools/build/mk/OptionalObsoleteFiles.inc stable/10/usr.bin/Makefile stable/10/usr.sbin/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Sat Aug 5 10:03:47 2017 (r322093) +++ stable/10/Makefile.inc1 Sat Aug 5 12:33:00 2017 (r322094) @@ -1713,13 +1713,17 @@ _prebuild_libs= ${_kerberos5_lib_libasn1} \ ${_cddl_lib_libzfs_core} \ lib/libutil ${_lib_libypclnt} lib/libz lib/msun \ ${_secure_lib_libcrypto} ${_lib_libldns} \ - ${_secure_lib_libssh} ${_secure_lib_libssl} \ - gnu/lib/libdialog + ${_secure_lib_libssh} ${_secure_lib_libssl} .if ${MK_GNUCXX} != no _prebuild_libs+= gnu/lib/libstdc++ gnu/lib/libsupc++ gnu/lib/libstdc++__L: lib/msun__L .endif +.if ${MK_DIALOG} != "no" +_prebuild_libs+= gnu/lib/libdialog +gnu/lib/libdialog__L: lib/msun__L lib/ncurses/ncursesw__L +.endif + .if ${MK_LIBCPLUSPLUS} != "no" _prebuild_libs+= lib/libc++ .endif @@ -1850,8 +1854,6 @@ _lib_libypclnt= lib/libypclnt .if ${MK_OPENSSL} == "no" lib/libradius__L: lib/libmd__L .endif - -gnu/lib/libdialog__L: lib/msun__L lib/ncurses/ncursesw__L .for _lib in ${_prereq_libs} ${_lib}__PL: .PHONY .MAKE Modified: stable/10/gnu/usr.bin/Makefile ============================================================================== --- stable/10/gnu/usr.bin/Makefile Sat Aug 5 10:03:47 2017 (r322093) +++ stable/10/gnu/usr.bin/Makefile Sat Aug 5 12:33:00 2017 (r322094) @@ -4,7 +4,7 @@ SUBDIR= ${_binutils} \ ${_cc} \ - dialog \ + ${_dialog} \ diff \ diff3 \ ${_dtc} \ @@ -24,6 +24,10 @@ _gperf= gperf .if ${MK_GROFF} != "no" _groff= groff .endif +.endif + +.if ${MK_DIALOG} != "no" +_dialog= dialog .endif .if ${MK_GPL_DTC} != "no" Modified: stable/10/lib/Makefile ============================================================================== --- stable/10/lib/Makefile Sat Aug 5 10:03:47 2017 (r322093) +++ stable/10/lib/Makefile Sat Aug 5 12:33:00 2017 (r322094) @@ -40,7 +40,7 @@ SUBDIR= ${SUBDIR_ORDERED} \ libdevctl \ libdevinfo \ libdevstat \ - libdpv \ + ${_libdpv} \ libdwarf \ libedit \ ${_libefi} \ @@ -162,6 +162,10 @@ _libbsnmp= libbsnmp .if ${MK_CLANG} != "no" && !defined(COMPAT_32BIT) _clang= clang +.endif + +.if ${MK_DIALOG} != "no" +_libdpv= libdpv .endif .if ${MK_FILE} != "no" Modified: stable/10/share/mk/bsd.own.mk ============================================================================== --- stable/10/share/mk/bsd.own.mk Sat Aug 5 10:03:47 2017 (r322093) +++ stable/10/share/mk/bsd.own.mk Sat Aug 5 12:33:00 2017 (r322094) @@ -288,6 +288,7 @@ __DEFAULT_YES_OPTIONS = \ CRYPT \ CTM \ CXX \ + DIALOG \ DICT \ DYNAMICROOT \ ED_CRYPTO \ @@ -549,6 +550,10 @@ MK_KERBEROS:= no .if ${MK_CXX} == "no" MK_CLANG:= no MK_GROFF:= no +.endif + +.if ${MK_DIALOG} == "no" +MK_BSDINSTALL:= no .endif .if ${MK_MAIL} == "no" Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Sat Aug 5 10:03:47 2017 (r322093) +++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Sat Aug 5 12:33:00 2017 (r322094) @@ -1057,6 +1057,27 @@ OLD_FILES+=usr/bin/g++ OLD_FILES+=usr/libexec/cc1plus .endif +.if ${MK_DIALOG} == no +OLD_FILES+=usr/bin/dialog +OLD_FILES+=usr/bin/dpv +OLD_FILES+=usr/lib/libdialog.a +OLD_FILES+=usr/lib/libdialog.so +OLD_FILES+=usr/lib/libdialog.so.8 +OLD_FILES+=usr/lib/libdialog_p.a +OLD_FILES+=usr/lib/libdpv.a +OLD_FILES+=usr/lib/libdpv.so +OLD_FILES+=usr/lib/libdpv.so.1 +OLD_FILES+=usr/lib/libdpv_p.a +OLD_FILES+=usr/sbin/bsdconfig +OLD_FILES+=usr/sbin/tzsetup +OLD_FILES+=usr/share/man/man1/dialog.1.gz +OLD_FILES+=usr/share/man/man1/dpv.1.gz +OLD_FILES+=usr/share/man/man3/dialog.3.gz +OLD_FILES+=usr/share/man/man3/dpv.3.gz +OLD_FILES+=usr/share/man/man8/tzsetup.8.gz +OLD_FILES+=usr/share/man/man8/bsdconfig.8.gz +.endif + .if ${MK_FMTREE} == no OLD_FILES+=usr/sbin/fmtree OLD_FILES+=usr/share/man/man8/fmtree.8.gz Copied: stable/10/tools/build/options/WITHOUT_DIALOG (from r306375, head/tools/build/options/WITHOUT_DIALOG) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/tools/build/options/WITHOUT_DIALOG Sat Aug 5 12:33:00 2017 (r322094, copy of r306375, head/tools/build/options/WITHOUT_DIALOG) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to not build dialog(1), dialog(1,3), and dpv(1,3). Modified: stable/10/usr.bin/Makefile ============================================================================== --- stable/10/usr.bin/Makefile Sat Aug 5 10:03:47 2017 (r322093) +++ stable/10/usr.bin/Makefile Sat Aug 5 12:33:00 2017 (r322094) @@ -37,7 +37,7 @@ SUBDIR= alias \ ctlstat \ cut \ dirname \ - dpv \ + ${_dpv} \ du \ elf2aout \ elfdump \ @@ -225,6 +225,10 @@ SUBDIR+= calendar .if ${MK_CLANG} != "no" _clang= clang +.endif + +.if ${MK_DIALOG} != "no" +_dpv= dpv .endif .if ${MK_EE} != "no" Modified: stable/10/usr.sbin/Makefile ============================================================================== --- stable/10/usr.sbin/Makefile Sat Aug 5 10:03:47 2017 (r322093) +++ stable/10/usr.sbin/Makefile Sat Aug 5 12:33:00 2017 (r322094) @@ -6,7 +6,7 @@ SUBDIR= adduser \ arp \ binmiscctl \ - bsdconfig \ + ${_bsdconfig} \ camdd \ cdcontrol \ chkgrp \ @@ -89,7 +89,7 @@ SUBDIR= adduser \ tcpdump \ traceroute \ trpt \ - tzsetup \ + ${_tzsetup} \ uefisign \ ugidfw \ vigr \ @@ -150,6 +150,11 @@ SUBDIR+= ctm .if ${MK_CXGBETOOL} != "no" SUBDIR+= cxgbetool +.endif + +.if ${MK_DIALOG} != "no" +_bsdconfig= bsdconfig +_tzsetup= tzsetup .endif .if ${MK_FLOPPY} != "no" From owner-svn-src-all@freebsd.org Sat Aug 5 12:34:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B728DD3B0C; Sat, 5 Aug 2017 12:34:33 +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 mx1.freebsd.org (Postfix) with ESMTPS id CE55673BF9; Sat, 5 Aug 2017 12:34:32 +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 v75CYVZP016264; Sat, 5 Aug 2017 12:34:31 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v75CYV3P016263; Sat, 5 Aug 2017 12:34:31 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201708051234.v75CYV3P016263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sat, 5 Aug 2017 12:34: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: r322095 - stable/10/share/man/man5 X-SVN-Group: stable-10 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: stable/10/share/man/man5 X-SVN-Commit-Revision: 322095 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.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 12:34:33 -0000 Author: marius Date: Sat Aug 5 12:34:31 2017 New Revision: 322095 URL: https://svnweb.freebsd.org/changeset/base/322095 Log: Regenerate src.conf.5 after r322094. Modified: stable/10/share/man/man5/src.conf.5 Modified: stable/10/share/man/man5/src.conf.5 ============================================================================== --- stable/10/share/man/man5/src.conf.5 Sat Aug 5 12:33:00 2017 (r322094) +++ stable/10/share/man/man5/src.conf.5 Sat Aug 5 12:34:31 2017 (r322095) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: stable/10/tools/build/options/makeman 318614 2017-05-22 06:08:20Z ngie .\" $FreeBSD$ -.Dd July 5, 2017 +.Dd August 5, 2017 .Dt SRC.CONF 5 .Os .Sh NAME @@ -371,6 +371,15 @@ The debug files will be placed in a subdirectory of .Pa /usr/lib/debug and are located automatically by .Xr gdb 1 . +.It Va WITHOUT_DIALOG +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_DIALOG 322094 2017-08-05 12:33:00Z marius +Set to not build dialog(1), dialog(1,3), and dpv(1,3). +When set, it also enforces the following options: +.Pp +.Bl -item -compact +.It +.Va WITHOUT_BSDINSTALL +.El .It Va WITHOUT_DICT .\" from FreeBSD: stable/10/tools/build/options/WITHOUT_DICT 156932 2006-03-21 07:50:50Z ru Set to not build the Webster dictionary files. From owner-svn-src-all@freebsd.org Sat Aug 5 12:54:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14915DD4C0C; Sat, 5 Aug 2017 12:54:09 +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 mx1.freebsd.org (Postfix) with ESMTPS id D531874748; Sat, 5 Aug 2017 12:54:08 +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 v75Cs8kY024504; Sat, 5 Aug 2017 12:54:08 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v75Cs789024498; Sat, 5 Aug 2017 12:54:07 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201708051254.v75Cs789024498@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sat, 5 Aug 2017 12:54:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322096 - in stable/10: tools/build/mk usr.sbin usr.sbin/bsdconfig/timezone usr.sbin/tzsetup X-SVN-Group: stable-10 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: in stable/10: tools/build/mk usr.sbin usr.sbin/bsdconfig/timezone usr.sbin/tzsetup X-SVN-Commit-Revision: 322096 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.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 12:54:09 -0000 Author: marius Date: Sat Aug 5 12:54:07 2017 New Revision: 322096 URL: https://svnweb.freebsd.org/changeset/base/322096 Log: MFC: r274394, r274399, r307802 - Default `bsdconfig timezone' and `tzsetup' to `-s' in a VM. - Hide dialog specific code behind HAVE_DIALOG. It allows to build a stripped down version (missing the dialog UI) but perfectly function tzsetup when world is built WITHOUT_DIALOG. Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc stable/10/usr.sbin/Makefile stable/10/usr.sbin/bsdconfig/timezone/timezone stable/10/usr.sbin/tzsetup/Makefile stable/10/usr.sbin/tzsetup/tzsetup.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Sat Aug 5 12:34:31 2017 (r322095) +++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Sat Aug 5 12:54:07 2017 (r322096) @@ -1069,12 +1069,10 @@ OLD_FILES+=usr/lib/libdpv.so OLD_FILES+=usr/lib/libdpv.so.1 OLD_FILES+=usr/lib/libdpv_p.a OLD_FILES+=usr/sbin/bsdconfig -OLD_FILES+=usr/sbin/tzsetup OLD_FILES+=usr/share/man/man1/dialog.1.gz OLD_FILES+=usr/share/man/man1/dpv.1.gz OLD_FILES+=usr/share/man/man3/dialog.3.gz OLD_FILES+=usr/share/man/man3/dpv.3.gz -OLD_FILES+=usr/share/man/man8/tzsetup.8.gz OLD_FILES+=usr/share/man/man8/bsdconfig.8.gz .endif Modified: stable/10/usr.sbin/Makefile ============================================================================== --- stable/10/usr.sbin/Makefile Sat Aug 5 12:34:31 2017 (r322095) +++ stable/10/usr.sbin/Makefile Sat Aug 5 12:54:07 2017 (r322096) @@ -89,7 +89,7 @@ SUBDIR= adduser \ tcpdump \ traceroute \ trpt \ - ${_tzsetup} \ + tzsetup \ uefisign \ ugidfw \ vigr \ @@ -154,7 +154,6 @@ SUBDIR+= cxgbetool .if ${MK_DIALOG} != "no" _bsdconfig= bsdconfig -_tzsetup= tzsetup .endif .if ${MK_FLOPPY} != "no" Modified: stable/10/usr.sbin/bsdconfig/timezone/timezone ============================================================================== --- stable/10/usr.sbin/bsdconfig/timezone/timezone Sat Aug 5 12:34:31 2017 (r322095) +++ stable/10/usr.sbin/bsdconfig/timezone/timezone Sat Aug 5 12:54:07 2017 (r322096) @@ -62,7 +62,7 @@ _PATH_WALL_CMOS_CLOCK="/etc/wall_cmos_clock" REALLYDOIT=1 REINSTALL= USEDIALOG=1 -SKIPUTC= +SKIPUTC= # See MAIN VERBOSE= TZ_OR_FAIL= CHROOTENV= @@ -118,6 +118,9 @@ dialog_menu_main() } ############################################################ MAIN + +# Skip initial question regarding UTC v. Wall-Clock time if run in VM +[ "$( sysctl -n kern.vm_guest 2> /dev/null )" = "none" ] || SKIPUTC=1 # Incorporate rc-file if it exists [ -f "$HOME/.bsdconfigrc" ] && f_include "$HOME/.bsdconfigrc" Modified: stable/10/usr.sbin/tzsetup/Makefile ============================================================================== --- stable/10/usr.sbin/tzsetup/Makefile Sat Aug 5 12:34:31 2017 (r322095) +++ stable/10/usr.sbin/tzsetup/Makefile Sat Aug 5 12:54:07 2017 (r322096) @@ -1,16 +1,18 @@ # $FreeBSD$ +.include + PROG= tzsetup MAN= tzsetup.8 -CFLAGS+= -I${.CURDIR}/../../contrib/dialog -I. +CFLAGS+= -I. +.if ${MK_DIALOG} != no WARNS?= 3 - +CFLAGS+= -I${.CURDIR}/../../contrib/dialog -DHAVE_DIALOG DPADD= ${LIBDIALOG} ${LIBM} LDADD= -ldialog -lm - -.include +.endif .if ${MK_NCURSESW} == "no" DPADD+= ${LIBNCURSES} Modified: stable/10/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- stable/10/usr.sbin/tzsetup/tzsetup.c Sat Aug 5 12:34:31 2017 (r322095) +++ stable/10/usr.sbin/tzsetup/tzsetup.c Sat Aug 5 12:54:07 2017 (r322096) @@ -47,8 +47,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#ifdef HAVE_DIALOG #include +#endif #define _PATH_ZONETAB "/usr/share/zoneinfo/zone.tab" #define _PATH_ISO3166 "/usr/share/misc/iso3166" @@ -71,6 +74,19 @@ __FBSDID("$FreeBSD$"); #define DITEM_LEAVE_MENU (1 << 16) #define DITEM_RECREATE (1 << 18) +static char path_zonetab[MAXPATHLEN], path_iso3166[MAXPATHLEN], + path_zoneinfo[MAXPATHLEN], path_localtime[MAXPATHLEN], + path_db[MAXPATHLEN], path_wall_cmos_clock[MAXPATHLEN]; + +static int reallydoit = 1; +static int reinstall = 0; +static char *chrootenv = NULL; + +static void usage(void); +static int install_zoneinfo(const char *zoneinfo); +static int install_zoneinfo_file(const char *zoneinfo_file); + +#ifdef HAVE_DIALOG /* for use in describing more exotic behaviors */ typedef struct dialogMenuItem { char *prompt; @@ -186,20 +202,10 @@ again: return result; } -static char path_zonetab[MAXPATHLEN], path_iso3166[MAXPATHLEN], - path_zoneinfo[MAXPATHLEN], path_localtime[MAXPATHLEN], - path_db[MAXPATHLEN], path_wall_cmos_clock[MAXPATHLEN]; - -static int reallydoit = 1; -static int reinstall = 0; static int usedialog = 1; -static char *chrootenv = NULL; -static void usage(void); static int confirm_zone(const char *filename); static int continent_country_menu(dialogMenuItem *); -static int install_zoneinfo(const char *zoneinfo); -static int install_zoneinfo_file(const char *zoneinfo_file); static int set_zone_multi(dialogMenuItem *); static int set_zone_whole_country(dialogMenuItem *); static int set_zone_menu(dialogMenuItem *); @@ -643,6 +649,53 @@ set_zone_utc(void) } static int +confirm_zone(const char *filename) +{ + char title[64], prompt[64]; + time_t t = time(0); + struct tm *tm; + int rv; + + setenv("TZ", filename == NULL ? "" : filename, 1); + tzset(); + tm = localtime(&t); + + snprintf(title, sizeof(title), "Confirmation"); + snprintf(prompt, sizeof(prompt), + "Does the abbreviation `%s' look reasonable?", tm->tm_zone); + rv = !dialog_yesno(title, prompt, 5, 72); + return (rv); +} + +static int +set_zone_multi(dialogMenuItem *dmi) +{ + struct zone *zp = dmi->data; + int rv; + + if (!confirm_zone(zp->filename)) + return (DITEM_FAILURE | DITEM_RECREATE); + + rv = install_zoneinfo(zp->filename); + return (rv); +} + +static int +set_zone_whole_country(dialogMenuItem *dmi) +{ + struct country *cp = dmi->data; + int rv; + + if (!confirm_zone(cp->filename)) + return (DITEM_FAILURE | DITEM_RECREATE); + + rv = install_zoneinfo(cp->filename); + return (rv); +} + +#endif + +static int install_zoneinfo_file(const char *zoneinfo_file) { char buf[1024]; @@ -671,9 +724,11 @@ install_zoneinfo_file(const char *zoneinfo_file) snprintf(prompt, sizeof(prompt), "Creating symbolic link %s to %s", path_localtime, zoneinfo_file); +#ifdef HAVE_DIALOG if (usedialog) dialog_msgbox(title, prompt, 8, 72, 1); else +#endif fprintf(stderr, "%s\n", prompt); #endif @@ -684,9 +739,11 @@ install_zoneinfo_file(const char *zoneinfo_file) snprintf(prompt, sizeof(prompt), "Could not delete %s: %s", path_localtime, strerror(errno)); +#ifdef HAVE_DIALOG if (usedialog) dialog_msgbox(title, prompt, 8, 72, 1); else +#endif fprintf(stderr, "%s\n", prompt); return (DITEM_FAILURE | DITEM_RECREATE); @@ -696,9 +753,11 @@ install_zoneinfo_file(const char *zoneinfo_file) snprintf(prompt, sizeof(prompt), "Could not delete %s: %s", path_db, strerror(errno)); +#ifdef HAVE_DIALOG if (usedialog) dialog_msgbox(title, prompt, 8, 72, 1); else +#endif fprintf(stderr, "%s\n", prompt); return (DITEM_FAILURE | DITEM_RECREATE); @@ -707,9 +766,11 @@ install_zoneinfo_file(const char *zoneinfo_file) snprintf(title, sizeof(title), "Done"); snprintf(prompt, sizeof(prompt), "Removed %s", path_localtime); +#ifdef HAVE_DIALOG if (usedialog) dialog_msgbox(title, prompt, 8, 72, 1); else +#endif fprintf(stderr, "%s\n", prompt); #endif return (DITEM_LEAVE_MENU); @@ -722,9 +783,11 @@ install_zoneinfo_file(const char *zoneinfo_file) snprintf(prompt, sizeof(prompt), "Could not open %s: %s", zoneinfo_file, strerror(errno)); +#ifdef HAVE_DIALOG if (usedialog) dialog_msgbox(title, prompt, 8, 72, 1); else +#endif fprintf(stderr, "%s\n", prompt); return (DITEM_FAILURE | DITEM_RECREATE); } @@ -733,10 +796,12 @@ install_zoneinfo_file(const char *zoneinfo_file) snprintf(prompt, sizeof(prompt), "Could not unlink %s: %s", path_localtime, strerror(errno)); +#ifdef HAVE_DIALOG if (usedialog) { snprintf(title, sizeof(title), "Error"); dialog_msgbox(title, prompt, 8, 72, 1); } else +#endif fprintf(stderr, "%s\n", prompt); return (DITEM_FAILURE | DITEM_RECREATE); } @@ -748,9 +813,11 @@ install_zoneinfo_file(const char *zoneinfo_file) snprintf(prompt, sizeof(prompt), "Could not open %s: %s", path_localtime, strerror(errno)); +#ifdef HAVE_DIALOG if (usedialog) dialog_msgbox(title, prompt, 8, 72, 1); else +#endif fprintf(stderr, "%s\n", prompt); return (DITEM_FAILURE | DITEM_RECREATE); } @@ -764,9 +831,11 @@ install_zoneinfo_file(const char *zoneinfo_file) snprintf(prompt, sizeof(prompt), "Error copying %s to %s %s", zoneinfo_file, path_localtime, strerror(errno)); +#ifdef HAVE_DIALOG if (usedialog) dialog_msgbox(title, prompt, 8, 72, 1); else +#endif fprintf(stderr, "%s\n", prompt); /* Better to leave none than a corrupt one. */ unlink(path_localtime); @@ -780,9 +849,11 @@ install_zoneinfo_file(const char *zoneinfo_file) snprintf(prompt, sizeof(prompt), "Cannot access %s: %s", zoneinfo_file, strerror(errno)); +#ifdef HAVE_DIALOG if (usedialog) dialog_msgbox(title, prompt, 8, 72, 1); else +#endif fprintf(stderr, "%s\n", prompt); return (DITEM_FAILURE | DITEM_RECREATE); } @@ -790,10 +861,12 @@ install_zoneinfo_file(const char *zoneinfo_file) snprintf(prompt, sizeof(prompt), "Could not unlink %s: %s", path_localtime, strerror(errno)); +#ifdef HAVE_DIALOG if (usedialog) { snprintf(title, sizeof(title), "Error"); dialog_msgbox(title, prompt, 8, 72, 1); } else +#endif fprintf(stderr, "%s\n", prompt); return (DITEM_FAILURE | DITEM_RECREATE); } @@ -803,9 +876,11 @@ install_zoneinfo_file(const char *zoneinfo_file) "Cannot create symbolic link %s to %s: %s", path_localtime, zoneinfo_file, strerror(errno)); +#ifdef HAVE_DIALOG if (usedialog) dialog_msgbox(title, prompt, 8, 72, 1); else +#endif fprintf(stderr, "%s\n", prompt); return (DITEM_FAILURE | DITEM_RECREATE); } @@ -821,9 +896,11 @@ install_zoneinfo_file(const char *zoneinfo_file) snprintf(prompt, sizeof(prompt), "Created symbolic link from %s to %s", zoneinfo_file, path_localtime); +#ifdef HAVE_DIALOG if (usedialog) dialog_msgbox(title, prompt, 8, 72, 1); else +#endif fprintf(stderr, "%s\n", prompt); #endif } /* reallydoit */ @@ -854,51 +931,6 @@ install_zoneinfo(const char *zoneinfo) return (rv); } -static int -confirm_zone(const char *filename) -{ - char title[64], prompt[64]; - time_t t = time(0); - struct tm *tm; - int rv; - - setenv("TZ", filename == NULL ? "" : filename, 1); - tzset(); - tm = localtime(&t); - - snprintf(title, sizeof(title), "Confirmation"); - snprintf(prompt, sizeof(prompt), - "Does the abbreviation `%s' look reasonable?", tm->tm_zone); - rv = !dialog_yesno(title, prompt, 5, 72); - return (rv); -} - -static int -set_zone_multi(dialogMenuItem *dmi) -{ - struct zone *zp = dmi->data; - int rv; - - if (!confirm_zone(zp->filename)) - return (DITEM_FAILURE | DITEM_RECREATE); - - rv = install_zoneinfo(zp->filename); - return (rv); -} - -static int -set_zone_whole_country(dialogMenuItem *dmi) -{ - struct country *cp = dmi->data; - int rv; - - if (!confirm_zone(cp->filename)) - return (DITEM_FAILURE | DITEM_RECREATE); - - rv = install_zoneinfo(cp->filename); - return (rv); -} - static void usage(void) { @@ -911,10 +943,21 @@ usage(void) int main(int argc, char **argv) { +#ifdef HAVE_DIALOG char title[64], prompt[128]; - int c, fd, rv, skiputc; + int fd; +#endif + int c, rv, skiputc; + char vm_guest[16] = ""; + size_t len = sizeof(vm_guest); skiputc = 0; + + /* Default skiputc to 1 for VM guests */ + if (sysctlbyname("kern.vm_guest", vm_guest, &len, NULL, 0) == 0 && + strcmp(vm_guest, "none") != 0) + skiputc = 1; + while ((c = getopt(argc, argv, "C:nrs")) != -1) { switch(c) { case 'C': @@ -925,7 +968,9 @@ main(int argc, char **argv) break; case 'r': reinstall = 1; +#ifdef HAVE_DIALOG usedialog = 0; +#endif break; case 's': skiputc = 1; @@ -989,12 +1034,15 @@ main(int argc, char **argv) struct stat sb; if (stat(argv[optind], &sb) != 0) { +#ifdef HAVE_DIALOG usedialog = 0; +#endif rv = install_zoneinfo(argv[optind]); exit(rv & ~DITEM_LEAVE_MENU); } /* FALLTHROUGH */ } +#ifdef HAVE_DIALOG read_iso3166_table(); read_zones(); @@ -1055,5 +1103,8 @@ main(int argc, char **argv) dlg_clear(); end_dialog(); +#else + usage(); +#endif return (0); } From owner-svn-src-all@freebsd.org Sat Aug 5 12:59:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 233E2DD4F1B; Sat, 5 Aug 2017 12:59:04 +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 mx1.freebsd.org (Postfix) with ESMTPS id F34CE748F3; Sat, 5 Aug 2017 12:59:03 +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 v75Cx30R024725; Sat, 5 Aug 2017 12:59:03 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v75Cx3jP024724; Sat, 5 Aug 2017 12:59:03 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201708051259.v75Cx3jP024724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sat, 5 Aug 2017 12:59:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322097 - head/usr.sbin/tzsetup X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/usr.sbin/tzsetup X-SVN-Commit-Revision: 322097 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.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 12:59:04 -0000 Author: marius Date: Sat Aug 5 12:59:03 2017 New Revision: 322097 URL: https://svnweb.freebsd.org/changeset/base/322097 Log: - Move creation and unlinking of /etc/wall_cmos_clock from the handling of the initial UTC dialog to install_zoneinfo() so that file gets the necessary treatment also when that dialog is skipped via "-s", when selecting UTC from the time zone menu or on the command-line instead etc. - Make the initial UTC dialog actually work by giving the relevant files the necessary treatment and then exit when choosing "Yes" there instead of moving on to the time zone menu regardless. - Since r301131, /etc/localtime is also installed when selecting UTC in interactive configurations (which previously meant only via the time zone menu, though). Thus, the code added in r230298 which treats a NULL zone file name as UTC and removes /etc/localtime in that case can go again. - Consistently refer to "could not delete" (as chosen by the oldest such code in here) when unlink(2) fails instead of a to mixture of "delete" and "unlink" in error messages. Modified: head/usr.sbin/tzsetup/tzsetup.c Modified: head/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- head/usr.sbin/tzsetup/tzsetup.c Sat Aug 5 12:54:07 2017 (r322096) +++ head/usr.sbin/tzsetup/tzsetup.c Sat Aug 5 12:59:03 2017 (r322097) @@ -107,7 +107,7 @@ xdialog_count_rows(const char *p) rows++; } - return rows ? rows : 1; + return (rows ? rows : 1); } static int @@ -124,7 +124,7 @@ xdialog_count_columns(const char *p) len = strlen(p); max_len = MAX(max_len, len); - return max_len; + return (max_len); } static int @@ -164,7 +164,8 @@ xdialog_menu(const char *title, const char *cprompt, i tag_x = MAX(tag_x, l + k + 2); } } - width = MAX(xdialog_count_columns(cprompt), title != NULL ? xdialog_count_columns(title) : 0); + width = MAX(xdialog_count_columns(cprompt), title != NULL ? + xdialog_count_columns(title) : 0); width = MAX(width, tag_x + 4) + 4; } width = MAX(width, 24); @@ -199,7 +200,7 @@ again: free(listitems); dlg_restore_vars(&save_vars); - return result; + return (result); } static int usedialog = 1; @@ -269,7 +270,7 @@ continent_country_menu(dialogMenuItem *continent) int rv; if (strcmp(continent->title, "UTC") == 0) - return set_zone_utc(); + return (set_zone_utc()); /* Short cut -- if there's only one country, don't post a menu. */ if (contp->nitems == 1) @@ -642,7 +643,7 @@ set_zone_menu(dialogMenuItem *dmi) static int set_zone_utc(void) { - if (!confirm_zone(NULL)) + if (!confirm_zone("UTC")) return (DITEM_FAILURE | DITEM_RECREATE); return (install_zoneinfo("UTC")); @@ -656,7 +657,7 @@ confirm_zone(const char *filename) struct tm *tm; int rv; - setenv("TZ", filename == NULL ? "" : filename, 1); + setenv("TZ", filename, 1); tzset(); tm = localtime(&t); @@ -714,11 +715,8 @@ install_zoneinfo_file(const char *zoneinfo_file) #ifdef VERBOSE snprintf(title, sizeof(title), "Info"); - if (zoneinfo_file == NULL) + if (copymode) snprintf(prompt, sizeof(prompt), - "Removing %s", path_localtime); - else if (copymode) - snprintf(prompt, sizeof(prompt), "Copying %s to %s", zoneinfo_file, path_localtime); else snprintf(prompt, sizeof(prompt), @@ -733,49 +731,6 @@ install_zoneinfo_file(const char *zoneinfo_file) #endif if (reallydoit) { - if (zoneinfo_file == NULL) { - if (unlink(path_localtime) < 0 && errno != ENOENT) { - snprintf(title, sizeof(title), "Error"); - snprintf(prompt, sizeof(prompt), - "Could not delete %s: %s", path_localtime, - strerror(errno)); -#ifdef HAVE_DIALOG - if (usedialog) - dialog_msgbox(title, prompt, 8, 72, 1); - else -#endif - fprintf(stderr, "%s\n", prompt); - - return (DITEM_FAILURE | DITEM_RECREATE); - } - if (unlink(path_db) < 0 && errno != ENOENT) { - snprintf(title, sizeof(title), "Error"); - snprintf(prompt, sizeof(prompt), - "Could not delete %s: %s", path_db, - strerror(errno)); -#ifdef HAVE_DIALOG - if (usedialog) - dialog_msgbox(title, prompt, 8, 72, 1); - else -#endif - fprintf(stderr, "%s\n", prompt); - - return (DITEM_FAILURE | DITEM_RECREATE); - } -#ifdef VERBOSE - snprintf(title, sizeof(title), "Done"); - snprintf(prompt, sizeof(prompt), - "Removed %s", path_localtime); -#ifdef HAVE_DIALOG - if (usedialog) - dialog_msgbox(title, prompt, 8, 72, 1); - else -#endif - fprintf(stderr, "%s\n", prompt); -#endif - return (DITEM_LEAVE_MENU); - } - if (copymode) { fd1 = open(zoneinfo_file, O_RDONLY, 0); if (fd1 < 0) { @@ -794,7 +749,7 @@ install_zoneinfo_file(const char *zoneinfo_file) if (unlink(path_localtime) < 0 && errno != ENOENT) { snprintf(prompt, sizeof(prompt), - "Could not unlink %s: %s", + "Could not delete %s: %s", path_localtime, strerror(errno)); #ifdef HAVE_DIALOG if (usedialog) { @@ -859,7 +814,7 @@ install_zoneinfo_file(const char *zoneinfo_file) } if (unlink(path_localtime) < 0 && errno != ENOENT) { snprintf(prompt, sizeof(prompt), - "Could not unlink %s: %s", + "Could not delete %s: %s", path_localtime, strerror(errno)); #ifdef HAVE_DIALOG if (usedialog) { @@ -911,10 +866,48 @@ install_zoneinfo_file(const char *zoneinfo_file) static int install_zoneinfo(const char *zoneinfo) { - int rv; + int fd, rv; FILE *f; char path_zoneinfo_file[MAXPATHLEN]; + char prompt[SILLY_BUFFER_SIZE], title[64]; + if (reallydoit) { + if (strcmp(zoneinfo, "UTC") == 0) { + if (unlink(path_wall_cmos_clock) < 0 && + errno != ENOENT) { + snprintf(title, sizeof(title), "Error"); + snprintf(prompt, sizeof(prompt), + "Could not delete %s: %s", + path_wall_cmos_clock, strerror(errno)); +#ifdef HAVE_DIALOG + if (usedialog) + dialog_msgbox(title, prompt, 8, 72, 1); + else +#endif + fprintf(stderr, "%s\n", prompt); + + return (DITEM_FAILURE | DITEM_RECREATE); + } + } else { + fd = open(path_wall_cmos_clock, O_WRONLY | O_CREAT | + O_TRUNC, S_IRUSR | S_IRGRP | S_IROTH); + if (fd < 0) { + snprintf(title, sizeof(title), "Error"); + snprintf(prompt, sizeof(prompt), + "Could not create %s: %s", + path_wall_cmos_clock, strerror(errno)); +#ifdef HAVE_DIALOG + if (usedialog) + dialog_msgbox(title, prompt, 8, 72, 1); + else +#endif + fprintf(stderr, "%s\n", prompt); + return (DITEM_FAILURE | DITEM_RECREATE); + } + close(fd); + } + } + if ((size_t)snprintf(path_zoneinfo_file, sizeof(path_zoneinfo_file), "%s/%s", path_zoneinfo, zoneinfo) >= sizeof(path_zoneinfo_file)) errx(1, "%s/%s name too long", path_zoneinfo, zoneinfo); @@ -945,7 +938,6 @@ main(int argc, char **argv) { #ifdef HAVE_DIALOG char title[64], prompt[128]; - int fd; #endif int c, rv, skiputc; char vm_guest[16] = ""; @@ -1067,19 +1059,11 @@ main(int argc, char **argv) yesno = dialog_yesno(title, prompt, 7, 73); dlg_restore_vars(&save_vars); if (!yesno) { - if (reallydoit) - unlink(path_wall_cmos_clock); - } else { if (reallydoit) { - fd = open(path_wall_cmos_clock, - O_WRONLY | O_CREAT | O_TRUNC, - S_IRUSR | S_IRGRP | S_IROTH); - if (fd < 0) { - end_dialog(); - err(1, "create %s", - path_wall_cmos_clock); - } - close(fd); + rv = install_zoneinfo("UTC"); + dlg_clear(); + end_dialog(); + exit(rv & ~DITEM_LEAVE_MENU); } } dlg_clear(); From owner-svn-src-all@freebsd.org Sat Aug 5 13:38:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3390DD6FA5; Sat, 5 Aug 2017 13:38:44 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8079675C44; Sat, 5 Aug 2017 13:38:44 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 9A5075A9F14; Sat, 5 Aug 2017 13:38:42 +0000 (UTC) Date: Sat, 5 Aug 2017 13:38:42 +0000 From: Brooks Davis To: Jeremie Le Hen Cc: "Ngie Cooper (yaneurabeya)" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r322029 - in head: usr.bin usr.sbin Message-ID: <20170805133842.GC16195@spindle.one-eyed-alien.net> References: <201708032130.v73LUC2H045637@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.3 (2017-05-23) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 13:38:44 -0000 On Fri, Aug 04, 2017 at 04:50:32PM +0200, Jeremie Le Hen wrote: > On Fri, Aug 4, 2017 at 12:42 AM, Ngie Cooper (yaneurabeya) > wrote: > > > >> On Aug 3, 2017, at 14:30, Jeremie Le Hen wrote: > >> > >> Author: jlh > >> Date: Thu Aug 3 21:30:12 2017 > >> New Revision: 322029 > >> URL: https://svnweb.freebsd.org/changeset/base/322029 > >> > >> Log: > >> rwho/ruptime/rwhod shouldn't be gated by RCMDS. > > > > The why in this commit and the next you made (r322031) would have been incredibly helpful. If bugzilla disappears I only have the commit history tracking the what. > > I agree, I realized this only afterwards. I don't know how to fix this though. Reverting the change and reapplying it with a meaningful message will produce the best result. -- Brooks From owner-svn-src-all@freebsd.org Sat Aug 5 14:49:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 086E1DAB76F; Sat, 5 Aug 2017 14:49:42 +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 mx1.freebsd.org (Postfix) with ESMTPS id C12D27793D; Sat, 5 Aug 2017 14:49:41 +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 v75Enewk068903; Sat, 5 Aug 2017 14:49:40 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v75EneLs068902; Sat, 5 Aug 2017 14:49:40 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201708051449.v75EneLs068902@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sat, 5 Aug 2017 14:49:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322098 - stable/10/usr.sbin/tzsetup X-SVN-Group: stable-10 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: stable/10/usr.sbin/tzsetup X-SVN-Commit-Revision: 322098 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.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 14:49:42 -0000 Author: marius Date: Sat Aug 5 14:49:40 2017 New Revision: 322098 URL: https://svnweb.freebsd.org/changeset/base/322098 Log: Fix a stable/10-specific mismerge in r322096; the MK_NCURSESW handling should be within the MK_DIALOG block as libncurses{,w} isn't required when building tzsetup(8) without dialog(3) support. Modified: stable/10/usr.sbin/tzsetup/Makefile Modified: stable/10/usr.sbin/tzsetup/Makefile ============================================================================== --- stable/10/usr.sbin/tzsetup/Makefile Sat Aug 5 12:59:03 2017 (r322097) +++ stable/10/usr.sbin/tzsetup/Makefile Sat Aug 5 14:49:40 2017 (r322098) @@ -12,14 +12,13 @@ WARNS?= 3 CFLAGS+= -I${.CURDIR}/../../contrib/dialog -DHAVE_DIALOG DPADD= ${LIBDIALOG} ${LIBM} LDADD= -ldialog -lm -.endif - .if ${MK_NCURSESW} == "no" DPADD+= ${LIBNCURSES} LDADD+= -lncurses .else DPADD+= ${LIBNCURSESW} LDADD+= -lncursesw +.endif .endif .include From owner-svn-src-all@freebsd.org Sat Aug 5 16:44:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA843DBCE9F; Sat, 5 Aug 2017 16:44:32 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9066D7ECF4; Sat, 5 Aug 2017 16:44:32 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v75GiVHd017066; Sat, 5 Aug 2017 16:44:31 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v75GiVFE017061; Sat, 5 Aug 2017 16:44:31 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201708051644.v75GiVFE017061@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 5 Aug 2017 16:44:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r322099 - in stable/11: etc/mtree share/mk share/zoneinfo share/zoneinfo/tests tools/build/options X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/11: etc/mtree share/mk share/zoneinfo share/zoneinfo/tests tools/build/options X-SVN-Commit-Revision: 322099 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.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 16:44:32 -0000 Author: ngie Date: Sat Aug 5 16:44:31 2017 New Revision: 322099 URL: https://svnweb.freebsd.org/changeset/base/322099 Log: MFC r320702,r320703: r320702: Formalize LEAPSECONDS and OLDTIMEZONES in share/zoneinfo/... as `MK_ZONEINFO_LEAPSECONDS_SUPPORT == yes` and `MK_ZONEINFO_OLD_TIMEZONES_SUPPORT == yes`. Keep `LEAPSECONDS` and `OLDTIMEZONES` for backwards compatibility, but print out a warning notifying users that they should use the new variables, in an effort to migrate them to the variables. This is being done mostly for automated build tools, etc, that might rely on these variables being set. The variables will be removed in the future on ^/head, e.g., after ^/stable/12 is cut. Relnotes: yes r320703: Add tests to help verify Links functionality for .../contrib/tzdata/backwards MFC with: r320702 Added: stable/11/share/zoneinfo/tests/ - copied from r320703, head/share/zoneinfo/tests/ stable/11/tools/build/options/WITH_ZONEINFO_LEAPSECONDS_SUPPORT - copied unchanged from r320702, head/tools/build/options/WITH_ZONEINFO_LEAPSECONDS_SUPPORT stable/11/tools/build/options/WITH_ZONEINFO_OLD_TIMEZONES_SUPPORT - copied unchanged from r320702, head/tools/build/options/WITH_ZONEINFO_OLD_TIMEZONES_SUPPORT Modified: stable/11/etc/mtree/BSD.tests.dist stable/11/share/mk/src.opts.mk stable/11/share/zoneinfo/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/mtree/BSD.tests.dist ============================================================================== --- stable/11/etc/mtree/BSD.tests.dist Sat Aug 5 14:49:40 2017 (r322098) +++ stable/11/etc/mtree/BSD.tests.dist Sat Aug 5 16:44:31 2017 (r322099) @@ -388,6 +388,8 @@ .. .. .. + zoneinfo + .. .. sys acl Modified: stable/11/share/mk/src.opts.mk ============================================================================== --- stable/11/share/mk/src.opts.mk Sat Aug 5 14:49:40 2017 (r322098) +++ stable/11/share/mk/src.opts.mk Sat Aug 5 16:44:31 2017 (r322099) @@ -194,6 +194,8 @@ __DEFAULT_NO_OPTIONS = \ SHARED_TOOLCHAIN \ SORT_THREADS \ SVN \ + ZONEINFO_LEAPSECONDS_SUPPORT \ + ZONEINFO_OLD_TIMEZONES_SUPPORT \ # @@ -371,6 +373,11 @@ MK_DTRACE_TESTS:= no .if ${MK_TEXTPROC} == "no" MK_GROFF:= no +.endif + +.if ${MK_ZONEINFO} == "no" +MK_ZONEINFO_LEAPSECONDS_SUPPORT:= no +MK_ZONEINFO_OLD_TIMEZONES_SUPPORT:= no .endif .if ${MK_CROSS_COMPILER} == "no" Modified: stable/11/share/zoneinfo/Makefile ============================================================================== --- stable/11/share/zoneinfo/Makefile Sat Aug 5 14:49:40 2017 (r322098) +++ stable/11/share/zoneinfo/Makefile Sat Aug 5 16:44:31 2017 (r322099) @@ -28,12 +28,24 @@ # $ svn commit # Commit message: "MFV of tzdata2008X" # +.include + CLEANFILES+= yearistype CLEANDIRS+= builddir CONTRIBDIR= ${.CURDIR}/../../contrib/tzdata/ .PATH: ${CONTRIBDIR} .if defined(LEAPSECONDS) +.warning "Using backwards compatibility variable for LEAPSECONDS; please use WITH_ZONEINFO_LEAPSECONDS_SUPPORT instead" +MK_ZONEINFO_LEAPSECONDS_SUPPORT= yes +.endif + +.if defined(OLDTIMEZONES) +.warning "Using backwards compatibility variable for OLDTIMEZONES; please use WITH_ZONEINFO_OLD_TIMEZONES_SUPPORT instead" +MK_ZONEINFO_OLD_TIMEZONES_SUPPORT= yes +.endif + +.if ${MK_ZONEINFO_LEAPSECONDS_SUPPORT} != "no" LEAPFILE= -L ${CONTRIBDIR}leapseconds .else LEAPFILE= @@ -43,7 +55,7 @@ TZFILES= africa antarctica asia australasia etcetera e factory northamerica southamerica POSIXRULES= America/New_York -.if defined(OLDTIMEZONES) +.if ${MK_ZONEINFO_OLD_TIMEZONES_SUPPORT} != "no" TZFILES+= backward systemv .endif @@ -67,7 +79,7 @@ TZBUILDSUBDIRS= \ Pacific \ SystemV -.if defined(OLDTIMEZONES) +.if ${MK_ZONEINFO_OLD_TIMEZONES_SUPPORT} != "no" TZBUILDSUBDIRS+= US Mexico Chile Canada Brazil .endif @@ -113,5 +125,9 @@ afterinstall: else \ echo "Run tzsetup(8) manually to update /etc/localtime."; \ fi + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif .include Copied: stable/11/tools/build/options/WITH_ZONEINFO_LEAPSECONDS_SUPPORT (from r320702, head/tools/build/options/WITH_ZONEINFO_LEAPSECONDS_SUPPORT) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/tools/build/options/WITH_ZONEINFO_LEAPSECONDS_SUPPORT Sat Aug 5 16:44:31 2017 (r322099, copy of r320702, head/tools/build/options/WITH_ZONEINFO_LEAPSECONDS_SUPPORT) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to build leapsecond information in to the timezone database. Copied: stable/11/tools/build/options/WITH_ZONEINFO_OLD_TIMEZONES_SUPPORT (from r320702, head/tools/build/options/WITH_ZONEINFO_OLD_TIMEZONES_SUPPORT) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/tools/build/options/WITH_ZONEINFO_OLD_TIMEZONES_SUPPORT Sat Aug 5 16:44:31 2017 (r322099, copy of r320702, head/tools/build/options/WITH_ZONEINFO_OLD_TIMEZONES_SUPPORT) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to build backward compatibility timezone aliases in to the timezone +database. From owner-svn-src-all@freebsd.org Sat Aug 5 16:55:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C44F6DBD5B5; Sat, 5 Aug 2017 16:55:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A05447F1C9; Sat, 5 Aug 2017 16:55:08 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v75Gt7Up021045; Sat, 5 Aug 2017 16:55:07 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v75Gt7uv021039; Sat, 5 Aug 2017 16:55:07 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201708051655.v75Gt7uv021039@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 5 Aug 2017 16:55:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322100 - in stable/10: etc/mtree share/mk share/zoneinfo share/zoneinfo/tests tools/build/options X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in stable/10: etc/mtree share/mk share/zoneinfo share/zoneinfo/tests tools/build/options X-SVN-Commit-Revision: 322100 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.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 16:55:08 -0000 Author: ngie Date: Sat Aug 5 16:55:07 2017 New Revision: 322100 URL: https://svnweb.freebsd.org/changeset/base/322100 Log: MFC r320702,r320703: r320702: Formalize LEAPSECONDS and OLDTIMEZONES in share/zoneinfo/... as `MK_ZONEINFO_LEAPSECONDS_SUPPORT == yes` and `MK_ZONEINFO_OLD_TIMEZONES_SUPPORT == yes`. Keep `LEAPSECONDS` and `OLDTIMEZONES` for backwards compatibility, but print out a warning notifying users that they should use the new variables, in an effort to migrate them to the variables. This is being done mostly for automated build tools, etc, that might rely on these variables being set. The variables will be removed in the future on ^/head, e.g., after ^/stable/12 is cut. Relnotes: yes r320703: Add tests to help verify Links functionality for .../contrib/tzdata/backwards MFC with: r320702 Added: stable/10/share/zoneinfo/tests/ - copied from r320703, head/share/zoneinfo/tests/ stable/10/tools/build/options/WITH_ZONEINFO_LEAPSECONDS_SUPPORT - copied unchanged from r320702, head/tools/build/options/WITH_ZONEINFO_LEAPSECONDS_SUPPORT stable/10/tools/build/options/WITH_ZONEINFO_OLD_TIMEZONES_SUPPORT - copied unchanged from r320702, head/tools/build/options/WITH_ZONEINFO_OLD_TIMEZONES_SUPPORT Modified: stable/10/etc/mtree/BSD.tests.dist stable/10/share/mk/bsd.own.mk stable/10/share/zoneinfo/Makefile stable/10/share/zoneinfo/tests/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Sat Aug 5 16:44:31 2017 (r322099) +++ stable/10/etc/mtree/BSD.tests.dist Sat Aug 5 16:55:07 2017 (r322100) @@ -374,6 +374,8 @@ .. .. .. + zoneinfo + .. .. sys acl Modified: stable/10/share/mk/bsd.own.mk ============================================================================== --- stable/10/share/mk/bsd.own.mk Sat Aug 5 16:44:31 2017 (r322099) +++ stable/10/share/mk/bsd.own.mk Sat Aug 5 16:55:07 2017 (r322100) @@ -411,8 +411,11 @@ __DEFAULT_NO_OPTIONS = \ SHARED_TOOLCHAIN \ SVN \ TESTS \ - USB_GADGET_EXAMPLES + USB_GADGET_EXAMPLES \ + ZONEINFO_LEAPSECONDS_SUPPORT \ + ZONEINFO_OLD_TIMEZONES_SUPPORT \ + # # Default behaviour of some options depends on the architecture. Unfortunately # this means that we have to test TARGET_ARCH (the buildworld case) as well @@ -584,6 +587,11 @@ MK_BINUTILS:= no MK_CLANG:= no MK_GCC:= no MK_GDB:= no +.endif + +.if ${MK_ZONEINFO} == "no" +MK_ZONEINFO_LEAPSECONDS_SUPPORT:= no +MK_ZONEINFO_OLD_TIMEZONES_SUPPORT:= no .endif .if ${MK_CLANG} == "no" Modified: stable/10/share/zoneinfo/Makefile ============================================================================== --- stable/10/share/zoneinfo/Makefile Sat Aug 5 16:44:31 2017 (r322099) +++ stable/10/share/zoneinfo/Makefile Sat Aug 5 16:55:07 2017 (r322100) @@ -28,12 +28,24 @@ # $ svn update # Commit message: "MFV of tzdata2008X" # +.include + CLEANFILES+= yearistype CLEANDIRS+= builddir CONTRIBDIR= ${.CURDIR}/../../contrib/tzdata/ .PATH: ${CONTRIBDIR} .if defined(LEAPSECONDS) +.warning "Using backwards compatibility variable for LEAPSECONDS; please use WITH_ZONEINFO_LEAPSECONDS_SUPPORT instead" +MK_ZONEINFO_LEAPSECONDS_SUPPORT= yes +.endif + +.if defined(OLDTIMEZONES) +.warning "Using backwards compatibility variable for OLDTIMEZONES; please use WITH_ZONEINFO_OLD_TIMEZONES_SUPPORT instead" +MK_ZONEINFO_OLD_TIMEZONES_SUPPORT= yes +.endif + +.if ${MK_ZONEINFO_LEAPSECONDS_SUPPORT} != "no" LEAPFILE= -L ${CONTRIBDIR}leapseconds .else LEAPFILE= @@ -43,7 +55,7 @@ TZFILES= africa antarctica asia australasia etcetera e factory northamerica southamerica POSIXRULES= America/New_York -.if defined(OLDTIMEZONES) +.if ${MK_ZONEINFO_OLD_TIMEZONES_SUPPORT} != "no" TZFILES+= backward systemv .endif @@ -67,7 +79,7 @@ TZBUILDSUBDIRS= \ Pacific \ SystemV -.if defined(OLDTIMEZONES) +.if ${MK_ZONEINFO_OLD_TIMEZONES_SUPPORT} != "no" TZBUILDSUBDIRS+= US Mexico Chile Canada Brazil .endif @@ -110,5 +122,9 @@ afterinstall: else \ echo "Run tzsetup(8) manually to update /etc/localtime."; \ fi + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif .include Modified: stable/10/share/zoneinfo/tests/Makefile ============================================================================== --- head/share/zoneinfo/tests/Makefile Thu Jul 6 04:30:06 2017 (r320703) +++ stable/10/share/zoneinfo/tests/Makefile Sat Aug 5 16:55:07 2017 (r322100) @@ -1,11 +1,10 @@ # $FreeBSD$ -.include +.include .PATH: ${SRCTOP}/contrib/tzdata -PACKAGE= tests - +FILESGROUPS= FILES FILESGROUPS+= TESTFILES .if ${MK_ZONEINFO_OLD_TIMEZONES_SUPPORT} != "no" @@ -14,7 +13,6 @@ TESTFILES+= backward .endif TESTFILES+= zoneinfo_common.sh -TESTFILESPACKAGE= ${PACKAGE} TESTFILESDIR= ${TESTSDIR} .include Copied: stable/10/tools/build/options/WITH_ZONEINFO_LEAPSECONDS_SUPPORT (from r320702, head/tools/build/options/WITH_ZONEINFO_LEAPSECONDS_SUPPORT) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/tools/build/options/WITH_ZONEINFO_LEAPSECONDS_SUPPORT Sat Aug 5 16:55:07 2017 (r322100, copy of r320702, head/tools/build/options/WITH_ZONEINFO_LEAPSECONDS_SUPPORT) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to build leapsecond information in to the timezone database. Copied: stable/10/tools/build/options/WITH_ZONEINFO_OLD_TIMEZONES_SUPPORT (from r320702, head/tools/build/options/WITH_ZONEINFO_OLD_TIMEZONES_SUPPORT) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/tools/build/options/WITH_ZONEINFO_OLD_TIMEZONES_SUPPORT Sat Aug 5 16:55:07 2017 (r322100, copy of r320702, head/tools/build/options/WITH_ZONEINFO_OLD_TIMEZONES_SUPPORT) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to build backward compatibility timezone aliases in to the timezone +database. From owner-svn-src-all@freebsd.org Sat Aug 5 16:58:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63832DBD91A; Sat, 5 Aug 2017 16:58:03 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 32D197F53C; Sat, 5 Aug 2017 16:58:03 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v75Gw25p021412; Sat, 5 Aug 2017 16:58:02 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v75Gw2H3021411; Sat, 5 Aug 2017 16:58:02 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201708051658.v75Gw2H3021411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 5 Aug 2017 16:58:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322101 - head/bin/chmod/tests X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/bin/chmod/tests X-SVN-Commit-Revision: 322101 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.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 16:58:03 -0000 Author: ngie Date: Sat Aug 5 16:58:02 2017 New Revision: 322101 URL: https://svnweb.freebsd.org/changeset/base/322101 Log: Don't check result of chflags in f_flag_cleanup() This will prevent false positives from occurring if the test is run on ZFS since ZFS doesn't support fflags throbbing like UFS. PR: 221189 MFC after: 4 days MFC with: r321949 Modified: head/bin/chmod/tests/chmod_test.sh Modified: head/bin/chmod/tests/chmod_test.sh ============================================================================== --- head/bin/chmod/tests/chmod_test.sh Sat Aug 5 16:55:07 2017 (r322100) +++ head/bin/chmod/tests/chmod_test.sh Sat Aug 5 16:58:02 2017 (r322101) @@ -115,7 +115,7 @@ f_flag_body() f_flag_cleanup() { - atf_check chflags 0 foo + chflags 0 foo || : } atf_test_case h_flag From owner-svn-src-all@freebsd.org Sat Aug 5 17:00:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4087DBDB9A; Sat, 5 Aug 2017 17:00:23 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2ABE7F75D; Sat, 5 Aug 2017 17:00:23 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v75H0MqV021584; Sat, 5 Aug 2017 17:00:22 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v75H0ML2021583; Sat, 5 Aug 2017 17:00:22 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201708051700.v75H0ML2021583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 5 Aug 2017 17:00: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: r322102 - stable/11/share/man/man5 X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/share/man/man5 X-SVN-Commit-Revision: 322102 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.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 17:00:24 -0000 Author: ngie Date: Sat Aug 5 17:00:22 2017 New Revision: 322102 URL: https://svnweb.freebsd.org/changeset/base/322102 Log: Regenerate src.conf(5) per r322099 Modified: stable/11/share/man/man5/src.conf.5 Modified: stable/11/share/man/man5/src.conf.5 ============================================================================== --- stable/11/share/man/man5/src.conf.5 Sat Aug 5 16:58:02 2017 (r322101) +++ stable/11/share/man/man5/src.conf.5 Sat Aug 5 17:00:22 2017 (r322102) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd July 5, 2017 +.Dd August 5, 2017 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1510,6 +1510,19 @@ protocols (usable only via 802.1X). Set to not build ZFS file system. .It Va WITHOUT_ZONEINFO Set to not build the timezone database. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITHOUT_ZONEINFO_LEAPSECONDS_SUPPORT +.It +.Va WITHOUT_ZONEINFO_OLD_TIMEZONES_SUPPORT +.El +.It Va WITH_ZONEINFO_LEAPSECONDS_SUPPORT +Set to build leapsecond information in to the timezone database. +.It Va WITH_ZONEINFO_OLD_TIMEZONES_SUPPORT +Set to build backward compatibility timezone aliases in to the timezone +database. .El .Sh FILES .Bl -tag -compact -width Pa From owner-svn-src-all@freebsd.org Sat Aug 5 17:01:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDE77DBDDB2; Sat, 5 Aug 2017 17:01:01 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A6397F982; Sat, 5 Aug 2017 17:01:01 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v75H10W8022312; Sat, 5 Aug 2017 17:01:00 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v75H102u022311; Sat, 5 Aug 2017 17:01:00 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201708051701.v75H102u022311@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 5 Aug 2017 17:01:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322103 - stable/10/share/man/man5 X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/share/man/man5 X-SVN-Commit-Revision: 322103 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.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 17:01:01 -0000 Author: ngie Date: Sat Aug 5 17:01:00 2017 New Revision: 322103 URL: https://svnweb.freebsd.org/changeset/base/322103 Log: Regenerate src.conf(5) per r322100 Modified: stable/10/share/man/man5/src.conf.5 Modified: stable/10/share/man/man5/src.conf.5 ============================================================================== --- stable/10/share/man/man5/src.conf.5 Sat Aug 5 17:00:22 2017 (r322102) +++ stable/10/share/man/man5/src.conf.5 Sat Aug 5 17:01:00 2017 (r322103) @@ -1213,6 +1213,21 @@ Set to not build ZFS file system. .It Va WITHOUT_ZONEINFO .\" from FreeBSD: stable/10/tools/build/options/WITHOUT_ZONEINFO 235342 2012-05-12 16:12:36Z gjb Set to not build the timezone database. +When set, it also enforces the following options: +.Pp +.Bl -item -compact +.It +.Va WITHOUT_ZONEINFO_LEAPSECONDS_SUPPORT +.It +.Va WITHOUT_ZONEINFO_OLD_TIMEZONES_SUPPORT +.El +.It Va WITH_ZONEINFO_LEAPSECONDS_SUPPORT +.\" from FreeBSD: stable/10/tools/build/options/WITH_ZONEINFO_LEAPSECONDS_SUPPORT 322100 2017-08-05 16:54:40Z ngie +Set to build leapsecond information in to the timezone database. +.It Va WITH_ZONEINFO_OLD_TIMEZONES_SUPPORT +.\" from FreeBSD: stable/10/tools/build/options/WITH_ZONEINFO_OLD_TIMEZONES_SUPPORT 322100 2017-08-05 16:54:40Z ngie +Set to build backward compatibility timezone aliases in to the timezone +database. .El .Sh FILES .Bl -tag -compact -width Pa From owner-svn-src-all@freebsd.org Sat Aug 5 17:01:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BE7BDBE253; Sat, 5 Aug 2017 17:01:59 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18C267FC6A; Sat, 5 Aug 2017 17:01:59 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v75H1wKb023147; Sat, 5 Aug 2017 17:01:58 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v75H1wGR023146; Sat, 5 Aug 2017 17:01:58 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201708051701.v75H1wGR023146@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 5 Aug 2017 17:01: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: r322104 - stable/11/share/mk X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/share/mk X-SVN-Commit-Revision: 322104 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.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 17:01:59 -0000 Author: ngie Date: Sat Aug 5 17:01:58 2017 New Revision: 322104 URL: https://svnweb.freebsd.org/changeset/base/322104 Log: MFC r321951: Some minor doc fixups - Tweak a sentence by placing the modifier before an adjective to make it flow better. - Fix a typo. Modified: stable/11/share/mk/bsd.opts.mk Directory Properties: stable/11/ (props changed) Modified: stable/11/share/mk/bsd.opts.mk ============================================================================== --- stable/11/share/mk/bsd.opts.mk Sat Aug 5 17:01:00 2017 (r322103) +++ stable/11/share/mk/bsd.opts.mk Sat Aug 5 17:01:58 2017 (r322104) @@ -4,7 +4,7 @@ # # Users define WITH_FOO and WITHOUT_FOO on the command line or in /etc/src.conf # and /etc/make.conf files. These translate in the build system to MK_FOO={yes,no} -# with sensible (usually) defaults. +# with (usually) sensible defaults. # # Makefiles must include bsd.opts.mk after defining specific MK_FOO options that # are applicable for that Makefile (typically there are none, but sometimes there @@ -41,7 +41,7 @@ ____: # # Only these options are used by bsd.*.mk. KERBEROS and OPENSSH are -# unforutnately needed to support statically linking the entire +# unfortunately needed to support statically linking the entire # tree. su(1) wouldn't link since it depends on PAM which depends on # ssh libraries when building with OPENSSH, and likewise for KERBEROS. From owner-svn-src-all@freebsd.org Sat Aug 5 17:02:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80E20DBE421; Sat, 5 Aug 2017 17:02:58 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 458307FF5F; Sat, 5 Aug 2017 17:02:58 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v75H2vYd025409; Sat, 5 Aug 2017 17:02:57 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v75H2vNY025408; Sat, 5 Aug 2017 17:02:57 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201708051702.v75H2vNY025408@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 5 Aug 2017 17:02:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r322106 - stable/11/lib/libcrypt X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/lib/libcrypt X-SVN-Commit-Revision: 322106 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.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 17:02:58 -0000 Author: ngie Date: Sat Aug 5 17:02:57 2017 New Revision: 322106 URL: https://svnweb.freebsd.org/changeset/base/322106 Log: MFC r321915: Remove bogus bsd.subdir.mk .include bsd.subdir.mk is included from bsd.obj.mk, which is included via bsd.lib.mk. Modified: stable/11/lib/libcrypt/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libcrypt/Makefile ============================================================================== --- stable/11/lib/libcrypt/Makefile Sat Aug 5 17:02:53 2017 (r322105) +++ stable/11/lib/libcrypt/Makefile Sat Aug 5 17:02:57 2017 (r322106) @@ -47,4 +47,3 @@ SUBDIR+= tests .endif .include -.include From owner-svn-src-all@freebsd.org Sat Aug 5 17:02:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5127DDBE3F1; Sat, 5 Aug 2017 17:02:55 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF35B7FF5A; Sat, 5 Aug 2017 17:02:54 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v75H2s7d025361; Sat, 5 Aug 2017 17:02:54 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v75H2s9u025360; Sat, 5 Aug 2017 17:02:54 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201708051702.v75H2s9u025360@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 5 Aug 2017 17:02:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r322105 - stable/10/lib/libcrypt X-SVN-Group: stable-10 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/10/lib/libcrypt X-SVN-Commit-Revision: 322105 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.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 17:02:55 -0000 Author: ngie Date: Sat Aug 5 17:02:53 2017 New Revision: 322105 URL: https://svnweb.freebsd.org/changeset/base/322105 Log: MFC r321915: Remove bogus bsd.subdir.mk .include bsd.subdir.mk is included from bsd.obj.mk, which is included via bsd.lib.mk. Modified: stable/10/lib/libcrypt/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libcrypt/Makefile ============================================================================== --- stable/10/lib/libcrypt/Makefile Sat Aug 5 17:01:58 2017 (r322104) +++ stable/10/lib/libcrypt/Makefile Sat Aug 5 17:02:53 2017 (r322105) @@ -45,4 +45,3 @@ SUBDIR+= tests .endif .include -.include From owner-svn-src-all@freebsd.org Sat Aug 5 17:11:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B545DBED7C; Sat, 5 Aug 2017 17:11:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 072CA8076E; Sat, 5 Aug 2017 17:11:41 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v75HBfMD029688; Sat, 5 Aug 2017 17:11:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v75HBf6g029687; Sat, 5 Aug 2017 17:11:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201708051711.v75HBf6g029687@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 5 Aug 2017 17:11: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: r322107 - stable/11/tools/tools/zfsboottest X-SVN-Group: stable-11 X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: stable/11/tools/tools/zfsboottest X-SVN-Commit-Revision: 322107 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.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 17:11:42 -0000 Author: ngie Date: Sat Aug 5 17:11:40 2017 New Revision: 322107 URL: https://svnweb.freebsd.org/changeset/base/322107 Log: MFC r321845: Standardize on SRCTOP instead of .CURDIR-relative paths Modified: stable/11/tools/tools/zfsboottest/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/tools/tools/zfsboottest/Makefile ============================================================================== --- stable/11/tools/tools/zfsboottest/Makefile Sat Aug 5 17:02:57 2017 (r322106) +++ stable/11/tools/tools/zfsboottest/Makefile Sat Aug 5 17:11:40 2017 (r322107) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../sys/boot/zfs ${.CURDIR}/../../../sys/cddl/boot/zfs +.PATH: ${SRCTOP}/sys/boot/zfs ${SRCTOP}/sys/cddl/boot/zfs BINDIR?= /usr/bin SCRIPTSDIR?= /usr/bin @@ -11,8 +11,8 @@ SCRIPTSNAME= zfsboottest.sh MAN= CFLAGS= -O1 \ - -I${.CURDIR}/../../../sys/boot/zfs \ - -I${.CURDIR}/../../../sys/cddl/boot/zfs \ + -I${SRCTOP}/sys/boot/zfs \ + -I${SRCTOP}/sys/cddl/boot/zfs \ -I. \ -fdiagnostics-show-option \ -W -Wextra -Wno-sign-compare -Wno-unused-parameter @@ -23,7 +23,7 @@ LIBADD+= md beforedepend zfsboottest.o: machine CLEANFILES+= machine machine: - ln -sf ${.CURDIR}/../../../sys/i386/include machine + ln -sf ${SRCTOP}/sys/i386/include machine .endif .include From owner-svn-src-all@freebsd.org Sat Aug 5 19:57:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57EB3DC721A; Sat, 5 Aug 2017 19:57:47 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 225281939; Sat, 5 Aug 2017 19:57:47 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v75Jvjct094162; Sat, 5 Aug 2017 19:57:45 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v75JvjRF094161; Sat, 5 Aug 2017 19:57:45 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201708051957.v75JvjRF094161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 5 Aug 2017 19:57:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322108 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 322108 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.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 19:57:47 -0000 Author: avos Date: Sat Aug 5 19:57:45 2017 New Revision: 322108 URL: https://svnweb.freebsd.org/changeset/base/322108 Log: Add myself to the calendar.freebsd. Reported by: mckusick Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Sat Aug 5 17:11:40 2017 (r322107) +++ head/usr.bin/calendar/calendars/calendar.freebsd Sat Aug 5 19:57:45 2017 (r322108) @@ -154,6 +154,7 @@ 04/22 Jakub Klama born in Blachownia, Silesia, Poland, 1989 04/25 Richard Gallamore born in Kissimmee, Florida, United States, 1987 04/26 Rene Ladan born in Geldrop, the Netherlands, 1980 +04/28 Andriy Voskoboinyk born in Bila Tserkva, Ukraine, 1992 04/29 Adam Weinberger born in Berkeley, California, United States, 1980 04/29 Eric Anholt born in Portland, Oregon, United States, 1983 05/01 Randall Stewart born in Spokane, Washington, United States, 1959 From owner-svn-src-all@freebsd.org Sat Aug 5 20:57:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB4A3DC9E5B; Sat, 5 Aug 2017 20:57:35 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A78435C9; Sat, 5 Aug 2017 20:57:35 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v75KvYND018593; Sat, 5 Aug 2017 20:57:34 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v75KvY5K018591; Sat, 5 Aug 2017 20:57:34 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201708052057.v75KvY5K018591@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 5 Aug 2017 20:57:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322109 - in head/sys/arm64: arm64 include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys/arm64: arm64 include X-SVN-Commit-Revision: 322109 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.23 Precedence: list List-Id: "SVN commit messages 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, 05 Aug 2017 20:57:35 -0000 Author: andrew Date: Sat Aug 5 20:57:34 2017 New Revision: 322109 URL: https://svnweb.freebsd.org/changeset/base/322109 Log: Mark each cpu in the appropriate cpuset_domain set. This allows devices to handle cases where they can only run on a single domain. To allow all devices access to this set we need to move reading the domain earlier in the boot as it was previously handled in the CPU driver, however this is too late for the GICv3 ITS driver. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/mp_machdep.c head/sys/arm64/include/param.h Modified: head/sys/arm64/arm64/mp_machdep.c ============================================================================== --- head/sys/arm64/arm64/mp_machdep.c Sat Aug 5 19:57:45 2017 (r322108) +++ head/sys/arm64/arm64/mp_machdep.c Sat Aug 5 20:57:34 2017 (r322109) @@ -198,10 +198,6 @@ arm64_cpu_attach(device_t dev) /* Set the device to start it later */ cpu_list[cpuid] = dev; - /* Try to read the numa node of this cpu */ - OF_getencprop(ofw_bus_get_node(dev), "numa-node-id", - &__pcpu[cpuid].pc_domain, sizeof(__pcpu[cpuid].pc_domain)); - return (0); } @@ -535,6 +531,7 @@ static boolean_t cpu_init_fdt(u_int id, phandle_t node, u_int addr_size, pcell_t *reg) { uint64_t target_cpu; + int domain; target_cpu = reg[0]; if (addr_size == 2) { @@ -542,7 +539,17 @@ cpu_init_fdt(u_int id, phandle_t node, u_int addr_size target_cpu |= reg[1]; } - return (start_cpu(id, target_cpu) ? TRUE : FALSE); + if (!start_cpu(id, target_cpu)) + return (FALSE); + + /* Try to read the numa node of this cpu */ + if (OF_getencprop(node, "numa-node-id", &domain, sizeof(domain)) > 0) { + __pcpu[id].pc_domain = domain; + if (domain < MAXMEMDOM) + CPU_SET(id, &cpuset_domain[domain]); + } + + return (TRUE); } #endif Modified: head/sys/arm64/include/param.h ============================================================================== --- head/sys/arm64/include/param.h Sat Aug 5 19:57:45 2017 (r322108) +++ head/sys/arm64/include/param.h Sat Aug 5 20:57:34 2017 (r322109) @@ -60,7 +60,7 @@ #endif /* SMP || KLD_MODULE */ #ifndef MAXMEMDOM -#define MAXMEMDOM 1 +#define MAXMEMDOM 2 #endif #define ALIGNBYTES _ALIGNBYTES