svn commit: r352866 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet
Author: cy Date: Sun Sep 29 03:41:15 2019 New Revision: 352866 URL: https://svnweb.freebsd.org/changeset/base/352866 Log: MFC r352737: ipf mistakenly regards UDP packets with a checksum of 0x as bad. Obtained from:NetBSD fil.c r1.30, NetBSD PR/54443 Modified: stable/11/sys/contrib/ipfilter/netinet/fil.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/contrib/ipfilter/netinet/fil.c stable/12/sys/contrib/ipfilter/netinet/fil.c Directory Properties: stable/10/ (props changed) stable/12/ (props changed) Modified: stable/11/sys/contrib/ipfilter/netinet/fil.c == --- stable/11/sys/contrib/ipfilter/netinet/fil.cSun Sep 29 03:36:50 2019(r352865) +++ stable/11/sys/contrib/ipfilter/netinet/fil.cSun Sep 29 03:41:15 2019(r352866) @@ -6730,8 +6730,11 @@ ipf_checkl4sum(fin) /*NOTREACHED*/ } - if (csump != NULL) + if (csump != NULL) { hdrsum = *csump; + if (fin->fin_p == IPPROTO_UDP && hdrsum == 0x) + hdrsum = 0x; + } if (dosum) { sum = fr_cksum(fin, fin->fin_ip, fin->fin_p, fin->fin_dp); ___ 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: r352866 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet
Author: cy Date: Sun Sep 29 03:41:15 2019 New Revision: 352866 URL: https://svnweb.freebsd.org/changeset/base/352866 Log: MFC r352737: ipf mistakenly regards UDP packets with a checksum of 0x as bad. Obtained from:NetBSD fil.c r1.30, NetBSD PR/54443 Modified: stable/12/sys/contrib/ipfilter/netinet/fil.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/contrib/ipfilter/netinet/fil.c stable/11/sys/contrib/ipfilter/netinet/fil.c Directory Properties: stable/10/ (props changed) stable/11/ (props changed) Modified: stable/12/sys/contrib/ipfilter/netinet/fil.c == --- stable/12/sys/contrib/ipfilter/netinet/fil.cSun Sep 29 03:36:50 2019(r352865) +++ stable/12/sys/contrib/ipfilter/netinet/fil.cSun Sep 29 03:41:15 2019(r352866) @@ -6730,8 +6730,11 @@ ipf_checkl4sum(fin) /*NOTREACHED*/ } - if (csump != NULL) + if (csump != NULL) { hdrsum = *csump; + if (fin->fin_p == IPPROTO_UDP && hdrsum == 0x) + hdrsum = 0x; + } if (dosum) { sum = fr_cksum(fin, fin->fin_ip, fin->fin_p, fin->fin_dp); ___ 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: r352866 - in stable: 10/sys/contrib/ipfilter/netinet 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet
Author: cy Date: Sun Sep 29 03:41:15 2019 New Revision: 352866 URL: https://svnweb.freebsd.org/changeset/base/352866 Log: MFC r352737: ipf mistakenly regards UDP packets with a checksum of 0x as bad. Obtained from:NetBSD fil.c r1.30, NetBSD PR/54443 Modified: stable/10/sys/contrib/ipfilter/netinet/fil.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/contrib/ipfilter/netinet/fil.c stable/12/sys/contrib/ipfilter/netinet/fil.c Directory Properties: stable/11/ (props changed) stable/12/ (props changed) Modified: stable/10/sys/contrib/ipfilter/netinet/fil.c == --- stable/10/sys/contrib/ipfilter/netinet/fil.cSun Sep 29 03:36:50 2019(r352865) +++ stable/10/sys/contrib/ipfilter/netinet/fil.cSun Sep 29 03:41:15 2019(r352866) @@ -6695,8 +6695,11 @@ ipf_checkl4sum(fin) /*NOTREACHED*/ } - if (csump != NULL) + if (csump != NULL) { hdrsum = *csump; + if (fin->fin_p == IPPROTO_UDP && hdrsum == 0x) + hdrsum = 0x; + } if (dosum) { sum = fr_cksum(fin, fin->fin_ip, fin->fin_p, fin->fin_dp); ___ 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: r352865 - in stable: 11 11/contrib/ntp/ntpd 11/etc 11/usr.sbin/ntp 12 12/contrib/ntp/ntpd 12/usr.sbin/ntp 12/usr.sbin/ntp/ntpd
Author: cy Date: Sun Sep 29 03:36:50 2019 New Revision: 352865 URL: https://svnweb.freebsd.org/changeset/base/352865 Log: MFC r352304, r352540 r352304: No longer mlock() ntpd pages by default in memory thus allowing its pages to page as necessary. To restore historic BSD behaviour add the following to ntp.conf: rlimit memlock 32 Discussed on: freebsd-current@ between Sept 6-9, 2019 Reported by: Users using ASLR with stack gap != 0 Reviewed by: ian, kib, rgrimes (all previous versions) Differential Revision:https://reviews.freebsd.org/D21581 r352540: Follow up on r352304 which disabled default mlockall() at startup. Unfortunately though the original tarball supports this in ./configure (for Linux), to fully support disabling of mlockall() by default requires a little extra help otherwise the following is logged in syslog: Cannot set RLIMIT_MEMLOCK: Operation not permitted Modified: stable/12/UPDATING stable/12/contrib/ntp/ntpd/ntpd.c stable/12/usr.sbin/ntp/config.h stable/12/usr.sbin/ntp/ntpd/ntp.conf Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/UPDATING stable/11/contrib/ntp/ntpd/ntpd.c stable/11/etc/ntp.conf stable/11/usr.sbin/ntp/config.h Directory Properties: stable/11/ (props changed) Modified: stable/12/UPDATING == --- stable/12/UPDATING Sun Sep 29 03:26:29 2019(r352864) +++ stable/12/UPDATING Sun Sep 29 03:36:50 2019(r352865) @@ -16,6 +16,12 @@ from older versions of FreeBSD, try WITHOUT_CLANG and the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. +20190913: + ntpd no longer by default locks its pages in memory, allowing them + to be paged out by the kernel. Use rlimit memlock to restore + historic BSD behaviour. For example, add "rlimit memlock 32" + to ntp.conf to lock up to 32 MB of ntpd address space in memory. + 20190914: The vfs.fusefs.sync_unmount and vfs.fusefs.init_backgrounded sysctls and the "-o sync_unmount" and "-o init_backgrounded" mount options have Modified: stable/12/contrib/ntp/ntpd/ntpd.c == --- stable/12/contrib/ntp/ntpd/ntpd.c Sun Sep 29 03:26:29 2019 (r352864) +++ stable/12/contrib/ntp/ntpd/ntpd.c Sun Sep 29 03:36:50 2019 (r352865) @@ -999,7 +999,7 @@ ntpdmain( # if defined(HAVE_MLOCKALL) # ifdef HAVE_SETRLIMIT ntp_rlimit(RLIMIT_STACK, DFLT_RLIMIT_STACK * 4096, 4096, "4k"); -# ifdef RLIMIT_MEMLOCK +# if defined(RLIMIT_MEMLOCK) && defined(DFLT_RLIMIT_MEMLOCK) && DFLT_RLIMIT_MEMLOCK != -1 /* * The default RLIMIT_MEMLOCK is very low on Linux systems. * Unless we increase this limit malloc calls are likely to Modified: stable/12/usr.sbin/ntp/config.h == --- stable/12/usr.sbin/ntp/config.h Sun Sep 29 03:26:29 2019 (r352864) +++ stable/12/usr.sbin/ntp/config.h Sun Sep 29 03:36:50 2019 (r352865) @@ -287,7 +287,7 @@ #define DEFAULT_HZ 100 /* Default number of megabytes for RLIMIT_MEMLOCK */ -#define DFLT_RLIMIT_MEMLOCK 32 +#define DFLT_RLIMIT_MEMLOCK -1 /* Default number of 4k pages for RLIMIT_STACK */ #define DFLT_RLIMIT_STACK 50 Modified: stable/12/usr.sbin/ntp/ntpd/ntp.conf == --- stable/12/usr.sbin/ntp/ntpd/ntp.confSun Sep 29 03:26:29 2019 (r352864) +++ stable/12/usr.sbin/ntp/ntpd/ntp.confSun Sep 29 03:36:50 2019 (r352865) @@ -102,3 +102,11 @@ restrict ::1 # Use either leapfile in /etc/ntp or periodically updated leapfile in /var/db. #leapfile "/etc/ntp/leap-seconds" leapfile "/var/db/ntpd.leap-seconds.list" + +# Specify the number of megabytes of memory that should be allocated and +# locked. -1 (default) means "do not lock the process into memory". +# 0 means "lock whatever memory the process wants into memory". Any other +# number means to lock up to that number of megabytes into memory. +# 0 may result in a segfault when ASLR with stack gap randomization +# is enabled. +#rlimit memlock 32 ___ 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: r352865 - in stable: 11 11/contrib/ntp/ntpd 11/etc 11/usr.sbin/ntp 12 12/contrib/ntp/ntpd 12/usr.sbin/ntp 12/usr.sbin/ntp/ntpd
Author: cy Date: Sun Sep 29 03:36:50 2019 New Revision: 352865 URL: https://svnweb.freebsd.org/changeset/base/352865 Log: MFC r352304, r352540 r352304: No longer mlock() ntpd pages by default in memory thus allowing its pages to page as necessary. To restore historic BSD behaviour add the following to ntp.conf: rlimit memlock 32 Discussed on: freebsd-current@ between Sept 6-9, 2019 Reported by: Users using ASLR with stack gap != 0 Reviewed by: ian, kib, rgrimes (all previous versions) Differential Revision:https://reviews.freebsd.org/D21581 r352540: Follow up on r352304 which disabled default mlockall() at startup. Unfortunately though the original tarball supports this in ./configure (for Linux), to fully support disabling of mlockall() by default requires a little extra help otherwise the following is logged in syslog: Cannot set RLIMIT_MEMLOCK: Operation not permitted Modified: stable/11/UPDATING stable/11/contrib/ntp/ntpd/ntpd.c stable/11/etc/ntp.conf stable/11/usr.sbin/ntp/config.h Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/UPDATING stable/12/contrib/ntp/ntpd/ntpd.c stable/12/usr.sbin/ntp/config.h stable/12/usr.sbin/ntp/ntpd/ntp.conf Directory Properties: stable/12/ (props changed) Modified: stable/11/UPDATING == --- stable/11/UPDATING Sun Sep 29 03:26:29 2019(r352864) +++ stable/11/UPDATING Sun Sep 29 03:36:50 2019(r352865) @@ -16,6 +16,12 @@ from older versions of FreeBSD, try WITHOUT_CLANG and the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. +20190913: + ntpd no longer by default locks its pages in memory, allowing them + to be paged out by the kernel. Use rlimit memlock to restore + historic BSD behaviour. For example, add "rlimit memlock 32" + to ntp.conf to lock up to 32 MB of ntpd address space in memory. + 20190723: Clang, llvm, lld, lldb, compiler-rt, libc++, libunwind and openmp have been upgraded to 8.0.1. Please see the 20141231 entry below for Modified: stable/11/contrib/ntp/ntpd/ntpd.c == --- stable/11/contrib/ntp/ntpd/ntpd.c Sun Sep 29 03:26:29 2019 (r352864) +++ stable/11/contrib/ntp/ntpd/ntpd.c Sun Sep 29 03:36:50 2019 (r352865) @@ -991,7 +991,7 @@ ntpdmain( # if defined(HAVE_MLOCKALL) # ifdef HAVE_SETRLIMIT ntp_rlimit(RLIMIT_STACK, DFLT_RLIMIT_STACK * 4096, 4096, "4k"); -# ifdef RLIMIT_MEMLOCK +# if defined(RLIMIT_MEMLOCK) && defined(DFLT_RLIMIT_MEMLOCK) && DFLT_RLIMIT_MEMLOCK != -1 /* * The default RLIMIT_MEMLOCK is very low on Linux systems. * Unless we increase this limit malloc calls are likely to Modified: stable/11/etc/ntp.conf == --- stable/11/etc/ntp.conf Sun Sep 29 03:26:29 2019(r352864) +++ stable/11/etc/ntp.conf Sun Sep 29 03:36:50 2019(r352865) @@ -102,3 +102,11 @@ restrict ::1 # Use either leapfile in /etc/ntp or periodically updated leapfile in /var/db. #leapfile "/etc/ntp/leap-seconds" leapfile "/var/db/ntpd.leap-seconds.list" + +# Specify the number of megabytes of memory that should be allocated and +# locked. -1 (default) means "do not lock the process into memory". +# 0 means "lock whatever memory the process wants into memory". Any other +# number means to lock up to that number of megabytes into memory. +# 0 may result in a segfault when ASLR with stack gap randomization +# is enabled. +#rlimit memlock 32 Modified: stable/11/usr.sbin/ntp/config.h == --- stable/11/usr.sbin/ntp/config.h Sun Sep 29 03:26:29 2019 (r352864) +++ stable/11/usr.sbin/ntp/config.h Sun Sep 29 03:36:50 2019 (r352865) @@ -287,7 +287,7 @@ #define DEFAULT_HZ 100 /* Default number of megabytes for RLIMIT_MEMLOCK */ -#define DFLT_RLIMIT_MEMLOCK 32 +#define DFLT_RLIMIT_MEMLOCK -1 /* Default number of 4k pages for RLIMIT_STACK */ #define DFLT_RLIMIT_STACK 50 ___ 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: r352864 - head/sys/sys
Author: kevans Date: Sun Sep 29 03:26:29 2019 New Revision: 352864 URL: https://svnweb.freebsd.org/changeset/base/352864 Log: MFD_*: swap ordering This API is still young enough that I would expect no one to be dependant on this yet... Swap the ordering while it's young to match Linux values to potentially ease implementation of linuxolator syscall, being able to reuse existing constants. Modified: head/sys/sys/mman.h Modified: head/sys/sys/mman.h == --- head/sys/sys/mman.h Sun Sep 29 03:12:35 2019(r352863) +++ head/sys/sys/mman.h Sun Sep 29 03:26:29 2019(r352864) @@ -193,8 +193,8 @@ /* * Flags for memfd_create(). */ -#defineMFD_ALLOW_SEALING 0x0001 -#defineMFD_CLOEXEC 0x0002 +#defineMFD_CLOEXEC 0x0001 +#defineMFD_ALLOW_SEALING 0x0002 /* UNSUPPORTED */ #defineMFD_HUGETLB 0x0004 ___ 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: r352863 - head/sys/dev/fdt
Author: kevans Date: Sun Sep 29 03:12:35 2019 New Revision: 352863 URL: https://svnweb.freebsd.org/changeset/base/352863 Log: fdt_slicer: bump to SI_ORDER_THIRD following r347183 r347183 bumped GEOM classes to SI_ORDER_SECOND to resolve a race between them and the initialization of devsoftc.mtx in devinit, but missed this dependency on g_flashmap that may now lose the race against GEOM classes/g_init. There's a great comment that describes the situation that has also been updated with the new ordering of GEOM classes. Reported by: bdragon MFC after:4 days Modified: head/sys/dev/fdt/fdt_slicer.c Modified: head/sys/dev/fdt/fdt_slicer.c == --- head/sys/dev/fdt/fdt_slicer.c Sun Sep 29 02:56:23 2019 (r352862) +++ head/sys/dev/fdt/fdt_slicer.c Sun Sep 29 03:12:35 2019 (r352863) @@ -159,12 +159,12 @@ fdt_slicer_cleanup(void) } /* - * Must be initialized after GEOM classes (SI_SUB_DRIVERS/SI_ORDER_FIRST), + * Must be initialized after GEOM classes (SI_SUB_DRIVERS/SI_ORDER_SECOND), * i. e. after g_init() is called, due to the use of the GEOM topology_lock * in flash_register_slicer(). However, must be before SI_SUB_CONFIGURE. */ -SYSINIT(fdt_slicer, SI_SUB_DRIVERS, SI_ORDER_SECOND, fdt_slicer_init, NULL); -SYSUNINIT(fdt_slicer, SI_SUB_DRIVERS, SI_ORDER_SECOND, fdt_slicer_cleanup, NULL); +SYSINIT(fdt_slicer, SI_SUB_DRIVERS, SI_ORDER_THIRD, fdt_slicer_init, NULL); +SYSUNINIT(fdt_slicer, SI_SUB_DRIVERS, SI_ORDER_THIRD, fdt_slicer_cleanup, NULL); static int mod_handler(module_t mod, int type, void *data) @@ -181,6 +181,6 @@ static moduledata_t fdt_slicer_mod = { "fdt_slicer", mod_handler, NULL }; -DECLARE_MODULE(fdt_slicer, fdt_slicer_mod, SI_SUB_DRIVERS, SI_ORDER_SECOND); +DECLARE_MODULE(fdt_slicer, fdt_slicer_mod, SI_SUB_DRIVERS, SI_ORDER_THIRD); MODULE_DEPEND(fdt_slicer, g_flashmap, 0, 0, 0); MODULE_VERSION(fdt_slicer, 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: r352862 - stable/11/sys/dev/uart
Author: mav Date: Sun Sep 29 02:56:23 2019 New Revision: 352862 URL: https://svnweb.freebsd.org/changeset/base/352862 Log: MFC r352369: Relax TX draining in ns8250_bus_transmit(). Since TX interrupt is generated when THRE is set, wait for TEMT set means wait for full character transmission time. At low speeds that may take awhile, burning CPU time while holding sc_hwmtx lock, also congested. This is partial revert of r317659. Modified: stable/11/sys/dev/uart/uart_dev_ns8250.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/uart/uart_dev_ns8250.c == --- stable/11/sys/dev/uart/uart_dev_ns8250.cSun Sep 29 02:55:57 2019 (r352861) +++ stable/11/sys/dev/uart/uart_dev_ns8250.cSun Sep 29 02:56:23 2019 (r352862) @@ -988,13 +988,8 @@ ns8250_bus_transmit(struct uart_softc *sc) bas = >sc_bas; uart_lock(sc->sc_hwmtx); - if (sc->sc_txdatasz > 1) { - if ((uart_getreg(bas, REG_LSR) & LSR_TEMT) == 0) - ns8250_drain(bas, UART_DRAIN_TRANSMITTER); - } else { - while ((uart_getreg(bas, REG_LSR) & LSR_THRE) == 0) - DELAY(4); - } + while ((uart_getreg(bas, REG_LSR) & LSR_THRE) == 0) + DELAY(4); for (i = 0; i < sc->sc_txdatasz; i++) { uart_setreg(bas, REG_DATA, sc->sc_txbuf[i]); uart_barrier(bas); ___ 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: r352861 - stable/12/sys/dev/uart
Author: mav Date: Sun Sep 29 02:55:57 2019 New Revision: 352861 URL: https://svnweb.freebsd.org/changeset/base/352861 Log: MFC r352369: Relax TX draining in ns8250_bus_transmit(). Since TX interrupt is generated when THRE is set, wait for TEMT set means wait for full character transmission time. At low speeds that may take awhile, burning CPU time while holding sc_hwmtx lock, also congested. This is partial revert of r317659. Modified: stable/12/sys/dev/uart/uart_dev_ns8250.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/uart/uart_dev_ns8250.c == --- stable/12/sys/dev/uart/uart_dev_ns8250.cSat Sep 28 23:08:19 2019 (r352860) +++ stable/12/sys/dev/uart/uart_dev_ns8250.cSun Sep 29 02:55:57 2019 (r352861) @@ -1026,13 +1026,8 @@ ns8250_bus_transmit(struct uart_softc *sc) bas = >sc_bas; uart_lock(sc->sc_hwmtx); - if (sc->sc_txdatasz > 1) { - if ((uart_getreg(bas, REG_LSR) & LSR_TEMT) == 0) - ns8250_drain(bas, UART_DRAIN_TRANSMITTER); - } else { - while ((uart_getreg(bas, REG_LSR) & LSR_THRE) == 0) - DELAY(4); - } + while ((uart_getreg(bas, REG_LSR) & LSR_THRE) == 0) + DELAY(4); for (i = 0; i < sc->sc_txdatasz; i++) { uart_setreg(bas, REG_DATA, sc->sc_txbuf[i]); uart_barrier(bas); ___ 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: r352860 - in head/sys/gnu/dts: arm arm64/allwinner arm64/altera arm64/amlogic arm64/arm arm64/broadcom/stingray arm64/exynos arm64/freescale arm64/hisilicon arm64/marvell arm64/mediatek...
Author: manu Date: Sat Sep 28 23:08:19 2019 New Revision: 352860 URL: https://svnweb.freebsd.org/changeset/base/352860 Log: Import DTS files from Linux 5.3 Added: - copied unchanged from r352856, vendor/device-tree/dist/src/arm/am335x-regor-rdk.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm/am335x-regor.dtsi - copied unchanged from r352856, vendor/device-tree/dist/src/arm/aspeed-bmc-facebook-yamp.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm/aspeed-bmc-inspur-fp5280g2.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm/aspeed-bmc-lenovo-hr630.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm/aspeed-bmc-microsoft-olympus.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm/aspeed-bmc-opp-swift.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm/aspeed-bmc-opp-vesnin.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm/ibm-power9-dual.dtsi - copied unchanged from r352856, vendor/device-tree/dist/src/arm/imx6dl-kontron-samx6i.dtsi - copied unchanged from r352856, vendor/device-tree/dist/src/arm/imx6q-kontron-samx6i.dtsi - copied unchanged from r352856, vendor/device-tree/dist/src/arm/imx6qdl-kontron-samx6i.dtsi - copied unchanged from r352856, vendor/device-tree/dist/src/arm/imx7d-meerkat96.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm/logicpd-torpedo-37xx-devkit-28.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm/ls1021a-tsn.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm/stm32mp157a-avenger96.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm/stm32mp157xaa-pinctrl.dtsi - copied unchanged from r352856, vendor/device-tree/dist/src/arm/stm32mp157xab-pinctrl.dtsi - copied unchanged from r352856, vendor/device-tree/dist/src/arm/stm32mp157xac-pinctrl.dtsi - copied unchanged from r352856, vendor/device-tree/dist/src/arm/stm32mp157xad-pinctrl.dtsi - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/amlogic/meson-g12b-odroid-n2.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/amlogic/meson-g12b.dtsi - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/broadcom/stingray/stingray-usb.dtsi head/sys/gnu/dts/arm64/freescale/imx8mn-pinfunc.h - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/freescale/imx8mn-pinfunc.h - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/freescale/imx8mq-librem5-devkit.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/hisilicon/hi3660-coresight.dtsi - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/mediatek/mt8183-evb.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/mediatek/mt8183.dtsi - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/qcom/sdm845-cheza-r1.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/qcom/sdm845-cheza-r2.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/qcom/sdm845-cheza-r3.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/qcom/sdm845-cheza.dtsi - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/qcom/sdm845-db845c.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/renesas/hihope-common.dtsi - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/renesas/hihope-rzg2-ex.dtsi - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/renesas/r8a774a1-hihope-rzg2m-ex.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/renesas/r8a774a1-hihope-rzg2m.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/rockchip/rk3399-hugsun-x99.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/rockchip/rk3399-khadas-edge-captain.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/rockchip/rk3399-khadas-edge-v.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/rockchip/rk3399-khadas-edge.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/rockchip/rk3399-khadas-edge.dtsi - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/rockchip/rk3399pro.dtsi - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/ti/k3-j721e-common-proc-board.dts - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/ti/k3-j721e-main.dtsi - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/ti/k3-j721e-mcu-wakeup.dtsi - copied unchanged from r352856, vendor/device-tree/dist/src/arm64/ti/k3-j721e-som-p0.dtsi - copied unchanged from r352856,
svn commit: r352859 - head/sys/arm/allwinner
Author: manu Date: Sat Sep 28 23:01:23 2019 New Revision: 352859 URL: https://svnweb.freebsd.org/changeset/base/352859 Log: arm: allwinner: Add pll_mipi to the files Modified: head/sys/arm/allwinner/files.allwinner Modified: head/sys/arm/allwinner/files.allwinner == --- head/sys/arm/allwinner/files.allwinner Sat Sep 28 22:54:56 2019 (r352858) +++ head/sys/arm/allwinner/files.allwinner Sat Sep 28 23:01:23 2019 (r352859) @@ -37,6 +37,7 @@ arm/allwinner/aw_gmacclk.cstandard arm/allwinner/clkng/aw_ccung.c standard arm/allwinner/clkng/aw_clk_frac.c standard arm/allwinner/clkng/aw_clk_m.c standard +arm/allwinner/clkng/aw_clk_mipi.c standard arm/allwinner/clkng/aw_clk_nkmp.c standard arm/allwinner/clkng/aw_clk_nm.cstandard arm/allwinner/clkng/aw_clk_prediv_mux.cstandard ___ 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: r352858 - in head/sys/gnu/dts: arm arm64/allwinner arm64/altera arm64/amlogic arm64/apm arm64/arm arm64/bitmain arm64/broadcom arm64/cavium arm64/exynos arm64/freescale arm64/hisilicon ...
Author: manu Date: Sat Sep 28 22:54:56 2019 New Revision: 352858 URL: https://svnweb.freebsd.org/changeset/base/352858 Log: Import DTS files from Linux 5.2 Added: - copied unchanged from r352854, vendor/device-tree/dist/src/arm/am5718.dtsi - copied unchanged from r352854, vendor/device-tree/dist/src/arm/am5728.dtsi - copied unchanged from r352854, vendor/device-tree/dist/src/arm/am5748.dtsi - copied unchanged from r352854, vendor/device-tree/dist/src/arm/dra71x.dtsi - copied unchanged from r352854, vendor/device-tree/dist/src/arm/imx50-kobo-aura.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm/imx53-m53menlo.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm/imx6dl-eckelmann-ci4x10.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm/imx7-mba7.dtsi - copied unchanged from r352854, vendor/device-tree/dist/src/arm/imx7-tqma7.dtsi - copied unchanged from r352854, vendor/device-tree/dist/src/arm/imx7d-mba7.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm/imx7d-tqma7.dtsi - copied unchanged from r352854, vendor/device-tree/dist/src/arm/imx7d-zii-rpu2.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm/imx7s-mba7.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm/imx7s-tqma7.dtsi - copied unchanged from r352854, vendor/device-tree/dist/src/arm/intel-ixp42x-linksys-nslu2.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm/intel-ixp42x.dtsi - copied unchanged from r352854, vendor/device-tree/dist/src/arm/intel-ixp43x-gateworks-gw2358.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm/intel-ixp43x.dtsi - copied unchanged from r352854, vendor/device-tree/dist/src/arm/intel-ixp45x-ixp46x.dtsi - copied unchanged from r352854, vendor/device-tree/dist/src/arm/intel-ixp4xx.dtsi - copied unchanged from r352854, vendor/device-tree/dist/src/arm/omap4-l4-abe.dtsi - copied unchanged from r352854, vendor/device-tree/dist/src/arm/omap4-mcpdm.dtsi - copied unchanged from r352854, vendor/device-tree/dist/src/arm/omap5-l4-abe.dtsi - copied unchanged from r352854, vendor/device-tree/dist/src/arm/rk3288-veyron-mighty.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm/stm32mp157a-dk1.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm/stm32mp157c-dk2.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm/sun8i-h3-rervision-dvk.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm/vf610-zii-spb4.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm64/allwinner/sun50i-a64-oceanic-5205-5inmfd.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm64/allwinner/sun50i-h6-beelink-gs1.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm64/allwinner/sun50i-h6-orangepi-3.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm64/amlogic/meson-g12a-sei510.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm64/freescale/imx8mm-evk.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm64/freescale/imx8mm.dtsi - copied unchanged from r352854, vendor/device-tree/dist/src/arm64/freescale/imx8mq-zii-ultra-rmb3.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm64/freescale/imx8mq-zii-ultra-zest.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm64/freescale/imx8mq-zii-ultra.dtsi head/sys/gnu/dts/arm64/intel/ - copied from r352854, vendor/device-tree/dist/src/arm64/intel/ - copied unchanged from r352854, vendor/device-tree/dist/src/arm64/mediatek/mt8183-pinfunc.h - copied unchanged from r352854, vendor/device-tree/dist/src/arm64/nvidia/tegra210-p3450-.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm64/rockchip/rk3399-nanopi-neo4.dts - copied unchanged from r352854, vendor/device-tree/dist/src/arm64/rockchip/rk3399-orangepi.dts - copied unchanged from r352854, vendor/device-tree/dist/include/dt-bindings/clock/mt8183-clk.h - copied unchanged from r352854, vendor/device-tree/dist/include/dt-bindings/clock/mt8516-clk.h - copied unchanged from r352854, vendor/device-tree/dist/include/dt-bindings/clock/qcom,turingcc-qcs404.h - copied unchanged from r352854, vendor/device-tree/dist/include/dt-bindings/clock/xlnx-zynqmp-clk.h head/sys/gnu/dts/include/dt-bindings/iio/temperature/ - copied from r352854, vendor/device-tree/dist/include/dt-bindings/iio/temperature/ - copied unchanged from r352854, vendor/device-tree/dist/include/dt-bindings/phy/phy-am654-serdes.h Directory Properties: head/sys/gnu/dts/arm/am5718.dtsi (props changed) head/sys/gnu/dts/arm/am5728.dtsi (props changed) head/sys/gnu/dts/arm/am5748.dtsi
svn commit: r352856 - in vendor/device-tree/dist: . Bindings Bindings/arm Bindings/arm/amlogic Bindings/arm/freescale Bindings/arm/mediatek Bindings/arm/nxp Bindings/arm/omap Bindings/arm/socionext...
Author: manu Date: Sat Sep 28 22:38:14 2019 New Revision: 352856 URL: https://svnweb.freebsd.org/changeset/base/352856 Log: Import DTS files from Linux 5.3 Added: vendor/device-tree/dist/Bindings/arm/al,alpine.yaml vendor/device-tree/dist/Bindings/arm/amlogic.yaml vendor/device-tree/dist/Bindings/arm/amlogic/amlogic,meson-gx-ao-secure.txt (contents, props changed) vendor/device-tree/dist/Bindings/arm/atmel-at91.yaml vendor/device-tree/dist/Bindings/arm/axxia.yaml vendor/device-tree/dist/Bindings/arm/digicolor.yaml vendor/device-tree/dist/Bindings/arm/mediatek.yaml vendor/device-tree/dist/Bindings/arm/moxart.yaml vendor/device-tree/dist/Bindings/arm/nxp/lpc32xx.yaml vendor/device-tree/dist/Bindings/arm/psci.yaml vendor/device-tree/dist/Bindings/arm/rda.yaml vendor/device-tree/dist/Bindings/arm/stm32/mlahb.txt (contents, props changed) vendor/device-tree/dist/Bindings/arm/stm32/stm32.yaml vendor/device-tree/dist/Bindings/bus/allwinner,sun8i-a23-rsb.yaml vendor/device-tree/dist/Bindings/clock/allwinner,sun4i-a10-ccu.yaml vendor/device-tree/dist/Bindings/clock/brcm,bcm63xx-clocks.txt (contents, props changed) vendor/device-tree/dist/Bindings/clock/silabs,si5341.txt (contents, props changed) vendor/device-tree/dist/Bindings/cpufreq/imx-cpufreq-dt.txt (contents, props changed) vendor/device-tree/dist/Bindings/csky/pmu.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml vendor/device-tree/dist/Bindings/display/ingenic,lcd.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/panel/armadeus,st0700-adapt.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/panel/evervision,vgg804821.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/panel/friendlyarm,hd702e.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/panel/koe,tx14d24vm1bpa.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/panel/osddisplays,osd101t2045-53ts.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/panel/osddisplays,osd101t2587-53ts.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/panel/samsung,s6e63m0.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/panel/tfc,s9700rtwv43tr-01b.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/panel/vl050_8048nt_c01.txt (contents, props changed) vendor/device-tree/dist/Bindings/dma/mtk-uart-apdma.txt (contents, props changed) vendor/device-tree/dist/Bindings/extcon/extcon-fsa9480.txt (contents, props changed) vendor/device-tree/dist/Bindings/gpio/pl061-gpio.yaml vendor/device-tree/dist/Bindings/i2c/allwinner,sun6i-a31-p2wi.yaml vendor/device-tree/dist/Bindings/i2c/i2c-mt7621.txt (contents, props changed) vendor/device-tree/dist/Bindings/i2c/marvell,mv64xxx-i2c.yaml vendor/device-tree/dist/Bindings/iio/accel/adi,adxl345.yaml vendor/device-tree/dist/Bindings/iio/accel/adi,adxl372.yaml vendor/device-tree/dist/Bindings/iio/adc/adi,ad7124.yaml vendor/device-tree/dist/Bindings/iio/adc/adi,ad7780.yaml vendor/device-tree/dist/Bindings/iio/chemical/sensirion,sps30.yaml vendor/device-tree/dist/Bindings/iio/frequency/adf4371.yaml vendor/device-tree/dist/Bindings/iio/light/isl29018.yaml vendor/device-tree/dist/Bindings/iio/light/tsl2583.yaml vendor/device-tree/dist/Bindings/iio/light/tsl2772.yaml vendor/device-tree/dist/Bindings/interrupt-controller/amazon,al-fic.txt (contents, props changed) vendor/device-tree/dist/Bindings/interrupt-controller/renesas,rza1-irqc.txt (contents, props changed) vendor/device-tree/dist/Bindings/leds/leds-lm36274.txt (contents, props changed) vendor/device-tree/dist/Bindings/leds/leds-lm3697.txt (contents, props changed) vendor/device-tree/dist/Bindings/leds/leds-spi-byte.txt (contents, props changed) vendor/device-tree/dist/Bindings/media/allegro.txt (contents, props changed) vendor/device-tree/dist/Bindings/media/amlogic,vdec.txt (contents, props changed) vendor/device-tree/dist/Bindings/media/marvell,mmp2-ccic.txt (contents, props changed) vendor/device-tree/dist/Bindings/mfd/rohm,bd70528-pmic.txt (contents, props changed) vendor/device-tree/dist/Bindings/misc/fsl,dpaa2-console.txt (contents, props changed) vendor/device-tree/dist/Bindings/misc/intel,ixp4xx-ahb-queue-manager.yaml vendor/device-tree/dist/Bindings/misc/olpc,xo1.75-ec.txt (contents, props changed) vendor/device-tree/dist/Bindings/misc/xlnx,sd-fec.txt (contents, props changed) vendor/device-tree/dist/Bindings/mmc/allwinner,sun4i-a10-mmc.yaml vendor/device-tree/dist/Bindings/mmc/mmc-controller.yaml vendor/device-tree/dist/Bindings/mmc/renesas,sdhi.txt (contents, props changed) vendor/device-tree/dist/Bindings/mtd/cypress,hyperflash.txt (contents, props changed)
svn commit: r352857 - vendor/device-tree/5.3
Author: manu Date: Sat Sep 28 22:38:47 2019 New Revision: 352857 URL: https://svnweb.freebsd.org/changeset/base/352857 Log: tag import of DTS files from Linux 5.3 Added: vendor/device-tree/5.3/ - copied from r352856, vendor/device-tree/dist/ ___ 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: r352855 - vendor/device-tree/5.2
Author: manu Date: Sat Sep 28 22:36:08 2019 New Revision: 352855 URL: https://svnweb.freebsd.org/changeset/base/352855 Log: tag import of 5.2 DTS files Added: vendor/device-tree/5.2/ - copied from r352854, vendor/device-tree/dist/ ___ 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: r352854 - in vendor/device-tree/dist: . Bindings Bindings/arm Bindings/arm/altera Bindings/arm/freescale Bindings/arm/keystone Bindings/arm/mediatek Bindings/arm/omap Bindings/arm/stm32...
Author: manu Date: Sat Sep 28 22:35:29 2019 New Revision: 352854 URL: https://svnweb.freebsd.org/changeset/base/352854 Log: Import DTS from Linux 5.2 Added: vendor/device-tree/dist/.gitignore vendor/device-tree/dist/Bindings/arm/intel-ixp4xx.yaml vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,camsys.txt (contents, props changed) vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,ipu.txt (contents, props changed) vendor/device-tree/dist/Bindings/arm/sunxi.yaml vendor/device-tree/dist/Bindings/arm/sunxi/sunxi-mbus.txt (contents, props changed) vendor/device-tree/dist/Bindings/clock/cirrus,lochnagar.txt (contents, props changed) vendor/device-tree/dist/Bindings/clock/milbeaut-clock.yaml vendor/device-tree/dist/Bindings/clock/qcom,turingcc.txt (contents, props changed) vendor/device-tree/dist/Bindings/clock/sifive/ vendor/device-tree/dist/Bindings/clock/sifive/fu540-prci.txt (contents, props changed) vendor/device-tree/dist/Bindings/clock/xlnx,zynqmp-clk.txt (contents, props changed) vendor/device-tree/dist/Bindings/counter/ vendor/device-tree/dist/Bindings/counter/ftm-quaddec.txt (contents, props changed) vendor/device-tree/dist/Bindings/counter/stm32-lptimer-cnt.txt (contents, props changed) vendor/device-tree/dist/Bindings/counter/stm32-timer-cnt.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/panel/feiyang,fy07024di26a30d.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/panel/lg,acx467akm-7.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/panel/osddisplays,osd070t1718-19ts.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/panel/rocktech,jh057n00900.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/panel/ronbo,rb070d30.yaml vendor/device-tree/dist/Bindings/display/rockchip/rockchip,rk3066-hdmi.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/simple-framebuffer.yaml vendor/device-tree/dist/Bindings/display/ste,mcde.txt (contents, props changed) vendor/device-tree/dist/Bindings/fieldbus/ vendor/device-tree/dist/Bindings/fieldbus/arcx,anybus-controller.txt (contents, props changed) vendor/device-tree/dist/Bindings/firmware/intel,ixp4xx-network-processing-engine.yaml vendor/device-tree/dist/Bindings/fpga/xlnx,zynqmp-pcap-fpga.txt (contents, props changed) vendor/device-tree/dist/Bindings/gpu/arm,mali-bifrost.txt (contents, props changed) vendor/device-tree/dist/Bindings/gpu/aspeed-gfx.txt (contents, props changed) vendor/device-tree/dist/Bindings/hwmon/cirrus,lochnagar.txt (contents, props changed) vendor/device-tree/dist/Bindings/iio/accel/kionix,kxcjk1013.txt (contents, props changed) vendor/device-tree/dist/Bindings/iio/adc/adi,ad7780.txt (contents, props changed) vendor/device-tree/dist/Bindings/iio/adc/avia-hx711.yaml vendor/device-tree/dist/Bindings/iio/adc/ti-ads8344.txt (contents, props changed) vendor/device-tree/dist/Bindings/iio/gyroscope/bmg160.txt (contents, props changed) vendor/device-tree/dist/Bindings/iio/gyroscope/nxp,fxas21002c.txt (contents, props changed) vendor/device-tree/dist/Bindings/iio/imu/adi,adis16480.txt (contents, props changed) vendor/device-tree/dist/Bindings/iio/light/vcnl4000.txt (contents, props changed) vendor/device-tree/dist/Bindings/iio/pressure/bmp085.yaml vendor/device-tree/dist/Bindings/iio/proximity/devantech-srf04.yaml vendor/device-tree/dist/Bindings/iio/proximity/maxbotix,mb1232.txt (contents, props changed) vendor/device-tree/dist/Bindings/iio/temperature/max31856.txt (contents, props changed) vendor/device-tree/dist/Bindings/iio/temperature/temperature-bindings.txt (contents, props changed) vendor/device-tree/dist/Bindings/input/gpio-vibrator.yaml vendor/device-tree/dist/Bindings/input/max77650-onkey.txt (contents, props changed) vendor/device-tree/dist/Bindings/input/microchip,qt1050.txt (contents, props changed) vendor/device-tree/dist/Bindings/input/touchscreen/iqs5xx.txt (contents, props changed) vendor/device-tree/dist/Bindings/interrupt-controller/intel,ixp4xx-interrupt.yaml vendor/device-tree/dist/Bindings/interrupt-controller/ti,sci-inta.txt (contents, props changed) vendor/device-tree/dist/Bindings/interrupt-controller/ti,sci-intr.txt (contents, props changed) vendor/device-tree/dist/Bindings/leds/backlight/lm3630a-backlight.yaml vendor/device-tree/dist/Bindings/leds/leds-lm3532.txt (contents, props changed) vendor/device-tree/dist/Bindings/leds/leds-max77650.txt (contents, props changed) vendor/device-tree/dist/Bindings/mailbox/marvell,armada-3700-rwtm-mailbox.txt (contents, props changed) vendor/device-tree/dist/Bindings/media/i2c/st,st-mipid02.txt (contents, props changed) vendor/device-tree/dist/Bindings/media/rcar_imr.txt (contents, props changed)
svn commit: r352853 - in head/sys: arm64/conf arm64/rockchip conf
Author: manu Date: Sat Sep 28 22:25:21 2019 New Revision: 352853 URL: https://svnweb.freebsd.org/changeset/base/352853 Log: arm64: rockchip: Add usb2phy driver This driver is for the usb phy present on rockchip SoC. It only support RK3399 and host mode for now. The driver expose the usb clock needed by the usb controller. Added: head/sys/arm64/rockchip/rk_usb2phy.c (contents, props changed) Modified: head/sys/arm64/conf/GENERIC head/sys/conf/files.arm64 Modified: head/sys/arm64/conf/GENERIC == --- head/sys/arm64/conf/GENERIC Sat Sep 28 22:23:21 2019(r352852) +++ head/sys/arm64/conf/GENERIC Sat Sep 28 22:25:21 2019(r352853) @@ -205,6 +205,7 @@ device pl011 # USB support device aw_ehci # Allwinner EHCI USB interface (USB 2.0) device aw_usbphy # Allwinner USB PHY +device rk_usb2phy # Rockchip USB2PHY device dwcotg # DWC OTG controller device ohci# OHCI USB interface device ehci# EHCI USB interface (USB 2.0) Added: head/sys/arm64/rockchip/rk_usb2phy.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/rockchip/rk_usb2phy.cSat Sep 28 22:25:21 2019 (r352853) @@ -0,0 +1,374 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2019 Emmanuel Vadot + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Rockchip USB2PHY + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "clkdev_if.h" +#include "syscon_if.h" + +#defineRK3399_GRF_USB20_PHY0_CON0 0x0 +#defineRK3399_GRF_USB20_PHY0_CON1 0x4 +#defineRK3399_GRF_USB20_PHY0_CON2 0x8 +#defineRK3399_GRF_USB20_PHY0_CON3 0xC + +struct rk_usb2phy_reg { + uint32_toffset; + uint32_tenable_mask; + uint32_tdisable_mask; +}; + +struct rk_usb2phy_regs { + struct rk_usb2phy_reg clk_ctl; +}; + +struct rk_usb2phy_regs rk3399_regs = { + .clk_ctl = { + /* bit 4 put pll in suspend */ + .enable_mask = 0x10, + .disable_mask = 0x100010, + } +}; + +static struct ofw_compat_data compat_data[] = { + { "rockchip,rk3399-usb2phy",(uintptr_t)_regs }, + { NULL, 0 } +}; + +struct rk_usb2phy_softc { + device_tdev; + struct syscon *grf; + regulator_t phy_supply; + clk_t clk; +}; + +/* Phy class and methods. */ +static int rk_usb2phy_enable(struct phynode *phynode, bool enable); +static phynode_method_t rk_usb2phy_phynode_methods[] = { + PHYNODEMETHOD(phynode_enable, rk_usb2phy_enable), + + PHYNODEMETHOD_END +}; + +DEFINE_CLASS_1(rk_usb2phy_phynode, rk_usb2phy_phynode_class, +rk_usb2phy_phynode_methods, +sizeof(struct phynode_usb_sc), phynode_usb_class); + +enum RK3399_USBPHY { + RK3399_USBPHY_HOST = 0, + RK3399_USBPHY_OTG, +}; + +static int +rk_usb2phy_enable(struct phynode *phynode, bool enable) +{ + struct rk_usb2phy_softc *sc; + device_t dev; + intptr_t phy; + int error; + + dev = phynode_get_device(phynode); + phy = phynode_get_id(phynode); + sc = device_get_softc(dev); + + if (phy !=
svn commit: r352852 - head/sys/dev/dwc
Author: manu Date: Sat Sep 28 22:23:21 2019 New Revision: 352852 URL: https://svnweb.freebsd.org/changeset/base/352852 Log: dwc: Add more delay for chip reset On rockchip board it seems that the value in the DTS are not enough for reseting the chip, I don't know if the value are really incorrect or if DELAY is not precise enough or if the rockchip gpio driver have some "lag" of some kind or not. For now just add more delay. Modified: head/sys/dev/dwc/if_dwc.c Modified: head/sys/dev/dwc/if_dwc.c == --- head/sys/dev/dwc/if_dwc.c Sat Sep 28 22:21:16 2019(r352851) +++ head/sys/dev/dwc/if_dwc.c Sat Sep 28 22:23:21 2019(r352852) @@ -1074,16 +1074,13 @@ dwc_reset(device_t dev) if (OF_hasprop(node, "snps,reset-active-low")) pin_value = GPIO_PIN_HIGH; - if (flags & GPIO_ACTIVE_LOW) - pin_value = !pin_value; - GPIO_PIN_SETFLAGS(gpio, pin, GPIO_PIN_OUTPUT); GPIO_PIN_SET(gpio, pin, pin_value); - DELAY(delay_prop[0]); + DELAY(delay_prop[0] * 5); GPIO_PIN_SET(gpio, pin, !pin_value); - DELAY(delay_prop[1]); + DELAY(delay_prop[1] * 5); GPIO_PIN_SET(gpio, pin, pin_value); - DELAY(delay_prop[2]); + DELAY(delay_prop[2] * 5); return (0); } ___ 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: r352851 - head/sys/arm64/rockchip
Author: manu Date: Sat Sep 28 22:21:16 2019 New Revision: 352851 URL: https://svnweb.freebsd.org/changeset/base/352851 Log: arm64: rockchip: Fix map_gpio The map_gpio function wasn't correct, the first element is the pin and not the phandle. Modified: head/sys/arm64/rockchip/rk_gpio.c Modified: head/sys/arm64/rockchip/rk_gpio.c == --- head/sys/arm64/rockchip/rk_gpio.c Sat Sep 28 22:19:52 2019 (r352850) +++ head/sys/arm64/rockchip/rk_gpio.c Sat Sep 28 22:21:16 2019 (r352851) @@ -390,9 +390,9 @@ rk_gpio_map_gpios(device_t bus, phandle_t dev, phandle pcell_t *gpios, uint32_t *pin, uint32_t *flags) { - /* The gpios are mapped as */ - *pin = gpios[1]; - *flags = gpios[2]; + /* The gpios are mapped as */ + *pin = gpios[0]; + *flags = gpios[1]; return (0); } ___ 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: r352850 - head/sys/arm64/rockchip/clk
Author: manu Date: Sat Sep 28 22:19:52 2019 New Revision: 352850 URL: https://svnweb.freebsd.org/changeset/base/352850 Log: arm64: rockchip: Implement resets Module resets where not implemented when rockchip clocks were commited. Implement them. Since all resets registers are contiguous a driver only need to give the start offset and the number of resets. This avoid to have to declare every resets. Modified: head/sys/arm64/rockchip/clk/rk3328_cru.c head/sys/arm64/rockchip/clk/rk3399_cru.c head/sys/arm64/rockchip/clk/rk3399_pmucru.c head/sys/arm64/rockchip/clk/rk_cru.c head/sys/arm64/rockchip/clk/rk_cru.h Modified: head/sys/arm64/rockchip/clk/rk3328_cru.c == --- head/sys/arm64/rockchip/clk/rk3328_cru.cSat Sep 28 22:17:26 2019 (r352849) +++ head/sys/arm64/rockchip/clk/rk3328_cru.cSat Sep 28 22:19:52 2019 (r352850) @@ -1083,6 +1083,9 @@ rk3328_cru_attach(device_t dev) sc->clks = rk3328_clks; sc->nclks = nitems(rk3328_clks); + sc->reset_offset = 0x300; + sc->reset_num = 184; + return (rk_cru_attach(dev)); } Modified: head/sys/arm64/rockchip/clk/rk3399_cru.c == --- head/sys/arm64/rockchip/clk/rk3399_cru.cSat Sep 28 22:17:26 2019 (r352849) +++ head/sys/arm64/rockchip/clk/rk3399_cru.cSat Sep 28 22:19:52 2019 (r352850) @@ -1673,6 +1673,9 @@ rk3399_cru_attach(device_t dev) sc->clks = rk3399_clks; sc->nclks = nitems(rk3399_clks); + sc->reset_offset = 0x400; + sc->reset_num = 335; + return (rk_cru_attach(dev)); } Modified: head/sys/arm64/rockchip/clk/rk3399_pmucru.c == --- head/sys/arm64/rockchip/clk/rk3399_pmucru.c Sat Sep 28 22:17:26 2019 (r352849) +++ head/sys/arm64/rockchip/clk/rk3399_pmucru.c Sat Sep 28 22:19:52 2019 (r352850) @@ -846,6 +846,9 @@ rk3399_pmucru_attach(device_t dev) sc->clks = rk3399_pmu_clks; sc->nclks = nitems(rk3399_pmu_clks); + sc->reset_offset = 0x110; + sc->reset_num = 30; + return (rk_cru_attach(dev)); } Modified: head/sys/arm64/rockchip/clk/rk_cru.c == --- head/sys/arm64/rockchip/clk/rk_cru.cSat Sep 28 22:17:26 2019 (r352849) +++ head/sys/arm64/rockchip/clk/rk_cru.cSat Sep 28 22:19:52 2019 (r352850) @@ -114,20 +114,23 @@ static int rk_cru_reset_assert(device_t dev, intptr_t id, bool reset) { struct rk_cru_softc *sc; + uint32_t reg; + int bit; uint32_t val; sc = device_get_softc(dev); - if (id >= sc->nresets || sc->resets[id].offset == 0) - return (0); + if (id > sc->reset_num) + return (ENXIO); + reg = sc->reset_offset + id / 16 * 4; + bit = id % 16; + mtx_lock(>mtx); - val = CCU_READ4(sc, sc->resets[id].offset); + val = 0; if (reset) - val &= ~(1 << sc->resets[id].shift); - else - val |= 1 << sc->resets[id].shift; - CCU_WRITE4(sc, sc->resets[id].offset, val); + val = (1 << bit); + CCU_WRITE4(sc, reg, val | ((1 << bit) << 16)); mtx_unlock(>mtx); return (0); @@ -137,18 +140,25 @@ static int rk_cru_reset_is_asserted(device_t dev, intptr_t id, bool *reset) { struct rk_cru_softc *sc; + uint32_t reg; + int bit; uint32_t val; sc = device_get_softc(dev); - if (id >= sc->nresets || sc->resets[id].offset == 0) - return (0); + if (id > sc->reset_num) + return (ENXIO); + reg = sc->reset_offset + id / 16 * 4; + bit = id % 16; mtx_lock(>mtx); - val = CCU_READ4(sc, sc->resets[id].offset); - *reset = (val & (1 << sc->resets[id].shift)) != 0 ? false : true; + val = CCU_READ4(sc, reg); mtx_unlock(>mtx); + *reset = true; + if (val & (1 << bit)) + *reset = true; + return (0); } @@ -256,8 +266,8 @@ rk_cru_attach(device_t dev) clk_set_assigned(dev, node); /* If we have resets, register our self as a reset provider */ - if (sc->resets) - hwreset_register_ofw_provider(dev); + /* if (sc->resets) */ + /* hwreset_register_ofw_provider(dev); */ return (0); } Modified: head/sys/arm64/rockchip/clk/rk_cru.h == --- head/sys/arm64/rockchip/clk/rk_cru.hSat Sep 28 22:17:26 2019 (r352849) +++ head/sys/arm64/rockchip/clk/rk_cru.hSat Sep 28 22:19:52 2019 (r352850) @@ -37,11 +37,6 @@ #include #include -struct rk_cru_reset { - uint32_t
svn commit: r352849 - head/sys/arm64/rockchip/clk
Author: manu Date: Sat Sep 28 22:17:26 2019 New Revision: 352849 URL: https://svnweb.freebsd.org/changeset/base/352849 Log: arm64: rockchip: rk3399: Add usb2 clocks Modified: head/sys/arm64/rockchip/clk/rk3399_cru.c Modified: head/sys/arm64/rockchip/clk/rk3399_cru.c == --- head/sys/arm64/rockchip/clk/rk3399_cru.cSat Sep 28 22:14:33 2019 (r352848) +++ head/sys/arm64/rockchip/clk/rk3399_cru.cSat Sep 28 22:17:26 2019 (r352849) @@ -52,6 +52,8 @@ __FBSDID("$FreeBSD$"); /* GATES */ +#defineSCLK_USB2PHY0_REF 123 +#defineSCLK_USB2PHY1_REF 124 #defineACLK_EMMC_CORE 241 #defineACLK_EMMC_NOC 242 #defineACLK_EMMC_GRF 243 @@ -64,6 +66,10 @@ __FBSDID("$FreeBSD$"); #definePCLK_I2C5 344 #definePCLK_I2C6 345 #definePCLK_I2C7 346 +#defineHCLK_HOST0 456 +#defineHCLK_HOST0_ARB 457 +#defineHCLK_HOST1 458 +#defineHCLK_HOST1_ARB 459 #defineHCLK_SDMMC 462 static struct rk_cru_gate rk3399_gates[] = { @@ -86,6 +92,8 @@ static struct rk_cru_gate rk3399_gates[] = { /* CRU_CLKGATE_CON6 */ CRU_GATE(0, "gpll_aclk_emmc_src", "gpll", 0x318, 12) CRU_GATE(0, "cpll_aclk_emmc_src", "cpll", 0x318, 13) + CRU_GATE(SCLK_USB2PHY0_REF, "clk_usb2phy0_ref", "xin24m", 0x318, 5) + CRU_GATE(SCLK_USB2PHY1_REF, "clk_usb2phy1_ref", "xin24m", 0x318, 6) /* CRU_CLKGATE_CON7 */ CRU_GATE(0, "gpll_aclk_perilp0_src", "gpll", 0x31C, 0) @@ -94,6 +102,12 @@ static struct rk_cru_gate rk3399_gates[] = { /* CRU_CLKGATE_CON8 */ CRU_GATE(0, "hclk_perilp1_cpll_src", "cpll", 0x320, 1) CRU_GATE(0, "hclk_perilp1_gpll_src", "gpll", 0x320, 0) + + /* CRU_CLKGATE_CON20 */ + CRU_GATE(HCLK_HOST0, "hclk_host0", "hclk_perihp", 0x350, 5) + CRU_GATE(HCLK_HOST0_ARB, "hclk_host0_arb", "hclk_perihp", 0x350, 6) + CRU_GATE(HCLK_HOST1, "hclk_host1", "hclk_perihp", 0x350, 7) + CRU_GATE(HCLK_HOST1_ARB, "hclk_host1_arb", "hclk_perihp", 0x350, 8) /* CRU_CLKGATE_CON22 */ CRU_GATE(PCLK_I2C7, "pclk_rki2c7", "pclk_perilp1", 0x358, 5) ___ 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: r352848 - in head/sys: arm/allwinner/clkng conf
Author: manu Date: Sat Sep 28 22:14:33 2019 New Revision: 352848 URL: https://svnweb.freebsd.org/changeset/base/352848 Log: arm64: allwinner: a64: Add PLL_MIPI PLL_MIPI is the last important PLL that we missed. Add support for it. Since it's one of the possible parent for TCON0 also add this clock now that we can. While here add some info about what video related clocks should be enabled at boot and with what frequency. Added: head/sys/arm/allwinner/clkng/aw_clk_mipi.c (contents, props changed) head/sys/arm/allwinner/clkng/aw_clk_mipi.h (contents, props changed) Modified: head/sys/arm/allwinner/clkng/aw_ccung.c head/sys/arm/allwinner/clkng/aw_ccung.h head/sys/arm/allwinner/clkng/aw_clk.h head/sys/arm/allwinner/clkng/ccu_a64.c head/sys/conf/files.arm64 Modified: head/sys/arm/allwinner/clkng/aw_ccung.c == --- head/sys/arm/allwinner/clkng/aw_ccung.c Sat Sep 28 17:16:03 2019 (r352847) +++ head/sys/arm/allwinner/clkng/aw_ccung.c Sat Sep 28 22:14:33 2019 (r352848) @@ -311,6 +311,8 @@ aw_ccung_attach(device_t dev) case AW_CLK_FRAC: aw_clk_frac_register(sc->clkdom, sc->clks[i].clk.frac); break; + case AW_CLK_MIPI: + aw_clk_mipi_register(sc->clkdom, sc->clks[i].clk.mipi); } } Modified: head/sys/arm/allwinner/clkng/aw_ccung.h == --- head/sys/arm/allwinner/clkng/aw_ccung.h Sat Sep 28 17:16:03 2019 (r352847) +++ head/sys/arm/allwinner/clkng/aw_ccung.h Sat Sep 28 22:14:33 2019 (r352848) @@ -32,6 +32,7 @@ #include #include +#include #include #include #include @@ -50,6 +51,7 @@ enum aw_ccung_clk_type { AW_CLK_PREDIV_MUX, AW_CLK_FRAC, AW_CLK_M, + AW_CLK_MIPI, }; struct aw_ccung_clk { @@ -63,6 +65,7 @@ struct aw_ccung_clk { struct aw_clk_prediv_mux_def*prediv_mux; struct aw_clk_frac_def *frac; struct aw_clk_m_def *m; + struct aw_clk_mipi_def *mipi; } clk; }; Modified: head/sys/arm/allwinner/clkng/aw_clk.h == --- head/sys/arm/allwinner/clkng/aw_clk.h Sat Sep 28 17:16:03 2019 (r352847) +++ head/sys/arm/allwinner/clkng/aw_clk.h Sat Sep 28 22:14:33 2019 (r352848) @@ -73,6 +73,8 @@ struct aw_clk_init { #defineAW_CLK_FACTOR_HAS_COND 0x0004 #defineAW_CLK_FACTOR_FIXED 0x0008 #defineAW_CLK_FACTOR_ZERO_IS_ONE 0x0010 +#defineAW_CLK_FACTOR_MIN_VALUE 0x0020 +#defineAW_CLK_FACTOR_MAX_VALUE 0x0040 struct aw_clk_factor { uint32_tshift; /* Shift bits for the factor */ @@ -85,6 +87,9 @@ struct aw_clk_factor { uint32_tcond_width; uint32_tcond_value; + uint32_tmin_value; + uint32_tmax_value; + uint32_tflags; /* Flags */ }; @@ -147,6 +152,8 @@ aw_clk_factor_get_min(struct aw_clk_factor *factor) min = factor->value; else if (factor->flags & AW_CLK_FACTOR_ZERO_BASED) min = 0; + else if (factor->flags & AW_CLK_FACTOR_MIN_VALUE) + min = factor->min_value; else min = 1; @@ -166,7 +173,9 @@ aw_clk_factor_get_value(struct aw_clk_factor *factor, else if (factor->flags & AW_CLK_FACTOR_POWER_OF_TWO) { for (val = 0; raw != 1; val++) raw >>= 1; - } else + } else if (factor->flags & AW_CLK_FACTOR_MAX_VALUE) + val = factor->max_value; + else val = raw - 1; return (val); @@ -456,6 +465,32 @@ aw_clk_factor_get_value(struct aw_clk_factor *factor, .prediv.cond_mask = _prediv_cond_mask, \ .prediv.cond_value = _prediv_cond_value,\ } + +#define MIPI_CLK(_clkname, _id, _name, _pnames,\ + _offset,\ + _kshift, _kwidth, _kflags, _kmin, \ + _mshift, _mwidth, \ + _nshift, _nwidth, \ + _gate_shift, _lock_shift) \ + static struct aw_clk_mipi_def _clkname = { \ + .clkdef = { \ + .id = _id, \ + .name = _name, \ + .parent_names = _pnames,\ + .parent_cnt = nitems(_pnames) \
svn commit: r352847 - head/sys/arm64/arm64
Author: alc Date: Sat Sep 28 17:16:03 2019 New Revision: 352847 URL: https://svnweb.freebsd.org/changeset/base/352847 Log: Eliminate redundant calls to critical_enter() and critical_exit() from pmap_update_entry(). It suffices that interrupts are blocked. Reviewed by: andrew, markj MFC after:1 week Differential Revision:https://reviews.freebsd.org/D21753 Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c == --- head/sys/arm64/arm64/pmap.c Sat Sep 28 17:15:48 2019(r352846) +++ head/sys/arm64/arm64/pmap.c Sat Sep 28 17:16:03 2019(r352847) @@ -3007,7 +3007,6 @@ pmap_update_entry(pmap_t pmap, pd_entry_t *pte, pd_ent * as they may make use of an address we are about to invalidate. */ intr = intr_disable(); - critical_enter(); /* * Clear the old mapping's valid bit, but leave the rest of the entry @@ -3021,7 +3020,6 @@ pmap_update_entry(pmap_t pmap, pd_entry_t *pte, pd_ent pmap_store(pte, newpte); dsb(ishst); - critical_exit(); intr_restore(intr); } ___ 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: r352846 - head/lib/libc/sys
Author: imp Date: Sat Sep 28 17:15:48 2019 New Revision: 352846 URL: https://svnweb.freebsd.org/changeset/base/352846 Log: Revert the mode_t -> int changes and add a warning in the BUGS section instead. While FreeBSD's implementation of these expect an int inside of libc, that's an implementation detail that we can hide from the user as it's the natural promotion of the current mode_t type and before it is used in the kernel, it's converted back to the narrower type that's the current definition of mode_t. As such, documenting int is at best confusing and at worst misleading. Instead add a note that these args are variadic and as such calling conventions may differ from non-variadic arguments. Modified: head/lib/libc/sys/mq_open.2 head/lib/libc/sys/open.2 Modified: head/lib/libc/sys/mq_open.2 == --- head/lib/libc/sys/mq_open.2 Sat Sep 28 14:20:28 2019(r352845) +++ head/lib/libc/sys/mq_open.2 Sat Sep 28 17:15:48 2019(r352846) @@ -37,7 +37,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 15, 2014 +.Dd September 28, 2019 .Dt MQ_OPEN 2 .Os .Sh NAME @@ -133,7 +133,7 @@ Create a message queue. It requires two additional arguments: .Fa mode , which is of type -.Vt int , +.Vt mode_t , and .Fa attr , which is a pointer to an @@ -317,6 +317,13 @@ This implementation places strict requirements on the it must begin with a slash .Pq Ql / and contain no other slash characters. +.Pp +The +.Fa mode +and +.Fa attr +arguments are variadic and may result in different calling conventions +than might otherwise be expected. .Sh COPYRIGHT Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Modified: head/lib/libc/sys/open.2 == --- head/lib/libc/sys/open.2Sat Sep 28 14:20:28 2019(r352845) +++ head/lib/libc/sys/open.2Sat Sep 28 17:15:48 2019(r352846) @@ -28,7 +28,7 @@ .\" @(#)open.2 8.2 (Berkeley) 11/16/93 .\" $FreeBSD$ .\" -.Dd September 17, 2019 +.Dd September 28, 2019 .Dt OPEN 2 .Os .Sh NAME @@ -61,7 +61,7 @@ In this case and .Fn openat require an additional argument -.Fa "int mode" , +.Fa "mode_t mode" , and the file is created with mode .Fa mode as described in @@ -615,3 +615,8 @@ permits searches. The present implementation of the .Fa openat checks the current permissions of directory instead. +.Pp +The +.Fa mode +argument is variadic and may result in different calling conventions +than might otherwise be expected. ___ 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: r352838 - head/share/man/man3
On Sat, 2019-09-28 at 09:37 +, Edward Tomasz Napierala wrote: > Author: trasz > Date: Sat Sep 28 09:37:05 2019 > New Revision: 352838 > URL: https://svnweb.freebsd.org/changeset/base/352838 > > Log: > Sort MLINKS for arb(3), and actually make them work by fixing a '=' > vs '+=' > mixup. > ::sigh:: This wouldn't happen if we just always used += for all lines in lists of things, but sadly (IMO, surrealistically), style.Makefile explicitly prohibits that. I'm not sure what value the prohibition is supposed to provide, but the downsides are making this mistake over and over again, and if you manage to avoid the mistake your consolation prize is a diff that's less-clear because you have to change lines that aren't actually involed in the change you're making. -- Ian ___ 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: r352845 - head
Author: jhb Date: Sat Sep 28 14:20:28 2019 New Revision: 352845 URL: https://svnweb.freebsd.org/changeset/base/352845 Log: Disable build of LOCAL_MODULES for cross-builds by default. WITHOUT_LOCAL_MODULES can be set to disable LOCAL_MODULES for native builds. WITH_LOCAL_MODULES can be set to leave it enabled for cross builds. This does not use a knob in kern.opts.mk because the options framework does not currently support options whose default varies on the build type. I discussed a few options there with Warner (e.g. maybe having a tri-state where the default value is "auto" and having Makefile.inc1 apply logic when MK_LOCAL_MODULES is set to "auto"), but Warner ok'd this approach for now until a better solution is implemented. Requested by: many Reviewed by: imp (in person at EuroBSDCon) Differential Revision:https://reviews.freebsd.org/D21608 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 == --- head/Makefile.inc1 Sat Sep 28 14:14:42 2019(r352844) +++ head/Makefile.inc1 Sat Sep 28 14:20:28 2019(r352845) @@ -678,6 +678,10 @@ CROSSENV+= BUILD_TOOLS_META=.NOMETA .if defined(TARGET_CFLAGS) CROSSENV+= ${TARGET_CFLAGS} .endif +.if (${TARGET} != ${MACHINE} && !defined(WITH_LOCAL_MODULES)) || \ +defined(WITHOUT_LOCAL_MODULES) +CROSSENV+= LOCAL_MODULES= +.endif BOOTSTRAPPING_OSRELDATE?=${OSRELDATE} ___ 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: r352844 - head/sys/conf
Author: jhb Date: Sat Sep 28 14:14:42 2019 New Revision: 352844 URL: https://svnweb.freebsd.org/changeset/base/352844 Log: Disable REPRODUCIBLE_BUILD for kernel builds. The REPRODUCIBLE_BUILD option is actually managed in two separate files. src.opts.mk governs the setting for world builds and kern.opts.mk governs it for kernel builds. r350550 only changed the default for world builds. Reported by: emaste Reviewed by: emaste Differential Revision:https://reviews.freebsd.org/D21444 Modified: head/sys/conf/kern.opts.mk Modified: head/sys/conf/kern.opts.mk == --- head/sys/conf/kern.opts.mk Sat Sep 28 13:13:23 2019(r352843) +++ head/sys/conf/kern.opts.mk Sat Sep 28 14:14:42 2019(r352844) @@ -42,7 +42,6 @@ __DEFAULT_YES_OPTIONS = \ KERNEL_SYMBOLS \ NETGRAPH \ PF \ -REPRODUCIBLE_BUILD \ SOURCELESS_HOST \ SOURCELESS_UCODE \ TESTS \ @@ -53,7 +52,8 @@ __DEFAULT_NO_OPTIONS = \ EXTRA_TCP_STACKS \ KERNEL_RETPOLINE \ OFED \ -RATELIMIT +RATELIMIT \ +REPRODUCIBLE_BUILD # Some options are totally broken on some architectures. We disable # them. If you need to enable them on an experimental basis, you ___ 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: r352843 - head/sys/netinet
Author: tuexen Date: Sat Sep 28 13:13:23 2019 New Revision: 352843 URL: https://svnweb.freebsd.org/changeset/base/352843 Log: Replacing MD5 by SipHash improves the performance of the TCP time stamp initialisation, which is important when the host is dealing with a SYN flood. This affects the computation of the initial TCP sequence number for the client side. This has been discussed with secteam@. Reviewed by: gallatin@ Sponsored by: Netflix, Inc. Differential Revision:https://reviews.freebsd.org/D21616 Modified: head/sys/netinet/tcp_subr.c Modified: head/sys/netinet/tcp_subr.c == --- head/sys/netinet/tcp_subr.c Sat Sep 28 13:05:37 2019(r352842) +++ head/sys/netinet/tcp_subr.c Sat Sep 28 13:13:23 2019(r352843) @@ -126,7 +126,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include @@ -242,7 +242,7 @@ VNET_DEFINE(uma_zone_t, sack_hole_zone); VNET_DEFINE(struct hhook_head *, tcp_hhh[HHOOK_TCP_LAST+1]); #endif -#define TS_OFFSET_SECRET_LENGTH 32 +#define TS_OFFSET_SECRET_LENGTH SIPHASH_KEY_LENGTH VNET_DEFINE_STATIC(u_char, ts_offset_secret[TS_OFFSET_SECRET_LENGTH]); #defineV_ts_offset_secret VNET(ts_offset_secret) @@ -2621,30 +2621,32 @@ out: static uint32_t tcp_keyed_hash(struct in_conninfo *inc, u_char *key, u_int len) { - MD5_CTX ctx; - uint32_t hash[4]; + SIPHASH_CTX ctx; + uint32_t hash[2]; - MD5Init(); - MD5Update(, >inc_fport, sizeof(uint16_t)); - MD5Update(, >inc_lport, sizeof(uint16_t)); + KASSERT(len >= SIPHASH_KEY_LENGTH, + ("%s: keylen %u too short ", __func__, len)); + SipHash24_Init(); + SipHash_SetKey(, (uint8_t *)key); + SipHash_Update(, >inc_fport, sizeof(uint16_t)); + SipHash_Update(, >inc_lport, sizeof(uint16_t)); switch (inc->inc_flags & INC_ISIPV6) { #ifdef INET case 0: - MD5Update(, >inc_faddr, sizeof(struct in_addr)); - MD5Update(, >inc_laddr, sizeof(struct in_addr)); + SipHash_Update(, >inc_faddr, sizeof(struct in_addr)); + SipHash_Update(, >inc_laddr, sizeof(struct in_addr)); break; #endif #ifdef INET6 case INC_ISIPV6: - MD5Update(, >inc6_faddr, sizeof(struct in6_addr)); - MD5Update(, >inc6_laddr, sizeof(struct in6_addr)); + SipHash_Update(, >inc6_faddr, sizeof(struct in6_addr)); + SipHash_Update(, >inc6_laddr, sizeof(struct in6_addr)); break; #endif } - MD5Update(, key, len); - MD5Final((unsigned char *)hash, ); + SipHash_Final((uint8_t *)hash, ); - return (hash[0]); + return (hash[0] ^ hash[1]); } uint32_t @@ -2711,7 +2713,7 @@ tcp_new_ts_offset(struct in_conninfo *inc) #define ISN_BYTES_PER_SECOND 1048576 #define ISN_STATIC_INCREMENT 4096 #define ISN_RANDOM_INCREMENT (4096 - 1) -#define ISN_SECRET_LENGTH32 +#define ISN_SECRET_LENGTHSIPHASH_KEY_LENGTH VNET_DEFINE_STATIC(u_char, isn_secret[ISN_SECRET_LENGTH]); VNET_DEFINE_STATIC(int, isn_last); @@ -2740,7 +2742,7 @@ tcp_new_isn(struct in_conninfo *inc) V_isn_last_reseed = ticks; } - /* Compute the md5 hash and return the ISN. */ + /* Compute the hash and return the ISN. */ new_isn = (tcp_seq)tcp_keyed_hash(inc, V_isn_secret, sizeof(V_isn_secret)); V_isn_offset += ISN_STATIC_INCREMENT + ___ 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: r352842 - head/sys/netinet/tcp_stacks
Author: tuexen Date: Sat Sep 28 13:05:37 2019 New Revision: 352842 URL: https://svnweb.freebsd.org/changeset/base/352842 Log: Ensure that the INP lock is released before leaving [gs]etsockopt() for RACK specific socket options. These issues were found by a syzkaller instance. Reviewed by: rrs@ Sponsored by: Netflix, Inc. Differential Revision:https://reviews.freebsd.org/D21825 Modified: head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_stacks/rack.c == --- head/sys/netinet/tcp_stacks/rack.c Sat Sep 28 12:02:43 2019 (r352841) +++ head/sys/netinet/tcp_stacks/rack.c Sat Sep 28 13:05:37 2019 (r352842) @@ -10261,10 +10261,10 @@ rack_set_sockopt(struct socket *so, struct sockopt *so break; case TCP_RACK_TLP_INC_VAR: /* Does TLP include rtt variance in t-o */ - return (EINVAL); + error = EINVAL; break; case TCP_RACK_IDLE_REDUCE_HIGH: - return (EINVAL); + error = EINVAL; break; case TCP_DELACK: if (optval == 0) @@ -10329,6 +10329,7 @@ rack_get_sockopt(struct socket *so, struct sockopt *so * add a option that is not a int, then this will have quite an * impact to this routine. */ + error = 0; switch (sopt->sopt_name) { case TCP_RACK_DO_DETECTION: optval = rack->do_detection; @@ -10398,10 +10399,10 @@ rack_get_sockopt(struct socket *so, struct sockopt *so break; case TCP_RACK_TLP_INC_VAR: /* Does TLP include rtt variance in t-o */ - return (EINVAL); + error = EINVAL; break; case TCP_RACK_IDLE_REDUCE_HIGH: - return (EINVAL); + error = EINVAL; break; case TCP_RACK_MIN_PACE: optval = rack->r_enforce_min_pace; @@ -10423,7 +10424,9 @@ rack_get_sockopt(struct socket *so, struct sockopt *so break; } INP_WUNLOCK(inp); - error = sooptcopyout(sopt, , sizeof optval); + if (error == 0) { + error = sooptcopyout(sopt, , sizeof optval); + } return (error); } ___ 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: r352841 - head/usr.sbin/bhyve
Author: vmaffione Date: Sat Sep 28 12:02:43 2019 New Revision: 352841 URL: https://svnweb.freebsd.org/changeset/base/352841 Log: bhyve: support for enabling/disabling the net backend Extend the net backend interface with two functions, namely netbe_rx_disable() and netbe_rx_enable(), which can be used by the net device emulators to stop the backend from invoking the receive callback. This is useful for device emulators, i.e., on hardware resets or to implement receive backpressure. The mevent module has been extendede to support the addition of a disabled event. To prevent race conditions, the net backends will start with receive operation disabled. A follow-up patch will use the new functionalities in the virtio-net device. Reviewed by: jhb, markj MFC after:1 week Differential Revision: https://reviews.freebsd.org/D20973 Modified: head/usr.sbin/bhyve/mevent.c head/usr.sbin/bhyve/net_backends.c head/usr.sbin/bhyve/net_backends.h Modified: head/usr.sbin/bhyve/mevent.c == --- head/usr.sbin/bhyve/mevent.cSat Sep 28 09:54:03 2019 (r352840) +++ head/usr.sbin/bhyve/mevent.cSat Sep 28 12:02:43 2019 (r352841) @@ -62,10 +62,11 @@ __FBSDID("$FreeBSD$"); #defineMEVENT_MAX 64 -#defineMEV_ADD 1 -#defineMEV_ENABLE 2 -#defineMEV_DISABLE 3 -#defineMEV_DEL_PENDING 4 +#defineMEV_ADD 1 +#defineMEV_ENABLE 2 +#defineMEV_DISABLE 3 +#defineMEV_DEL_PENDING 4 +#defineMEV_ADD_DISABLED5 extern char *vmname; @@ -161,6 +162,9 @@ mevent_kq_flags(struct mevent *mevp) case MEV_ADD: ret = EV_ADD; /* implicitly enabled */ break; + case MEV_ADD_DISABLED: + ret = EV_ADD | EV_DISABLE; + break; case MEV_ENABLE: ret = EV_ENABLE; break; @@ -249,9 +253,10 @@ mevent_handle(struct kevent *kev, int numev) } } -struct mevent * -mevent_add(int tfd, enum ev_type type, - void (*func)(int, enum ev_type, void *), void *param) +static struct mevent * +mevent_add_state(int tfd, enum ev_type type, + void (*func)(int, enum ev_type, void *), void *param, + int state) { struct mevent *lp, *mevp; @@ -299,13 +304,21 @@ mevent_add(int tfd, enum ev_type type, LIST_INSERT_HEAD(_head, mevp, me_list); mevp->me_cq = 1; - mevp->me_state = MEV_ADD; + mevp->me_state = state; mevent_notify(); exit: mevent_qunlock(); return (mevp); +} + +struct mevent * +mevent_add(int tfd, enum ev_type type, + void (*func)(int, enum ev_type, void *), void *param) +{ + + return mevent_add_state(tfd, type, func, param, MEV_ADD); } static int Modified: head/usr.sbin/bhyve/net_backends.c == --- head/usr.sbin/bhyve/net_backends.c Sat Sep 28 09:54:03 2019 (r352840) +++ head/usr.sbin/bhyve/net_backends.c Sat Sep 28 12:02:43 2019 (r352841) @@ -110,6 +110,17 @@ struct net_backend { ssize_t (*recv)(struct net_backend *be, struct iovec *iov, int iovcnt); /* +* Ask the backend to enable or disable receive operation in the +* backend. On return from a disable operation, it is guaranteed +* that the receive callback won't be called until receive is +* enabled again. Note however that it is up to the caller to make +* sure that netbe_recv() is not currently being executed by another +* thread. +*/ + void (*recv_enable)(struct net_backend *be); + void (*recv_disable)(struct net_backend *be); + + /* * Ask the backend for the virtio-net features it is able to * support. Possible features are TSO, UFO and checksum offloading * in both rx and tx direction and for both IPv4 and IPv6. @@ -248,6 +259,22 @@ tap_recv(struct net_backend *be, struct iovec *iov, in return (ret); } +static void +tap_recv_enable(struct net_backend *be) +{ + struct tap_priv *priv = (struct tap_priv *)be->opaque; + + mevent_enable(priv->mevp); +} + +static void +tap_recv_disable(struct net_backend *be) +{ + struct tap_priv *priv = (struct tap_priv *)be->opaque; + + mevent_disable(priv->mevp); +} + static uint64_t tap_get_cap(struct net_backend *be) { @@ -270,6 +297,8 @@ static struct net_backend tap_backend = { .cleanup = tap_cleanup, .send = tap_send, .recv = tap_recv, + .recv_enable = tap_recv_enable, + .recv_disable = tap_recv_disable, .get_cap = tap_get_cap, .set_cap = tap_set_cap, }; @@ -282,6 +311,8 @@ static struct net_backend vmnet_backend = { .cleanup =
svn commit: r352840 - head/sys/sys
Author: trasz Date: Sat Sep 28 09:54:03 2019 New Revision: 352840 URL: https://svnweb.freebsd.org/changeset/base/352840 Log: Fix Q_TOSTR(3) with GCC when it's called with first parameter being const. Discussed with: cem MFC after:2 weeks Sponsored by: Klara Inc, Netflix Differential Revision:https://reviews.freebsd.org/D21766 Modified: head/sys/sys/qmath.h Modified: head/sys/sys/qmath.h == --- head/sys/sys/qmath.hSat Sep 28 09:50:01 2019(r352839) +++ head/sys/sys/qmath.hSat Sep 28 09:54:03 2019(r352840) @@ -58,11 +58,16 @@ typedef uint64_tu64q_t; typedefs64q_t smaxq_t; typedefu64q_t umaxq_t; +#if defined(__GNUC__) +/* Ancient GCC hack to de-const, remove when GCC4 is removed. */ +#defineQ_BT(q) __typeof(1 * q) +#else /* The underlying base type of 'q'. */ #defineQ_BT(q) __typeof(q) +#endif /* Type-cast variable 'v' to the same underlying type as 'q'. */ -#defineQ_TC(q, v) ((Q_BT(q))(v)) +#defineQ_TC(q, v) ((__typeof(q))(v)) /* Number of total bits associated with the data type underlying 'q'. */ #defineQ_NTBITS(q) ((uint32_t)(sizeof(q) << 3)) ___ 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: r352839 - in head: share/man/man3 sys/sys
Author: trasz Date: Sat Sep 28 09:50:01 2019 New Revision: 352839 URL: https://svnweb.freebsd.org/changeset/base/352839 Log: Rename ARB_REBALANCE(3) to ARB_REINSERT(3) to match tree(3), and document it. MFC after:2 weeks Sponsored by: Klara Inc, Netflix Modified: head/share/man/man3/Makefile head/share/man/man3/arb.3 head/sys/sys/arb.h Modified: head/share/man/man3/Makefile == --- head/share/man/man3/MakefileSat Sep 28 09:37:05 2019 (r352838) +++ head/share/man/man3/MakefileSat Sep 28 09:50:01 2019 (r352839) @@ -65,6 +65,7 @@ MLINKS= arb.3 ARB8_ENTRY.3 \ arb.3 ARB_PARENT.3 \ arb.3 ARB_PARENTIDX.3 \ arb.3 ARB_PREV.3 \ + arb.3 ARB_REINSERT.3 \ arb.3 ARB_REMOVE.3 \ arb.3 ARB_RIGHT.3 \ arb.3 ARB_RIGHTIDX.3 \ Modified: head/share/man/man3/arb.3 == --- head/share/man/man3/arb.3 Sat Sep 28 09:37:05 2019(r352838) +++ head/share/man/man3/arb.3 Sat Sep 28 09:50:01 2019(r352839) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 8, 2019 +.Dd September 28, 2019 .Dt ARB 3 .Os .Sh NAME @@ -45,6 +45,7 @@ .Nm ARB_PROTOTYPE_NEXT , .Nm ARB_PROTOTYPE_PREV , .Nm ARB_PROTOTYPE_MINMAX , +.Nm ARB_PROTOTYPE_REINSERT , .Nm ARB_GENERATE , .Nm ARB_GENERATE_STATIC , .Nm ARB_GENERATE_INSERT , @@ -56,6 +57,7 @@ .Nm ARB_GENERATE_NEXT , .Nm ARB_GENERATE_PREV , .Nm ARB_GENERATE_MINMAX , +.Nm ARB_GENERATE_REINSERT , .Nm ARB8_ENTRY , .Nm ARB16_ENTRY , .Nm ARB32_ENTRY , @@ -91,7 +93,8 @@ .Nm ARB_FOREACH_REVERSE_SAFE , .Nm ARB_INIT , .Nm ARB_INSERT , -.Nm ARB_REMOVE +.Nm ARB_REMOVE , +.Nm ARB_REINSERT .Nd "array-based red-black trees" .Sh SYNOPSIS .In sys/arb.h @@ -106,6 +109,7 @@ .Fn ARB_PROTOTYPE_NEXT NAME TYPE ATTR .Fn ARB_PROTOTYPE_PREV NAME TYPE ATTR .Fn ARB_PROTOTYPE_MINMAX NAME TYPE ATTR +.Fn ARB_PROTOTYPE_REINSERT NAME TYPE ATTR .Fn ARB_GENERATE NAME TYPE FIELD CMP .Fn ARB_GENERATE_STATIC NAME TYPE FIELD CMP .Fn ARB_GENERATE_INSERT NAME TYPE FIELD CMP ATTR @@ -117,6 +121,7 @@ .Fn ARB_GENERATE_NEXT NAME TYPE FIELD ATTR .Fn ARB_GENERATE_PREV NAME TYPE FIELD ATTR .Fn ARB_GENERATE_MINMAX NAME TYPE FIELD ATTR +.Fn ARB_GENERATE_REINSERT NAME TYPE FIELD CMP ATTR .Fn ARB<8|16|32>_ENTRY .Fn ARB<8|16|32>_HEAD HEADNAME TYPE .Ft "size_t" @@ -172,6 +177,8 @@ .Fn ARB_INSERT NAME "ARB_HEAD *head" "struct TYPE *elm" .Ft "struct TYPE *" .Fn ARB_REMOVE NAME "ARB_HEAD *head" "struct TYPE *elm" +.Ft "struct TYPE *" +.Fn ARB_REINSERT NAME "ARB_HEAD *head" "struct TYPE *elm" .Sh DESCRIPTION These macros define data structures for and array-based red-black trees. They use a single, continuous chunk of memory, and are useful @@ -297,8 +304,9 @@ Individual prototypes can be declared with .Fn ARB_PROTOTYPE_NFIND , .Fn ARB_PROTOTYPE_NEXT , .Fn ARB_PROTOTYPE_PREV , +.Fn ARB_PROTOTYPE_MINMAX , and -.Fn ARB_PROTOTYPE_MINMAX +.Fn ARB_PROTOTYPE_REINSERT in case not all functions are required. The individual prototype macros expect .Fa NAME , @@ -331,8 +339,9 @@ As an alternative individual function bodies are gener .Fn ARB_GENERATE_NFIND , .Fn ARB_GENERATE_NEXT , .Fn ARB_GENERATE_PREV , +.Fn ARB_GENERATE_MINMAX , and -.Fn ARB_GENERATE_MINMAX +.Fn ARB_GENERATE_REINSERT macros. .Pp Finally, @@ -464,6 +473,18 @@ Accordingly, returns the pointer to the removed element otherwise they return .Dv NULL to indicate an error. +.Pp +The +.Fn RB_REINSERT +macro updates the position of the element +.Fa elm +in the tree. +This must be called if a member of a +.Nm tree +is modified in a way that affects comparison, such as by modifying +a node's key. +This is a lower overhead alternative to removing the element +and reinserting it again. .Sh SEE ALSO .Xr queue 3 , .Xr tree 3 Modified: head/sys/sys/arb.h == --- head/sys/sys/arb.h Sat Sep 28 09:37:05 2019(r352838) +++ head/sys/sys/arb.h Sat Sep 28 09:50:01 2019(r352839) @@ -253,7 +253,7 @@ struct { \ ARB_PROTOTYPE_PREV(name, type, attr); \ ARB_PROTOTYPE_CMINMAX(name, type, attr);\ ARB_PROTOTYPE_MINMAX(name, type, attr); \ - ARB_PROTOTYPE_REBALANCE(name, type, attr); + ARB_PROTOTYPE_REINSERT(name, type, attr); #defineARB_PROTOTYPE_INSERT_COLOR(name, type, attr) \ attr void name##_ARB_INSERT_COLOR(struct name *, struct type *) #defineARB_PROTOTYPE_REMOVE_COLOR(name, type, attr) \ @@ -289,8 +289,8 @@ struct { \ attr const struct type
svn commit: r352838 - head/share/man/man3
Author: trasz Date: Sat Sep 28 09:37:05 2019 New Revision: 352838 URL: https://svnweb.freebsd.org/changeset/base/352838 Log: Sort MLINKS for arb(3), and actually make them work by fixing a '=' vs '+=' mixup. MFC after:2 weeks Sponsored by: Klara Inc, Netflix Modified: head/share/man/man3/Makefile Modified: head/share/man/man3/Makefile == --- head/share/man/man3/MakefileSat Sep 28 09:22:52 2019 (r352837) +++ head/share/man/man3/MakefileSat Sep 28 09:37:05 2019 (r352838) @@ -33,43 +33,43 @@ MAN=arb.3 \ timeradd.3 \ tree.3 -MLINKS+= arb.3 ARB8_ENTRY.3 \ - arb.3 ARB16_ENTRY.3 \ - arb.3 ARB32_ENTRY.3 \ +MLINKS=arb.3 ARB8_ENTRY.3 \ arb.3 ARB8_HEAD.3 \ + arb.3 ARB16_ENTRY.3 \ arb.3 ARB16_HEAD.3 \ + arb.3 ARB32_ENTRY.3 \ arb.3 ARB32_HEAD.3 \ arb.3 ARB_ALLOCSIZE.3 \ - arb.3 ARB_INITIALIZER.3 \ - arb.3 ARB_ROOT.3 \ - arb.3 ARB_EMPTY.3 \ - arb.3 ARB_FULL.3 \ arb.3 ARB_CURNODES.3 \ - arb.3 ARB_MAXNODES.3 \ - arb.3 ARB_NEXT.3 \ - arb.3 ARB_PREV.3 \ - arb.3 ARB_MIN.3 \ - arb.3 ARB_MAX.3 \ + arb.3 ARB_EMPTY.3 \ arb.3 ARB_FIND.3 \ - arb.3 ARB_NFIND.3 \ - arb.3 ARB_LEFT.3 \ - arb.3 ARB_LEFTIDX.3 \ - arb.3 ARB_RIGHT.3 \ - arb.3 ARB_RIGHTIDX.3 \ - arb.3 ARB_PARENT.3 \ - arb.3 ARB_PARENTIDX.3 \ - arb.3 ARB_GETFREE.3 \ - arb.3 ARB_FREEIDX.3 \ arb.3 ARB_FOREACH.3 \ arb.3 ARB_FOREACH_FROM.3 \ - arb.3 ARB_FOREACH_SAFE.3 \ arb.3 ARB_FOREACH_REVERSE.3 \ arb.3 ARB_FOREACH_REVERSE_FROM.3 \ arb.3 ARB_FOREACH_REVERSE_SAFE.3 \ + arb.3 ARB_FOREACH_SAFE.3 \ + arb.3 ARB_FREEIDX.3 \ + arb.3 ARB_FULL.3 \ + arb.3 ARB_GETFREE.3 \ arb.3 ARB_INIT.3 \ + arb.3 ARB_INITIALIZER.3 \ arb.3 ARB_INSERT.3 \ - arb.3 ARB_REMOVE.3 -MLINKS=ATOMIC_VAR_INIT.3 atomic_compare_exchange_strong.3 \ + arb.3 ARB_LEFT.3 \ + arb.3 ARB_LEFTIDX.3 \ + arb.3 ARB_MAX.3 \ + arb.3 ARB_MAXNODES.3 \ + arb.3 ARB_MIN.3 \ + arb.3 ARB_NEXT.3 \ + arb.3 ARB_NFIND.3 \ + arb.3 ARB_PARENT.3 \ + arb.3 ARB_PARENTIDX.3 \ + arb.3 ARB_PREV.3 \ + arb.3 ARB_REMOVE.3 \ + arb.3 ARB_RIGHT.3 \ + arb.3 ARB_RIGHTIDX.3 \ + arb.3 ARB_ROOT.3 +MLINKS+= ATOMIC_VAR_INIT.3 atomic_compare_exchange_strong.3 \ ATOMIC_VAR_INIT.3 atomic_compare_exchange_strong_explicit.3 \ ATOMIC_VAR_INIT.3 atomic_compare_exchange_weak.3 \ ATOMIC_VAR_INIT.3 atomic_compare_exchange_weak_explicit.3 \ ___ 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: r352837 - in head: share/man/man3 sys/sys
Author: trasz Date: Sat Sep 28 09:22:52 2019 New Revision: 352837 URL: https://svnweb.freebsd.org/changeset/base/352837 Log: Add RB_REINSERT(3), a low overhead alternative to removing a node and reinserting it back with an updated key. This is one of dependencies for the upcoming stats(3) code. Reviewed by: cem Obtained from:Netflix MFC after:2 weeks Sponsored by: Klara Inc, Netflix Differential Revision:https://reviews.freebsd.org/D21786 Modified: head/share/man/man3/Makefile head/share/man/man3/tree.3 head/sys/sys/tree.h Modified: head/share/man/man3/Makefile == --- head/share/man/man3/MakefileSat Sep 28 09:12:41 2019 (r352836) +++ head/share/man/man3/MakefileSat Sep 28 09:22:52 2019 (r352837) @@ -324,6 +324,7 @@ MLINKS+=tree.3 RB_EMPTY.3 \ tree.3 RB_PROTOTYPE_REMOVE.3 \ tree.3 RB_PROTOTYPE_REMOVE_COLOR.3 \ tree.3 RB_PROTOTYPE_STATIC.3 \ + tree.3 RB_REINSERT.3 \ tree.3 RB_REMOVE.3 \ tree.3 RB_RIGHT.3 \ tree.3 RB_ROOT.3 \ Modified: head/share/man/man3/tree.3 == --- head/share/man/man3/tree.3 Sat Sep 28 09:12:41 2019(r352836) +++ head/share/man/man3/tree.3 Sat Sep 28 09:22:52 2019(r352837) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 8, 2019 +.Dd September 28, 2019 .Dt TREE 3 .Os .Sh NAME @@ -62,6 +62,7 @@ .Nm RB_PROTOTYPE_NEXT , .Nm RB_PROTOTYPE_PREV , .Nm RB_PROTOTYPE_MINMAX , +.Nm RB_PROTOTYPE_REINSERT , .Nm RB_GENERATE , .Nm RB_GENERATE_STATIC , .Nm RB_GENERATE_INSERT , @@ -73,6 +74,7 @@ .Nm RB_GENERATE_NEXT , .Nm RB_GENERATE_PREV , .Nm RB_GENERATE_MINMAX , +.Nm RB_GENERATE_REINSERT , .Nm RB_ENTRY , .Nm RB_HEAD , .Nm RB_INITIALIZER , @@ -95,7 +97,8 @@ .Nm RB_FOREACH_REVERSE_SAFE , .Nm RB_INIT , .Nm RB_INSERT , -.Nm RB_REMOVE +.Nm RB_REMOVE , +.Nm RB_REINSERT .Nd "implementations of splay and red-black trees" .Sh SYNOPSIS .In sys/tree.h @@ -138,6 +141,7 @@ .Fn RB_PROTOTYPE_NEXT NAME TYPE ATTR .Fn RB_PROTOTYPE_PREV NAME TYPE ATTR .Fn RB_PROTOTYPE_MINMAX NAME TYPE ATTR +.Fn RB_PROTOTYPE_REINSERT NAME TYPE ATTR .Fn RB_GENERATE NAME TYPE FIELD CMP .Fn RB_GENERATE_STATIC NAME TYPE FIELD CMP .Fn RB_GENERATE_INSERT NAME TYPE FIELD CMP ATTR @@ -149,6 +153,7 @@ .Fn RB_GENERATE_NEXT NAME TYPE FIELD ATTR .Fn RB_GENERATE_PREV NAME TYPE FIELD ATTR .Fn RB_GENERATE_MINMAX NAME TYPE FIELD ATTR +.Fn RB_GENERATE_REINSERT NAME TYPE FIELD CMP ATTR .Fn RB_ENTRY TYPE .Fn RB_HEAD HEADNAME TYPE .Fn RB_INITIALIZER "RB_HEAD *head" @@ -186,6 +191,8 @@ .Fn RB_INSERT NAME "RB_HEAD *head" "struct TYPE *elm" .Ft "struct TYPE *" .Fn RB_REMOVE NAME "RB_HEAD *head" "struct TYPE *elm" +.Ft "struct TYPE *" +.Fn RB_REINSERT NAME "RB_HEAD *head" "struct TYPE *elm" .Sh DESCRIPTION These macros define data structures for different types of trees: splay trees and red-black trees. @@ -422,8 +429,9 @@ Individual prototypes can be declared with .Fn RB_PROTOTYPE_NFIND , .Fn RB_PROTOTYPE_NEXT , .Fn RB_PROTOTYPE_PREV , +.Fn RB_PROTOTYPE_MINMAX , and -.Fn RB_PROTOTYPE_MINMAX +.Fn RB_PROTOTYPE_REINSERT in case not all functions are required. The individual prototype macros expect .Fa NAME , @@ -456,8 +464,9 @@ As an alternative individual function bodies are gener .Fn RB_GENERATE_NFIND , .Fn RB_GENERATE_NEXT , .Fn RB_GENERATE_PREV , +.Fn RB_GENERATE_MINMAX , and -.Fn RB_GENERATE_MINMAX +.Fn RB_GENERATE_REINSERT macros. .Pp Finally, @@ -559,6 +568,18 @@ and will be overwritten to provide safe traversal. The .Fn RB_EMPTY macro should be used to check whether a red-black tree is empty. +.Pp +The +.Fn RB_REINSERT +macro updates the position of the element +.Fa elm +in the tree. +This must be called if a member of a +.Nm tree +is modified in a way that affects comparison, such as by modifying +a node's key. +This is a lower overhead alternative to removing the element +and reinserting it again. .Sh EXAMPLES The following example demonstrates how to declare a red-black tree holding integers. Modified: head/sys/sys/tree.h == --- head/sys/sys/tree.h Sat Sep 28 09:12:41 2019(r352836) +++ head/sys/sys/tree.h Sat Sep 28 09:22:52 2019(r352837) @@ -393,7 +393,8 @@ struct { \ RB_PROTOTYPE_NFIND(name, type, attr); \ RB_PROTOTYPE_NEXT(name, type, attr);\ RB_PROTOTYPE_PREV(name, type, attr);\ - RB_PROTOTYPE_MINMAX(name, type, attr); + RB_PROTOTYPE_MINMAX(name, type, attr); \ + RB_PROTOTYPE_REINSERT(name, type, attr); #define
svn commit: r352836 - in head/libexec/rc: . rc.d
Author: trasz Date: Sat Sep 28 09:12:41 2019 New Revision: 352836 URL: https://svnweb.freebsd.org/changeset/base/352836 Log: Move the SysV IPC stuff out of the 'abi' rc script, into a new one: 'sysvipc' - it has nothing to do with ABIs, and I'd like to later rename 'abi' to 'linux', which better describes its purpose and also matches the rcvar name. Reviewed by: emaste MFC after:2 weeks Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D21615 Added: head/libexec/rc/rc.d/sysvipc - copied, changed from r352676, head/libexec/rc/rc.d/abi Modified: head/libexec/rc/rc.conf head/libexec/rc/rc.d/Makefile head/libexec/rc/rc.d/SERVERS head/libexec/rc/rc.d/abi head/libexec/rc/rc.d/localpkg Modified: head/libexec/rc/rc.conf == --- head/libexec/rc/rc.conf Sat Sep 28 08:57:29 2019(r352835) +++ head/libexec/rc/rc.conf Sat Sep 28 09:12:41 2019(r352836) @@ -638,8 +638,6 @@ accounting_enable="NO" # Turn on process accounting (o firstboot_sentinel="/firstboot"# Scripts with "firstboot" keyword are run if # this file exists. Should be on a R/W filesystem so # the file can be deleted after the boot completes. - -# Emulation/compatibility services provided by /etc/rc.d/abi sysvipc_enable="NO"# Load System V IPC primitives at startup (or NO). linux_enable="NO" # Linux binary compatibility loaded at startup (or NO). clear_tmp_enable="NO" # Clear /tmp at startup. Modified: head/libexec/rc/rc.d/Makefile == --- head/libexec/rc/rc.d/Makefile Sat Sep 28 08:57:29 2019 (r352835) +++ head/libexec/rc/rc.d/Makefile Sat Sep 28 09:12:41 2019 (r352836) @@ -107,6 +107,7 @@ CONFS= DAEMON \ swaplate \ sysctl \ syslogd \ + sysvipc \ tmp \ ugidfw \ ${_utx} \ Modified: head/libexec/rc/rc.d/SERVERS == --- head/libexec/rc/rc.d/SERVERSSat Sep 28 08:57:29 2019 (r352835) +++ head/libexec/rc/rc.d/SERVERSSat Sep 28 09:12:41 2019 (r352836) @@ -4,7 +4,7 @@ # # PROVIDE: SERVERS -# REQUIRE: mountcritremote abi ldconfig savecore watchdogd +# REQUIRE: mountcritremote sysvipc abi ldconfig savecore watchdogd # This is a dummy dependency, for early-start servers relying on # some basic configuration. Modified: head/libexec/rc/rc.d/abi == --- head/libexec/rc/rc.d/abiSat Sep 28 08:57:29 2019(r352835) +++ head/libexec/rc/rc.d/abiSat Sep 28 09:12:41 2019(r352836) @@ -14,14 +14,6 @@ desc="Enable foreign ABIs" start_cmd="${name}_start" stop_cmd=":" -sysv_start() -{ - echo -n ' sysvipc' - load_kld sysvmsg - load_kld sysvsem - load_kld sysvshm -} - linux_start() { local _tmpdir @@ -48,12 +40,11 @@ abi_start() local _echostop _echostop= - if checkyesno sysvipc_enable || checkyesno linux_enable; then + if checkyesno linux_enable; then echo -n 'Additional ABI support:' _echostop=yes fi - checkyesno sysvipc_enable && sysv_start checkyesno linux_enable && linux_start [ -n "${_echostop}" ] && echo '.' Modified: head/libexec/rc/rc.d/localpkg == --- head/libexec/rc/rc.d/localpkg Sat Sep 28 08:57:29 2019 (r352835) +++ head/libexec/rc/rc.d/localpkg Sat Sep 28 09:12:41 2019 (r352836) @@ -4,7 +4,7 @@ # # PROVIDE: localpkg -# REQUIRE: abi +# REQUIRE: sysvipc abi # BEFORE: securelevel # KEYWORD: shutdown Copied and modified: head/libexec/rc/rc.d/sysvipc (from r352676, head/libexec/rc/rc.d/abi) == --- head/libexec/rc/rc.d/abiWed Sep 25 10:46:05 2019(r352676, copy source) +++ head/libexec/rc/rc.d/sysvipcSat Sep 28 09:12:41 2019 (r352836) @@ -3,60 +3,23 @@ # $FreeBSD$ # -# PROVIDE: abi +# PROVIDE: sysvipc # REQUIRE: archdep # KEYWORD: nojail . /etc/rc.subr -name="abi" -desc="Enable foreign ABIs" +name="sysvipc" +desc="Load SysV IPC modules" +rcvar="sysvipc_enable" start_cmd="${name}_start" stop_cmd=":" -sysv_start() +sysvipc_start() { - echo -n ' sysvipc' load_kld sysvmsg load_kld sysvsem load_kld sysvshm -} - -linux_start() -{ - local _tmpdir - - echo -n ' linux' - load_kld -e 'linux(aout|elf)' linux - case `sysctl -n hw.machine_arch` in - amd64) - load_kld -e 'linux64elf' linux64 - ;; -
svn commit: r352835 - in stable: 10/lib/msun/src 11/lib/msun/src 12/lib/msun/src 8/lib/msun/src 9/lib/msun/src
Author: dim Date: Sat Sep 28 08:57:29 2019 New Revision: 352835 URL: https://svnweb.freebsd.org/changeset/base/352835 Log: MFC r352710: Do not left-shift a negative number (inducing undefined behavior in C/C++) in exp(3), expf(3), expm1(3) and expm1f(3) during intermediate computations that compute the IEEE-754 bit pattern for |2**k| for integer |k|. The implementations of exp(3), expf(3), expm1(3) and expm1f(3) need to compute IEEE-754 bit patterns for 2**k in certain places. (k is an integer and 2**k is exactly representable in IEEE-754.) Currently they do things like 0x3FF0'+(k<<20), which is to say they take the bit pattern representing 1 and then add directly to the exponent field to get the desired power of two. This is fine when k is non-negative. But when k<0 (and certain classes of input trigger this), this left-shifts a negative number -- an operation with undefined behavior in C and C++. The desired semantics can be achieved by instead adding the possibly-negative k to the IEEE-754 exponent bias to get the desired exponent field, _then_ shifting that into its proper overall position. (Note that in case of s_expm1.c and s_expm1f.c, there are SET_HIGH_WORD and SET_FLOAT_WORD uses further down in each of these files that perform shift operations involving k, but by these points k's range has been restricted to 2 < k <= 56, and the shift operations under those circumstances can't do anything that would be UB.) Submitted by: Jeff Walden, https://github.com/jswalden Obtained from:https://github.com/freebsd/freebsd/pull/411 Obtained from:https://github.com/freebsd/freebsd/pull/412 Modified: stable/11/lib/msun/src/e_exp.c stable/11/lib/msun/src/e_expf.c stable/11/lib/msun/src/s_expm1.c stable/11/lib/msun/src/s_expm1f.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/lib/msun/src/e_exp.c stable/10/lib/msun/src/e_expf.c stable/10/lib/msun/src/s_expm1.c stable/10/lib/msun/src/s_expm1f.c stable/12/lib/msun/src/e_exp.c stable/12/lib/msun/src/e_expf.c stable/12/lib/msun/src/s_expm1.c stable/12/lib/msun/src/s_expm1f.c stable/8/lib/msun/src/e_exp.c stable/8/lib/msun/src/e_expf.c stable/8/lib/msun/src/s_expm1.c stable/8/lib/msun/src/s_expm1f.c stable/9/lib/msun/src/e_exp.c stable/9/lib/msun/src/e_expf.c stable/9/lib/msun/src/s_expm1.c stable/9/lib/msun/src/s_expm1f.c Directory Properties: stable/10/ (props changed) stable/12/ (props changed) stable/8/ (props changed) stable/8/lib/ (props changed) stable/8/lib/msun/ (props changed) stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/msun/ (props changed) Modified: stable/11/lib/msun/src/e_exp.c == --- stable/11/lib/msun/src/e_exp.c Sat Sep 28 08:54:32 2019 (r352834) +++ stable/11/lib/msun/src/e_exp.c Sat Sep 28 08:57:29 2019 (r352835) @@ -145,9 +145,9 @@ __ieee754_exp(double x) /* default IEEE double exp */ /* x is now in primary range */ t = x*x; if(k >= -1021) - INSERT_WORDS(twopk,0x3ff0+(k<<20), 0); + INSERT_WORDS(twopk,((u_int32_t)(0x3ff+k))<<20, 0); else - INSERT_WORDS(twopk,0x3ff0+((k+1000)<<20), 0); + INSERT_WORDS(twopk,((u_int32_t)(0x3ff+(k+1000)))<<20, 0); c = x - t*(P1+t*(P2+t*(P3+t*(P4+t*P5; if(k==0)return one-((x*c)/(c-2.0)-x); elsey = one-((lo-(x*c)/(2.0-c))-hi); Modified: stable/11/lib/msun/src/e_expf.c == --- stable/11/lib/msun/src/e_expf.c Sat Sep 28 08:54:32 2019 (r352834) +++ stable/11/lib/msun/src/e_expf.c Sat Sep 28 08:57:29 2019 (r352835) @@ -83,9 +83,9 @@ __ieee754_expf(float x) /* x is now in primary range */ t = x*x; if(k >= -125) - SET_FLOAT_WORD(twopk,0x3f80+(k<<23)); + SET_FLOAT_WORD(twopk,((u_int32_t)(0x7f+k))<<23); else - SET_FLOAT_WORD(twopk,0x3f80+((k+100)<<23)); + SET_FLOAT_WORD(twopk,((u_int32_t)(0x7f+(k+100)))<<23); c = x - t*(P1+t*P2); if(k==0)return one-((x*c)/(c-(float)2.0)-x); elsey = one-((lo-(x*c)/((float)2.0-c))-hi); Modified: stable/11/lib/msun/src/s_expm1.c == --- stable/11/lib/msun/src/s_expm1.cSat Sep 28 08:54:32 2019 (r352834) +++ stable/11/lib/msun/src/s_expm1.cSat Sep 28 08:57:29 2019 (r352835) @@ -188,7 +188,7 @@ expm1(double x) e = hxs*((r1-t)/(6.0 - x*t)); if(k==0) return x - (x*e-hxs); /* c is 0 */ else { - INSERT_WORDS(twopk,0x3ff0+(k<<20),0); /* 2^k */ +
svn commit: r352835 - in stable: 10/lib/msun/src 11/lib/msun/src 12/lib/msun/src 8/lib/msun/src 9/lib/msun/src
Author: dim Date: Sat Sep 28 08:57:29 2019 New Revision: 352835 URL: https://svnweb.freebsd.org/changeset/base/352835 Log: MFC r352710: Do not left-shift a negative number (inducing undefined behavior in C/C++) in exp(3), expf(3), expm1(3) and expm1f(3) during intermediate computations that compute the IEEE-754 bit pattern for |2**k| for integer |k|. The implementations of exp(3), expf(3), expm1(3) and expm1f(3) need to compute IEEE-754 bit patterns for 2**k in certain places. (k is an integer and 2**k is exactly representable in IEEE-754.) Currently they do things like 0x3FF0'+(k<<20), which is to say they take the bit pattern representing 1 and then add directly to the exponent field to get the desired power of two. This is fine when k is non-negative. But when k<0 (and certain classes of input trigger this), this left-shifts a negative number -- an operation with undefined behavior in C and C++. The desired semantics can be achieved by instead adding the possibly-negative k to the IEEE-754 exponent bias to get the desired exponent field, _then_ shifting that into its proper overall position. (Note that in case of s_expm1.c and s_expm1f.c, there are SET_HIGH_WORD and SET_FLOAT_WORD uses further down in each of these files that perform shift operations involving k, but by these points k's range has been restricted to 2 < k <= 56, and the shift operations under those circumstances can't do anything that would be UB.) Submitted by: Jeff Walden, https://github.com/jswalden Obtained from:https://github.com/freebsd/freebsd/pull/411 Obtained from:https://github.com/freebsd/freebsd/pull/412 Modified: stable/8/lib/msun/src/e_exp.c stable/8/lib/msun/src/e_expf.c stable/8/lib/msun/src/s_expm1.c stable/8/lib/msun/src/s_expm1f.c Directory Properties: stable/8/ (props changed) stable/8/lib/ (props changed) stable/8/lib/msun/ (props changed) Changes in other areas also in this revision: Modified: stable/10/lib/msun/src/e_exp.c stable/10/lib/msun/src/e_expf.c stable/10/lib/msun/src/s_expm1.c stable/10/lib/msun/src/s_expm1f.c stable/11/lib/msun/src/e_exp.c stable/11/lib/msun/src/e_expf.c stable/11/lib/msun/src/s_expm1.c stable/11/lib/msun/src/s_expm1f.c stable/12/lib/msun/src/e_exp.c stable/12/lib/msun/src/e_expf.c stable/12/lib/msun/src/s_expm1.c stable/12/lib/msun/src/s_expm1f.c stable/9/lib/msun/src/e_exp.c stable/9/lib/msun/src/e_expf.c stable/9/lib/msun/src/s_expm1.c stable/9/lib/msun/src/s_expm1f.c Directory Properties: stable/10/ (props changed) stable/11/ (props changed) stable/12/ (props changed) stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/msun/ (props changed) Modified: stable/8/lib/msun/src/e_exp.c == --- stable/8/lib/msun/src/e_exp.c Sat Sep 28 08:54:32 2019 (r352834) +++ stable/8/lib/msun/src/e_exp.c Sat Sep 28 08:57:29 2019 (r352835) @@ -143,9 +143,9 @@ __ieee754_exp(double x) /* default IEEE double exp */ /* x is now in primary range */ t = x*x; if(k >= -1021) - INSERT_WORDS(twopk,0x3ff0+(k<<20), 0); + INSERT_WORDS(twopk,((u_int32_t)(0x3ff+k))<<20, 0); else - INSERT_WORDS(twopk,0x3ff0+((k+1000)<<20), 0); + INSERT_WORDS(twopk,((u_int32_t)(0x3ff+(k+1000)))<<20, 0); c = x - t*(P1+t*(P2+t*(P3+t*(P4+t*P5; if(k==0)return one-((x*c)/(c-2.0)-x); elsey = one-((lo-(x*c)/(2.0-c))-hi); Modified: stable/8/lib/msun/src/e_expf.c == --- stable/8/lib/msun/src/e_expf.c Sat Sep 28 08:54:32 2019 (r352834) +++ stable/8/lib/msun/src/e_expf.c Sat Sep 28 08:57:29 2019 (r352835) @@ -80,9 +80,9 @@ __ieee754_expf(float x) /* default IEEE double exp */ /* x is now in primary range */ t = x*x; if(k >= -125) - SET_FLOAT_WORD(twopk,0x3f80+(k<<23)); + SET_FLOAT_WORD(twopk,((u_int32_t)(0x7f+k))<<23); else - SET_FLOAT_WORD(twopk,0x3f80+((k+100)<<23)); + SET_FLOAT_WORD(twopk,((u_int32_t)(0x7f+(k+100)))<<23); c = x - t*(P1+t*P2); if(k==0)return one-((x*c)/(c-(float)2.0)-x); elsey = one-((lo-(x*c)/((float)2.0-c))-hi); Modified: stable/8/lib/msun/src/s_expm1.c == --- stable/8/lib/msun/src/s_expm1.c Sat Sep 28 08:54:32 2019 (r352834) +++ stable/8/lib/msun/src/s_expm1.c Sat Sep 28 08:57:29 2019 (r352835) @@ -186,7 +186,7 @@ expm1(double x) e = hxs*((r1-t)/(6.0 - x*t)); if(k==0) return x - (x*e-hxs); /* c is 0 */ else { -
svn commit: r352835 - in stable: 10/lib/msun/src 11/lib/msun/src 12/lib/msun/src 8/lib/msun/src 9/lib/msun/src
Author: dim Date: Sat Sep 28 08:57:29 2019 New Revision: 352835 URL: https://svnweb.freebsd.org/changeset/base/352835 Log: MFC r352710: Do not left-shift a negative number (inducing undefined behavior in C/C++) in exp(3), expf(3), expm1(3) and expm1f(3) during intermediate computations that compute the IEEE-754 bit pattern for |2**k| for integer |k|. The implementations of exp(3), expf(3), expm1(3) and expm1f(3) need to compute IEEE-754 bit patterns for 2**k in certain places. (k is an integer and 2**k is exactly representable in IEEE-754.) Currently they do things like 0x3FF0'+(k<<20), which is to say they take the bit pattern representing 1 and then add directly to the exponent field to get the desired power of two. This is fine when k is non-negative. But when k<0 (and certain classes of input trigger this), this left-shifts a negative number -- an operation with undefined behavior in C and C++. The desired semantics can be achieved by instead adding the possibly-negative k to the IEEE-754 exponent bias to get the desired exponent field, _then_ shifting that into its proper overall position. (Note that in case of s_expm1.c and s_expm1f.c, there are SET_HIGH_WORD and SET_FLOAT_WORD uses further down in each of these files that perform shift operations involving k, but by these points k's range has been restricted to 2 < k <= 56, and the shift operations under those circumstances can't do anything that would be UB.) Submitted by: Jeff Walden, https://github.com/jswalden Obtained from:https://github.com/freebsd/freebsd/pull/411 Obtained from:https://github.com/freebsd/freebsd/pull/412 Modified: stable/12/lib/msun/src/e_exp.c stable/12/lib/msun/src/e_expf.c stable/12/lib/msun/src/s_expm1.c stable/12/lib/msun/src/s_expm1f.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/10/lib/msun/src/e_exp.c stable/10/lib/msun/src/e_expf.c stable/10/lib/msun/src/s_expm1.c stable/10/lib/msun/src/s_expm1f.c stable/11/lib/msun/src/e_exp.c stable/11/lib/msun/src/e_expf.c stable/11/lib/msun/src/s_expm1.c stable/11/lib/msun/src/s_expm1f.c stable/8/lib/msun/src/e_exp.c stable/8/lib/msun/src/e_expf.c stable/8/lib/msun/src/s_expm1.c stable/8/lib/msun/src/s_expm1f.c stable/9/lib/msun/src/e_exp.c stable/9/lib/msun/src/e_expf.c stable/9/lib/msun/src/s_expm1.c stable/9/lib/msun/src/s_expm1f.c Directory Properties: stable/10/ (props changed) stable/11/ (props changed) stable/8/ (props changed) stable/8/lib/ (props changed) stable/8/lib/msun/ (props changed) stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/msun/ (props changed) Modified: stable/12/lib/msun/src/e_exp.c == --- stable/12/lib/msun/src/e_exp.c Sat Sep 28 08:54:32 2019 (r352834) +++ stable/12/lib/msun/src/e_exp.c Sat Sep 28 08:57:29 2019 (r352835) @@ -145,9 +145,9 @@ __ieee754_exp(double x) /* default IEEE double exp */ /* x is now in primary range */ t = x*x; if(k >= -1021) - INSERT_WORDS(twopk,0x3ff0+(k<<20), 0); + INSERT_WORDS(twopk,((u_int32_t)(0x3ff+k))<<20, 0); else - INSERT_WORDS(twopk,0x3ff0+((k+1000)<<20), 0); + INSERT_WORDS(twopk,((u_int32_t)(0x3ff+(k+1000)))<<20, 0); c = x - t*(P1+t*(P2+t*(P3+t*(P4+t*P5; if(k==0)return one-((x*c)/(c-2.0)-x); elsey = one-((lo-(x*c)/(2.0-c))-hi); Modified: stable/12/lib/msun/src/e_expf.c == --- stable/12/lib/msun/src/e_expf.c Sat Sep 28 08:54:32 2019 (r352834) +++ stable/12/lib/msun/src/e_expf.c Sat Sep 28 08:57:29 2019 (r352835) @@ -83,9 +83,9 @@ __ieee754_expf(float x) /* x is now in primary range */ t = x*x; if(k >= -125) - SET_FLOAT_WORD(twopk,0x3f80+(k<<23)); + SET_FLOAT_WORD(twopk,((u_int32_t)(0x7f+k))<<23); else - SET_FLOAT_WORD(twopk,0x3f80+((k+100)<<23)); + SET_FLOAT_WORD(twopk,((u_int32_t)(0x7f+(k+100)))<<23); c = x - t*(P1+t*P2); if(k==0)return one-((x*c)/(c-(float)2.0)-x); elsey = one-((lo-(x*c)/((float)2.0-c))-hi); Modified: stable/12/lib/msun/src/s_expm1.c == --- stable/12/lib/msun/src/s_expm1.cSat Sep 28 08:54:32 2019 (r352834) +++ stable/12/lib/msun/src/s_expm1.cSat Sep 28 08:57:29 2019 (r352835) @@ -188,7 +188,7 @@ expm1(double x) e = hxs*((r1-t)/(6.0 - x*t)); if(k==0) return x - (x*e-hxs); /* c is 0 */ else { - INSERT_WORDS(twopk,0x3ff0+(k<<20),0); /* 2^k */ +
svn commit: r352835 - in stable: 10/lib/msun/src 11/lib/msun/src 12/lib/msun/src 8/lib/msun/src 9/lib/msun/src
Author: dim Date: Sat Sep 28 08:57:29 2019 New Revision: 352835 URL: https://svnweb.freebsd.org/changeset/base/352835 Log: MFC r352710: Do not left-shift a negative number (inducing undefined behavior in C/C++) in exp(3), expf(3), expm1(3) and expm1f(3) during intermediate computations that compute the IEEE-754 bit pattern for |2**k| for integer |k|. The implementations of exp(3), expf(3), expm1(3) and expm1f(3) need to compute IEEE-754 bit patterns for 2**k in certain places. (k is an integer and 2**k is exactly representable in IEEE-754.) Currently they do things like 0x3FF0'+(k<<20), which is to say they take the bit pattern representing 1 and then add directly to the exponent field to get the desired power of two. This is fine when k is non-negative. But when k<0 (and certain classes of input trigger this), this left-shifts a negative number -- an operation with undefined behavior in C and C++. The desired semantics can be achieved by instead adding the possibly-negative k to the IEEE-754 exponent bias to get the desired exponent field, _then_ shifting that into its proper overall position. (Note that in case of s_expm1.c and s_expm1f.c, there are SET_HIGH_WORD and SET_FLOAT_WORD uses further down in each of these files that perform shift operations involving k, but by these points k's range has been restricted to 2 < k <= 56, and the shift operations under those circumstances can't do anything that would be UB.) Submitted by: Jeff Walden, https://github.com/jswalden Obtained from:https://github.com/freebsd/freebsd/pull/411 Obtained from:https://github.com/freebsd/freebsd/pull/412 Modified: stable/9/lib/msun/src/e_exp.c stable/9/lib/msun/src/e_expf.c stable/9/lib/msun/src/s_expm1.c stable/9/lib/msun/src/s_expm1f.c Directory Properties: stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/msun/ (props changed) Changes in other areas also in this revision: Modified: stable/10/lib/msun/src/e_exp.c stable/10/lib/msun/src/e_expf.c stable/10/lib/msun/src/s_expm1.c stable/10/lib/msun/src/s_expm1f.c stable/11/lib/msun/src/e_exp.c stable/11/lib/msun/src/e_expf.c stable/11/lib/msun/src/s_expm1.c stable/11/lib/msun/src/s_expm1f.c stable/12/lib/msun/src/e_exp.c stable/12/lib/msun/src/e_expf.c stable/12/lib/msun/src/s_expm1.c stable/12/lib/msun/src/s_expm1f.c stable/8/lib/msun/src/e_exp.c stable/8/lib/msun/src/e_expf.c stable/8/lib/msun/src/s_expm1.c stable/8/lib/msun/src/s_expm1f.c Directory Properties: stable/10/ (props changed) stable/11/ (props changed) stable/12/ (props changed) stable/8/ (props changed) stable/8/lib/ (props changed) stable/8/lib/msun/ (props changed) Modified: stable/9/lib/msun/src/e_exp.c == --- stable/9/lib/msun/src/e_exp.c Sat Sep 28 08:54:32 2019 (r352834) +++ stable/9/lib/msun/src/e_exp.c Sat Sep 28 08:57:29 2019 (r352835) @@ -143,9 +143,9 @@ __ieee754_exp(double x) /* default IEEE double exp */ /* x is now in primary range */ t = x*x; if(k >= -1021) - INSERT_WORDS(twopk,0x3ff0+(k<<20), 0); + INSERT_WORDS(twopk,((u_int32_t)(0x3ff+k))<<20, 0); else - INSERT_WORDS(twopk,0x3ff0+((k+1000)<<20), 0); + INSERT_WORDS(twopk,((u_int32_t)(0x3ff+(k+1000)))<<20, 0); c = x - t*(P1+t*(P2+t*(P3+t*(P4+t*P5; if(k==0)return one-((x*c)/(c-2.0)-x); elsey = one-((lo-(x*c)/(2.0-c))-hi); Modified: stable/9/lib/msun/src/e_expf.c == --- stable/9/lib/msun/src/e_expf.c Sat Sep 28 08:54:32 2019 (r352834) +++ stable/9/lib/msun/src/e_expf.c Sat Sep 28 08:57:29 2019 (r352835) @@ -80,9 +80,9 @@ __ieee754_expf(float x) /* default IEEE double exp */ /* x is now in primary range */ t = x*x; if(k >= -125) - SET_FLOAT_WORD(twopk,0x3f80+(k<<23)); + SET_FLOAT_WORD(twopk,((u_int32_t)(0x7f+k))<<23); else - SET_FLOAT_WORD(twopk,0x3f80+((k+100)<<23)); + SET_FLOAT_WORD(twopk,((u_int32_t)(0x7f+(k+100)))<<23); c = x - t*(P1+t*P2); if(k==0)return one-((x*c)/(c-(float)2.0)-x); elsey = one-((lo-(x*c)/((float)2.0-c))-hi); Modified: stable/9/lib/msun/src/s_expm1.c == --- stable/9/lib/msun/src/s_expm1.c Sat Sep 28 08:54:32 2019 (r352834) +++ stable/9/lib/msun/src/s_expm1.c Sat Sep 28 08:57:29 2019 (r352835) @@ -186,7 +186,7 @@ expm1(double x) e = hxs*((r1-t)/(6.0 - x*t)); if(k==0) return x - (x*e-hxs); /* c is 0 */ else { -
svn commit: r352835 - in stable: 10/lib/msun/src 11/lib/msun/src 12/lib/msun/src 8/lib/msun/src 9/lib/msun/src
Author: dim Date: Sat Sep 28 08:57:29 2019 New Revision: 352835 URL: https://svnweb.freebsd.org/changeset/base/352835 Log: MFC r352710: Do not left-shift a negative number (inducing undefined behavior in C/C++) in exp(3), expf(3), expm1(3) and expm1f(3) during intermediate computations that compute the IEEE-754 bit pattern for |2**k| for integer |k|. The implementations of exp(3), expf(3), expm1(3) and expm1f(3) need to compute IEEE-754 bit patterns for 2**k in certain places. (k is an integer and 2**k is exactly representable in IEEE-754.) Currently they do things like 0x3FF0'+(k<<20), which is to say they take the bit pattern representing 1 and then add directly to the exponent field to get the desired power of two. This is fine when k is non-negative. But when k<0 (and certain classes of input trigger this), this left-shifts a negative number -- an operation with undefined behavior in C and C++. The desired semantics can be achieved by instead adding the possibly-negative k to the IEEE-754 exponent bias to get the desired exponent field, _then_ shifting that into its proper overall position. (Note that in case of s_expm1.c and s_expm1f.c, there are SET_HIGH_WORD and SET_FLOAT_WORD uses further down in each of these files that perform shift operations involving k, but by these points k's range has been restricted to 2 < k <= 56, and the shift operations under those circumstances can't do anything that would be UB.) Submitted by: Jeff Walden, https://github.com/jswalden Obtained from:https://github.com/freebsd/freebsd/pull/411 Obtained from:https://github.com/freebsd/freebsd/pull/412 Modified: stable/10/lib/msun/src/e_exp.c stable/10/lib/msun/src/e_expf.c stable/10/lib/msun/src/s_expm1.c stable/10/lib/msun/src/s_expm1f.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/lib/msun/src/e_exp.c stable/11/lib/msun/src/e_expf.c stable/11/lib/msun/src/s_expm1.c stable/11/lib/msun/src/s_expm1f.c stable/12/lib/msun/src/e_exp.c stable/12/lib/msun/src/e_expf.c stable/12/lib/msun/src/s_expm1.c stable/12/lib/msun/src/s_expm1f.c stable/8/lib/msun/src/e_exp.c stable/8/lib/msun/src/e_expf.c stable/8/lib/msun/src/s_expm1.c stable/8/lib/msun/src/s_expm1f.c stable/9/lib/msun/src/e_exp.c stable/9/lib/msun/src/e_expf.c stable/9/lib/msun/src/s_expm1.c stable/9/lib/msun/src/s_expm1f.c Directory Properties: stable/11/ (props changed) stable/12/ (props changed) stable/8/ (props changed) stable/8/lib/ (props changed) stable/8/lib/msun/ (props changed) stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/msun/ (props changed) Modified: stable/10/lib/msun/src/e_exp.c == --- stable/10/lib/msun/src/e_exp.c Sat Sep 28 08:54:32 2019 (r352834) +++ stable/10/lib/msun/src/e_exp.c Sat Sep 28 08:57:29 2019 (r352835) @@ -145,9 +145,9 @@ __ieee754_exp(double x) /* default IEEE double exp */ /* x is now in primary range */ t = x*x; if(k >= -1021) - INSERT_WORDS(twopk,0x3ff0+(k<<20), 0); + INSERT_WORDS(twopk,((u_int32_t)(0x3ff+k))<<20, 0); else - INSERT_WORDS(twopk,0x3ff0+((k+1000)<<20), 0); + INSERT_WORDS(twopk,((u_int32_t)(0x3ff+(k+1000)))<<20, 0); c = x - t*(P1+t*(P2+t*(P3+t*(P4+t*P5; if(k==0)return one-((x*c)/(c-2.0)-x); elsey = one-((lo-(x*c)/(2.0-c))-hi); Modified: stable/10/lib/msun/src/e_expf.c == --- stable/10/lib/msun/src/e_expf.c Sat Sep 28 08:54:32 2019 (r352834) +++ stable/10/lib/msun/src/e_expf.c Sat Sep 28 08:57:29 2019 (r352835) @@ -83,9 +83,9 @@ __ieee754_expf(float x) /* x is now in primary range */ t = x*x; if(k >= -125) - SET_FLOAT_WORD(twopk,0x3f80+(k<<23)); + SET_FLOAT_WORD(twopk,((u_int32_t)(0x7f+k))<<23); else - SET_FLOAT_WORD(twopk,0x3f80+((k+100)<<23)); + SET_FLOAT_WORD(twopk,((u_int32_t)(0x7f+(k+100)))<<23); c = x - t*(P1+t*P2); if(k==0)return one-((x*c)/(c-(float)2.0)-x); elsey = one-((lo-(x*c)/((float)2.0-c))-hi); Modified: stable/10/lib/msun/src/s_expm1.c == --- stable/10/lib/msun/src/s_expm1.cSat Sep 28 08:54:32 2019 (r352834) +++ stable/10/lib/msun/src/s_expm1.cSat Sep 28 08:57:29 2019 (r352835) @@ -188,7 +188,7 @@ expm1(double x) e = hxs*((r1-t)/(6.0 - x*t)); if(k==0) return x - (x*e-hxs); /* c is 0 */ else { - INSERT_WORDS(twopk,0x3ff0+(k<<20),0); /* 2^k */ +
svn commit: r352834 - stable/12/share/mk
Author: dim Date: Sat Sep 28 08:54:32 2019 New Revision: 352834 URL: https://svnweb.freebsd.org/changeset/base/352834 Log: MFC r352699: In suite.test.mk, test if ${DESTDIR} exists before attempting to run chflags -R on it, otherwise the command will error out. (Note that adding -f to the chflags invocation does not help, unlike with rm.) Modified: stable/12/share/mk/suite.test.mk Directory Properties: stable/12/ (props changed) Modified: stable/12/share/mk/suite.test.mk == --- stable/12/share/mk/suite.test.mkSat Sep 28 07:33:08 2019 (r352833) +++ stable/12/share/mk/suite.test.mkSat Sep 28 08:54:32 2019 (r352834) @@ -120,7 +120,7 @@ beforecheck: # etc. aftercheck: @cd ${.CURDIR} && ${MAKE} clean - @chflags -R 0 "${DESTDIR}" + @test ! -e ${DESTDIR} || chflags -R 0 "${DESTDIR}" @rm -Rf "${DESTDIR}" .endif ___ 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: r352833 - stable/12/sys/kern
Author: kib Date: Sat Sep 28 07:33:08 2019 New Revision: 352833 URL: https://svnweb.freebsd.org/changeset/base/352833 Log: MFC r352582, r352585: Make non-ASLR pie base tunable. Modified: stable/12/sys/kern/imgact_elf.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/imgact_elf.c == --- stable/12/sys/kern/imgact_elf.c Sat Sep 28 03:33:07 2019 (r352832) +++ stable/12/sys/kern/imgact_elf.c Sat Sep 28 07:33:08 2019 (r352833) @@ -136,6 +136,27 @@ SYSCTL_INT(_kern_elf32, OID_AUTO, read_exec, CTLFLAG_R #endif #endif +static u_long __elfN(pie_base) = ET_DYN_LOAD_ADDR; +static int +sysctl_pie_base(SYSCTL_HANDLER_ARGS) +{ + u_long val; + int error; + + val = __elfN(pie_base); + error = sysctl_handle_long(oidp, , 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + if ((val & PAGE_MASK) != 0) + return (EINVAL); + __elfN(pie_base) = val; + return (0); +} +SYSCTL_PROC(__CONCAT(_kern_elf, __ELF_WORD_SIZE), OID_AUTO, pie_base, +CTLTYPE_ULONG | CTLFLAG_MPSAFE | CTLFLAG_RW, NULL, 0, +sysctl_pie_base, "LU", +"PIE load base without randomization"); + SYSCTL_NODE(__CONCAT(_kern_elf, __ELF_WORD_SIZE), OID_AUTO, aslr, CTLFLAG_RW, 0, ""); #defineASLR_NODE_OID __CONCAT(__CONCAT(_kern_elf, __ELF_WORD_SIZE), _aslr) @@ -1148,13 +1169,13 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i if (baddr == 0) { if ((sv->sv_flags & SV_ASLR) == 0 || (fctl0 & NT_FREEBSD_FCTL_ASLR_DISABLE) != 0) - et_dyn_addr = ET_DYN_LOAD_ADDR; + et_dyn_addr = __elfN(pie_base); else if ((__elfN(pie_aslr_enabled) && (imgp->proc->p_flag2 & P2_ASLR_DISABLE) == 0) || (imgp->proc->p_flag2 & P2_ASLR_ENABLE) != 0) et_dyn_addr = ET_DYN_ADDR_RAND; else - et_dyn_addr = ET_DYN_LOAD_ADDR; + et_dyn_addr = __elfN(pie_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: r352795 - head/lib/libc/sys
On Fri, Sep 27, 2019 at 03:19:59PM -0600, Warner Losh wrote: > On Fri, Sep 27, 2019 at 2:38 PM Mateusz Guzik wrote: > > > On 9/27/19, Konstantin Belousov wrote: > > > On Fri, Sep 27, 2019 at 08:32:20PM +0200, Mateusz Guzik wrote: > > >> On 9/27/19, Warner Losh wrote: > > >> > Document varadic args as int, since you can't have short varadic > > args > > >> > (they are > > >> > promoted to ints). > > >> > > > >> > - `mode_t` is `uint16_t` (`sys/sys/_types.h`) > > >> > - `openat` takes variadic args > > >> > - variadic args cannot be 16-bit, and indeed the code uses int > > >> > - the manpage currently kinda implies the argument is 16-bit by > > >> > saying > > >> > `mode_t` > > >> > > > >> But opengroup says it is mode_t. Perhaps it is mode_t which needs > > >> to be changed? > > > > > > Yes, users must pass mode_t, and the man page is written for users. > > > Implementation needs to be aware of the implicit promotion and handle > > > it accordingly. > > > > > > In theory, mode_t might be wider than int. > > > > > > > So I think the change should be reverted. Whatever workaround is being > > in place in rust should remain for the current codebase. > > > > Rust needs to understand that it's not C. It's mistake was assuming it was > just like C and this is a case where the languages differ because C is so > quirky. > > > > If anyone is to fixed the problem they should bump mode_t to uint32_t, > > to match Linux. This is ABI breakage, I don't know how that's handled. > > > > That's not going to happen. And there's no need. It would cause more > heartache than it's worth. > > > > I have no interest in handling any of this, but the change committed > > is definitely wrong. > > > > I tend to agree, but the manual was/is incomplete. The arg *IS* promoted to > an int, per normal C rules, so that part is right and there's no > type-checking against truncation or the wrong type being used as would be > the case if it weren't varadic (so don't pass a long here). > > However, type purity aside, that's not how things are implemented. Open is > expecting an int (as is openat): > > int > open(const char *path, int flags, ...) > { > va_list ap; > int mode; > > if ((flags & O_CREAT) != 0) { > va_start(ap, flags); > mode = va_arg(ap, int); > va_end(ap); > } else { > mode = 0; > } > return (((int (*)(int, const char *, int, ...)) > __libc_interposing[INTERPOS_openat])(fd, path, flags, mode)); > } > > so the change, from that perspective, actually documents the interface (so > isn't definitely wrong, and my guarded 'tend to agree'). So if you did > change the type of mode_t, the above code might be wrong afterwards (hence > my can of worms comment). And then we're passing it again through a varadic > function pointer... > > So while POSIX says one thing, we implement something else. Should we > document POSIX or what we implement? I do not see how did you come to this conclusion. > Or do we fix our implementation to > match the docs? For all programs that don't pass in a 'long' or a pointer, > the difference is zero, however. ... on all supported architectures. On 32bit it actually does not matter even for long or pointers. But this is irrelevant, because correct programs must only pass mode_t as the third arg, and then our libc does the right thing on all currently supported platforms. More, I do not expect that this fragment would need any revisions for future architectures. > > To be honest, though, quibbling over how it should be implemented aside, I > think we should actually do the following: > > diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2 > index a771461e2e49..aa912b797f74 100644 > --- a/lib/libc/sys/open.2 > +++ b/lib/libc/sys/open.2 > @@ -61,7 +61,7 @@ In this case > and > .Fn openat > require an additional argument > -.Fa "int mode" , > +.Fa "mode_t mode" , > and the file is created with mode > .Fa mode > as described in > @@ -615,3 +615,8 @@ permits searches. > The present implementation of the > .Fa openat > checks the current permissions of directory instead. > +.Pp > +The > +.Fa mode > +argument is varadic and may result in different calling conventions > +than might otherwise be expected. I do not see how this could be useful for a user trying to call open(2). I think it would be much easier to understand and use if you simply mention that 'on all supported arches, mode_t is promoted to int by C rules for implicit conversions of arguments for variadic functions'. And perhaps put it somewhere else, not in the BUGS section. > > Is what I was thinking of committing instead. It's in the BUGS section, and > is useful to know if you are debugging code that has this in the call path > (since values may be on the stack instead of in registers, depending on the > calling convention for the underlying architecture). The Rust issue, from my