svn commit: r330271 - in head/sys/compat/linuxkpi/common: include/linux src
Author: hselasky Date: Fri Mar 2 08:52:27 2018 New Revision: 330271 URL: https://svnweb.freebsd.org/changeset/base/330271 Log: Rename callout member in struct timer_list to match the one in struct delayed_work in the LinuxKPI. This allows the timer_pending() function macro to be used with delayed work structures. No functional nor structural change. MFC after:1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: head/sys/compat/linuxkpi/common/include/linux/timer.h head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/include/linux/timer.h == --- head/sys/compat/linuxkpi/common/include/linux/timer.h Fri Mar 2 06:02:54 2018(r330270) +++ head/sys/compat/linuxkpi/common/include/linux/timer.h Fri Mar 2 08:52:27 2018(r330271) @@ -38,7 +38,7 @@ #include struct timer_list { - struct callout timer_callout; + struct callout callout; void(*function) (unsigned long); unsigned long data; int expires; @@ -51,7 +51,7 @@ extern unsigned long linux_timer_hz_mask; #definesetup_timer(timer, func, dat) do { \ (timer)->function = (func); \ (timer)->data = (dat); \ - callout_init(&(timer)->timer_callout, 1); \ + callout_init(&(timer)->callout, 1); \ } while (0) #define__setup_timer(timer, func, dat, flags) do { \ @@ -62,16 +62,16 @@ extern unsigned long linux_timer_hz_mask; #defineinit_timer(timer) do { \ (timer)->function = NULL; \ (timer)->data = 0; \ - callout_init(&(timer)->timer_callout, 1); \ + callout_init(&(timer)->callout, 1); \ } while (0) extern void mod_timer(struct timer_list *, int); extern void add_timer(struct timer_list *); extern void add_timer_on(struct timer_list *, int cpu); -#definedel_timer(timer) (void)callout_stop(&(timer)->timer_callout) -#definedel_timer_sync(timer) (void)callout_drain(&(timer)->timer_callout) -#definetimer_pending(timer)callout_pending(&(timer)->timer_callout) +#definedel_timer(timer)(void)callout_stop(&(timer)->callout) +#definedel_timer_sync(timer) (void)callout_drain(&(timer)->callout) +#definetimer_pending(timer)callout_pending(&(timer)->callout) #defineround_jiffies(j)\ ((int)(((j) + linux_timer_hz_mask) & ~linux_timer_hz_mask)) #defineround_jiffies_relative(j) round_jiffies(j) Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c == --- head/sys/compat/linuxkpi/common/src/linux_compat.c Fri Mar 2 06:02:54 2018(r330270) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Fri Mar 2 08:52:27 2018(r330271) @@ -1734,7 +1734,7 @@ mod_timer(struct timer_list *timer, int expires) { timer->expires = expires; - callout_reset(&timer->timer_callout, + callout_reset(&timer->callout, linux_timer_jiffies_until(expires), &linux_timer_callback_wrapper, timer); } @@ -1743,7 +1743,7 @@ void add_timer(struct timer_list *timer) { - callout_reset(&timer->timer_callout, + callout_reset(&timer->callout, linux_timer_jiffies_until(timer->expires), &linux_timer_callback_wrapper, timer); } @@ -1752,7 +1752,7 @@ void add_timer_on(struct timer_list *timer, int cpu) { - callout_reset_on(&timer->timer_callout, + callout_reset_on(&timer->callout, linux_timer_jiffies_until(timer->expires), &linux_timer_callback_wrapper, timer, cpu); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r330272 - head/sys/compat/linuxkpi/common/include/linux
Author: hselasky Date: Fri Mar 2 08:56:15 2018 New Revision: 330272 URL: https://svnweb.freebsd.org/changeset/base/330272 Log: Implement wait_on_bit() function macro in the LinuxKPI. MFC after:1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: head/sys/compat/linuxkpi/common/include/linux/wait.h Modified: head/sys/compat/linuxkpi/common/include/linux/wait.h == --- head/sys/compat/linuxkpi/common/include/linux/wait.hFri Mar 2 08:52:27 2018(r330271) +++ head/sys/compat/linuxkpi/common/include/linux/wait.hFri Mar 2 08:56:15 2018(r330272) @@ -249,6 +249,8 @@ void linux_wake_up_atomic_t(atomic_t *); int linux_wait_on_atomic_t(atomic_t *, unsigned int); #definewake_up_bit(word, bit) linux_wake_up_bit(word, bit) +#definewait_on_bit(word, bit, state) \ + linux_wait_on_bit_timeout(word, bit, state, MAX_SCHEDULE_TIMEOUT) #definewait_on_bit_timeout(word, bit, state, timeout) \ linux_wait_on_bit_timeout(word, bit, state, timeout) #definewake_up_atomic_t(a) linux_wake_up_atomic_t(a) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r330273 - head/sys/compat/linuxkpi/common/include/linux
Author: hselasky Date: Fri Mar 2 08:58:32 2018 New Revision: 330273 URL: https://svnweb.freebsd.org/changeset/base/330273 Log: Implement ktime_get_raw() function in the LinuxKPI. MFC after:1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: head/sys/compat/linuxkpi/common/include/linux/ktime.h Modified: head/sys/compat/linuxkpi/common/include/linux/ktime.h == --- head/sys/compat/linuxkpi/common/include/linux/ktime.h Fri Mar 2 08:56:15 2018(r330272) +++ head/sys/compat/linuxkpi/common/include/linux/ktime.h Fri Mar 2 08:58:32 2018(r330273) @@ -189,6 +189,15 @@ ktime_get_real_seconds(void) return (ts.tv_sec); } +static inline ktime_t +ktime_get_raw(void) +{ + struct timespec ts; + + nanotime(&ts); + return (timespec_to_ktime(ts)); +} + static inline u64 ktime_get_raw_ns(void) { ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r330274 - head/sys/compat/linuxkpi/common/include/linux
Author: hselasky Date: Fri Mar 2 08:59:53 2018 New Revision: 330274 URL: https://svnweb.freebsd.org/changeset/base/330274 Log: Implement more lockdep stubs in the LinuxKPI. MFC after:1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: head/sys/compat/linuxkpi/common/include/linux/lockdep.h Modified: head/sys/compat/linuxkpi/common/include/linux/lockdep.h == --- head/sys/compat/linuxkpi/common/include/linux/lockdep.h Fri Mar 2 08:58:32 2018(r330273) +++ head/sys/compat/linuxkpi/common/include/linux/lockdep.h Fri Mar 2 08:59:53 2018(r330274) @@ -36,8 +36,9 @@ struct lock_class_key { }; #definelockdep_set_class(lock, key) - #definelockdep_set_class_and_name(lock, key, name) +#definelockdep_set_current_reclaim_state(g) do { } while (0) +#definelockdep_clear_current_reclaim_state() do { } while (0) #definelockdep_assert_held(m) \ sx_assert(&(m)->sx, SA_XLOCKED) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r330275 - stable/11/sys/x86/x86
Author: kib Date: Fri Mar 2 10:57:46 2018 New Revision: 330275 URL: https://svnweb.freebsd.org/changeset/base/330275 Log: MFC r329864: Do not return out of bound pointers from intr_lookup_source(). Modified: stable/11/sys/x86/x86/intr_machdep.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/x86/intr_machdep.c == --- stable/11/sys/x86/x86/intr_machdep.cFri Mar 2 08:59:53 2018 (r330274) +++ stable/11/sys/x86/x86/intr_machdep.cFri Mar 2 10:57:46 2018 (r330275) @@ -167,6 +167,8 @@ struct intsrc * intr_lookup_source(int vector) { + if (vector < 0 || vector >= nitems(interrupt_sources)) + return (NULL); return (interrupt_sources[vector]); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r330276 - head/sys/arm64/arm64
Author: andrew Date: Fri Mar 2 13:04:21 2018 New Revision: 330276 URL: https://svnweb.freebsd.org/changeset/base/330276 Log: Count the number of children in the GICv3 ACPI attachment. This is needed later for assigning IRQ vector space. Sponsored by: DARPA, AFRL Sponsored by: Cavium (Hardware) Modified: head/sys/arm64/arm64/gic_v3_acpi.c Modified: head/sys/arm64/arm64/gic_v3_acpi.c == --- head/sys/arm64/arm64/gic_v3_acpi.c Fri Mar 2 10:57:46 2018 (r330275) +++ head/sys/arm64/arm64/gic_v3_acpi.c Fri Mar 2 13:04:21 2018 (r330276) @@ -297,12 +297,14 @@ gic_v3_add_children(ACPI_SUBTABLE_HEADER *entry, void { ACPI_MADT_GENERIC_TRANSLATOR *gict; struct gic_v3_acpi_devinfo *di; + struct gic_v3_softc *sc; device_t child, dev; if (entry->Type == ACPI_MADT_TYPE_GENERIC_TRANSLATOR) { /* We have an ITS, add it as a child */ gict = (ACPI_MADT_GENERIC_TRANSLATOR *)entry; dev = arg; + sc = device_get_softc(dev); child = device_add_child(dev, "its", -1); if (child == NULL) @@ -313,6 +315,7 @@ gic_v3_add_children(ACPI_SUBTABLE_HEADER *entry, void resource_list_add(&di->di_rl, SYS_RES_MEMORY, 0, gict->BaseAddress, gict->BaseAddress + 128 * 1024 - 1, 128 * 1024); + sc->gic_nchildren++; device_set_ivars(child, di); } } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r329882 - in head/sys: conf kern sys vm
Hi, I'm curious, it looks like Kd is quite significant by default, I assume to limit the slew rate of the output. Given that the error is an integer, and pidctrl_daemon() is called at irregular intervals, it seems to me that the derivative will be very noisy. In my experience with PID controllers controlling physical processes, one would need some kind of filtering on the input to make Kd useful, otherwise it would just contribute more instability to the system. In practice even a simple exponential (single pole) filter can help a lot at the cost of increased response time. Is this something that was considered? - Pieter de Goeje ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r330277 - in head: bin/stty libexec/getty
Author: trasz Date: Fri Mar 2 14:16:19 2018 New Revision: 330277 URL: https://svnweb.freebsd.org/changeset/base/330277 Log: .Xr pstat(8), so that people have a chance to learn how to get a list of terminal devices using "pstat -t". MFC after:2 weeks Sponsored by: The FreeBSD Foundation Modified: head/bin/stty/stty.1 head/libexec/getty/getty.8 head/libexec/getty/ttys.5 Modified: head/bin/stty/stty.1 == --- head/bin/stty/stty.1Fri Mar 2 13:04:21 2018(r330276) +++ head/bin/stty/stty.1Fri Mar 2 14:16:19 2018(r330277) @@ -32,7 +32,7 @@ .\" @(#)stty.1 8.4 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd October 5, 2016 +.Dd March 2, 2018 .Dt STTY 1 .Os .Sh NAME @@ -589,7 +589,8 @@ Same as the control character .Ex -std .Sh SEE ALSO .Xr resizewin 1 , -.Xr termios 4 +.Xr termios 4 , +.Xr pstat 8 .Sh STANDARDS The .Nm Modified: head/libexec/getty/getty.8 == --- head/libexec/getty/getty.8 Fri Mar 2 13:04:21 2018(r330276) +++ head/libexec/getty/getty.8 Fri Mar 2 14:16:19 2018(r330277) @@ -28,7 +28,7 @@ .\" from: @(#)getty.8 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" " -.Dd June 4, 1993 +.Dd March 2, 2018 .Dt GETTY 8 .Os .Sh NAME @@ -116,7 +116,8 @@ does not exist. .Xr tty 4 , .Xr gettytab 5 , .Xr ttys 5 , -.Xr init 8 +.Xr init 8 , +.Xr pstat 8 .Sh HISTORY A .Nm Modified: head/libexec/getty/ttys.5 == --- head/libexec/getty/ttys.5 Fri Mar 2 13:04:21 2018(r330276) +++ head/libexec/getty/ttys.5 Fri Mar 2 14:16:19 2018(r330277) @@ -28,7 +28,7 @@ .\" from: @(#)ttys.5 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" " -.Dd March 16, 2017 +.Dd March 2, 2018 .Dt TTYS 5 .Os .Sh NAME @@ -166,7 +166,8 @@ ttyv0 "/usr/local/bin/xterm -display :0" xterm on wind .Xr login.conf 5 , .Xr termcap 5 , .Xr getty 8 , -.Xr init 8 +.Xr init 8 , +.Xr pstat 8 .\".Xr init 8 , .\".Xr ttyflags 8 .Sh HISTORY ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r329882 - in head/sys: conf kern sys vm
Hi Jeff, 2018-02-23 23:51 GMT+01:00 Jeff Roberson : > Add a generic Proportional Integral Derivative (PID) controller algorithm > and > use it to regulate page daemon output. That looks pretty nifty. Looking at the code, it exposes metrics through sysctl. Be sure to give prometheus_sysctl_exporter(8) a try if you ever want to graph the characteristics of the controller! -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r330278 - head
Author: trasz Date: Fri Mar 2 14:42:08 2018 New Revision: 330278 URL: https://svnweb.freebsd.org/changeset/base/330278 Log: Fix README.md formatting. MFC after:2 weeks Sponsored by: DARPA, AFRL Modified: head/README.md Modified: head/README.md == --- head/README.md Fri Mar 2 14:16:19 2018(r330277) +++ head/README.md Fri Mar 2 14:42:08 2018(r330278) @@ -36,53 +36,53 @@ devices, not just those commonly used. Source Roadmap: --- ``` -binSystem/user commands. +binSystem/user commands. -cddl Various commands and libraries under the Common Development - and Distribution License. +cddl Various commands and libraries under the Common Development + and Distribution License. -contribPackages contributed by 3rd parties. +contribPackages contributed by 3rd parties. -crypto Cryptography stuff (see crypto/README). +crypto Cryptography stuff (see crypto/README). -etcTemplate files for /etc. +etcTemplate files for /etc. -gnuVarious commands and libraries under the GNU Public License. - Please see gnu/COPYING* for more information. +gnuVarious commands and libraries under the GNU Public License. + Please see gnu/COPYING* for more information. -includeSystem include files. +includeSystem include files. -kerberos5 Kerberos5 (Heimdal) package. +kerberos5 Kerberos5 (Heimdal) package. -libSystem libraries. +libSystem libraries. -libexecSystem daemons. +libexecSystem daemons. -releaseRelease building Makefile & associated tools. +releaseRelease building Makefile & associated tools. -rescue Build system for statically linked /rescue utilities. +rescue Build system for statically linked /rescue utilities. -sbin System commands. +sbin System commands. -secure Cryptographic libraries and commands. +secure Cryptographic libraries and commands. -share Shared resources. +share Shared resources. -stand Boot loader sources. +stand Boot loader sources. -sysKernel sources. +sysKernel sources. -tests Regression tests which can be run by Kyua. See tests/README - for additional information. +tests Regression tests which can be run by Kyua. See tests/README + for additional information. -tools Utilities for regression testing and miscellaneous tasks. +tools Utilities for regression testing and miscellaneous tasks. -usr.binUser commands. +usr.binUser commands. -usr.sbin System administration commands. +usr.sbin System administration commands. ``` For information on synchronizing your source tree with one or more of the FreeBSD Project's development branches, please see: - https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/current-stable.html + https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/current-stable.html ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r330279 - head/lib/libefivar
Author: emaste Date: Fri Mar 2 15:12:18 2018 New Revision: 330279 URL: https://svnweb.freebsd.org/changeset/base/330279 Log: libefivar: use standard 2-Clause FreeBSD license Approved by: imp Sponsored by: The FreeBSD Foundation Modified: head/lib/libefivar/efi-osdep.h head/lib/libefivar/efivar-dp-format.c head/lib/libefivar/efivar-dp-parse.c head/lib/libefivar/efivar-dp-xlate.c head/lib/libefivar/efivar-dp.h head/lib/libefivar/efivar.c head/lib/libefivar/efivar.h head/lib/libefivar/uefi-dplib.h head/lib/libefivar/uefi-dputil.c Modified: head/lib/libefivar/efi-osdep.h == --- head/lib/libefivar/efi-osdep.h Fri Mar 2 14:42:08 2018 (r330278) +++ head/lib/libefivar/efi-osdep.h Fri Mar 2 15:12:18 2018 (r330279) @@ -6,22 +6,22 @@ * 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 - *in this position and unchanged. + *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. + * 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$ */ Modified: head/lib/libefivar/efivar-dp-format.c == --- head/lib/libefivar/efivar-dp-format.c Fri Mar 2 14:42:08 2018 (r330278) +++ head/lib/libefivar/efivar-dp-format.c Fri Mar 2 15:12:18 2018 (r330279) @@ -6,22 +6,22 @@ * 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 - *in this position and unchanged. + *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. + * 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 + * DAMAGE
svn commit: r330280 - in stable/11: etc/defaults etc/rc.d share/man/man5
Author: manu Date: Fri Mar 2 15:17:42 2018 New Revision: 330280 URL: https://svnweb.freebsd.org/changeset/base/330280 Log: MFC r320943-r320944, r321008, r321072, r321128 r320943: Add ipfw_status command to etc/rc.d/ipfw This is helpful when using service/conf management tools. Sonsored-By: Gandi.net r320944: Add an rc.d script to setup a netflow export via ng_netflow The default is to export netflow data on localhost on the netflow port. ngtee is used to have the lowest overhead possible. The ipfw ng hook is the netflow port (it can only be numeric) Default is netflow version 5. Sponsored-By: Gandi.net Reviewed by: bapt (earlier version), olivier (earlier version) r321008: etc/rc.d: Only install ipfw_netflow is MK_IPFW and MK_NETGRAPH is defined While here only install ipfw rc script if MK_IPFW is defined. Reported by: ngie r321072: ipfw_netflow: add +ipfw_netflow_enable="NO" to defaults/rc.conf and document usage in rc.conf(5) Reported by: markj Sponsored by: Gandi.net r321128: ipfw_netflow: Add support for FIB If ipfw_netflow_fib, the ipfw rule will only match packets in that FIB. While here correct some value in rc.conf(5) to be int and not str. Sponsored by: Gandi.net Added: stable/11/etc/rc.d/ipfw_netflow - copied, changed from r320944, head/etc/rc.d/ipfw_netflow Modified: stable/11/etc/defaults/rc.conf stable/11/etc/rc.d/Makefile stable/11/etc/rc.d/ipfw stable/11/share/man/man5/rc.conf.5 Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/defaults/rc.conf == --- stable/11/etc/defaults/rc.conf Fri Mar 2 15:12:18 2018 (r330279) +++ stable/11/etc/defaults/rc.conf Fri Mar 2 15:17:42 2018 (r330280) @@ -167,6 +167,7 @@ firewall_nat_enable="NO"# Enable kernel NAT (if firew firewall_nat_interface="" # Public interface or IPaddress to use firewall_nat_flags="" # Additional configuration parameters dummynet_enable="NO" # Load the dummynet(4) module +ipfw_netflow_enable="NO" # Enable netflow logging via ng_netflow ip_portrange_first="NO"# Set first dynamically allocated port ip_portrange_last="NO" # Set last dynamically allocated port ike_enable="NO"# Enable IKE daemon (usually racoon or isakmpd) Modified: stable/11/etc/rc.d/Makefile == --- stable/11/etc/rc.d/Makefile Fri Mar 2 15:12:18 2018(r330279) +++ stable/11/etc/rc.d/Makefile Fri Mar 2 15:17:42 2018(r330280) @@ -47,7 +47,6 @@ FILES=DAEMON \ ip6addrctl \ ipfilter \ ipfs \ - ipfw \ ipmon \ ipnat \ ipsec \ @@ -212,6 +211,13 @@ HASTPACKAGE= hast .if ${MK_INETD} != "no" FILES+=inetd +.endif + +.if ${MK_IPFW} != "no" +FILES+=ipfw +.if ${MK_NETGRAPH} != "no" +FILES+=ipfw_netflow +.endif .endif .if ${MK_ISCSI} != "no" Modified: stable/11/etc/rc.d/ipfw == --- stable/11/etc/rc.d/ipfw Fri Mar 2 15:12:18 2018(r330279) +++ stable/11/etc/rc.d/ipfw Fri Mar 2 15:17:42 2018(r330280) @@ -17,7 +17,9 @@ start_cmd="ipfw_start" start_precmd="ipfw_prestart" start_postcmd="ipfw_poststart" stop_cmd="ipfw_stop" +status_cmd="ipfw_status" required_modules="ipfw" +extra_commands="status" set_rcvar_obsolete ipv6_firewall_enable @@ -107,6 +109,18 @@ ipfw_stop() ${_coscript} quietstop fi done +} + +ipfw_status() +{ +status=$(sysctl -n net.inet.ip.fw.enable) +if [ ${status} -eq 0 ]; then + echo "ipfw is not enabled" + exit 1 +else + echo "ipfw is enabled" + exit 0 +fi } load_rc_config $name Copied and modified: stable/11/etc/rc.d/ipfw_netflow (from r320944, head/etc/rc.d/ipfw_netflow) == --- head/etc/rc.d/ipfw_netflow Thu Jul 13 13:40:18 2017(r320944, copy source) +++ stable/11/etc/rc.d/ipfw_netflow Fri Mar 2 15:17:42 2018 (r330280) @@ -54,7 +54,7 @@ ipfw_netflow_status() ipfw_netflow_start() { ipfw_netflow_is_running && err 1 "ipfw_netflow is already active" - ipfw add ${ipfw_netflow_rule} ngtee ${ipfw_netflow_hook} ip from any to any + ipfw add ${ipfw_netflow_rule} ngtee ${ipfw_netflow_hook} ip from any to any ${ipfw_netflow_fib:+fib ${ipfw_netflow_fib}} ngctl -f - <<-EOF mkpeer ipfw: netflow ${ipfw_netflow_hook} iface0 name ipfw:${ipfw_netflow_hook} netflow Modified: stable/11/share/man/man5/rc.conf.5 == --- stable/
svn commit: r330281 - head/stand/lua
Author: kevans Date: Fri Mar 2 15:28:08 2018 New Revision: 330281 URL: https://svnweb.freebsd.org/changeset/base/330281 Log: lualoader: Steamroll the box-drawing - Add drawer.frame_styles to map out the kinds of characters we need for the different loader_menu_frame values - Respect loader_menu_frame, default to double[*] - (imp) Use loader.printc instead of print- print adds a newline to the output, which is not the right thing we want to be doing. - (imp) Draw horizontal frames a little more efficiently- setting the cursor after every line segment is horribly inefficient, especially on serial consoles. Halve the number of characters written at the expense of an additional loop to draw the bottom frame, which is likely more efficient in the long run for some of less ideal scenarios. [*] menu.4th(8) claims that the default here was single, but unset loader_menu_frame yielded double and we didn't have any overrides in the default loader.conf(5), so double it is. Modified: head/stand/lua/drawer.lua Modified: head/stand/lua/drawer.lua == --- head/stand/lua/drawer.lua Fri Mar 2 15:17:42 2018(r330280) +++ head/stand/lua/drawer.lua Fri Mar 2 15:28:08 2018(r330281) @@ -256,6 +256,36 @@ drawer.logodefs = { }, } +drawer.frame_styles = { + -- Indexed by valid values for loader_menu_frame in loader.conf(5). + -- All of the keys appearing below must be set for any menu frame style + -- added to drawer.frame_styles. + ["ascii"] = { + horizontal = "-", + vertical= "|", + top_left= "+", + bottom_left = "+", + top_right = "+", + bottom_right= "+", + }, + ["single"] = { + horizontal = "\xC4", + vertical= "\xB3", + top_left= "\xDA", + bottom_left = "\xC0", + top_right = "\xBF", + bottom_right= "\xD9", + }, + ["double"] = { + horizontal = "\xCD", + vertical= "\xBA", + top_left= "\xC9", + bottom_left = "\xC8", + top_right = "\xBB", + bottom_right= "\xBC", + }, +} + function drawer.drawscreen(menu_opts) -- drawlogo() must go first. -- it determines the positions of other elements @@ -306,42 +336,52 @@ function drawer.drawmenu(menudef) return alias_table end - function drawer.drawbox() local x = drawer.box_pos_dim.x local y = drawer.box_pos_dim.y local w = drawer.box_pos_dim.w local h = drawer.box_pos_dim.h - local hl = "\xCD" - local vl = "\xBA" + local framestyle = loader.getenv("loader_menu_frame") or "double" + local framespec = drawer.frame_styles[framestyle] + -- If we don't have a framespec for the current frame style, just don't + -- draw a box. + if framespec == nil then + return + end - local tl = "\xC9" - local bl = "\xC8" - local tr = "\xBB" - local br = "\xBC" + local hl = framespec.horizontal + local vl = framespec.vertical - screen.setcursor(x, y); print(tl) - screen.setcursor(x, y+h); print(bl) - screen.setcursor(x+w, y); print(tr) - screen.setcursor(x+w, y+h); print(br) + local tl = framespec.top_left + local bl = framespec.bottom_left + local tr = framespec.top_right + local br = framespec.bottom_right - for i = 1, w-1 do - screen.setcursor(x+i, y) - print(hl) - screen.setcursor(x+i, y+h) - print(hl) + screen.setcursor(x, y); loader.printc(tl) + screen.setcursor(x, y + h); loader.printc(bl) + screen.setcursor(x + w, y); loader.printc(tr) + screen.setcursor(x + w, y + h); loader.printc(br) + + screen.setcursor(x + 1, y) + for _ = 1, w - 1 do + loader.printc(hl) end - for i = 1, h-1 do - screen.setcursor(x, y+i) - print(vl) - screen.setcursor(x+w, y+i) - print(vl) + screen.setcursor(x + 1, y + h) + for _ = 1, w - 1 do + loader.printc(hl) end - screen.setcursor(x+(w/2)-9, y) - print("Welcome to FreeBSD") + for i = 1, h - 1 do + screen.setcursor(x, y + i) + loader.printc(vl) + screen.setcursor(x + w, y + i) + loader.printc(vl) + end + + screen.setcursor(x + (w / 2) - 9, y) + loader.printc("Welcome to FreeBSD") end function drawer.draw(x, y, logo) ___ svn-src-all@freebsd.org mailing list ht
svn commit: r330282 - head/stand/liblua
Author: kevans Date: Fri Mar 2 15:46:22 2018 New Revision: 330282 URL: https://svnweb.freebsd.org/changeset/base/330282 Log: lualoader: Register loader.printc as global printc Modified: head/stand/liblua/lutils.c Modified: head/stand/liblua/lutils.c == --- head/stand/liblua/lutils.c Fri Mar 2 15:28:08 2018(r330281) +++ head/stand/liblua/lutils.c Fri Mar 2 15:46:22 2018(r330282) @@ -307,6 +307,7 @@ static const struct luaL_Reg loaderlib[] = { REG_SIMPLE(command), REG_SIMPLE(getenv), REG_SIMPLE(perform), + /* Also registered as the global 'printc' */ REG_SIMPLE(printc), REG_SIMPLE(setenv), REG_SIMPLE(time), @@ -335,6 +336,8 @@ luaopen_loader(lua_State *L) lua_setfield(L, -2, "machine"); lua_pushstring(L, MACHINE_ARCH); lua_setfield(L, -2, "machine_arch"); + /* Set global printc to loader.printc */ + lua_register(L, "printc", lua_printc); return 1; } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r330283 - head/stand/lua
Author: kevans Date: Fri Mar 2 16:06:20 2018 New Revision: 330283 URL: https://svnweb.freebsd.org/changeset/base/330283 Log: lualoader: Use global printc instead of loader.printc r330282 registered loader.printc as printc, so use it instead. This makes sense for a couple reasons, the major point being that it reads a little bit easier and pairs nicely with the global 'print'. Similar cases can not really be made for other loader.* functions as most of them are either highly specific to our use-case or usually available in other modules, such as `os`. printc does not have a standard implementation in the Lua world(*), so we have a little more leeway with it, and it's kind of a special case of the globally available 'print'. (*) I've been in the Lua world for all of two weeks, so this could be wrong. Modified: head/stand/lua/drawer.lua head/stand/lua/password.lua head/stand/lua/screen.lua Modified: head/stand/lua/drawer.lua == --- head/stand/lua/drawer.lua Fri Mar 2 15:46:22 2018(r330282) +++ head/stand/lua/drawer.lua Fri Mar 2 16:06:20 2018(r330283) @@ -358,30 +358,30 @@ function drawer.drawbox() local tr = framespec.top_right local br = framespec.bottom_right - screen.setcursor(x, y); loader.printc(tl) - screen.setcursor(x, y + h); loader.printc(bl) - screen.setcursor(x + w, y); loader.printc(tr) - screen.setcursor(x + w, y + h); loader.printc(br) + screen.setcursor(x, y); printc(tl) + screen.setcursor(x, y + h); printc(bl) + screen.setcursor(x + w, y); printc(tr) + screen.setcursor(x + w, y + h); printc(br) screen.setcursor(x + 1, y) for _ = 1, w - 1 do - loader.printc(hl) + printc(hl) end screen.setcursor(x + 1, y + h) for _ = 1, w - 1 do - loader.printc(hl) + printc(hl) end for i = 1, h - 1 do screen.setcursor(x, y + i) - loader.printc(vl) + printc(vl) screen.setcursor(x + w, y + i) - loader.printc(vl) + printc(vl) end screen.setcursor(x + (w / 2) - 9, y) - loader.printc("Welcome to FreeBSD") + printc("Welcome to FreeBSD") end function drawer.draw(x, y, logo) Modified: head/stand/lua/password.lua == --- head/stand/lua/password.lua Fri Mar 2 15:46:22 2018(r330282) +++ head/stand/lua/password.lua Fri Mar 2 16:06:20 2018(r330283) @@ -45,14 +45,14 @@ function password.read(prompt_length) local twiddle_pos = 1 local function draw_twiddle() - loader.printc(" " .. twiddle_chars[twiddle_pos]) + printc(" " .. twiddle_chars[twiddle_pos]) -- Reset cursor to just after the password prompt screen.setcursor(prompt_length + 2, screen.default_y) twiddle_pos = (twiddle_pos % #twiddle_chars) + 1 end -- Space between the prompt and any on-screen feedback - loader.printc(" ") + printc(" ") while true do local ch = io.getchar() if ch == core.KEY_ENTER then @@ -61,7 +61,7 @@ function password.read(prompt_length) if ch == core.KEY_BACKSPACE or ch == core.KEY_DELETE then if #str > 0 then if show_password_mask then - loader.printc("\008 \008") + printc("\008 \008") else draw_twiddle() end @@ -69,7 +69,7 @@ function password.read(prompt_length) end else if show_password_mask then - loader.printc("*") + printc("*") else draw_twiddle() end @@ -87,23 +87,23 @@ function password.check() local attempts = 1 local function clear_incorrect_text_prompt() - loader.printc("\n") - loader.printc(string.rep(" ", #INCORRECT_PASSWORD)) + printc("\n") + printc(string.rep(" ", #INCORRECT_PASSWORD)) end while true do screen.defcursor() - loader.printc(prompt) + printc(prompt) local read_pwd = password.read(#prompt) if pwd == nil or pwd == read_pwd then -- Clear the prompt + twiddle -
svn commit: r330284 - head/stand/liblua
Author: kevans Date: Fri Mar 2 16:31:23 2018 New Revision: 330284 URL: https://svnweb.freebsd.org/changeset/base/330284 Log: liblua: Use putc instead of printf for printc printc does not need the features or the overhead of printf. It does not take formatting strings, and it pipes the single string argument through an "%s" format. Instead, use putc directly. This pipes the string through in its entirety as a series of 'unsigned char's, generally straight to the console emulator. Discussed with: tsoome Modified: head/stand/liblua/lutils.c Modified: head/stand/liblua/lutils.c == --- head/stand/liblua/lutils.c Fri Mar 2 16:06:20 2018(r330283) +++ head/stand/liblua/lutils.c Fri Mar 2 16:31:23 2018(r330284) @@ -153,13 +153,13 @@ lua_unsetenv(lua_State *L) static int lua_printc(lua_State *L) { - int status; - ssize_t l; + ssize_t cur, l; const char *s = luaL_checklstring(L, 1, &l); - status = (printf("%s", s) == l); + for (cur = 0; cur < l; ++cur) + putchar((unsigned char)*(s++)); - return status; + return 1; } static int ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r330285 - head/sys/sys
Author: kib Date: Fri Mar 2 16:47:02 2018 New Revision: 330285 URL: https://svnweb.freebsd.org/changeset/base/330285 Log: Remove _Nonnull attributes from user addresses arguments for copyout(9) family. The addresses are user-controllable, and if the process ABI allows mapping at zero, then the zero address is meaningful, contradicting the definition of _Nonnull. In any case, it does not require any special code to handle NULL udaddr. It is not clear if __restrict makes sense as well, since kaddr and udaddr point to different address spaces, so equal numeric values of the pointers do not imply aliasing and a legitimate. But leave it for later. copyinstr(9) does not have its user address argument annotated. Sponsored by: The FreeBSD Foundation MFC after:1 week Modified: head/sys/sys/systm.h Modified: head/sys/sys/systm.h == --- head/sys/sys/systm.hFri Mar 2 16:31:23 2018(r330284) +++ head/sys/sys/systm.hFri Mar 2 16:47:02 2018(r330285) @@ -277,14 +277,14 @@ int copystr(const void * _Nonnull __restrict kfaddr, intcopyinstr(const void * __restrict udaddr, void * _Nonnull __restrict kaddr, size_t len, size_t * __restrict lencopied); -intcopyin(const void * _Nonnull __restrict udaddr, +intcopyin(const void * __restrict udaddr, void * _Nonnull __restrict kaddr, size_t len); -intcopyin_nofault(const void * _Nonnull __restrict udaddr, +intcopyin_nofault(const void * __restrict udaddr, void * _Nonnull __restrict kaddr, size_t len); intcopyout(const void * _Nonnull __restrict kaddr, - void * _Nonnull __restrict udaddr, size_t len); + void * __restrict udaddr, size_t len); intcopyout_nofault(const void * _Nonnull __restrict kaddr, - void * _Nonnull __restrict udaddr, size_t len); + void * __restrict udaddr, size_t len); intfubyte(volatile const void *base); long fuword(volatile const void *base); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r330284 - head/stand/liblua
On Fri, Mar 2, 2018 at 10:31 AM, Kyle Evans wrote: > Author: kevans > Date: Fri Mar 2 16:31:23 2018 > New Revision: 330284 > URL: https://svnweb.freebsd.org/changeset/base/330284 > > Log: > liblua: Use putc instead of printf for printc > > printc does not need the features or the overhead of printf. It does not > take formatting strings, and it pipes the single string argument through an > "%s" format. > > Instead, use putc directly. This pipes the string through in its entirety as > a series of 'unsigned char's, generally straight to the console emulator. > > Discussed with: tsoome > FYI- This has been confirmed to fix a problem recently reported to -current by garga@ where the frames around the menu wouldn't draw properly on an EFI boot. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r330286 - head/tools/boot
Author: kevans Date: Fri Mar 2 16:51:43 2018 New Revision: 330286 URL: https://svnweb.freebsd.org/changeset/base/330286 Log: Add --globals printc to lua-lint We provide a global 'printc' as of r330282; make luacheck aware of this fact so that we can use it without complaints. Modified: head/tools/boot/lua-lint.sh Modified: head/tools/boot/lua-lint.sh == --- head/tools/boot/lua-lint.sh Fri Mar 2 16:47:02 2018(r330285) +++ head/tools/boot/lua-lint.sh Fri Mar 2 16:51:43 2018(r330286) @@ -16,4 +16,4 @@ LUACHECK=$(which luacheck) cd $(make -V SRCTOP)/stand ${LUACHECK} . --globals loader --globals lfs --globals io.getchar \ - --globals io.ischar --globals cli_execute --std lua53 + --globals io.ischar --globals printc --globals cli_execute --std lua53 ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r330287 - head/stand/lua
Author: kevans Date: Fri Mar 2 17:07:08 2018 New Revision: 330287 URL: https://svnweb.freebsd.org/changeset/base/330287 Log: lualoader: Reset the cursor position after the menu is drawn Rather than before the menu is drawn. The drawer is going to reset the crusor position as soon as it draws anything anyways, so doing it before serves no purpose. Setting it after is needed so we don't clobber the menu when we start booting. Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua == --- head/stand/lua/menu.lua Fri Mar 2 16:51:43 2018(r330286) +++ head/stand/lua/menu.lua Fri Mar 2 17:07:08 2018(r330287) @@ -346,9 +346,9 @@ menu.current_alias_table = {} function menu.draw(menudef) -- Clear the screen, reset the cursor, then draw screen.clear() - screen.defcursor() menu.current_alias_table = drawer.drawscreen(menudef) drawn_menu = menudef + screen.defcursor() end -- 'keypress' allows the caller to indicate that a key has been pressed that we ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r330285 - head/sys/sys
(cc in Eitan as he may be interested in the extra restrict cases) On 02/03/2018 11:47, Konstantin Belousov wrote: Author: kib Date: Fri Mar 2 16:47:02 2018 New Revision: 330285 URL: https://svnweb.freebsd.org/changeset/base/330285 Log: Remove _Nonnull attributes from user addresses arguments for copyout(9) family. The addresses are user-controllable, and if the process ABI allows mapping at zero, then the zero address is meaningful, contradicting the definition of _Nonnull. In any case, it does not require any special code to handle NULL udaddr. FWIW, the _Nonnull attributes didn't do much at all beyond producing a warning. They replaced the GNU __nonnull() attributes which were much more dangerous. I am OK with seeing both gone here though. It is not clear if __restrict makes sense as well, since kaddr and udaddr point to different address spaces, so equal numeric values of the pointers do not imply aliasing and a legitimate. But leave it for later. copyinstr(9) does not have its user address argument annotated. I think use of _Nonnull attributes in the threading functions may also be a waste (I introduced them mostly to be compatible with Android). FWIW, Dragonfly sprinkled some restrict there recently: http://gitweb.dragonflybsd.org/dragonfly.git/commit/d33005aaee6af52c80428b59b52aee522c002492 Just in case someone is considering more cleanups. Cheers, Pedro. Sponsored by:The FreeBSD Foundation MFC after: 1 week Modified: head/sys/sys/systm.h Modified: head/sys/sys/systm.h == --- head/sys/sys/systm.hFri Mar 2 16:31:23 2018(r330284) +++ head/sys/sys/systm.hFri Mar 2 16:47:02 2018(r330285) @@ -277,14 +277,14 @@ int copystr(const void * _Nonnull __restrict kfaddr, int copyinstr(const void * __restrict udaddr, void * _Nonnull __restrict kaddr, size_t len, size_t * __restrict lencopied); -intcopyin(const void * _Nonnull __restrict udaddr, +intcopyin(const void * __restrict udaddr, void * _Nonnull __restrict kaddr, size_t len); -intcopyin_nofault(const void * _Nonnull __restrict udaddr, +intcopyin_nofault(const void * __restrict udaddr, void * _Nonnull __restrict kaddr, size_t len); int copyout(const void * _Nonnull __restrict kaddr, - void * _Nonnull __restrict udaddr, size_t len); + void * __restrict udaddr, size_t len); int copyout_nofault(const void * _Nonnull __restrict kaddr, - void * _Nonnull __restrict udaddr, size_t len); + void * __restrict udaddr, size_t len); int fubyte(volatile const void *base); long fuword(volatile const void *base); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r330285 - head/sys/sys
On Fri, Mar 02, 2018 at 12:43:34PM -0500, Pedro Giffuni wrote: > (cc in Eitan as he may be interested in the extra restrict cases) > > > On 02/03/2018 11:47, Konstantin Belousov wrote: > > Author: kib > > Date: Fri Mar 2 16:47:02 2018 > > New Revision: 330285 > > URL: https://svnweb.freebsd.org/changeset/base/330285 > > > > Log: > >Remove _Nonnull attributes from user addresses arguments for > >copyout(9) family. > > > >The addresses are user-controllable, and if the process ABI allows > >mapping at zero, then the zero address is meaningful, contradicting > >the definition of _Nonnull. In any case, it does not require any > >special code to handle NULL udaddr. > > > > FWIW, the _Nonnull attributes didn't do much at all beyond producing a > warning. > They replaced the GNU __nonnull() attributes which were much more dangerous. > I am OK with seeing both gone here though. Even if the process ABI doesn't allow mapping at NULL, we have code that depends on copyout(NULL, foo, 0) being a nop. -- Brooks signature.asc Description: PGP signature
Re: svn commit: r330285 - head/sys/sys
On Fri, Mar 02, 2018 at 12:43:34PM -0500, Pedro Giffuni wrote: > (cc in Eitan as he may be interested in the extra restrict cases) > > > On 02/03/2018 11:47, Konstantin Belousov wrote: > > Author: kib > > Date: Fri Mar 2 16:47:02 2018 > > New Revision: 330285 > > URL: https://svnweb.freebsd.org/changeset/base/330285 > > > > Log: > >Remove _Nonnull attributes from user addresses arguments for > >copyout(9) family. > > > >The addresses are user-controllable, and if the process ABI allows > >mapping at zero, then the zero address is meaningful, contradicting > >the definition of _Nonnull. In any case, it does not require any > >special code to handle NULL udaddr. > > > > FWIW, the _Nonnull attributes didn't do much at all beyond producing a > warning. > They replaced the GNU __nonnull() attributes which were much more dangerous. > I am OK with seeing both gone here though. > > >It is not clear if __restrict makes sense as well, since kaddr and > >udaddr point to different address spaces, so equal numeric values of > >the pointers do not imply aliasing and a legitimate. But leave it for > >later. > > > >copyinstr(9) does not have its user address argument annotated. > > I think use of _Nonnull attributes in the threading functions may also > be a waste (I introduced them mostly to be compatible with Android). > FWIW, Dragonfly sprinkled some restrict there recently: > > http://gitweb.dragonflybsd.org/dragonfly.git/commit/d33005aaee6af52c80428b59b52aee522c002492 > > Just in case someone is considering more cleanups. This is not a cleanup for me, but a needed change. Right now x86 copyouts are implemented in asm, so whatever damage is done to the prototypes, only effect is at the caller side. In my work, i386 copyouts are done in C, so it starts matter. Also I looked at the dragonfly commit because I become curious what do you mean by threading functions. The first example was intpthread_attr_getguardsize(const pthread_attr_t * __restrict, - size_t *); + size_t * __restrict); POSIX agrees with the dragonfly change, but I do not understand it. Aliasing rules already disallow the first and second arguments to point to the same memory, because they have different types. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r330289 - head/sys/net
Author: shurd Date: Fri Mar 2 18:48:07 2018 New Revision: 330289 URL: https://svnweb.freebsd.org/changeset/base/330289 Log: iflib: stop timer callout when stopping iflib_timer has been seen running after the interface had been removed. This change prevents that. Submitted by: matt.m...@joyent.com Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c == --- head/sys/net/iflib.cFri Mar 2 18:12:25 2018(r330288) +++ head/sys/net/iflib.cFri Mar 2 18:48:07 2018(r330289) @@ -2267,6 +2267,10 @@ iflib_stop(if_ctx_t ctx) for (i = 0; i < scctx->isc_ntxqsets; i++, txq++) { /* make sure all transmitters have completed before proceeding XXX */ + CALLOUT_LOCK(txq); + callout_stop(&txq->ift_timer); + CALLOUT_UNLOCK(txq); + /* clean any enqueued buffers */ iflib_ifmp_purge(txq); /* Free any existing tx buffers. */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r330290 - head/share/man/man4
Author: wblock (doc committer) Date: Fri Mar 2 18:57:00 2018 New Revision: 330290 URL: https://svnweb.freebsd.org/changeset/base/330290 Log: Clarity and style fixes. Sponsored by: iXsystems Modified: head/share/man/man4/dtrace_lockstat.4 Modified: head/share/man/man4/dtrace_lockstat.4 == --- head/share/man/man4/dtrace_lockstat.4 Fri Mar 2 18:48:07 2018 (r330289) +++ head/share/man/man4/dtrace_lockstat.4 Fri Mar 2 18:57:00 2018 (r330290) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 3, 2017 +.Dd March 2, 2018 .Dt DTRACE_LOCKSTAT 4 .Os .Sh NAME @@ -58,19 +58,19 @@ provider allows the tracing of events related to locki .Fx . .Pp The -.Nm lockstat -provider contains DTrace probes for inspecting the kernel's lock +.Nm +provider contains DTrace probes for inspecting kernel lock state transitions. Probes exist for the .Xr mutex 9 , -.Xr rwlock 9 +.Xr rwlock 9 , and .Xr sx 9 lock types. The .Xr lockstat 1 utility can be used to collect and display data collected from the -.Nm lockstat +.Nm provider. Each type of lock has .Fn acquire @@ -125,7 +125,7 @@ and probes fire when a .Dv MTX_SPIN .Xr mutex 9 -is acquired and released, respectively. +is acquired or released, respectively. The only argument is a pointer to the lock structure which describes the lock being acquired or released. .Pp @@ -151,7 +151,7 @@ and .Fn lockstat:::rw-release probes fire when a .Xr rwlock 9 -is acquired and released, respectively. +is acquired or released, respectively. The first argument is a pointer to the structure which describes the lock being acquired. The second argument is @@ -210,7 +210,7 @@ and .Fn lockstat:::sx-release probes fire when a .Xr sx 9 -is acquired and released, respectively. +is acquired or released, respectively. The first argument is a pointer to the structure which describes the lock being acquired. The second argument is @@ -281,14 +281,14 @@ in nanoseconds, that the thread was spinning. .Xr sx 9 .Sh HISTORY The -.Nm lockstat +.Nm provider first appeared in Solaris. The .Fx implementation of the -.Nm lockstat +.Nm provider first appeared in -.Fx 9. +.Fx 9 . .Sh AUTHORS This manual page was written by .An George V. Neville-Neil Aq Mt g...@freebsd.org . ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r330291 - head/sbin/geom/class/part
Author: wblock (doc committer) Date: Fri Mar 2 19:07:32 2018 New Revision: 330291 URL: https://svnweb.freebsd.org/changeset/base/330291 Log: Clarify and clean up some language, and add an explicit example. Sponsored by: iXsystems Differential Revision:https://reviews.freebsd.org/D12336 Modified: head/sbin/geom/class/part/gpart.8 Modified: head/sbin/geom/class/part/gpart.8 == --- head/sbin/geom/class/part/gpart.8 Fri Mar 2 18:57:00 2018 (r330290) +++ head/sbin/geom/class/part/gpart.8 Fri Mar 2 19:07:32 2018 (r330291) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 10, 2018 +.Dd March 2, 2018 .Dt GPART 8 .Os .Sh NAME @@ -1327,16 +1327,16 @@ After creating all required partitions, embed bootstra .Bd -literal -offset indent /sbin/gpart bootcode -p /boot/boot1 da0 .Ed -.Ss Deleting partitions and partitioning scheme -If you get a +.Ss Deleting Partitions and Destroying the Partitioning Scheme +If a .Em "Device busy" -error when trying to destroy a partition table, remember that you must -delete all its partitions first with the +error is shown when trying to destroy a partition table, remember that +all of the partitions must be deleted first with the .Cm delete action. -In this example, assume we have +In this example, .Pa da0 -with three partitions: +has three partitions: .Bd -literal -offset indent /sbin/gpart delete -i 3 da0 /sbin/gpart delete -i 2 da0 @@ -1344,11 +1344,15 @@ with three partitions: /sbin/gpart destroy da0 .Ed .Pp -Alternatively, you can invoke the -.Cm destroy -action with the +Rather than deleting each partition and then destroying the partitioning +scheme, the .Fl F -flag. +option can be given with +.Cm destroy +to delete all of the partitions before destroying the partitioning scheme. +This is equivalent to the previous example: +.Bd -literal -offset indent +/sbin/gpart destroy -F da0 .Ed .Ss Backup and Restore .Pp ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r330292 - head/sys/dev/ispfw
Author: mav Date: Fri Mar 2 19:50:41 2018 New Revision: 330292 URL: https://svnweb.freebsd.org/changeset/base/330292 Log: Update QLogic ISP 24xx/25xx chips firmware to 8.07.00. MFC after:1 month Modified: head/sys/dev/ispfw/asm_2400.h head/sys/dev/ispfw/asm_2500.h Modified: head/sys/dev/ispfw/asm_2400.h == --- head/sys/dev/ispfw/asm_2400.h Fri Mar 2 19:07:32 2018 (r330291) +++ head/sys/dev/ispfw/asm_2400.h Fri Mar 2 19:50:41 2018 (r330292) @@ -27,23 +27,23 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* - * Firmware Version 7.03.00 (Apr 14, 2014) + * Firmware Version 8.07.00 (2017) */ #ifdef ISP_2400 static const uint32_t isp_2400_risc_code[] = { - 0x0401f195, 0x00112000, 0x0010, 0xc798, - 0x0007, 0x0003, 0x, 0x9496, + 0x0401f1be, 0x00112000, 0x0010, 0xc79b, + 0x0008, 0x0007, 0x, 0x9496, 0x0003, 0x, 0x20434f50, 0x59524947, - 0x48542032, 0x30303720, 0x514c4f47, 0x49432043, + 0x48542032, 0x30313720, 0x514c4f47, 0x49432043, 0x4f52504f, 0x52415449, 0x4f4e2020, 0x20495350, 0x32347878, 0x20466972, 0x6d776172, 0x65202020, - 0x56657273, 0x696f6e20, 0x2020372e, 0x30332e30, + 0x56657273, 0x696f6e20, 0x2020382e, 0x30372e30, 0x30202024, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, - 0x42001800, 0x0010014c, 0x42002000, 0x0010e36f, + 0x42001800, 0x0010014c, 0x42002000, 0x0010e377, 0x500c0800, 0x800c1800, 0x500c1000, 0x800c1800, 0x54042000, 0x80102000, 0x80040800, 0x80081040, 0x040207fc, 0x500c0800, 0x800409c0, 0x040207f6, @@ -126,759 +126,771 @@ static const uint32_t isp_2400_risc_code[] = { 0x6150, 0x0010, 0x6170, 0x0010, 0x6190, 0x0010, 0x61b0, 0x0010, 0x, 0x, 0x, 0x, - 0x, 0x0010, 0x0010, 0xc798, - 0x, 0x00112004, 0x0002, 0x0c50, - 0x, 0x00112c54, 0x0010fd00, 0x1b58, - 0x, 0x001147ac, 0xc000, 0x08b1, - 0x00ff, 0x0011505d, 0x8000, 0x0696, + 0x, 0x0010, 0x0010, 0xc79b, + 0x, 0x00112004, 0x0002, 0x1083, + 0x, 0x00113087, 0x0010fd00, 0x1b72, + 0x, 0x00114bf9, 0xc000, 0x08e2, + 0x00ff, 0x001154db, 0x8000, 0x069e, 0x00ff, 0x, 0x, 0x, - 0x, 0x4203f000, 0x00021fff, 0x4000, - 0x4203e000, 0x9100, 0x4000, 0x42000800, - 0x00020c51, 0x4202f000, 0x, 0x4200, - 0x7023, 0x5000, 0x8c000500, 0x04020003, - 0x42000800, 0x0002, 0x45780800, 0x80040800, - 0x82040580, 0x00022000, 0x040207fc, 0x4178a000, - 0x4200a800, 0x0010c798, 0x42000800, 0x0010fd00, - 0x4054, 0x8004b480, 0x0201f800, 0x0010c5e6, - 0x0401fade, 0x0401fa0a, 0x4803c856, 0x4200, - 0x1000, 0x5000, 0x82000480, 0x24320002, - 0x0402000d, 0x0201f800, 0x0010c62d, 0x0408, - 0x42000800, 0x7a17, 0x5004, 0x8c00050e, - 0x04020003, 0x8400054e, 0x44000800, 0x4a03, - 0x, 0x4a03c020, 0x0004, 0x4203e000, - 0x600f, 0x4a0370e8, 0x0003, 0x4a0378e8, - 0x0003, 0x59e00023, 0x8c000500, 0x04020027, - 0x42002800, 0x0010017d, 0x58140800, 0x4817c857, - 0x4807c857, 0x800409c0, 0x040b, 0x58142002, - 0x4813c857, 0x58141003, 0x4c14, 0x0401faaa, - 0x5c002800, 0x0402002a, 0x82142c00, 0x0004, - 0x0401f7f2, 0x42002800, 0x0010017d, 0x5814a000, - 0x4817c857, 0x4853c857, 0x8050a1c0, 0x040f, - 0x4c14, 0x5814a801, 0x4857c857, 0x4050, - 0x80540480, 0x0405, 0x5814b002, 0x485bc857, - 0x0201f800, 0x0010c5dd, 0x5c002800, 0x82142c00, - 0x0004, 0x0401f7ee, 0x42002800, 0x0010017d, - 0x58140801, 0x4817c857, 0x4807c857, 0x800409c0, - 0x0418, 0x58142002, 0x4813c857, 0x58141003, - 0x4c14, 0x0401fa84, 0x04020005, 0x5c002800, - 0x82142c00, 0x0004, 0x0401f7f2, 0x4803c856, - 0x4a03c020, 0x4010, 0x4a03c011, 0x40100011, - 0x04006000, 0x4203e000, 0x4000, 0x4a03c017, - 0x, 0x4203e000, 0x3001, 0x0401f000, - 0x4803c856, 0x0201f800, 0x0010fd04, 0x0401fb0b, - 0x4a03c014, 0x001c001c, 0x42002000, 0x00111858, - 0x0201f800, 0x0010c5ee, 0x4200, 0x1000, - 0x5000, 0x82000480, 0x24220001, 0x04000908, + 0x, 0x0006, 0x0009, 0x000c, + 0x000
svn commit: r330293 - head/sys/modules/dtb/allwinner
Author: manu Date: Fri Mar 2 20:59:36 2018 New Revision: 330293 URL: https://svnweb.freebsd.org/changeset/base/330293 Log: dtb/allwinner: Build sun8i-h3-nanopi-m1-plus.dts We have a u-boot port for this board so add the dtb to the build. Modified: head/sys/modules/dtb/allwinner/Makefile Modified: head/sys/modules/dtb/allwinner/Makefile == --- head/sys/modules/dtb/allwinner/Makefile Fri Mar 2 19:50:41 2018 (r330292) +++ head/sys/modules/dtb/allwinner/Makefile Fri Mar 2 20:59:36 2018 (r330293) @@ -14,6 +14,7 @@ DTS= \ sun8i-a83t-bananapi-m3.dts \ sun8i-h2-plus-orangepi-zero.dts \ sun8i-h3-nanopi-m1.dts \ + sun8i-h3-nanopi-m1-plus.dts \ sun8i-h3-nanopi-neo.dts \ sun8i-h3-orangepi-one.dts \ sun8i-h3-orangepi-plus2e.dts ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r330294 - head/sys/kern
Author: mjg Date: Fri Mar 2 21:26:27 2018 New Revision: 330294 URL: https://svnweb.freebsd.org/changeset/base/330294 Log: sx: fix adaptive spinning broken in r327397 The condition was flipped. In particular heavy multithreaded kernel builds on zfs started suffering due to nested sx locks. For instance make -s -j 128 buildkernel: before: 3326.67s user 1269.62s system 6981% cpu 1:05.84 total after: 3365.55s user 911.27s system 6871% cpu 1:02.24 total ps. .-'---`-. .-'---`-. ,' `.,' `. | \ | \ | \ | \ \ _ \ \ _ \ ,\ _,'-,/-)\ ,\ _,'-,/-)\ ( * \ \,' ,' ,'-) ( * \ \,' ,' ,'-) `._,) -',-') `._,) -',-') \/ ''/\/ ''/ )/ / )/ / / ,'-' / ,'-' Modified: head/sys/kern/kern_sx.c Modified: head/sys/kern/kern_sx.c == --- head/sys/kern/kern_sx.c Fri Mar 2 20:59:36 2018(r330293) +++ head/sys/kern/kern_sx.c Fri Mar 2 21:26:27 2018(r330294) @@ -584,7 +584,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t x, int opts LO sx->lock_object.lo_name, (void *)sx->sx_lock, file, line); #ifdef ADAPTIVE_SX - adaptive = ((sx->lock_object.lo_flags & SX_NOADAPTIVE) != 0); + adaptive = ((sx->lock_object.lo_flags & SX_NOADAPTIVE) == 0); #endif #ifdef HWPMC_HOOKS @@ -937,7 +937,7 @@ _sx_slock_hard(struct sx *sx, int opts, uintptr_t x LO #endif #ifdef ADAPTIVE_SX - adaptive = ((sx->lock_object.lo_flags & SX_NOADAPTIVE) != 0); + adaptive = ((sx->lock_object.lo_flags & SX_NOADAPTIVE) == 0); #endif #ifdef HWPMC_HOOKS ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r330295 - head/cddl/contrib/opensolaris/lib/libzfs/common
Author: asomers Date: Fri Mar 2 21:26:48 2018 New Revision: 330295 URL: https://svnweb.freebsd.org/changeset/base/330295 Log: ZFS: fix adding vdevs to very large pools r323791 changed the return value of zpool_read_label. Error paths that previously returned 0 began to return -1 instead. However, not all error paths initialized errno. When adding vdevs to a very large pool, errno could be prepopulated with ENOMEM, causing the operation to fail. Fix the bug by setting errno=ENOENT in the case that no ZFS label is found. PR: 226096 Submitted by: Nikita Kozlov Reviewed by: avg MFC after:3 weeks Differential Revision:https://reviews.freebsd.org/D13088 Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c == --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Fri Mar 2 21:26:27 2018(r330294) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Fri Mar 2 21:26:48 2018(r330295) @@ -923,6 +923,7 @@ zpool_read_label(int fd, nvlist_t **config) free(label); *config = NULL; + errno = ENOENT; return (-1); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r330294 - head/sys/kern
On Fri, Mar 2, 2018 at 10:26 PM, Mateusz Guzik wrote: > Author: mjg > Date: Fri Mar 2 21:26:27 2018 > New Revision: 330294 > URL: https://svnweb.freebsd.org/changeset/base/330294 > > Log: > sx: fix adaptive spinning broken in r327397 > > The condition was flipped. > > In particular heavy multithreaded kernel builds on zfs started suffering > due to nested sx locks. > > For instance make -s -j 128 buildkernel: > > before: 3326.67s user 1269.62s system 6981% cpu 1:05.84 total > after: 3365.55s user 911.27s system 6871% cpu 1:02.24 total > > ps. > .-'---`-. .-'---`-. > ,' `.,' `. > | \ | \ > | \ | \ > \ _ \ \ _ \ > ,\ _,'-,/-)\ ,\ _,'-,/-)\ > ( * \ \,' ,' ,'-) ( * \ \,' ,' ,'-) >`._,) -',-') `._,) -',-') > \/ ''/\/ ''/ > )/ / )/ / > / ,'-' / ,'-' > For some reason some people have non-fixed size fonts and keep asking what this is. It's not a squirrel, Admiral Ackbar nor a failed attempt at ascii art. The svnweb version provides a nice view: https://svnweb.freebsd.org/base?view=revision&revision=330294 Courtesy of http://www.asciifacepalm.com/ -- Mateusz Guzik ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r330297 - in head: lib/libc/sys sys/compat/freebsd32 sys/i386/ibcs2 sys/kern sys/sys
Author: brooks Date: Fri Mar 2 22:10:48 2018 New Revision: 330297 URL: https://svnweb.freebsd.org/changeset/base/330297 Log: Rename kernel-only members of semid_ds and msgid_ds. This deliberately breaks the API in preperation for future syscall revisions which will remove these nonstandard members. In an exp-run a single port (devel/qemu-user-static) was found to use them which it did becuase it emulates system calls. This has been fixed in the ports tree. PR: 224443 (exp-run) Reviewed by: kib, jhb (previous version) Exp-run by: antoine Sponsored by: DARPA, AFRP Differential Revision:https://reviews.freebsd.org/D14490 Modified: head/lib/libc/sys/msgctl.2 head/lib/libc/sys/semctl.2 head/sys/compat/freebsd32/freebsd32_ipc.h head/sys/i386/ibcs2/ibcs2_ipc.c head/sys/kern/sysv_msg.c head/sys/kern/sysv_sem.c head/sys/sys/msg.h head/sys/sys/sem.h Modified: head/lib/libc/sys/msgctl.2 == --- head/lib/libc/sys/msgctl.2 Fri Mar 2 21:50:02 2018(r330296) +++ head/lib/libc/sys/msgctl.2 Fri Mar 2 22:10:48 2018(r330297) @@ -63,8 +63,8 @@ and contains (amongst others) the following members: .Bd -literal struct msqid_ds { struct ipc_perm msg_perm; /* msg queue permission bits */ - struct msg *msg_first; /* first message in the queue */ - struct msg *msg_last; /* last message in the queue */ + struct msg *__msg_first; /* kernel data, don't use */ + struct msg *__msg_last;/* kernel data, don't use */ msglen_t msg_cbytes;/* number of bytes in use on the queue */ msgqnum_t msg_qnum; /* number of msgs in the queue */ msglen_t msg_qbytes;/* max # of bytes on the queue */ Modified: head/lib/libc/sys/semctl.2 == --- head/lib/libc/sys/semctl.2 Fri Mar 2 21:50:02 2018(r330296) +++ head/lib/libc/sys/semctl.2 Fri Mar 2 22:10:48 2018(r330297) @@ -145,7 +145,7 @@ is defined as follows: .Bd -literal struct semid_ds { struct ipc_perm sem_perm; /* operation permission struct */ -struct sem *sem_base; /* pointer to first semaphore in set */ +struct sem *__sem_base; /* kernel data, don't use */ u_short sem_nsems; /* number of sems in set */ time_t sem_otime; /* last operation time */ time_t sem_ctime; /* last change time */ Modified: head/sys/compat/freebsd32/freebsd32_ipc.h == --- head/sys/compat/freebsd32/freebsd32_ipc.h Fri Mar 2 21:50:02 2018 (r330296) +++ head/sys/compat/freebsd32/freebsd32_ipc.h Fri Mar 2 22:10:48 2018 (r330297) @@ -43,7 +43,7 @@ struct ipc_perm32 { struct semid_ds32 { struct ipc_perm32 sem_perm; - uint32_tsem_base; + uint32_t__sem_base; unsigned short sem_nsems; int32_t sem_otime; int32_t sem_ctime; @@ -69,8 +69,8 @@ union semun32 { struct msqid_ds32 { struct ipc_perm32 msg_perm; - uint32_tmsg_first; - uint32_tmsg_last; + uint32_t__msg_first; + uint32_t__msg_last; uint32_tmsg_cbytes; uint32_tmsg_qnum; uint32_tmsg_qbytes; @@ -143,7 +143,7 @@ struct ipc_perm32_old { struct semid_ds32_old { struct ipc_perm32_old sem_perm; - uint32_tsem_base; + uint32_t__sem_base; unsigned short sem_nsems; int32_t sem_otime; int32_t sem_pad1; @@ -154,8 +154,8 @@ struct semid_ds32_old { struct msqid_ds32_old { struct ipc_perm32_old msg_perm; - uint32_tmsg_first; - uint32_tmsg_last; + uint32_t__msg_first; + uint32_t__msg_last; uint32_tmsg_cbytes; uint32_tmsg_qnum; uint32_tmsg_qbytes; Modified: head/sys/i386/ibcs2/ibcs2_ipc.c == --- head/sys/i386/ibcs2/ibcs2_ipc.c Fri Mar 2 21:50:02 2018 (r330296) +++ head/sys/i386/ibcs2/ibcs2_ipc.c Fri Mar 2 22:10:48 2018 (r330297) @@ -73,9 +73,8 @@ cvt_msqid2imsqid(bp, ibp) struct msqid_ds *bp; struct ibcs2_msqid_ds *ibp; { + memset(ibp, 0, sizeof(*ibp)); cvt_perm2iperm(&bp->msg_perm, &ibp->msg_perm); - ibp->msg_first = bp->msg_first; - ibp->msg_last = bp->msg_last; ibp->msg_cbytes = (u_short)bp->msg_cbytes; ibp->msg_qnum = (u_short)bp->msg_qnum; ibp->msg_qbytes = (u_short)bp->msg_qbytes; @@ -93,8 +92,6 @@ struct ibcs2_msqid_ds *ibp; struct msqid_ds *bp; { cvt_iperm2perm(&ibp->msg_perm, &bp->msg_perm); - bp->msg_first = ibp->
svn commit: r330298 - head/sys/sys
Author: brooks Date: Fri Mar 2 22:13:29 2018 New Revision: 330298 URL: https://svnweb.freebsd.org/changeset/base/330298 Log: Don't define struct mymsg. PR: 224299, 224443 (exp-run) Reviewed by: kib, jhb Exp-run by: antoine Sponsored by: DARPA, AFRL Differential Revision:https://reviews.freebsd.org/D14491 Modified: head/sys/sys/msg.h Modified: head/sys/sys/msg.h == --- head/sys/sys/msg.h Fri Mar 2 22:10:48 2018(r330297) +++ head/sys/sys/msg.h Fri Mar 2 22:13:29 2018(r330298) @@ -101,23 +101,6 @@ struct msqid_ds { time_t msg_ctime; /* time of last msgctl() */ }; -#if __BSD_VISIBLE -/* - * Structure describing a message. The SVID doesn't suggest any - * particular name for this structure. There is a reference in the - * msgop man page that reads "The structure mymsg is an example of what - * this user defined buffer might look like, and includes the following - * members:". This sentence is followed by two lines equivalent - * to the mtype and mtext field declarations below. It isn't clear - * if "mymsg" refers to the name of the structure type or the name of an - * instance of the structure... - */ -struct mymsg { - longmtype; /* message type (+ve integer) */ - charmtext[1]; /* message body */ -}; -#endif - #ifdef _KERNEL struct msg { struct msg *msg_next; /* next msg in the chain */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r330297 - in head: lib/libc/sys sys/compat/freebsd32 sys/i386/ibcs2 sys/kern sys/sys
On Fri, Mar 02, 2018 at 10:10:49PM +, Brooks Davis wrote: > Author: brooks > Date: Fri Mar 2 22:10:48 2018 > New Revision: 330297 > URL: https://svnweb.freebsd.org/changeset/base/330297 > > Log: > Rename kernel-only members of semid_ds and msgid_ds. > > This deliberately breaks the API in preperation for future syscall > revisions which will remove these nonstandard members. > > In an exp-run a single port (devel/qemu-user-static) was found to > use them which it did becuase it emulates system calls. This has > been fixed in the ports tree. > > PR: 224443 (exp-run) > Reviewed by:kib, jhb (previous version) > Exp-run by: antoine > Sponsored by: DARPA, AFRP > Differential Revision: https://reviews.freebsd.org/D14490 FYI, a __FreeBSD_version bump is coming along with a third commit. -- Brooks signature.asc Description: PGP signature
svn commit: r330299 - in head: contrib/sendmail/include/sm/os lib/libc/gen lib/libc/sys sys/sys usr.bin/svn/lib/libapr
Author: brooks Date: Fri Mar 2 22:32:53 2018 New Revision: 330299 URL: https://svnweb.freebsd.org/changeset/base/330299 Log: Don't declare union semun in userspace unless _WANT_SEMUN is defined. POSIX explicitly states that the application must declare union semun. This makes no sense, but it is what it is. This brings us into line with Linux, MacOS/Darwin, and NetBSD. In a ports exp-run a moderate number of ports fail due to a lack of approprate autotools-like discovery mechanisms or local patches. A commit to address them will follow shortly. PR: 224300, 224443 (exp-run) Reviewed by: emaste, jhb, kib Exp-run by: antoine Sponsored by: DARPA, AFRL Differential Revision:https://reviews.freebsd.org/D14492 Modified: head/contrib/sendmail/include/sm/os/sm_os_freebsd.h head/lib/libc/gen/semctl.c head/lib/libc/sys/semctl.2 head/sys/sys/param.h head/sys/sys/sem.h head/usr.bin/svn/lib/libapr/apr.h Modified: head/contrib/sendmail/include/sm/os/sm_os_freebsd.h == --- head/contrib/sendmail/include/sm/os/sm_os_freebsd.h Fri Mar 2 22:13:29 2018(r330298) +++ head/contrib/sendmail/include/sm/os/sm_os_freebsd.h Fri Mar 2 22:32:53 2018(r330299) @@ -34,7 +34,7 @@ # define SM_CONF_SHM 1 #endif /* SM_CONF_SHM */ #ifndef SM_CONF_SEM -# define SM_CONF_SEM 1 +# define SM_CONF_SEM 2 #endif /* SM_CONF_SEM */ #ifndef SM_CONF_MSG # define SM_CONF_MSG 1 Modified: head/lib/libc/gen/semctl.c == --- head/lib/libc/gen/semctl.c Fri Mar 2 22:13:29 2018(r330298) +++ head/lib/libc/gen/semctl.c Fri Mar 2 22:32:53 2018(r330299) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #ifndef NO_COMPAT7 #define _WANT_SEMUN_OLD #endif +#define _WANT_SEMUN #include #include Modified: head/lib/libc/sys/semctl.2 == --- head/lib/libc/sys/semctl.2 Fri Mar 2 22:13:29 2018(r330298) +++ head/lib/libc/sys/semctl.2 Fri Mar 2 22:32:53 2018(r330299) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 12, 1995 +.Dd February 23, 2018 .Dt SEMCTL 2 .Os .Sh NAME @@ -55,10 +55,7 @@ For the commands that use the .Fa arg argument, .Fa "union semun" -is defined as follows: -.\" -.\" From : -.\" +must be defined as follows: .Bd -literal union semun { int val;/* value for SETVAL */ @@ -66,6 +63,12 @@ union semun { u_short *array; /* array for GETALL & SETALL */ }; .Ed +Non-portable software may define +.Dv _WANT_SEMUN +before including +.Pa sys/sem.h +to use the system definition of +.Fa "union semun" . .Pp Commands are performed as follows: .\" Modified: head/sys/sys/param.h == --- head/sys/sys/param.hFri Mar 2 22:13:29 2018(r330298) +++ head/sys/sys/param.hFri Mar 2 22:32:53 2018(r330299) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200058 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200059 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: head/sys/sys/sem.h == --- head/sys/sys/sem.h Fri Mar 2 22:13:29 2018(r330298) +++ head/sys/sys/sem.h Fri Mar 2 22:32:53 2018(r330299) @@ -76,6 +76,7 @@ union semun_old { }; #endif +#if defined(_KERNEL) || defined(_WANT_SEMUN) /* * semctl's arg parameter structure */ @@ -84,6 +85,7 @@ union semun { struct semid_ds *buf; /* buffer for IPC_STAT & IPC_SET */ unsigned short *array; /* array for GETALL & SETALL */ }; +#endif /* * commands for semctl Modified: head/usr.bin/svn/lib/libapr/apr.h == --- head/usr.bin/svn/lib/libapr/apr.h Fri Mar 2 22:13:29 2018 (r330298) +++ head/usr.bin/svn/lib/libapr/apr.h Fri Mar 2 22:32:53 2018 (r330299) @@ -261,7 +261,7 @@ extern "C" { #define APR_HAVE_STRSTR 1 #define APR_HAVE_MEMCHR 1 #define APR_HAVE_STRUCT_RLIMIT 1 -#define APR_HAVE_UNION_SEMUN1 +#define APR_HAVE_UNION_SEMUN0 #define APR_HAVE_SCTP 1 #define APR_HAVE_IOVEC 1 ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r330297 - in head: lib/libc/sys sys/compat/freebsd32 sys/i386/ibcs2 sys/kern sys/sys
In message <20180302223138.ga83...@spindle.one-eyed-alien.net>, Brooks Davis wr ites: > > --yrj/dFKFPuw6o+aM > Content-Type: text/plain; charset=us-ascii > Content-Disposition: inline > Content-Transfer-Encoding: quoted-printable > > On Fri, Mar 02, 2018 at 10:10:49PM +, Brooks Davis wrote: > > Author: brooks > > Date: Fri Mar 2 22:10:48 2018 > > New Revision: 330297 > > URL: https://svnweb.freebsd.org/changeset/base/330297 > >=20 > > Log: > > Rename kernel-only members of semid_ds and msgid_ds. > > =20 > > This deliberately breaks the API in preperation for future syscall > > revisions which will remove these nonstandard members. > > =20 > > In an exp-run a single port (devel/qemu-user-static) was found to > > use them which it did becuase it emulates system calls. This has > > been fixed in the ports tree. > > =20 > > PR: 224443 (exp-run) > > Reviewed by: kib, jhb (previous version) > > Exp-run by: antoine > > Sponsored by: DARPA, AFRP > > Differential Revision:https://reviews.freebsd.org/D14490 > > FYI, a __FreeBSD_version bump is coming along with a third commit. Hi Brooks, This causes ipcrm build to fail: /opt/src/svn-current/usr.bin/ipcrm/ipcrm.c:156:14: error: variable has incomplete type 'union semun' union semun arg; ^ /opt/src/svn-current/usr.bin/ipcrm/ipcrm.c:156:8: note: forward declaration of 'union semun' union semun arg; ^ Index: usr.bin/ipcrm/ipcrm.c === --- usr.bin/ipcrm/ipcrm.c (revision 330299) +++ usr.bin/ipcrm/ipcrm.c (working copy) @@ -39,6 +39,7 @@ #define_WANT_SYSVMSG_INTERNALS #include #define_WANT_SYSVSEM_INTERNALS +#define _WANT_SEMUN #include #define_WANT_SYSVSHM_INTERNALS #include And: /opt/src/svn-current/contrib/netbsd-tests/kernel/t_sysv.c:444:14: error: variable has incomplete type 'union semun' union semun sun; ^ /opt/src/svn-current/contrib/netbsd-tests/kernel/t_sysv.c:444:8: note: forward declaration of 'union semun' union semun sun; ^ Index: /opt/src/svn-current/contrib/netbsd-tests/kernel/t_sysv.c === --- /opt/src/svn-current/contrib/netbsd-tests/kernel/t_sysv.c (revision 330299) +++ /opt/src/svn-current/contrib/netbsd-tests/kernel/t_sysv.c (working copy) @@ -49,6 +49,7 @@ #include #include #include +#define _WANT_SEMUN #include #include #include I'm not sure if there are more. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r330297 - in head: lib/libc/sys sys/compat/freebsd32 sys/i386/ibcs2 sys/kern sys/sys
In message <201803022325.w22npyiw050...@slippy.cwsent.com>, Cy Schubert writes: > In message <20180302223138.ga83...@spindle.one-eyed-alien.net>, Brooks > Davis wr > ites: > > > > --yrj/dFKFPuw6o+aM > > Content-Type: text/plain; charset=us-ascii > > Content-Disposition: inline > > Content-Transfer-Encoding: quoted-printable > > > > On Fri, Mar 02, 2018 at 10:10:49PM +, Brooks Davis wrote: > > > Author: brooks > > > Date: Fri Mar 2 22:10:48 2018 > > > New Revision: 330297 > > > URL: https://svnweb.freebsd.org/changeset/base/330297 > > >=20 > > > Log: > > > Rename kernel-only members of semid_ds and msgid_ds. > > > =20 > > > This deliberately breaks the API in preperation for future syscall > > > revisions which will remove these nonstandard members. > > > =20 > > > In an exp-run a single port (devel/qemu-user-static) was found to > > > use them which it did becuase it emulates system calls. This has > > > been fixed in the ports tree. > > > =20 > > > PR: 224443 (exp-run) > > > Reviewed by:kib, jhb (previous version) > > > Exp-run by: antoine > > > Sponsored by: DARPA, AFRP > > > Differential Revision: https://reviews.freebsd.org/D14490 > > > > FYI, a __FreeBSD_version bump is coming along with a third commit. > > Hi Brooks, > > This causes ipcrm build to fail: > > /opt/src/svn-current/usr.bin/ipcrm/ipcrm.c:156:14: error: variable has > incomplete type 'union semun' > union semun arg; > ^ > /opt/src/svn-current/usr.bin/ipcrm/ipcrm.c:156:8: note: forward > declaration of 'union semun' > union semun arg; > ^ > > > Index: usr.bin/ipcrm/ipcrm.c > === > --- usr.bin/ipcrm/ipcrm.c (revision 330299) > +++ usr.bin/ipcrm/ipcrm.c (working copy) > @@ -39,6 +39,7 @@ > #define _WANT_SYSVMSG_INTERNALS > #include > #define _WANT_SYSVSEM_INTERNALS > +#define _WANT_SEMUN > #include > #define _WANT_SYSVSHM_INTERNALS > #include > > And: > > /opt/src/svn-current/contrib/netbsd-tests/kernel/t_sysv.c:444:14: > error: variable has incomplete type 'union semun' > union semun sun; > ^ > /opt/src/svn-current/contrib/netbsd-tests/kernel/t_sysv.c:444:8: note: > forward declaration of 'union semun' > union semun sun; > ^ > > Index: /opt/src/svn-current/contrib/netbsd-tests/kernel/t_sysv.c > === > --- /opt/src/svn-current/contrib/netbsd-tests/kernel/t_sysv.c (revision > 330299) > +++ /opt/src/svn-current/contrib/netbsd-tests/kernel/t_sysv.c (working > copy) > @@ -49,6 +49,7 @@ > #include > #include > #include > +#define _WANT_SEMUN > #include > #include > #include > > > I'm not sure if there are more. Sorry, this should be reported against r330299. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r330300 - in head: contrib/netbsd-tests/kernel usr.bin/ipcrm
Author: brooks Date: Fri Mar 2 23:31:55 2018 New Revision: 330300 URL: https://svnweb.freebsd.org/changeset/base/330300 Log: Fix build post r330299 Modified: head/contrib/netbsd-tests/kernel/t_sysv.c head/usr.bin/ipcrm/ipcrm.c Modified: head/contrib/netbsd-tests/kernel/t_sysv.c == --- head/contrib/netbsd-tests/kernel/t_sysv.c Fri Mar 2 22:32:53 2018 (r330299) +++ head/contrib/netbsd-tests/kernel/t_sysv.c Fri Mar 2 23:31:55 2018 (r330300) @@ -94,13 +94,11 @@ key_t msgkey, semkey, shmkey; intmaxloop = 1; -#ifndef __FreeBSD__ union semun { int val;/* value for SETVAL */ struct semid_ds *buf; /* buffer for IPC_{STAT,SET} */ u_short *array; /* array for GETALL & SETALL */ }; -#endif /* Writes an integer to a file. To be used from the body of the test Modified: head/usr.bin/ipcrm/ipcrm.c == --- head/usr.bin/ipcrm/ipcrm.c Fri Mar 2 22:32:53 2018(r330299) +++ head/usr.bin/ipcrm/ipcrm.c Fri Mar 2 23:31:55 2018(r330300) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #define_WANT_SYSVMSG_INTERNALS #include #define_WANT_SYSVSEM_INTERNALS +#define_WANT_SEMUN #include #define_WANT_SYSVSHM_INTERNALS #include ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r330297 - in head: lib/libc/sys sys/compat/freebsd32 sys/i386/ibcs2 sys/kern sys/sys
On Fri, Mar 02, 2018 at 03:31:36PM -0800, Cy Schubert wrote: > In message <201803022325.w22npyiw050...@slippy.cwsent.com>, Cy Schubert > writes: > > In message <20180302223138.ga83...@spindle.one-eyed-alien.net>, Brooks > > Davis wr > > ites: > > > > > > --yrj/dFKFPuw6o+aM > > > Content-Type: text/plain; charset=us-ascii > > > Content-Disposition: inline > > > Content-Transfer-Encoding: quoted-printable > > > > > > On Fri, Mar 02, 2018 at 10:10:49PM +, Brooks Davis wrote: > > > > Author: brooks > > > > Date: Fri Mar 2 22:10:48 2018 > > > > New Revision: 330297 > > > > URL: https://svnweb.freebsd.org/changeset/base/330297 > > > >=20 > > > > Log: > > > > Rename kernel-only members of semid_ds and msgid_ds. > > > > =20 > > > > This deliberately breaks the API in preperation for future syscall > > > > revisions which will remove these nonstandard members. > > > > =20 > > > > In an exp-run a single port (devel/qemu-user-static) was found to > > > > use them which it did becuase it emulates system calls. This has > > > > been fixed in the ports tree. > > > > =20 > > > > PR: 224443 (exp-run) > > > > Reviewed by: kib, jhb (previous version) > > > > Exp-run by: antoine > > > > Sponsored by: DARPA, AFRP > > > > Differential Revision:https://reviews.freebsd.org/D14490 > > > > > > FYI, a __FreeBSD_version bump is coming along with a third commit. > > > > Hi Brooks, > > > > This causes ipcrm build to fail: > > > > /opt/src/svn-current/usr.bin/ipcrm/ipcrm.c:156:14: error: variable has > > incomplete type 'union semun' > > union semun arg; > > ^ > > /opt/src/svn-current/usr.bin/ipcrm/ipcrm.c:156:8: note: forward > > declaration of 'union semun' > > union semun arg; > > ^ > > > > > > Index: usr.bin/ipcrm/ipcrm.c > > === > > --- usr.bin/ipcrm/ipcrm.c (revision 330299) > > +++ usr.bin/ipcrm/ipcrm.c (working copy) > > @@ -39,6 +39,7 @@ > > #define_WANT_SYSVMSG_INTERNALS > > #include > > #define_WANT_SYSVSEM_INTERNALS > > +#define _WANT_SEMUN > > #include > > #define_WANT_SYSVSHM_INTERNALS > > #include > > > > And: > > > > /opt/src/svn-current/contrib/netbsd-tests/kernel/t_sysv.c:444:14: > > error: variable has incomplete type 'union semun' > > union semun sun; > > ^ > > /opt/src/svn-current/contrib/netbsd-tests/kernel/t_sysv.c:444:8: note: > > forward declaration of 'union semun' > > union semun sun; > > ^ > > > > Index: /opt/src/svn-current/contrib/netbsd-tests/kernel/t_sysv.c > > === > > --- /opt/src/svn-current/contrib/netbsd-tests/kernel/t_sysv.c > > (revision > > 330299) > > +++ /opt/src/svn-current/contrib/netbsd-tests/kernel/t_sysv.c > > (working > > copy) > > @@ -49,6 +49,7 @@ > > #include > > #include > > #include > > +#define _WANT_SEMUN > > #include > > #include > > #include > > > > > > I'm not sure if there are more. > > Sorry, this should be reported against r330299. Thanks for the reports. Sorry about that. Doing another buildworld to check for more. -- Brooks signature.asc Description: PGP signature
Re: svn commit: r330297 - in head: lib/libc/sys sys/compat/freebsd32 sys/i386/ibcs2 sys/kern sys/sys
In message <20180302233343.gc83...@spindle.one-eyed-alien.net>, Brooks Davis wr ites: > > > --ALfTUftag+2gvp1h > Content-Type: text/plain; charset=us-ascii > Content-Disposition: inline > Content-Transfer-Encoding: quoted-printable > > On Fri, Mar 02, 2018 at 03:31:36PM -0800, Cy Schubert wrote: > > In message <201803022325.w22npyiw050...@slippy.cwsent.com>, Cy Schubert= > =20 > > writes: > > > In message <20180302223138.ga83...@spindle.one-eyed-alien.net>, Brooks= > =20 > > > Davis wr > > > ites: > > > >=20 > > > > --yrj/dFKFPuw6o+aM > > > > Content-Type: text/plain; charset=3Dus-ascii > > > > Content-Disposition: inline > > > > Content-Transfer-Encoding: quoted-printable > > > > > > > > On Fri, Mar 02, 2018 at 10:10:49PM +, Brooks Davis wrote: > > > > > Author: brooks > > > > > Date: Fri Mar 2 22:10:48 2018 > > > > > New Revision: 330297 > > > > > URL: https://svnweb.freebsd.org/changeset/base/330297 > > > > >=3D20 > > > > > Log: > > > > > Rename kernel-only members of semid_ds and msgid_ds. > > > > > =3D20 > > > > > This deliberately breaks the API in preperation for future syscall > > > > > revisions which will remove these nonstandard members. > > > > > =3D20 > > > > > In an exp-run a single port (devel/qemu-user-static) was found to > > > > > use them which it did becuase it emulates system calls. This has > > > > > been fixed in the ports tree. > > > > > =3D20 > > > > > PR: 224443 (exp-run) > > > > > Reviewed by:kib, jhb (previous version) > > > > > Exp-run by: antoine > > > > > Sponsored by: DARPA, AFRP > > > > > Differential Revision: https://reviews.freebsd.org/D14490 > > > > > > > > FYI, a __FreeBSD_version bump is coming along with a third commit. > > > > > > Hi Brooks, > > > > > > This causes ipcrm build to fail: > > > > > > /opt/src/svn-current/usr.bin/ipcrm/ipcrm.c:156:14: error: variable has= > =20 > > > incomplete type 'union semun' > > > union semun arg; > > > ^ > > > /opt/src/svn-current/usr.bin/ipcrm/ipcrm.c:156:8: note: forward=20 > > > declaration of 'union semun' > > > union semun arg; > > > ^ > > > > > > > > > Index: usr.bin/ipcrm/ipcrm.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 > > > --- usr.bin/ipcrm/ipcrm.c (revision 330299) > > > +++ usr.bin/ipcrm/ipcrm.c (working copy) > > > @@ -39,6 +39,7 @@ > > > #define _WANT_SYSVMSG_INTERNALS > > > #include > > > #define _WANT_SYSVSEM_INTERNALS > > > +#define _WANT_SEMUN > > > #include > > > #define _WANT_SYSVSHM_INTERNALS > > > #include > > > > > > And: > > > > > > /opt/src/svn-current/contrib/netbsd-tests/kernel/t_sysv.c:444:14:=20 > > > error: variable has incomplete type 'union semun' > > > union semun sun; > > > ^ > > > /opt/src/svn-current/contrib/netbsd-tests/kernel/t_sysv.c:444:8: note:= > =20 > > > forward declaration of 'union semun' > > > union semun sun; > > > ^ > > > > > > Index: /opt/src/svn-current/contrib/netbsd-tests/kernel/t_sysv.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 > > > --- /opt/src/svn-current/contrib/netbsd-tests/kernel/t_sysv.c (revisi > on= > =20 > > > 330299) > > > +++ /opt/src/svn-current/contrib/netbsd-tests/kernel/t_sysv.c (workin > g= > =20 > > > copy) > > > @@ -49,6 +49,7 @@ > > > #include > > > #include > > > #include > > > +#define _WANT_SEMUN > > > #include > > > #include > > > #include > > > > > > > > > I'm not sure if there are more. > >=20 > > Sorry, this should be reported against r330299. > > Thanks for the reports. Sorry about that. Doing another buildworld > to check for more. Thanks for the prompt fixes. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r330301 - stable/11/sys/net
Author: np Date: Sat Mar 3 00:10:37 2018 New Revision: 330301 URL: https://svnweb.freebsd.org/changeset/base/330301 Log: MFC r323221: Make LACP based lagg work with interfaces (like 100Gbps and 25Gbps) that report extended media types. lacp_aggregator_bandwidth() uses the media to determine the speed of the interface and returns 0 for IFM_OTHER without the bits in the extended range. Reported by: kbowling@ Reviewed by: eugen_grosbein.net, mjoras@ Sponsored by: Chelsio Communications Differential Revision:https://reviews.freebsd.org/D12188 Modified: stable/11/sys/net/ieee8023ad_lacp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/ieee8023ad_lacp.c == --- stable/11/sys/net/ieee8023ad_lacp.c Fri Mar 2 23:31:55 2018 (r330300) +++ stable/11/sys/net/ieee8023ad_lacp.c Sat Mar 3 00:10:37 2018 (r330301) @@ -461,7 +461,11 @@ lacp_linkstate(struct lagg_port *lgp) uint16_t old_key; bzero((char *)&ifmr, sizeof(ifmr)); - error = (*ifp->if_ioctl)(ifp, SIOCGIFMEDIA, (caddr_t)&ifmr); + error = (*ifp->if_ioctl)(ifp, SIOCGIFXMEDIA, (caddr_t)&ifmr); + if (error != 0) { + bzero((char *)&ifmr, sizeof(ifmr)); + error = (*ifp->if_ioctl)(ifp, SIOCGIFMEDIA, (caddr_t)&ifmr); + } if (error != 0) return; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r330302 - in stable/11/sys: netinet netinet6
Author: np Date: Sat Mar 3 00:22:32 2018 New Revision: 330302 URL: https://svnweb.freebsd.org/changeset/base/330302 Log: MFC r328314: Do not generate illegal mbuf chains during IP fragment reassembly. Only the first mbuf of the reassembled datagram should have a pkthdr. Modified: stable/11/sys/netinet/ip_reass.c stable/11/sys/netinet6/frag6.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/ip_reass.c == --- stable/11/sys/netinet/ip_reass.cSat Mar 3 00:10:37 2018 (r330301) +++ stable/11/sys/netinet/ip_reass.cSat Mar 3 00:22:32 2018 (r330302) @@ -377,6 +377,7 @@ ip_reass(struct mbuf *m) q->m_nextpkt = NULL; m->m_pkthdr.csum_flags &= q->m_pkthdr.csum_flags; m->m_pkthdr.csum_data += q->m_pkthdr.csum_data; + m_demote_pkthdr(q); m_cat(m, q); } /* Modified: stable/11/sys/netinet6/frag6.c == --- stable/11/sys/netinet6/frag6.c Sat Mar 3 00:10:37 2018 (r330301) +++ stable/11/sys/netinet6/frag6.c Sat Mar 3 00:22:32 2018 (r330302) @@ -539,6 +539,7 @@ insert: while (t->m_next) t = t->m_next; m_adj(IP6_REASS_MBUF(af6), af6->ip6af_offset); + m_demote_pkthdr(IP6_REASS_MBUF(af6)); m_cat(t, IP6_REASS_MBUF(af6)); free(af6, M_FTABLE); af6 = af6dwn; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r330303 - in stable: 10/sys/dev/cxgb/ulp/tom 10/sys/dev/cxgbe/tom 10/sys/netinet 11/sys/dev/cxgb/ulp/tom 11/sys/dev/cxgbe/tom 11/sys/netinet
Author: jhb Date: Sat Mar 3 00:54:12 2018 New Revision: 330303 URL: https://svnweb.freebsd.org/changeset/base/330303 Log: MFC 328608: Export tcp_always_keepalive for use by the Chelsio TOM module. This used to work by accident with ld.bfd even though always_keepalive was marked as static. LLD honors static more correctly, so export this variable properly (including moving it into the tcp_* namespace). Relative to HEAD the MFC includes two additional changes: - The t3_tom module used for cxgb(4) is also patched. - A strong reference from the new name (tcp_always_keepalive) to the old name (always_keepalive) has been added to preserve the KBI for existing modules. Suggested by: kib (strong reference) Sponsored by: Chelsio Communications Modified: stable/10/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c stable/10/sys/dev/cxgbe/tom/t4_tom.c stable/10/sys/netinet/tcp_timer.c stable/10/sys/netinet/tcp_timer.h Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c stable/11/sys/dev/cxgbe/tom/t4_tom.c stable/11/sys/netinet/tcp_timer.c stable/11/sys/netinet/tcp_timer.h Directory Properties: stable/11/ (props changed) Modified: stable/10/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c == --- stable/10/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.cSat Mar 3 00:22:32 2018(r330302) +++ stable/10/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.cSat Mar 3 00:54:12 2018(r330303) @@ -86,7 +86,6 @@ VNET_DECLARE(int, tcp_autorcvbuf_inc); #define V_tcp_autorcvbuf_inc VNET(tcp_autorcvbuf_inc) VNET_DECLARE(int, tcp_autorcvbuf_max); #define V_tcp_autorcvbuf_max VNET(tcp_autorcvbuf_max) -extern int always_keepalive; /* * For ULP connections HW may add headers, e.g., for digests, that aren't part @@ -839,7 +838,7 @@ calc_opt0h(struct socket *so, int mtu_idx, int rscale, if (so != NULL) { struct inpcb *inp = sotoinpcb(so); struct tcpcb *tp = intotcpcb(inp); - int keepalive = always_keepalive || + int keepalive = tcp_always_keepalive || so_options_get(so) & SO_KEEPALIVE; opt0h |= V_NAGLE((tp->t_flags & TF_NODELAY) == 0); Modified: stable/10/sys/dev/cxgbe/tom/t4_tom.c == --- stable/10/sys/dev/cxgbe/tom/t4_tom.cSat Mar 3 00:22:32 2018 (r330302) +++ stable/10/sys/dev/cxgbe/tom/t4_tom.cSat Mar 3 00:54:12 2018 (r330303) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #define TCPSTATES #include +#include #include #ifdef TCP_OFFLOAD @@ -549,8 +550,6 @@ select_rcv_wscale(void) return (wscale); } -extern int always_keepalive; - /* * socket so could be a listening socket too. */ @@ -569,7 +568,7 @@ calc_opt0(struct socket *so, struct vi_info *vi, struc if (so != NULL) { struct inpcb *inp = sotoinpcb(so); struct tcpcb *tp = intotcpcb(inp); - int keepalive = always_keepalive || + int keepalive = tcp_always_keepalive || so_options_get(so) & SO_KEEPALIVE; opt0 |= V_NAGLE((tp->t_flags & TF_NODELAY) == 0); Modified: stable/10/sys/netinet/tcp_timer.c == --- stable/10/sys/netinet/tcp_timer.c Sat Mar 3 00:22:32 2018 (r330302) +++ stable/10/sys/netinet/tcp_timer.c Sat Mar 3 00:54:12 2018 (r330303) @@ -110,9 +110,10 @@ SYSCTL_PROC(_net_inet_tcp, OID_AUTO, rexmit_slop, CTLT &tcp_rexmit_slop, 0, sysctl_msec_to_ticks, "I", "Retransmission Timer Slop"); -static int always_keepalive = 1; +inttcp_always_keepalive = 1; SYSCTL_INT(_net_inet_tcp, OID_AUTO, always_keepalive, CTLFLAG_RW, -&always_keepalive , 0, "Assume SO_KEEPALIVE on all TCP connections"); +&tcp_always_keepalive , 0, "Assume SO_KEEPALIVE on all TCP connections"); +__strong_reference(tcp_always_keepalive, always_keepalive); inttcp_fast_finwait2_recycle = 0; SYSCTL_INT(_net_inet_tcp, OID_AUTO, fast_finwait2_recycle, CTLFLAG_RW, @@ -375,7 +376,8 @@ tcp_timer_keep(void *xtp) TCPSTAT_INC(tcps_keeptimeo); if (tp->t_state < TCPS_ESTABLISHED) goto dropit; - if ((always_keepalive || inp->inp_socket->so_options & SO_KEEPALIVE) && + if ((tcp_always_keepalive || + inp->inp_socket->so_options & SO_KEEPALIVE) && tp->t_state <= TCPS_CLOSING) { if (ticks - tp->t_rcvtime >= TP_KEEPIDLE(tp) + TP_MAXIDLE(tp)) goto dropit; Modified: stable/10/sys/netinet/tcp_timer.h == --- stable/10/sys/netinet/tcp_timer.h Sat Mar 3 00:22:32 2018
svn commit: r330303 - in stable: 10/sys/dev/cxgb/ulp/tom 10/sys/dev/cxgbe/tom 10/sys/netinet 11/sys/dev/cxgb/ulp/tom 11/sys/dev/cxgbe/tom 11/sys/netinet
Author: jhb Date: Sat Mar 3 00:54:12 2018 New Revision: 330303 URL: https://svnweb.freebsd.org/changeset/base/330303 Log: MFC 328608: Export tcp_always_keepalive for use by the Chelsio TOM module. This used to work by accident with ld.bfd even though always_keepalive was marked as static. LLD honors static more correctly, so export this variable properly (including moving it into the tcp_* namespace). Relative to HEAD the MFC includes two additional changes: - The t3_tom module used for cxgb(4) is also patched. - A strong reference from the new name (tcp_always_keepalive) to the old name (always_keepalive) has been added to preserve the KBI for existing modules. Suggested by: kib (strong reference) Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c stable/11/sys/dev/cxgbe/tom/t4_tom.c stable/11/sys/netinet/tcp_timer.c stable/11/sys/netinet/tcp_timer.h Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c stable/10/sys/dev/cxgbe/tom/t4_tom.c stable/10/sys/netinet/tcp_timer.c stable/10/sys/netinet/tcp_timer.h Directory Properties: stable/10/ (props changed) Modified: stable/11/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c == --- stable/11/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.cSat Mar 3 00:22:32 2018(r330302) +++ stable/11/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.cSat Mar 3 00:54:12 2018(r330303) @@ -87,7 +87,6 @@ VNET_DECLARE(int, tcp_autorcvbuf_inc); #define V_tcp_autorcvbuf_inc VNET(tcp_autorcvbuf_inc) VNET_DECLARE(int, tcp_autorcvbuf_max); #define V_tcp_autorcvbuf_max VNET(tcp_autorcvbuf_max) -extern int always_keepalive; /* * For ULP connections HW may add headers, e.g., for digests, that aren't part @@ -840,7 +839,7 @@ calc_opt0h(struct socket *so, int mtu_idx, int rscale, if (so != NULL) { struct inpcb *inp = sotoinpcb(so); struct tcpcb *tp = intotcpcb(inp); - int keepalive = always_keepalive || + int keepalive = tcp_always_keepalive || so_options_get(so) & SO_KEEPALIVE; opt0h |= V_NAGLE((tp->t_flags & TF_NODELAY) == 0); Modified: stable/11/sys/dev/cxgbe/tom/t4_tom.c == --- stable/11/sys/dev/cxgbe/tom/t4_tom.cSat Mar 3 00:22:32 2018 (r330302) +++ stable/11/sys/dev/cxgbe/tom/t4_tom.cSat Mar 3 00:54:12 2018 (r330303) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #define TCPSTATES #include +#include #include #include @@ -535,8 +536,6 @@ select_rcv_wscale(void) return (wscale); } -extern int always_keepalive; - /* * socket so could be a listening socket too. */ @@ -555,7 +554,7 @@ calc_opt0(struct socket *so, struct vi_info *vi, struc if (so != NULL) { struct inpcb *inp = sotoinpcb(so); struct tcpcb *tp = intotcpcb(inp); - int keepalive = always_keepalive || + int keepalive = tcp_always_keepalive || so_options_get(so) & SO_KEEPALIVE; opt0 |= V_NAGLE((tp->t_flags & TF_NODELAY) == 0); Modified: stable/11/sys/netinet/tcp_timer.c == --- stable/11/sys/netinet/tcp_timer.c Sat Mar 3 00:22:32 2018 (r330302) +++ stable/11/sys/netinet/tcp_timer.c Sat Mar 3 00:54:12 2018 (r330303) @@ -116,9 +116,10 @@ SYSCTL_PROC(_net_inet_tcp, OID_AUTO, rexmit_slop, CTLT &tcp_rexmit_slop, 0, sysctl_msec_to_ticks, "I", "Retransmission Timer Slop"); -static int always_keepalive = 1; +inttcp_always_keepalive = 1; SYSCTL_INT(_net_inet_tcp, OID_AUTO, always_keepalive, CTLFLAG_RW, -&always_keepalive , 0, "Assume SO_KEEPALIVE on all TCP connections"); +&tcp_always_keepalive , 0, "Assume SO_KEEPALIVE on all TCP connections"); +__strong_reference(tcp_always_keepalive, always_keepalive); inttcp_fast_finwait2_recycle = 0; SYSCTL_INT(_net_inet_tcp, OID_AUTO, fast_finwait2_recycle, CTLFLAG_RW, @@ -428,7 +429,8 @@ tcp_timer_keep(void *xtp) TCPSTAT_INC(tcps_keeptimeo); if (tp->t_state < TCPS_ESTABLISHED) goto dropit; - if ((always_keepalive || inp->inp_socket->so_options & SO_KEEPALIVE) && + if ((tcp_always_keepalive || + inp->inp_socket->so_options & SO_KEEPALIVE) && tp->t_state <= TCPS_CLOSING) { if (ticks - tp->t_rcvtime >= TP_KEEPIDLE(tp) + TP_MAXIDLE(tp)) goto dropit; Modified: stable/11/sys/netinet/tcp_timer.h == --- stable/11/sys/netinet/tcp_timer.h Sat Mar 3 00:22:32 2018 (r
svn commit: r330304 - in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/imcsmb sys/i386/conf sys/modules/i2c/controllers sys/modules/i2c/controllers/imcsmb
Author: rpokala Date: Sat Mar 3 01:53:51 2018 New Revision: 330304 URL: https://svnweb.freebsd.org/changeset/base/330304 Log: imcsmb(4): Intel integrated Memory Controller (iMC) SMBus controller driver imcsmb(4) provides smbus(4) support for the SMBus controller functionality in the integrated Memory Controllers (iMCs) embedded in Intel Sandybridge- Xeon, Ivybridge-Xeon, Haswell-Xeon, and Broadwell-Xeon CPUs. Each CPU implements one or more iMCs, depending on the number of cores; each iMC implements two SMBus controllers (iMC-SMBs). *** IMPORTANT NOTE *** Because motherboard firmware or the BMC might try to use the iMC-SMBs for monitoring DIMM temperatures and/or managing an NVDIMM, the driver might need to temporarily disable those functions, or take a hardware interlock, before using the iMC-SMBs. Details on how to do this may vary from board to board, and the procedure may be proprietary. It is strongly suggested that anyone wishing to use this driver contact their motherboard vendor, and modify the driver as described in the manual page and in the driver itself. (For what it's worth, the driver as-is has been tested on various SuperMicro motherboards.) Reviewed by: avg, jhb MFC after:1 week Relnotes: yes Sponsored by: Panasas Differential Revision:https://reviews.freebsd.org/D14447 Discussed with: avg, ian, jhb Tested by:allanjude (previous version), Panasas Added: head/share/man/man4/imcsmb.4 (contents, props changed) head/sys/dev/imcsmb/ head/sys/dev/imcsmb/imcsmb.c (contents, props changed) head/sys/dev/imcsmb/imcsmb_pci.c (contents, props changed) head/sys/dev/imcsmb/imcsmb_reg.h (contents, props changed) head/sys/dev/imcsmb/imcsmb_var.h (contents, props changed) head/sys/modules/i2c/controllers/imcsmb/ head/sys/modules/i2c/controllers/imcsmb/Makefile (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/amd64/conf/NOTES head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/i386/conf/NOTES head/sys/modules/i2c/controllers/Makefile Modified: head/share/man/man4/Makefile == --- head/share/man/man4/MakefileSat Mar 3 00:54:12 2018 (r330303) +++ head/share/man/man4/MakefileSat Mar 3 01:53:51 2018 (r330304) @@ -218,6 +218,7 @@ MAN=aac.4 \ iicbus.4 \ iicsmb.4 \ iir.4 \ + ${_imcsmb.4} \ inet.4 \ inet6.4 \ intpm.4 \ @@ -824,6 +825,7 @@ _if_vmx.4= if_vmx.4 _if_vtnet.4= if_vtnet.4 _if_vxge.4=if_vxge.4 _if_wpi.4= if_wpi.4 +_imcsmb.4= imcsmb.4 _ipmi.4= ipmi.4 _io.4= io.4 _linux.4= linux.4 Added: head/share/man/man4/imcsmb.4 == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/imcsmb.4Sat Mar 3 01:53:51 2018 (r330304) @@ -0,0 +1,133 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2018 Panasas +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\"notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\"notice, this list of conditions and the following disclaimer in the +.\"documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd March 2, 2018 +.Dt IMCSMB 4 +.Os +.Sh NAME +.Nm imcsmb +.Nd Intel integrated Memory Controller (iMC) SMBus controller driver +.Sh SYNOPSIS +.Cd device pci +.Cd device smbus +.Cd device imcsmb +.Pp +Alternatively, to load the driver as a module at boot time, place the following +line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +imcsmb_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides +.Xr smbus 4 +support for the SMBus controller functionality in the integrated
svn commit: r330305 - in head/sys/powerpc: powerpc ps3
Author: nwhitehorn Date: Sat Mar 3 02:04:40 2018 New Revision: 330305 URL: https://svnweb.freebsd.org/changeset/base/330305 Log: Remove assumption that all physical memory is available to the kernel and that the physical and available memory arrays are interchangeable. Modified: head/sys/powerpc/powerpc/platform.c head/sys/powerpc/ps3/ps3bus.c Modified: head/sys/powerpc/powerpc/platform.c == --- head/sys/powerpc/powerpc/platform.c Sat Mar 3 01:53:51 2018 (r330304) +++ head/sys/powerpc/powerpc/platform.c Sat Mar 3 02:04:40 2018 (r330305) @@ -156,10 +156,14 @@ mem_regions(struct mem_region **phys, int *physsz, str } } - *phys = pregions; - *avail = aregions; - *physsz = npregions; - *availsz = naregions; + if (phys != NULL) + *phys = pregions; + if (avail != NULL) + *avail = aregions; + if (physsz != NULL) + *physsz = npregions; + if (availsz != NULL) + *availsz = naregions; } int Modified: head/sys/powerpc/ps3/ps3bus.c == --- head/sys/powerpc/ps3/ps3bus.c Sat Mar 3 01:53:51 2018 (r330304) +++ head/sys/powerpc/ps3/ps3bus.c Sat Mar 3 02:04:40 2018 (r330305) @@ -337,7 +337,7 @@ ps3bus_attach(device_t self) rman_manage_region(&sc->sc_intr_rman, 0, ~0); /* Get memory regions for DMA */ - mem_regions(&sc->regions, &sc->rcount, &sc->regions, &sc->rcount); + mem_regions(&sc->regions, &sc->rcount, NULL, NULL); /* * Probe all the PS3's buses. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r330306 - head/sys/powerpc/ps3
Author: nwhitehorn Date: Sat Mar 3 02:06:48 2018 New Revision: 330306 URL: https://svnweb.freebsd.org/changeset/base/330306 Log: Honor physical memory regions marked unavailable in the FDT, when present. The most notable of these is the FDT itself, which it is a bad idea to overwrite. Modified: head/sys/powerpc/ps3/platform_ps3.c Modified: head/sys/powerpc/ps3/platform_ps3.c == --- head/sys/powerpc/ps3/platform_ps3.c Sat Mar 3 02:04:40 2018 (r330305) +++ head/sys/powerpc/ps3/platform_ps3.c Sat Mar 3 02:06:48 2018 (r330306) @@ -141,37 +141,38 @@ void ps3_mem_regions(platform_t plat, struct mem_region *phys, int *physsz, struct mem_region *avail_regions, int *availsz) { - uint64_t lpar_id, junk, ppe_id; + uint64_t lpar_id, junk; + int i; - /* Get real mode memory region */ - avail_regions[0].mr_start = 0; - lv1_get_logical_partition_id(&lpar_id); - lv1_get_logical_ppe_id(&ppe_id); - lv1_get_repository_node_value(lpar_id, - lv1_repository_string("bi") >> 32, lv1_repository_string("pu"), - ppe_id, lv1_repository_string("rm_size"), - &avail_regions[0].mr_size, &junk); + /* Prefer device tree information if available */ + if (OF_finddevice("/") != -1) { + ofw_mem_regions(phys, physsz, avail_regions, availsz); + } else { + /* Real mode memory region is first segment */ + phys[0].mr_start = 0; + phys[0].mr_size = ps3_real_maxaddr(plat); + *physsz = *availsz = 1; + avail_regions[0] = phys[0]; + } /* Now get extended memory region */ + lv1_get_logical_partition_id(&lpar_id); lv1_get_repository_node_value(lpar_id, lv1_repository_string("bi") >> 32, lv1_repository_string("rgntotal"), 0, 0, - &avail_regions[1].mr_size, &junk); + &phys[*physsz].mr_size, &junk); + for (i = 0; i < *physsz; i++) + phys[*physsz].mr_size -= phys[i].mr_size; /* Convert to maximum amount we can allocate in 16 MB pages */ - avail_regions[1].mr_size -= avail_regions[0].mr_size; - avail_regions[1].mr_size -= avail_regions[1].mr_size % (16*1024*1024); + phys[*physsz].mr_size -= phys[*physsz].mr_size % (16*1024*1024); /* Allocate extended memory region */ - lv1_allocate_memory(avail_regions[1].mr_size, 24 /* 16 MB pages */, - 0, 0x04 /* any address */, &avail_regions[1].mr_start, &junk); - - *availsz = 2; - - if (phys != NULL) { - memcpy(phys, avail_regions, sizeof(*phys)*2); - *physsz = 2; - } + lv1_allocate_memory(phys[*physsz].mr_size, 24 /* 16 MB pages */, + 0, 0x04 /* any address */, &phys[*physsz].mr_start, &junk); + avail_regions[*availsz] = phys[*physsz]; + (*physsz)++; + (*availsz)++; } static u_long @@ -260,12 +261,22 @@ ps3_reset(platform_t plat) static vm_offset_t ps3_real_maxaddr(platform_t plat) { - struct mem_region *phys, *avail; - int nphys, navail; + uint64_t lpar_id, junk, ppe_id; + static uint64_t rm_maxaddr = 0; - mem_regions(&phys, &nphys, &avail, &navail); + if (rm_maxaddr == 0) { + /* Get real mode memory region */ + lv1_get_logical_partition_id(&lpar_id); + lv1_get_logical_ppe_id(&ppe_id); - return (phys[0].mr_start + phys[0].mr_size); + lv1_get_repository_node_value(lpar_id, + lv1_repository_string("bi") >> 32, + lv1_repository_string("pu"), + ppe_id, lv1_repository_string("rm_size"), + &rm_maxaddr, &junk); + } + + return (rm_maxaddr); } static void ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r330307 - in stable/11: share/man/man4 sys/conf sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/cudbg sys/dev/cxgbe/firmware sys/dev/cxgbe/iw_cxgbe sys/dev/cxgbe/tom sys/modules/cxgbe/...
Author: np Date: Sat Mar 3 02:30:52 2018 New Revision: 330307 URL: https://svnweb.freebsd.org/changeset/base/330307 Log: MFC r319506, r319872, r321063, r321103, r321179, r321390, r321435, r321582, r321671, r322014, r322034, r322055, r322123, r322167, r322425, r322549, r322914, r322960, r322962, r322964, r322985, r322990, r323006, r323026, r323041, r323069, r323078, r323343, r323514, r323520, r324296, r324379, r324386, r324443, r324945, r325596, r325680, r325880, r325883-r325884, r325961, r326026, r326042, r327062, r327093, r327332, r327528, r328420, and r328423. r319506: cxgbe(4): Update the statistics for compound tx work requests once per work request, not once per frame. r319872: cxgbe(4): Do not request an FEC setting that the port does not support. r321063: cxgbe(4): Various link/media related improvements. - Deal with changes to port_type, and not just port_mod when a transceiver is changed. This fixes hot swapping of transceivers of different types (QSFP+ or QSA or QSFP28 in a QSFP28 port, SFP+ or SFP28 in a SFP28 port, etc.). - Always refresh media information for ifconfig if the port is down. The firmware does not generate tranceiver-change interrupts unless at least one VI is enabled on the physical port. Before this change ifconfig diplayed potentially stale information for ports that were administratively down. - Always recalculate and reapply L1 config on a transceiver change. - Display PAUSE settings in ifconfig. The driver sysctls for this continue to work as well. r321103: cxgbe(4): New ioctls to flash bootrom and boot config to the card. r321179: cxgbe/t4_tom: Log more details about the newly ESTABLISHED tid to the trace buffer. r321390: cxgbe(4): Install the firmware bundled with the driver to the card if it doesn't seem to have one. This lets the driver recover automatically from incomplete firmware upgrades (panic, reboot, power loss, etc. in the middle of an upgrade). r321435: cxgbe(4): Display some more TOE parameters related to retransmission and keepalive in the sysctl MIB. Provide tunables to change some of these parameters. These are supposed to be setup by the firmware so these tunables are for experimentation only. r321582: cxgbe(4): Some updates to the common code. - Updated register ranges. - Helper routines for access to TP registers. - Updated routine to read flash parameters. r321671: cxgbe/iw_cxgbe: Log the end point's history and flags to the trace buffer just before it's freed. r322014: 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. r322034: cxgbe(4): Always use the first and not the last virtual interface associated with a port in begin_synchronized_op. r322055: 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. r322123: cxgbe(4): Avoid a NULL dereference that would occur during module unload if there were problems earlier during attach. r322167: cxgbe(4): Add the T6 and T5 Unified Wire configuration files to the kernel, just like for T4, when the driver is compiled into the kernel. r322425: cxgbe(4): Save the last reported link parameters and compare them with the current state to determine whether to generate a link-state change notification. This fixes a bug introduced in r321063 that caused the driver to sometimes skip these notifications. r322549: cxgbe/t4_tom: Use correct name for the ISS-valid bit in options2. r322914: cxgbe(4): Dump the mailbox contents in the same format as CH_DUMP_MBOX. r322960: cxgbe(4): Verify that the driver accesses the firmware mailbox in a thread-safe manner. r322962: cxgbe(4): Remove write only variable from t4_port_init. r322964: cxgbe(4): vi_mac_funcs should include the base Ethernet function. It is already used in the driver as if it does. r322985: cxgbe(4): Maintain one ifmedia per physical port instead of one per Virtual Interface (VI). All autonomous VIs that share a port share the same media. r322990: cxgbe(4): Do not access the mailbox without appropriate locks while creating hardware VIs. This fixes a bad race on systems with hw.cxgbe.num_vis > 1. r323006: cxgbe(4): Update T6/T5/T4 firmwares to 1.16.59.0. r323026: cxgbe(4): Zero out the memory allocated for the debug dump. cudbg_collect seems to expect it this way. r323041: cxgbe(4): Add two new debug flags -- one to allow manual firmware install after full initialization, and ano
svn commit: r330308 - stable/11/sys/dev/cxgb
Author: np Date: Sat Mar 3 02:39:54 2018 New Revision: 330308 URL: https://svnweb.freebsd.org/changeset/base/330308 Log: MFC r328315: cxgb(4): Validate offset/len in the GET_EEPROM ioctl. Modified: stable/11/sys/dev/cxgb/cxgb_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgb/cxgb_main.c == --- stable/11/sys/dev/cxgb/cxgb_main.c Sat Mar 3 02:30:52 2018 (r330307) +++ stable/11/sys/dev/cxgb/cxgb_main.c Sat Mar 3 02:39:54 2018 (r330308) @@ -2958,8 +2958,14 @@ cxgb_extension_ioctl(struct cdev *dev, unsigned long c case CHELSIO_GET_EEPROM: { int i; struct ch_eeprom *e = (struct ch_eeprom *)data; - uint8_t *buf = malloc(EEPROMSIZE, M_DEVBUF, M_NOWAIT); + uint8_t *buf; + if (e->offset & 3 || e->offset >= EEPROMSIZE || + e->len > EEPROMSIZE || e->offset + e->len > EEPROMSIZE) { + return (EINVAL); + } + + buf = malloc(EEPROMSIZE, M_DEVBUF, M_NOWAIT); if (buf == NULL) { return (ENOMEM); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r330309 - in head/share/man: man4 man9
Author: gonzo Date: Sat Mar 3 02:49:49 2018 New Revision: 330309 URL: https://svnweb.freebsd.org/changeset/base/330309 Log: [fdt_pinctrl] Add man pages for fdt_pinctrl driver - Add fdt_pinctrl(4) with general information for the driver - Add fdt_pinctrl(9) with fdt_pinctrl KPI description Reviewed by: ian, manu, wblock MFC after:2 weeks Differential Revision:https://reviews.freebsd.org/D14235 Added: head/share/man/man4/fdt_pinctrl.4 (contents, props changed) head/share/man/man9/fdt_pinctrl.9 (contents, props changed) Modified: head/share/man/man4/Makefile head/share/man/man9/Makefile Modified: head/share/man/man4/Makefile == --- head/share/man/man4/MakefileSat Mar 3 02:39:54 2018 (r330308) +++ head/share/man/man4/MakefileSat Mar 3 02:49:49 2018 (r330309) @@ -165,6 +165,7 @@ MAN=aac.4 \ fd.4 \ fdc.4 \ fdt.4 \ + fdt_pinctrl.4 \ fdtbus.4 \ ffclock.4 \ filemon.4 \ Added: head/share/man/man4/fdt_pinctrl.4 == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/fdt_pinctrl.4 Sat Mar 3 02:49:49 2018 (r330309) @@ -0,0 +1,127 @@ +.\" Copyright (c) 2018 Oleksandr Tymoshenko +.\" 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 AUTHORS 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 AUTHORS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd March 2, 2018 +.Dt "FDT_PINCTRL" 4 +.Os +.Sh NAME +.Nm fdt_pinctrl +.Nd FDT I/O pin multiplexing support +.Sh SYNOPSIS +.Cd "device fdt_pinctrl" +.Sh DESCRIPTION +.Pp +Pin multiplexing is a technology used to re-purpose a single +physical connection (depending on chip packaging it may be +pin, ball, or pad) to pull signal from one of SoC internal +controllers to peripheral devices. +For example, based on the actual device design, a single SoC chip +pin can perform any of these roles: SPI clock, I2C +data, GPIO pin, or PWM signal. +Function selection is performed by the pinmux controller, a SoC +hardware block, usually controlled a set of registers. +Pinmux controller capabilities and register format depend +on the actual hardware implementation. +.Pp +On +.Xr fdt 4 +based systems, the pinmux controller is represented by a node in +the device tree. +It may have any number of child nodes representing pin +configuration groups. +Properties of such nodes are hardware-specific and handled +by individual pinctrl drivers. +.Ss Example 1 +Pinmux controller device tree node +.Bd -literal +pinctrl@7e22 { +compatible = "vndr,soc1715-pinctrl"; +reg = <0x7e22 0x100> + +spi0_pins: spi0 { +vndr,pins = <11 12> +vndr,functions = +} + +i2c0_pins: i2c0 { +... +} +} +.Ed +.Pp +Client devices are hardware devices that require certain pin +configurations to function properly. +Depending on the state the device is in (active, idle) it might +require different pin configurations. +Each configuration is described by setting the pinctrl-N +property to the list of phandles pointing to specific child +nodes of the pinmux controller node. +N is an integer value starting with 0 and incremented by 1 +for every new set of pin configurations. +pinctrl-0 is a default configuration that is applied in the +.Xr fdt_pinctrl_configure_tree 9 +call. +In addition to referring to pin configurations by index, they +can be referred to by name if the pinctrl-names property is set. +The value of pinctrl-names is a list of strings with names for +each pinctrl-N property. +Client devices can request specific configuration using +.Xr fdt_
Re: svn commit: r330285 - head/sys/sys
On Fri, 2 Mar 2018, Konstantin Belousov wrote: On Fri, Mar 02, 2018 at 12:43:34PM -0500, Pedro Giffuni wrote: ... I think use of _Nonnull attributes in the threading functions may also be a waste (I introduced them mostly to be compatible with Android). FWIW, Dragonfly sprinkled some restrict there recently: http://gitweb.dragonflybsd.org/dragonfly.git/commit/d33005aaee6af52c80428b59b52aee522c002492 Just in case someone is considering more cleanups. This is not a cleanup for me, but a needed change. Right now x86 copyouts are implemented in asm, so whatever damage is done to the prototypes, only effect is at the caller side. In my work, i386 copyouts are done in C, so it starts matter. That seems slow, especially for small sizes as are common for syscall args (in 1 of my versions, copyin() of args is optimized to fuword() in a loop, and fuword() is optimized to not use pcb_onfault, so it is not much more than 1 memory access. However, in your i386 version this optimization would be negative since the slow part is switching the map, so fuword() should never be used to access multiple words). However, copyinstr() and copystr() should never have been "optimized" by writing them in asm. On x86, their asm is badly written so they are slower than simple C versions except on 8088's and maybe 8086's and maybe on the original i386. (8088's were limited mainly by instruction bandwidth and the original i386 wasn't much better, so short CISC instructions like lodsb and stosb tended to be faster than larger separate instructions despite their large setup overheads. Also I looked at the dragonfly commit because I become curious what do you mean by threading functions. The first example was intpthread_attr_getguardsize(const pthread_attr_t * __restrict, - size_t *); + size_t * __restrict); POSIX agrees with the dragonfly change, but I do not understand it. Aliasing rules already disallow the first and second arguments to point to the same memory, because they have different types. (1) thread_attr_t is opaque, so the types might be the same. (2) pthread_attr_t might be a pointer to a struct/union containing a size_t. (3) perhaps other reasons. I'm not sure how 'restrict interacts with global variables or even it it prevents the interaction in (2). A previous discussion showed that const doesn't make types different enough to prevent aliasing. Similarly for volatile. Similarly for other pointers to {opaque, struct/union, or even integer} types. size_t can't be aliased to int, but it can be aliased to any unsigned type in C and to any unsigned type not smaller than uint16_t in POSIX (POSIX but not C requires u_char == uint8_t, so size_t can't be u_char in POSIX but it can be u_char in C). Bruce ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r330310 - stable/11/usr.sbin/cxgbetool
Author: np Date: Sat Mar 3 03:12:19 2018 New Revision: 330310 URL: https://svnweb.freebsd.org/changeset/base/330310 Log: MFC r321105: cxgbetool(8): Add loadboot and loadboot-cfg subcommands to install or remove bootrom and boot config. Modified: stable/11/usr.sbin/cxgbetool/cxgbetool.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/cxgbetool/cxgbetool.c == --- stable/11/usr.sbin/cxgbetool/cxgbetool.cSat Mar 3 02:49:49 2018 (r330309) +++ stable/11/usr.sbin/cxgbetool/cxgbetool.cSat Mar 3 03:12:19 2018 (r330310) @@ -96,6 +96,10 @@ usage(FILE *fp) "\tfilter list list all filters\n" "\tfilter mode [] ... get/set global filter mode\n" "\ti2c[] read from i2c device\n" + "\tloadboot [pf|offset ] install boot image\n" + "\tloadboot clear [pf|offset ]remove boot image\n" + "\tloadboot-cfginstall boot config\n" + "\tloadboot-cfg clear remove boot config\n" "\tloadcfg install configuration file\n" "\tloadcfg clear remove configuration file\n" "\tloadfwinstall firmware\n" @@ -1944,6 +1948,107 @@ done: return (rc); } +static int +loadboot(int argc, const char *argv[]) +{ + int rc, fd; + long l; + char *p; + struct t4_bootrom br = {0}; + const char *fname = argv[0]; + struct stat st = {0}; + + if (argc == 1) { + br.pf_offset = 0; + br.pfidx_addr = 0; + } else if (argc == 3) { + if (!strcmp(argv[1], "pf")) + br.pf_offset = 0; + else if (!strcmp(argv[1], "offset")) + br.pf_offset = 1; + else + return (EINVAL); + + p = str_to_number(argv[2], &l, NULL); + if (*p) + return (EINVAL); + br.pfidx_addr = l; + } else { + warnx("loadboot: incorrect number of arguments."); + return (EINVAL); + } + + if (strcmp(fname, "clear") == 0) + return (doit(CHELSIO_T4_LOAD_BOOT, &br)); + + fd = open(fname, O_RDONLY); + if (fd < 0) { + warn("open(%s)", fname); + return (errno); + } + + if (fstat(fd, &st) < 0) { + warn("fstat"); + close(fd); + return (errno); + } + + br.len = st.st_size; + br.data = mmap(0, br.len, PROT_READ, MAP_PRIVATE, fd, 0); + if (br.data == MAP_FAILED) { + warn("mmap"); + close(fd); + return (errno); + } + + rc = doit(CHELSIO_T4_LOAD_BOOT, &br); + munmap(br.data, br.len); + close(fd); + return (rc); +} + +static int +loadbootcfg(int argc, const char *argv[]) +{ + int rc, fd; + struct t4_data bc = {0}; + const char *fname = argv[0]; + struct stat st = {0}; + + if (argc != 1) { + warnx("loadbootcfg: incorrect number of arguments."); + return (EINVAL); + } + + if (strcmp(fname, "clear") == 0) + return (doit(CHELSIO_T4_LOAD_BOOTCFG, &bc)); + + fd = open(fname, O_RDONLY); + if (fd < 0) { + warn("open(%s)", fname); + return (errno); + } + + if (fstat(fd, &st) < 0) { + warn("fstat"); + close(fd); + return (errno); + } + + bc.len = st.st_size; + bc.data = mmap(0, bc.len, PROT_READ, MAP_PRIVATE, fd, 0); + if (bc.data == MAP_FAILED) { + warn("mmap"); + close(fd); + return (errno); + } + + rc = doit(CHELSIO_T4_LOAD_BOOTCFG, &bc); + munmap(bc.data, bc.len); + close(fd); + return (rc); +} + /* * Display memory as list of 'n' 4-byte values per line. */ @@ -2818,6 +2923,10 @@ run_cmd(int argc, const char *argv[]) rc = sched_queue(argc, argv); else if (!strcmp(cmd, "loadcfg")) rc = loadcfg(argc, argv); + else if (!strcmp(cmd, "loadboot")) + rc = loadboot(argc, argv); + else if (!strcmp(cmd, "loadboot-cfg")) + rc = loadbootcfg(argc, argv); else if (!strcmp(cmd, "dumpstate")) rc = dumpstate(argc, argv); else { ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r330294 - head/sys/kern
On Fri, 2 Mar 2018, Mateusz Guzik wrote: Log: sx: fix adaptive spinning broken in r327397 The condition was flipped. In particular heavy multithreaded kernel builds on zfs started suffering due to nested sx locks. For instance make -s -j 128 buildkernel: before: 3326.67s user 1269.62s system 6981% cpu 1:05.84 total after: 3365.55s user 911.27s system 6871% cpu 1:02.24 total What are you doing to make builds so slow? Kernel builds here take about 5 seconds. A full world takes about 120 seconds. This is with old (~5.2) worlds. (I don't like newer worlds since they are so much slower. Yesterday I did more than 200 makeworlds looking for a lost wakeup for idle threads. When makeworld has a sys time of 50-100 seconds, it is hard to see the effect of optimizations in the noise. I recently rewrote the statistics reporting to show real, user, sys, interrupt, total = sum of these and idle times for the whole system. Based on kern.cp_time. This is innaccurate, but it is much better than rusage times which can't show times for other threads or even interrupt and idle times for threads in the build's tree. Results look like: 128.57r 566.24u 77.10s 0.83i 644.17t 384.36I 408X i386-12-cold-102-40 168.53r 559.01u 76.95s 1.07i 637.03t 711.19I 735X i386-12-cold-102-40 Here I is the idle time according to kern.cp_time and X is the idle time according to td_runtime. The latter is much more accurate and shows that there is an error of about 24 seconds = 24 * (stathz = 127) = 3048 ticks in the u+s+i vs I ticks (u+s+i is too high by 24 seconds or 3 seconds per CPU, and I is too low by 24 seconds). The second run shows an enormous variance in the idle time -- of 327 seconds or 41 seconds per CPU. This pessimization was mostly the result of enabling PREEMPTION and IPI_PREEMPTION, which was supposed to decrease the variance. Normally I turn these off to reduce context switches, and this somehow reduces the variance to more like 5 seconds per CPU. Context switches turned out to be mostly for waking up idle threads and this should not be affected by PREEMPTION, and my optimization of turning off PREEMPTION makes little difference. That it helps on average and for the best case was determined by running many more than a few hundred makeworlds. Increasing kern.sched.quantum makes similarly little difference. I don't normally use that since it was a pessimization on average. Now I think I understand why it is a pessimization: it saves a little u+s+i time by reducing context switches, but increases I time by reducing compensation for the missing wakeups. These benchmarks are with 4BSD. ULE is slightly slower and has lower variance but its variance is high enough to indicate missed wakeups. I can reduce the variance using spinloops, so that idle threads never sleep. This only works with HTT turned off (the above is wirh 4 cores times 2 threads). With HTT on, spinloops in idle threads slow down running threads by abiut 50%. ULE is aware of this and avoids internal spinloops for HTT cases. 4BSD and lower levels are not aware of this, but it takes the misconfigurations machdep.idle_mwait=0 and machdep.idle= spin to reach the spinloop case. Some times for ULE: 127.06r 565.81u 79.40s 0.65i 645.86t 370.58I 394X i386-12-cold-102-40 125.83r 566.72u 79.10s 0.61i 646.43t 360.24I 382X i386-12-warm-102-40 130.33r 565.56u 79.41s 0.65i 645.62t 397.02I 417X i386-12-cold-102-40 118.70r 566.55u 80.46s 0.54i 647.56t 302.05I 325X i386-12-warm-102-40 127.09r 569.36u 77.07s 0.98i 647.41t 369.28I 390X i386-12-cold-102-40 115.80r 570.67u 79.17s 0.63i 650.46t 275.90I 297X i386-12-warm-102-40 115.80r is the best time seen recently. The u+s+i = t times average a couple of seconds higher for ULE. This is not quite in the noise -- 2 seconds for 8 CPUs is 0.25 seconds in real time. The noise in the I time dominates the signal in the u+s+i = t times, so it isn't clear if ULE is doing anything better or worse. If the u+s+i times can be trusted, then ULE's affinity optimizations are apparently negative. I have some optimizations in 4BSD too. These might be negative too. One seemed to work, but only on 1 system, and recent benchmarks indicated that this is just because it accidentally reduced lost wakeups. Its improvements for u+s+i are in the noise. Bruce ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r330311 - in stable/11/stand/pc98: . boot0 boot0.5 boot2 btx/btx btx/btxldr btx/lib cdboot kgzldr libpc98 loader pc98boot
Author: kevans Date: Sat Mar 3 06:37:53 2018 New Revision: 330311 URL: https://svnweb.freebsd.org/changeset/base/330311 Log: stand: Make pc98 build This is a direct commit to stable/11 due to pc98 removal from head. Several improvements in head that were MFC'd left the pc98 build broken in stable/11. Massage the pc98 bits to get it to at least build. Deleted: stable/11/stand/pc98/libpc98/time.c Modified: stable/11/stand/pc98/Makefile stable/11/stand/pc98/Makefile.inc stable/11/stand/pc98/boot0.5/Makefile stable/11/stand/pc98/boot0/Makefile stable/11/stand/pc98/boot2/Makefile stable/11/stand/pc98/btx/btx/Makefile stable/11/stand/pc98/btx/btxldr/Makefile stable/11/stand/pc98/btx/lib/Makefile stable/11/stand/pc98/cdboot/Makefile stable/11/stand/pc98/kgzldr/Makefile stable/11/stand/pc98/libpc98/Makefile stable/11/stand/pc98/loader/Makefile stable/11/stand/pc98/loader/main.c stable/11/stand/pc98/pc98boot/Makefile Modified: stable/11/stand/pc98/Makefile == --- stable/11/stand/pc98/Makefile Sat Mar 3 03:12:19 2018 (r330310) +++ stable/11/stand/pc98/Makefile Sat Mar 3 06:37:53 2018 (r330311) @@ -1,5 +1,9 @@ # $FreeBSD$ +NO_OBJ=t + +.include + SUBDIR=boot0 boot0.5 pc98boot btx boot2 cdboot kgzldr libpc98 loader .include Modified: stable/11/stand/pc98/Makefile.inc == --- stable/11/stand/pc98/Makefile.inc Sat Mar 3 03:12:19 2018 (r330310) +++ stable/11/stand/pc98/Makefile.inc Sat Mar 3 06:37:53 2018 (r330311) @@ -2,28 +2,24 @@ # # $FreeBSD$ -BINDIR?= /boot - LOADER_ADDRESS?=0x20 -CFLAGS+= -march=i386 -ffreestanding -CFLAGS.gcc+= -mpreferred-stack-boundary=2 -CFLAGS+= ${CFLAGS_NO_SIMD} -msoft-float -CFLAGS+= -Os -DPC98 LDFLAGS+= -nostdlib # BTX components -.if exists(${.OBJDIR}/../btx) -BTXDIR=${.OBJDIR}/../btx -.else -BTXDIR=${.CURDIR}/../btx -.endif +BTXDIR=${BOOTOBJ}/pc98/btx BTXLDR=${BTXDIR}/btxldr/btxldr BTXKERN= ${BTXDIR}/btx/btx + +BTXSRC=${BOOTSRC}/pc98/btx BTXCRT=${BTXDIR}/lib/crt0.o # compact binary with no padding between text, data, bss -LDSCRIPT= ${SRCTOP}/stand/i386/boot.ldscript -LDFLAGS_BIN=-e start -Ttext ${ORG} -Wl,-T,${LDSCRIPT},-S,--oformat,binary -LD_FLAGS_BIN=-static -T ${LDSCRIPT} --gc-sections +LDSCRIPT= ${BOOTSRC}/i386/boot.ldscript +#LDFLAGS_BIN=-e start -Ttext ${ORG} -Wl,-T,${LDSCRIPT},-S,--oformat,binary +LDFLAGS_BIN=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary +#LD_FLAGS_BIN=-static -T ${LDSCRIPT} --gc-sections +LD_FLAGS_BIN=-static -N --gc-sections + +WARNS?=0 .include "../Makefile.inc" Modified: stable/11/stand/pc98/boot0.5/Makefile == --- stable/11/stand/pc98/boot0.5/Makefile Sat Mar 3 03:12:19 2018 (r330310) +++ stable/11/stand/pc98/boot0.5/Makefile Sat Mar 3 06:37:53 2018 (r330311) @@ -3,10 +3,9 @@ PROG= ${BOOT}.out INTERNALPROG= FILES= ${BOOT} -MAN= SRCS= start.s boot.s boot0.5.s disk.s selector.s support.s syscons.s \ putssjis.s -CLEANFILES= ${BOOT} ${BOOT}.bin +CLEANFILES+= ${BOOT} ${BOOT}.bin BOOT= boot0.5 @@ -14,7 +13,7 @@ BOOT= boot0.5 # unless you are glutton for punishment. BOOT_BOOT0_ORG?= 0x -LDFLAGS=-e start -Ttext ${BOOT_BOOT0_ORG} -Wl,-N,-T,${.CURDIR}/ldscript +LDFLAGS+=-e start -Ttext ${BOOT_BOOT0_ORG} -Wl,-N,-T,${.CURDIR}/ldscript # The size of boot0.5 must be 7168 bytes ${BOOT}: ${BOOT}.bin Modified: stable/11/stand/pc98/boot0/Makefile == --- stable/11/stand/pc98/boot0/Makefile Sat Mar 3 03:12:19 2018 (r330310) +++ stable/11/stand/pc98/boot0/Makefile Sat Mar 3 06:37:53 2018 (r330311) @@ -3,9 +3,8 @@ PROG= ${BOOT} INTERNALPROG= FILES= ${BOOT} -MAN= SRCS= ${BOOT}.s -CLEANFILES= ${BOOT} +CLEANFILES+= ${BOOT} BOOT= boot0 @@ -14,6 +13,6 @@ BOOT= boot0 BOOT_BOOT0_ORG?= 0x ORG=${BOOT_BOOT0_ORG} -LDFLAGS=${LDFLAGS_BIN} +LDFLAGS+=${LDFLAGS_BIN} .include Modified: stable/11/stand/pc98/boot2/Makefile == --- stable/11/stand/pc98/boot2/Makefile Sat Mar 3 03:12:19 2018 (r330310) +++ stable/11/stand/pc98/boot2/Makefile Sat Mar 3 06:37:53 2018 (r330311) @@ -27,10 +27,11 @@ CFLAGS= -fomit-frame-pointer \ -DSIOPRT=${BOOT_COMCONSOLE_PORT} \ -DSIOFMT=${B2SIOFMT} \ -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \ - -I${.CURDIR}/../../.. \ - -I${.CURDIR}/../../i386/boot2 \ - -I${.CURDIR}/../../common \ - -I${.CURDIR}/../btx/lib -I. \ +