svn commit: r368384 - in head/sys: compat/linux conf
Author: tijl Date: Sun Dec 6 10:58:55 2020 New Revision: 368384 URL: https://svnweb.freebsd.org/changeset/base/368384 Log: Move V4L feature declarations and DTrace provider definitions from linux_common.c to linux_util.c so they become available on i386. linux_common.c defines the linux_common kernel module but this module does not exist on i386 and linux_common.c is not included in the linux module. linux_util.c is included in the linux_common module on amd64 and the linux module on i386. Remove linux_common.c from files.i386 again. It was added recently in r367433 when the DTrace provider definitions were moved. The V4L feature declarations were moved to linux_common in r283423. Modified: head/sys/compat/linux/linux_common.c head/sys/compat/linux/linux_util.c head/sys/conf/files.i386 Modified: head/sys/compat/linux/linux_common.c == --- head/sys/compat/linux/linux_common.cSun Dec 6 08:01:27 2020 (r368383) +++ head/sys/compat/linux/linux_common.cSun Dec 6 10:58:55 2020 (r368384) @@ -36,33 +36,14 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include -#include #include #include #include #include -FEATURE(linuxulator_v4l, "V4L ioctl wrapper support in the linuxulator"); -FEATURE(linuxulator_v4l2, "V4L2 ioctl wrapper support in the linuxulator"); - MODULE_VERSION(linux_common, 1); - -/** - * Special DTrace provider for the linuxulator. - * - * In this file we define the provider for the entire linuxulator. All - * modules (= files of the linuxulator) use it. - * - * We define a different name depending on the emulated bitsize, see - * ../..//linux{,32}/linux.h, e.g.: - * native bitsize = linuxulator - * amd64, 32bit emulation = linuxulator32 - */ -LIN_SDT_PROVIDER_DEFINE(linuxulator); -LIN_SDT_PROVIDER_DEFINE(linuxulator32); SET_DECLARE(linux_device_handler_set, struct linux_device_handler); Modified: head/sys/compat/linux/linux_util.c == --- head/sys/compat/linux/linux_util.c Sun Dec 6 08:01:27 2020 (r368383) +++ head/sys/compat/linux/linux_util.c Sun Dec 6 10:58:55 2020 (r368384) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -61,6 +62,23 @@ MALLOC_DEFINE(M_LINUX, "linux", "Linux mode structures MALLOC_DEFINE(M_EPOLL, "lepoll", "Linux events structures"); MALLOC_DEFINE(M_FUTEX, "futex", "Linux futexes"); MALLOC_DEFINE(M_FUTEX_WP, "futex wp", "Linux futex waiting proc"); + +FEATURE(linuxulator_v4l, "V4L ioctl wrapper support in the linuxulator"); +FEATURE(linuxulator_v4l2, "V4L2 ioctl wrapper support in the linuxulator"); + +/** + * Special DTrace provider for the linuxulator. + * + * In this file we define the provider for the entire linuxulator. All + * modules (= files of the linuxulator) use it. + * + * We define a different name depending on the emulated bitsize, see + * ../..//linux{,32}/linux.h, e.g.: + * native bitsize = linuxulator + * amd64, 32bit emulation = linuxulator32 + */ +LIN_SDT_PROVIDER_DEFINE(linuxulator); +LIN_SDT_PROVIDER_DEFINE(linuxulator32); char linux_emul_path[MAXPATHLEN] = "/compat/linux"; Modified: head/sys/conf/files.i386 == --- head/sys/conf/files.i386Sun Dec 6 08:01:27 2020(r368383) +++ head/sys/conf/files.i386Sun Dec 6 10:58:55 2020(r368384) @@ -52,7 +52,6 @@ cddl/dev/dtrace/i386/dtrace_asm.S optional dtrace co cddl/dev/dtrace/i386/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}" compat/linprocfs/linprocfs.c optional linprocfs compat/linsysfs/linsysfs.c optional linsysfs -compat/linux/linux_common.coptional compat_linux compat/linux/linux_dummy.c optional compat_linux compat/linux/linux_event.c optional compat_linux compat/linux/linux_emul.c optional compat_linux ___ 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: r368372 - in head/sys: amd64/linux32 conf modules/linux
Author: tijl Date: Sat Dec 5 14:53:24 2020 New Revision: 368372 URL: https://svnweb.freebsd.org/changeset/base/368372 Log: Fix i386 linux module after r367395. In r367395 parts of machine dependent linux_dummy.c were moved to a new machine independent file sys/compat/linux/linux_dummy.c and the existing linux_dummy.c was renamed to linux_dummy_machdep.c. Add linux_dummy_machdep.c to the linux module for i386. Rename sys/amd64/linux32/linux_dummy.c for consistency. Add the new linux_dummy.c to the linux module for i386. Added: head/sys/amd64/linux32/linux32_dummy_machdep.c - copied unchanged from r368371, head/sys/amd64/linux32/linux32_dummy.c Deleted: head/sys/amd64/linux32/linux32_dummy.c Modified: head/sys/conf/files.amd64 head/sys/modules/linux/Makefile Copied: head/sys/amd64/linux32/linux32_dummy_machdep.c (from r368371, head/sys/amd64/linux32/linux32_dummy.c) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/amd64/linux32/linux32_dummy_machdep.c Sat Dec 5 14:53:24 2020(r368372, copy of r368371, head/sys/amd64/linux32/linux32_dummy.c) @@ -0,0 +1,89 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 1994-1995 Søren Schmidt + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +/* DTrace init */ +LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); + +UNIMPLEMENTED(break); +UNIMPLEMENTED(ftime); +UNIMPLEMENTED(gtty); +UNIMPLEMENTED(stty); +UNIMPLEMENTED(lock); +UNIMPLEMENTED(mpx); +UNIMPLEMENTED(prof); +UNIMPLEMENTED(profil); +UNIMPLEMENTED(ulimit); + +DUMMY(stime); +DUMMY(olduname); +DUMMY(uname); +DUMMY(bdflush); +DUMMY(ptrace); +DUMMY(mq_open); +DUMMY(mq_unlink); +DUMMY(mq_timedsend); +DUMMY(mq_timedreceive); +DUMMY(mq_notify); +DUMMY(mq_getsetattr); +/* Linux 4.11: */ +DUMMY(arch_prctl); +/* Linux 5.0: */ +DUMMY(clock_gettime64); +DUMMY(clock_settime64); +DUMMY(clock_adjtime64); +DUMMY(clock_getres_time64); +DUMMY(clock_nanosleep_time64); +DUMMY(timer_gettime64); +DUMMY(timer_settime64); +DUMMY(timerfd_gettime64); +DUMMY(timerfd_settime64); +DUMMY(utimensat_time64); +DUMMY(pselect6_time64); +DUMMY(ppoll_time64); +DUMMY(io_pgetevents_time64); +DUMMY(recvmmsg_time64); +DUMMY(mq_timedsend_time64); +DUMMY(mq_timedreceive_time64); +DUMMY(semtimedop_time64); +DUMMY(rt_sigtimedwait_time64); +DUMMY(futex_time64); +DUMMY(sched_rr_get_interval_time64); Modified: head/sys/conf/files.amd64 == --- head/sys/conf/files.amd64 Sat Dec 5 14:38:46 2020(r368371) +++ head/sys/conf/files.amd64 Sat Dec 5 14:53:24 2020(r368372) @@ -405,7 +405,7 @@ compat/linsysfs/linsysfs.c optionallinsysfs # # Linux/i386 binary support # -amd64/linux32/linux32_dummy.c optionalcompat_linux32 +amd64/linux32/linux32_dummy_machdep.c optionalcompat_linux32 amd64/linux32/linux32_machdep.coptionalcompat_linux32 amd64/linux32/linux32_support.soptionalcompat_linux32 \ dependency "linux32_assym.h" Modified: head/sys/modules/linux/Makefile == --- head/sys/modules/linux/Makefile Sat Dec 5 14:38:46 2020 (r368371) +++ head/sys/modules/linux/Makefile Sat Dec 5 14:53:24 2020 (r368372) @@ -13,7 +13,7 @@ CFLAGS+=-DCOMPAT_FREEBSD32 -DCOMPAT_LINUX32 VDSO= linux${SFX}_vdso KMOD= linux -SRCS= lin
svn commit: r361700 - in head: etc/mtree secure/lib/libcrypto secure/lib/libcrypto/engines
Author: tijl Date: Mon Jun 1 18:58:09 2020 New Revision: 361700 URL: https://svnweb.freebsd.org/changeset/base/361700 Log: Install 32-bit libcrypto engines in /usr/lib32/engines instead of /usr/lib32 and let 32-bit libcrypto search that location instead of /usr/lib/engines. Reviewed by: jkim Modified: head/etc/mtree/BSD.lib32.dist head/secure/lib/libcrypto/Makefile.inc head/secure/lib/libcrypto/engines/Makefile.inc Modified: head/etc/mtree/BSD.lib32.dist == --- head/etc/mtree/BSD.lib32.dist Mon Jun 1 18:43:51 2020 (r361699) +++ head/etc/mtree/BSD.lib32.dist Mon Jun 1 18:58:09 2020 (r361700) @@ -8,6 +8,8 @@ lib32 dtrace .. +engines +.. geom .. i18n Modified: head/secure/lib/libcrypto/Makefile.inc == --- head/secure/lib/libcrypto/Makefile.inc Mon Jun 1 18:43:51 2020 (r361699) +++ head/secure/lib/libcrypto/Makefile.inc Mon Jun 1 18:58:09 2020 (r361700) @@ -75,7 +75,7 @@ CFLAGS+= -DPOLY1305_ASM .if defined(LIB) CFLAGS+= -DOPENSSLDIR="\"/etc/ssl\"" -CFLAGS+= -DENGINESDIR="\"/usr/lib/engines\"" +CFLAGS+= -DENGINESDIR="\"${LIBDIR}/engines\"" .endif CFLAGS+= -DNDEBUG Modified: head/secure/lib/libcrypto/engines/Makefile.inc == --- head/secure/lib/libcrypto/engines/Makefile.inc Mon Jun 1 18:43:51 2020(r361699) +++ head/secure/lib/libcrypto/engines/Makefile.inc Mon Jun 1 18:58:09 2020(r361700) @@ -1,6 +1,6 @@ # $FreeBSD$ -SHLIBDIR?= /usr/lib/engines +SHLIBDIR= ${LIBDIR}/engines LCRYPTO_SRC= ${SRCTOP}/crypto/openssl ___ 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: r361663 - in head: etc/mtree lib/libxo/encoder/csv lib/libxo/libxo
Author: tijl Date: Sun May 31 17:20:17 2020 New Revision: 361663 URL: https://svnweb.freebsd.org/changeset/base/361663 Log: Fix installation of libxo encoder modules. Because the install location was hardcoded in the Makefile as /usr/lib/libxo/encoder, the lib32 version was installed over the native version. Replace /usr/lib with ${LIBDIR}. Also define SHLIB_NAME instead of LIB + FILES. This prevents building a static library. MFC after:2 weeks Modified: head/etc/mtree/BSD.lib32.dist head/lib/libxo/encoder/csv/Makefile head/lib/libxo/libxo/Makefile Modified: head/etc/mtree/BSD.lib32.dist == --- head/etc/mtree/BSD.lib32.dist Sun May 31 15:31:47 2020 (r361662) +++ head/etc/mtree/BSD.lib32.dist Sun May 31 17:20:17 2020 (r361663) @@ -12,5 +12,9 @@ .. i18n .. +libxo +encoder +.. +.. .. .. Modified: head/lib/libxo/encoder/csv/Makefile == --- head/lib/libxo/encoder/csv/Makefile Sun May 31 15:31:47 2020 (r361662) +++ head/lib/libxo/encoder/csv/Makefile Sun May 31 17:20:17 2020 (r361663) @@ -8,30 +8,17 @@ LIBXOSRC= ${SRCTOP}/contrib/libxo .PATH: ${LIBXOSRC}/encoder/csv -# We use FILES to install the encoder library under the proper/magic -# name, in the proper/magic directory. libxo looks for encoders from -# "--libxo encoder=name" as "${prefix}/lib/libxo/encoder/${name}.enc" -FILES = libenc_csv.so -FILESNAME_libenc_csv.so= csv.enc -FILESDIR = /usr/lib/libxo/encoder +SHLIBDIR= ${LIBDIR}/libxo/encoder +SHLIB_NAME=csv.enc -LIB= enc_csv -SHLIB_MAJOR=0 -SHLIB_NAME= lib${LIB}.so - SRCS= enc_csv.c CFLAGS+=-I${LIBXOSRC}/libxo -I${.CURDIR} -CFLAGS+=-DXO_ENCODERDIR=\"/usr/lib/libxo/encoder\" +CFLAGS+=-DXO_ENCODERDIR=\"${LIBDIR}/libxo/encoder\" LIBADD=util xo LDFLAGS += -L${.OBJDIR:H:H}/libxo WARNS?= 5 -# Need to define a fake "install" target to block the one in bsd.lib.mk, -# since that one will install our lib in the wrong place (/usr/lib/). -install: realinstall - .include -.include Modified: head/lib/libxo/libxo/Makefile == --- head/lib/libxo/libxo/Makefile Sun May 31 15:31:47 2020 (r361662) +++ head/lib/libxo/libxo/Makefile Sun May 31 17:20:17 2020 (r361663) @@ -16,7 +16,7 @@ SHLIB_MAJOR=0 SRCS= libxo.c xo_encoder.c xo_syslog.c CFLAGS+=-I${LIBXOSRC}/libxo -I${.CURDIR} -CFLAGS+=-DXO_ENCODERDIR=\"/usr/lib/libxo/encoder\" +CFLAGS+=-DXO_ENCODERDIR=\"${LIBDIR}/libxo/encoder\" INCS= xo.h xo_encoder.h INCSDIR=${INCLUDEDIR}/libxo ___ 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: r358673 - head/sys/compat/linux
Author: tijl Date: Thu Mar 5 14:41:27 2020 New Revision: 358673 URL: https://svnweb.freebsd.org/changeset/base/358673 Log: Move compat.linux.map_sched_prio sysctl definition to linux_mib.c so it is only defined by linux_common kernel module and not both linux and linux64 modules. Reported by: Yuri Pankov Modified: head/sys/compat/linux/linux_mib.c head/sys/compat/linux/linux_mib.h head/sys/compat/linux/linux_misc.c Modified: head/sys/compat/linux/linux_mib.c == --- head/sys/compat/linux/linux_mib.c Thu Mar 5 14:13:22 2020 (r358672) +++ head/sys/compat/linux/linux_mib.c Thu Mar 5 14:41:27 2020 (r358673) @@ -71,6 +71,11 @@ int linux_preserve_vstatus = 0; SYSCTL_INT(_compat_linux, OID_AUTO, preserve_vstatus, CTLFLAG_RWTUN, &linux_preserve_vstatus, 0, "Preserve VSTATUS termios(4) flag"); +bool linux_map_sched_prio = true; +SYSCTL_BOOL(_compat_linux, OID_AUTO, map_sched_prio, CTLFLAG_RDTUN, +&linux_map_sched_prio, 0, "Map scheduler priorities to Linux priorities " +"(not POSIX compliant)"); + static int linux_set_osname(struct thread *td, char *osname); static int linux_set_osrelease(struct thread *td, char *osrelease); static int linux_set_oss_version(struct thread *td, int oss_version); Modified: head/sys/compat/linux/linux_mib.h == --- head/sys/compat/linux/linux_mib.h Thu Mar 5 14:13:22 2020 (r358672) +++ head/sys/compat/linux/linux_mib.h Thu Mar 5 14:41:27 2020 (r358673) @@ -64,5 +64,6 @@ int linux_kernver(struct thread *td); extern int linux_ignore_ip_recverr; extern int linux_preserve_vstatus; +extern bool linux_map_sched_prio; #endif /* _LINUX_MIB_H_ */ Modified: head/sys/compat/linux/linux_misc.c == --- head/sys/compat/linux/linux_misc.c Thu Mar 5 14:13:22 2020 (r358672) +++ head/sys/compat/linux/linux_misc.c Thu Mar 5 14:41:27 2020 (r358673) @@ -144,11 +144,6 @@ struct l_pselect6arg { l_size_tss_len; }; -static bool map_sched_prio = true; -SYSCTL_BOOL(_compat_linux, OID_AUTO, map_sched_prio, CTLFLAG_RDTUN, -&map_sched_prio, 0, "Map scheduler priorities to Linux priorities " -"(not POSIX compliant)"); - static int linux_utimensat_nsec_valid(l_long); @@ -1424,7 +1419,7 @@ linux_sched_setscheduler(struct thread *td, if (error) return (error); - if (map_sched_prio) { + if (linux_map_sched_prio) { switch (policy) { case SCHED_OTHER: if (sched_param.sched_priority != 0) @@ -1494,7 +1489,7 @@ linux_sched_get_priority_max(struct thread *td, { struct sched_get_priority_max_args bsd; - if (map_sched_prio) { + if (linux_map_sched_prio) { switch (args->policy) { case LINUX_SCHED_OTHER: td->td_retval[0] = 0; @@ -1530,7 +1525,7 @@ linux_sched_get_priority_min(struct thread *td, { struct sched_get_priority_min_args bsd; - if (map_sched_prio) { + if (linux_map_sched_prio) { switch (args->policy) { case LINUX_SCHED_OTHER: td->td_retval[0] = 0; @@ -1934,7 +1929,7 @@ linux_sched_setparam(struct thread *td, if (tdt == NULL) return (ESRCH); - if( map_sched_prio ) { + if (linux_map_sched_prio) { error = kern_sched_getscheduler(td, tdt, &policy); if (error) goto out; @@ -1990,7 +1985,7 @@ linux_sched_getparam(struct thread *td, return (error); } - if (map_sched_prio) { + if (linux_map_sched_prio) { error = kern_sched_getscheduler(td, tdt, &policy); PROC_UNLOCK(tdt->td_proc); if (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: r358483 - head/sys/compat/linux
Author: tijl Date: Sun Mar 1 13:12:04 2020 New Revision: 358483 URL: https://svnweb.freebsd.org/changeset/base/358483 Log: linuxulator: Map scheduler priorities to Linux priorities. On Linux the valid range of priorities for the SCHED_FIFO and SCHED_RR scheduling policies is [1,99]. For SCHED_OTHER the single valid priority is 0. On FreeBSD it is [0,31] for all policies. Programs are supposed to query the valid range using sched_get_priority_(min|max), but of course some programs assume the Linux values are valid. This commit adds a tunable compat.linux.map_sched_prio. When enabled sched_get_priority_(min|max) return the Linux values and sched_setscheduler and sched_(get|set)param translate between FreeBSD and Linux values. Because there are more Linux levels than FreeBSD levels, multiple Linux levels map to a single FreeBSD level, which means pre-emption might not happen as it does on Linux, so the tunable allows to disable this behaviour. It is enabled by default because I think it is unlikely that anyone runs real-time software under Linux emulation on FreeBSD that critically relies on correct pre-emption. This fixes FMOD, a commercial sound library used by several games. PR: 240043 Tested by:Alex S Reviewed by: dchagin MFC after:2 weeks Differential Revision:https://reviews.freebsd.org/D23790 Modified: head/sys/compat/linux/linux_misc.c head/sys/compat/linux/linux_misc.h Modified: head/sys/compat/linux/linux_misc.c == --- head/sys/compat/linux/linux_misc.c Sun Mar 1 12:34:27 2020 (r358482) +++ head/sys/compat/linux/linux_misc.c Sun Mar 1 13:12:04 2020 (r358483) @@ -144,6 +144,11 @@ struct l_pselect6arg { l_size_tss_len; }; +static bool map_sched_prio = true; +SYSCTL_BOOL(_compat_linux, OID_AUTO, map_sched_prio, CTLFLAG_RDTUN, +&map_sched_prio, 0, "Map scheduler priorities to Linux priorities " +"(not POSIX compliant)"); + static int linux_utimensat_nsec_valid(l_long); @@ -1419,6 +1424,33 @@ linux_sched_setscheduler(struct thread *td, if (error) return (error); + if (map_sched_prio) { + switch (policy) { + case SCHED_OTHER: + if (sched_param.sched_priority != 0) + return (EINVAL); + + sched_param.sched_priority = + PRI_MAX_TIMESHARE - PRI_MIN_TIMESHARE; + break; + case SCHED_FIFO: + case SCHED_RR: + if (sched_param.sched_priority < 1 || + sched_param.sched_priority >= LINUX_MAX_RT_PRIO) + return (EINVAL); + + /* +* Map [1, LINUX_MAX_RT_PRIO - 1] to +* [0, RTP_PRIO_MAX - RTP_PRIO_MIN] (rounding down). +*/ + sched_param.sched_priority = + (sched_param.sched_priority - 1) * + (RTP_PRIO_MAX - RTP_PRIO_MIN + 1) / + (LINUX_MAX_RT_PRIO - 1); + break; + } + } + tdt = linux_tdfind(td, args->pid, -1); if (tdt == NULL) return (ESRCH); @@ -1462,6 +1494,20 @@ linux_sched_get_priority_max(struct thread *td, { struct sched_get_priority_max_args bsd; + if (map_sched_prio) { + switch (args->policy) { + case LINUX_SCHED_OTHER: + td->td_retval[0] = 0; + return (0); + case LINUX_SCHED_FIFO: + case LINUX_SCHED_RR: + td->td_retval[0] = LINUX_MAX_RT_PRIO - 1; + return (0); + default: + return (EINVAL); + } + } + switch (args->policy) { case LINUX_SCHED_OTHER: bsd.policy = SCHED_OTHER; @@ -1484,6 +1530,20 @@ linux_sched_get_priority_min(struct thread *td, { struct sched_get_priority_min_args bsd; + if (map_sched_prio) { + switch (args->policy) { + case LINUX_SCHED_OTHER: + td->td_retval[0] = 0; + return (0); + case LINUX_SCHED_FIFO: + case LINUX_SCHED_RR: + td->td_retval[0] = 1; + return (0); + default: + return (EINVAL); + } + } + switch (args->policy) { case LINUX_SCHED_OTHER: bsd.policy = SCHED_OTHER; @@ -1864,7 +1924,7 @@ linux_sched_setparam(struct thread *td, { struct sched_param sched_param; struct thread *tdt; - int error; + int err
svn commit: r353300 - stable/12/sys/compat/linsysfs
Author: tijl Date: Tue Oct 8 10:24:48 2019 New Revision: 353300 URL: https://svnweb.freebsd.org/changeset/base/353300 Log: MFC r352618: Create a "drm" subdirectory for drm devices in linsysfs. Recent versions of linux libdrm check for the existence of this directory: https://cgit.freedesktop.org/mesa/drm/commit/?id=f8392583418aef5e27bfed9989aeb601e20cc96d Modified: stable/12/sys/compat/linsysfs/linsysfs.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linsysfs/linsysfs.c == --- stable/12/sys/compat/linsysfs/linsysfs.cTue Oct 8 10:24:01 2019 (r353299) +++ stable/12/sys/compat/linsysfs/linsysfs.cTue Oct 8 10:24:48 2019 (r353300) @@ -520,6 +520,7 @@ linsysfs_run_bus(device_t dev, struct pfs_node *dir, s device_get_unit(dev) >= 0) { dinfo = device_get_ivars(parent); if (dinfo != NULL && dinfo->cfg.baseclass == PCIC_DISPLAY) { + pfs_create_dir(dir, "drm", NULL, NULL, NULL, 0); sprintf(devname, "226:%d", device_get_unit(dev)); sub_dir = pfs_create_dir(chardev, ___ 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: r353299 - stable/11/sys/compat/linsysfs
Author: tijl Date: Tue Oct 8 10:24:01 2019 New Revision: 353299 URL: https://svnweb.freebsd.org/changeset/base/353299 Log: MFC r352618: Create a "drm" subdirectory for drm devices in linsysfs. Recent versions of linux libdrm check for the existence of this directory: https://cgit.freedesktop.org/mesa/drm/commit/?id=f8392583418aef5e27bfed9989aeb601e20cc96d Modified: stable/11/sys/compat/linsysfs/linsysfs.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linsysfs/linsysfs.c == --- stable/11/sys/compat/linsysfs/linsysfs.cTue Oct 8 07:14:21 2019 (r353298) +++ stable/11/sys/compat/linsysfs/linsysfs.cTue Oct 8 10:24:01 2019 (r353299) @@ -373,6 +373,7 @@ linsysfs_run_bus(device_t dev, struct pfs_node *dir, s device_get_unit(dev) >= 0) { dinfo = device_get_ivars(parent); if (dinfo != NULL && dinfo->cfg.baseclass == PCIC_DISPLAY) { + pfs_create_dir(dir, "drm", NULL, NULL, NULL, 0); sprintf(devname, "226:%d", device_get_unit(dev)); sub_dir = pfs_create_dir(chardev, ___ 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: r352618 - head/sys/compat/linsysfs
Author: tijl Date: Mon Sep 23 12:27:55 2019 New Revision: 352618 URL: https://svnweb.freebsd.org/changeset/base/352618 Log: Create a "drm" subdirectory for drm devices in linsysfs. Recent versions of linux libdrm check for the existence of this directory: https://cgit.freedesktop.org/mesa/drm/commit/?id=f8392583418aef5e27bfed9989aeb601e20cc96d MFC after:2 weeks Modified: head/sys/compat/linsysfs/linsysfs.c Modified: head/sys/compat/linsysfs/linsysfs.c == --- head/sys/compat/linsysfs/linsysfs.c Mon Sep 23 08:53:14 2019 (r352617) +++ head/sys/compat/linsysfs/linsysfs.c Mon Sep 23 12:27:55 2019 (r352618) @@ -520,6 +520,7 @@ linsysfs_run_bus(device_t dev, struct pfs_node *dir, s device_get_unit(dev) >= 0) { dinfo = device_get_ivars(parent); if (dinfo != NULL && dinfo->cfg.baseclass == PCIC_DISPLAY) { + pfs_create_dir(dir, "drm", NULL, NULL, NULL, 0); sprintf(devname, "226:%d", device_get_unit(dev)); sub_dir = pfs_create_dir(chardev, ___ 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: r351846 - stable/12/usr.bin/top
Author: tijl Date: Thu Sep 5 09:57:20 2019 New Revision: 351846 URL: https://svnweb.freebsd.org/changeset/base/351846 Log: MFC r349957: Fix layout. -C needs to be styled as a flag here, not as a new list item. Modified: stable/12/usr.bin/top/top.1 Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/top/top.1 == --- stable/12/usr.bin/top/top.1 Thu Sep 5 09:35:41 2019(r351845) +++ stable/12/usr.bin/top/top.1 Thu Sep 5 09:57:20 2019(r351846) @@ -51,7 +51,7 @@ By default top displays the weighted CPU percentage in .Xr ps 1 displays as CPU). Each time -.It Fl C +.Fl C flag is passed it toggles between \*(lqraw cpu\*(rq mode and \*(lqweighted cpu\*(rq mode, showing the \*(lqCPU\*(rq or the \*(lqWCPU\*(rq column respectively. ___ 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: r350279 - stable/11/sys/compat/linux
Author: tijl Date: Wed Jul 24 12:48:51 2019 New Revision: 350279 URL: https://svnweb.freebsd.org/changeset/base/350279 Log: MFC r349880: Let linuxulator mprotect mask unsupported bits before calling kern_mprotect. After r349240 kern_mprotect returns EINVAL for unsupported bits in the prot argument. Linux rtld uses PROT_GROWSDOWN and PROT_GROWS_UP when marking the stack executable. Mask these bits like kern_mprotect used to do. For other unsupported bits EINVAL is returned like Linux does. Reviewed by:trasz, brooks Modified: stable/11/sys/compat/linux/linux_mmap.c stable/11/sys/compat/linux/linux_mmap.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_mmap.c == --- stable/11/sys/compat/linux/linux_mmap.c Wed Jul 24 12:46:55 2019 (r350278) +++ stable/11/sys/compat/linux/linux_mmap.c Wed Jul 24 12:48:51 2019 (r350279) @@ -229,6 +229,11 @@ int linux_mprotect_common(struct thread *td, uintptr_t addr, size_t len, int prot) { + /* XXX Ignore PROT_GROWSDOWN and PROT_GROWSUP for now. */ + prot &= ~(LINUX_PROT_GROWSDOWN | LINUX_PROT_GROWSUP); + if ((prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC)) != 0) + return (EINVAL); + #if defined(__amd64__) linux_fixup_prot(td, &prot); #endif Modified: stable/11/sys/compat/linux/linux_mmap.h == --- stable/11/sys/compat/linux/linux_mmap.h Wed Jul 24 12:46:55 2019 (r350278) +++ stable/11/sys/compat/linux/linux_mmap.h Wed Jul 24 12:48:51 2019 (r350279) @@ -41,6 +41,8 @@ #defineLINUX_MAP_ANON 0x0020 #defineLINUX_MAP_GROWSDOWN 0x0100 +#defineLINUX_PROT_GROWSDOWN0x0100 +#defineLINUX_PROT_GROWSUP 0x0200 int linux_mmap_common(struct thread *, uintptr_t, size_t, int, int, int, off_t); ___ 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: r350278 - stable/12/sys/compat/linux
Author: tijl Date: Wed Jul 24 12:46:55 2019 New Revision: 350278 URL: https://svnweb.freebsd.org/changeset/base/350278 Log: MFC r349880: Let linuxulator mprotect mask unsupported bits before calling kern_mprotect. After r349240 kern_mprotect returns EINVAL for unsupported bits in the prot argument. Linux rtld uses PROT_GROWSDOWN and PROT_GROWS_UP when marking the stack executable. Mask these bits like kern_mprotect used to do. For other unsupported bits EINVAL is returned like Linux does. Reviewed by: trasz, brooks Modified: stable/12/sys/compat/linux/linux_mmap.c stable/12/sys/compat/linux/linux_mmap.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linux/linux_mmap.c == --- stable/12/sys/compat/linux/linux_mmap.c Wed Jul 24 11:34:10 2019 (r350277) +++ stable/12/sys/compat/linux/linux_mmap.c Wed Jul 24 12:46:55 2019 (r350278) @@ -228,6 +228,11 @@ int linux_mprotect_common(struct thread *td, uintptr_t addr, size_t len, int prot) { + /* XXX Ignore PROT_GROWSDOWN and PROT_GROWSUP for now. */ + prot &= ~(LINUX_PROT_GROWSDOWN | LINUX_PROT_GROWSUP); + if ((prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC)) != 0) + return (EINVAL); + #if defined(__amd64__) linux_fixup_prot(td, &prot); #endif Modified: stable/12/sys/compat/linux/linux_mmap.h == --- stable/12/sys/compat/linux/linux_mmap.h Wed Jul 24 11:34:10 2019 (r350277) +++ stable/12/sys/compat/linux/linux_mmap.h Wed Jul 24 12:46:55 2019 (r350278) @@ -41,6 +41,8 @@ #defineLINUX_MAP_ANON 0x0020 #defineLINUX_MAP_GROWSDOWN 0x0100 +#defineLINUX_PROT_GROWSDOWN0x0100 +#defineLINUX_PROT_GROWSUP 0x0200 int linux_mmap_common(struct thread *, uintptr_t, size_t, int, int, int, off_t); ___ 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: r349957 - head/usr.bin/top
Author: tijl Date: Fri Jul 12 21:19:47 2019 New Revision: 349957 URL: https://svnweb.freebsd.org/changeset/base/349957 Log: Fix layout. -C needs to be styled as a flag here, not as a new list item. MFC after:2 weeks Modified: head/usr.bin/top/top.1 Modified: head/usr.bin/top/top.1 == --- head/usr.bin/top/top.1 Fri Jul 12 20:59:10 2019(r349956) +++ head/usr.bin/top/top.1 Fri Jul 12 21:19:47 2019(r349957) @@ -51,7 +51,7 @@ By default top displays the weighted CPU percentage in .Xr ps 1 displays as CPU). Each time -.It Fl C +.Fl C flag is passed it toggles between \*(lqraw cpu\*(rq mode and \*(lqweighted cpu\*(rq mode, showing the \*(lqCPU\*(rq or the \*(lqWCPU\*(rq column respectively. ___ 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: r349880 - head/sys/compat/linux
Author: tijl Date: Wed Jul 10 08:19:33 2019 New Revision: 349880 URL: https://svnweb.freebsd.org/changeset/base/349880 Log: Let linuxulator mprotect mask unsupported bits before calling kern_mprotect. After r349240 kern_mprotect returns EINVAL for unsupported bits in the prot argument. Linux rtld uses PROT_GROWSDOWN and PROT_GROWS_UP when marking the stack executable. Mask these bits like kern_mprotect used to do. For other unsupported bits EINVAL is returned like Linux does. Reviewed by: trasz, brooks MFC after:2 weeks Differential Revision:https://reviews.freebsd.org/D20864 Modified: head/sys/compat/linux/linux_mmap.c head/sys/compat/linux/linux_mmap.h Modified: head/sys/compat/linux/linux_mmap.c == --- head/sys/compat/linux/linux_mmap.c Wed Jul 10 08:08:14 2019 (r349879) +++ head/sys/compat/linux/linux_mmap.c Wed Jul 10 08:19:33 2019 (r349880) @@ -228,6 +228,11 @@ int linux_mprotect_common(struct thread *td, uintptr_t addr, size_t len, int prot) { + /* XXX Ignore PROT_GROWSDOWN and PROT_GROWSUP for now. */ + prot &= ~(LINUX_PROT_GROWSDOWN | LINUX_PROT_GROWSUP); + if ((prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC)) != 0) + return (EINVAL); + #if defined(__amd64__) linux_fixup_prot(td, &prot); #endif Modified: head/sys/compat/linux/linux_mmap.h == --- head/sys/compat/linux/linux_mmap.h Wed Jul 10 08:08:14 2019 (r349879) +++ head/sys/compat/linux/linux_mmap.h Wed Jul 10 08:19:33 2019 (r349880) @@ -41,6 +41,8 @@ #defineLINUX_MAP_ANON 0x0020 #defineLINUX_MAP_GROWSDOWN 0x0100 +#defineLINUX_PROT_GROWSDOWN0x0100 +#defineLINUX_PROT_GROWSUP 0x0200 int linux_mmap_common(struct thread *, uintptr_t, size_t, int, int, int, off_t); ___ 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: r349879 - stable/11/tools/build/mk
Author: tijl Date: Wed Jul 10 08:08:14 2019 New Revision: 349879 URL: https://svnweb.freebsd.org/changeset/base/349879 Log: MFC r349641: Also remove lib32 versions of libradius. Modified: stable/11/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/11/ (props changed) Modified: stable/11/tools/build/mk/OptionalObsoleteFiles.inc == --- stable/11/tools/build/mk/OptionalObsoleteFiles.inc Wed Jul 10 08:07:33 2019(r349878) +++ stable/11/tools/build/mk/OptionalObsoleteFiles.inc Wed Jul 10 08:08:14 2019(r349879) @@ -7284,6 +7284,12 @@ OLD_LIBS+=usr/lib/libradius.so.4 OLD_FILES+=usr/lib/libradius_p.a OLD_FILES+=usr/lib/pam_radius.so OLD_LIBS+=usr/lib/pam_radius.so.6 +OLD_FILES+=usr/lib32/libradius.a +OLD_FILES+=usr/lib32/libradius.so +OLD_LIBS+=usr/lib32/libradius.so.4 +OLD_FILES+=usr/lib32/libradius_p.a +OLD_FILES+=usr/lib32/pam_radius.so +OLD_LIBS+=usr/lib32/pam_radius.so.6 OLD_FILES+=usr/include/radlib.h OLD_FILES+=usr/include/radlib_vs.h OLD_FILES+=usr/share/man/man3/libradius.3.gz ___ 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: r349878 - stable/12/tools/build/mk
Author: tijl Date: Wed Jul 10 08:07:33 2019 New Revision: 349878 URL: https://svnweb.freebsd.org/changeset/base/349878 Log: MFC r349641: Also remove lib32 versions of libradius. Modified: stable/12/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/12/ (props changed) Modified: stable/12/tools/build/mk/OptionalObsoleteFiles.inc == --- stable/12/tools/build/mk/OptionalObsoleteFiles.inc Wed Jul 10 08:05:13 2019(r349877) +++ stable/12/tools/build/mk/OptionalObsoleteFiles.inc Wed Jul 10 08:07:33 2019(r349878) @@ -7893,6 +7893,12 @@ OLD_LIBS+=usr/lib/libradius.so.4 OLD_FILES+=usr/lib/libradius_p.a OLD_FILES+=usr/lib/pam_radius.so OLD_LIBS+=usr/lib/pam_radius.so.6 +OLD_FILES+=usr/lib32/libradius.a +OLD_FILES+=usr/lib32/libradius.so +OLD_LIBS+=usr/lib32/libradius.so.4 +OLD_FILES+=usr/lib32/libradius_p.a +OLD_FILES+=usr/lib32/pam_radius.so +OLD_LIBS+=usr/lib32/pam_radius.so.6 OLD_FILES+=usr/include/radlib.h OLD_FILES+=usr/include/radlib_vs.h OLD_FILES+=usr/share/man/man3/libradius.3.gz ___ 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: r349877 - stable/12
Author: tijl Date: Wed Jul 10 08:05:13 2019 New Revision: 349877 URL: https://svnweb.freebsd.org/changeset/base/349877 Log: MFC r349640, r349706: Also remove lib32 version of libcasper.so.0. Modified: stable/12/ObsoleteFiles.inc Directory Properties: stable/12/ (props changed) Modified: stable/12/ObsoleteFiles.inc == --- stable/12/ObsoleteFiles.inc Wed Jul 10 05:57:37 2019(r349876) +++ stable/12/ObsoleteFiles.inc Wed Jul 10 08:05:13 2019(r349877) @@ -585,6 +585,7 @@ OLD_FILES+=usr/share/man/man3/arc4random_stir.3.gz OLD_FILES+=usr/bin/send-pr # 20180725: Cleanup old libcasper.so.0 OLD_LIBS+=lib/libcasper.so.0 +OLD_LIBS+=usr/lib32/libcasper.so.0 # 20180722: indent(1) option renamed, test files follow OLD_FILES+=usr/bin/indent/tests/nsac.0 OLD_FILES+=usr/bin/indent/tests/nsac.0.pro ___ 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: r349722 - stable/11
Author: tijl Date: Thu Jul 4 10:41:09 2019 New Revision: 349722 URL: https://svnweb.freebsd.org/changeset/base/349722 Log: MFC r349548: Build lib32 libl. The library is built from usr.bin/lex/lib. It would be better to move this directory to lib/libl, but this requires more extensive changes to Makefile.inc1. This simple fix can be MFCed quickly. PR: 238874 Reviewed by: imp Modified: stable/11/Makefile.libcompat Directory Properties: stable/11/ (props changed) Modified: stable/11/Makefile.libcompat == --- stable/11/Makefile.libcompatThu Jul 4 10:16:44 2019 (r349721) +++ stable/11/Makefile.libcompatThu Jul 4 10:41:09 2019 (r349722) @@ -115,6 +115,7 @@ LIBCOMPATIMAKE+=${LIBCOMPATWMAKE:NINSTALL=*:NDESTDIR= -DLIBRARIES_ONLY _LC_LIBDIRS.yes= lib gnu/lib +_LC_LIBDIRS.yes+= usr.bin/lex/lib _LC_LIBDIRS.${MK_CDDL:tl}+=cddl/lib _LC_LIBDIRS.${MK_CRYPT:tl}+= secure/lib _LC_LIBDIRS.${MK_KERBEROS:tl}+=kerberos5/lib ___ 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: r349721 - stable/12
Author: tijl Date: Thu Jul 4 10:16:44 2019 New Revision: 349721 URL: https://svnweb.freebsd.org/changeset/base/349721 Log: MFC r349548: Build lib32 libl. The library is built from usr.bin/lex/lib. It would be better to move this directory to lib/libl, but this requires more extensive changes to Makefile.inc1. This simple fix can be MFCed quickly. PR: 238874 Reviewed by: imp Modified: stable/12/Makefile.libcompat Directory Properties: stable/12/ (props changed) Modified: stable/12/Makefile.libcompat == --- stable/12/Makefile.libcompatThu Jul 4 08:40:10 2019 (r349720) +++ stable/12/Makefile.libcompatThu Jul 4 10:16:44 2019 (r349721) @@ -136,6 +136,7 @@ LIBCOMPATIMAKE+=${LIBCOMPATWMAKE:NINSTALL=*:NDESTDIR= _LC_LIBDIRS.yes= lib _LC_LIBDIRS.yes+= gnu/lib +_LC_LIBDIRS.yes+= usr.bin/lex/lib _LC_LIBDIRS.${MK_CDDL:tl}+=cddl/lib _LC_LIBDIRS.${MK_CRYPT:tl}+= secure/lib _LC_LIBDIRS.${MK_KERBEROS:tl}+=kerberos5/lib ___ 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: r349706 - head
Author: tijl Date: Wed Jul 3 20:52:10 2019 New Revision: 349706 URL: https://svnweb.freebsd.org/changeset/base/349706 Log: Fix path of lib32 libcasper. Reported by: jhb MFC after:1 week Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc == --- head/ObsoleteFiles.inc Wed Jul 3 20:52:07 2019(r349705) +++ head/ObsoleteFiles.inc Wed Jul 3 20:52:10 2019(r349706) @@ -825,7 +825,7 @@ OLD_FILES+=usr/share/man/man3/arc4random_stir.3.gz OLD_FILES+=usr/bin/send-pr # 20180725: Cleanup old libcasper.so.0 OLD_LIBS+=lib/libcasper.so.0 -OLD_LIBS+=lib32/libcasper.so.0 +OLD_LIBS+=usr/lib32/libcasper.so.0 # 20180722: indent(1) option renamed, test files follow OLD_FILES+=usr/bin/indent/tests/nsac.0 OLD_FILES+=usr/bin/indent/tests/nsac.0.pro ___ 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: r349641 - head/tools/build/mk
Author: tijl Date: Wed Jul 3 09:14:39 2019 New Revision: 349641 URL: https://svnweb.freebsd.org/changeset/base/349641 Log: Also remove lib32 versions of libradius. MFC after:1 week Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc == --- head/tools/build/mk/OptionalObsoleteFiles.inc Wed Jul 3 09:08:17 2019(r349640) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Wed Jul 3 09:14:39 2019(r349641) @@ -8321,6 +8321,12 @@ OLD_LIBS+=usr/lib/libradius.so.4 OLD_FILES+=usr/lib/libradius_p.a OLD_FILES+=usr/lib/pam_radius.so OLD_LIBS+=usr/lib/pam_radius.so.6 +OLD_FILES+=usr/lib32/libradius.a +OLD_FILES+=usr/lib32/libradius.so +OLD_LIBS+=usr/lib32/libradius.so.4 +OLD_FILES+=usr/lib32/libradius_p.a +OLD_FILES+=usr/lib32/pam_radius.so +OLD_LIBS+=usr/lib32/pam_radius.so.6 OLD_FILES+=usr/include/radlib.h OLD_FILES+=usr/include/radlib_vs.h OLD_FILES+=usr/share/man/man3/libradius.3.gz ___ 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: r349640 - head
Author: tijl Date: Wed Jul 3 09:08:17 2019 New Revision: 349640 URL: https://svnweb.freebsd.org/changeset/base/349640 Log: Also remove lib32 version of libcasper.so.0. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc == --- head/ObsoleteFiles.inc Wed Jul 3 09:06:39 2019(r349639) +++ head/ObsoleteFiles.inc Wed Jul 3 09:08:17 2019(r349640) @@ -825,6 +825,7 @@ OLD_FILES+=usr/share/man/man3/arc4random_stir.3.gz OLD_FILES+=usr/bin/send-pr # 20180725: Cleanup old libcasper.so.0 OLD_LIBS+=lib/libcasper.so.0 +OLD_LIBS+=lib32/libcasper.so.0 # 20180722: indent(1) option renamed, test files follow OLD_FILES+=usr/bin/indent/tests/nsac.0 OLD_FILES+=usr/bin/indent/tests/nsac.0.pro ___ 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: r349639 - head
Author: tijl Date: Wed Jul 3 09:06:39 2019 New Revision: 349639 URL: https://svnweb.freebsd.org/changeset/base/349639 Log: Also remove lib32 version of libprivateifconfig after r344530. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc == --- head/ObsoleteFiles.inc Wed Jul 3 03:42:51 2019(r349638) +++ head/ObsoleteFiles.inc Wed Jul 3 09:06:39 2019(r349639) @@ -388,6 +388,8 @@ OLD_FILES+=usr/include/sys/seq.h # 20190222: libifconfig made INTERNALLIB OLD_FILES+=usr/lib/libprivateifconfig.a OLD_FILES+=usr/lib/libprivateifconfig_p.a +OLD_FILES+=usr/lib32/libprivateifconfig.a +OLD_FILES+=usr/lib32/libprivateifconfig_p.a # 20190131: pfil(9) changed OLD_FILES+=usr/share/man/man9/pfil_hook_get.9.gz OLD_FILES+=usr/share/man/man9/pfil_rlock.9.gz ___ 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: r349548 - head
Author: tijl Date: Sat Jun 29 17:01:56 2019 New Revision: 349548 URL: https://svnweb.freebsd.org/changeset/base/349548 Log: Build lib32 libl. The library is built from usr.bin/lex/lib. It would be better to move this directory to lib/libl, but this requires more extensive changes to Makefile.inc1. This simple fix can be MFCed quickly. PR: 238874 Reviewed by: imp MFC after:3 days Modified: head/Makefile.libcompat Modified: head/Makefile.libcompat == --- head/Makefile.libcompat Sat Jun 29 16:11:09 2019(r349547) +++ head/Makefile.libcompat Sat Jun 29 17:01:56 2019(r349548) @@ -136,6 +136,7 @@ LIBCOMPATIMAKE+=${LIBCOMPATWMAKE:NINSTALL=*:NDESTDIR= _LC_LIBDIRS.yes= lib _LC_LIBDIRS.yes+= gnu/lib +_LC_LIBDIRS.yes+= usr.bin/lex/lib _LC_LIBDIRS.${MK_CDDL:tl}+=cddl/lib _LC_LIBDIRS.${MK_CRYPT:tl}+= secure/lib _LC_LIBDIRS.${MK_KERBEROS:tl}+=kerberos5/lib ___ 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: r340762 - releng/12.0/sys/compat/linux
Author: tijl Date: Thu Nov 22 13:12:17 2018 New Revision: 340762 URL: https://svnweb.freebsd.org/changeset/base/340762 Log: MFS r340757: Fix another user address dereference in linux_sendmsg syscall. This was hidden behind the LINUX_CMSG_NXTHDR macro which dereferences its second argument. Stop using the macro as well as LINUX_CMSG_FIRSTHDR. Use the size field of the kernel copy of the control message header to obtain the next control message. PR: 217901 Approved by: re (marius) Modified: releng/12.0/sys/compat/linux/linux_socket.c Directory Properties: releng/12.0/ (props changed) Modified: releng/12.0/sys/compat/linux/linux_socket.c == --- releng/12.0/sys/compat/linux/linux_socket.c Thu Nov 22 13:09:42 2018 (r340761) +++ releng/12.0/sys/compat/linux/linux_socket.c Thu Nov 22 13:12:17 2018 (r340762) @@ -1096,6 +1096,7 @@ linux_sendmsg_common(struct thread *td, l_int s, struc sa_family_t sa_family; void *data; l_size_t len; + l_size_t clen; int error; error = copyin(msghdr, &linux_msg, sizeof(linux_msg)); @@ -1127,7 +1128,7 @@ linux_sendmsg_common(struct thread *td, l_int s, struc control = NULL; - if ((ptr_cmsg = LINUX_CMSG_FIRSTHDR(&linux_msg)) != NULL) { + if (linux_msg.msg_controllen >= sizeof(struct l_cmsghdr)) { error = kern_getsockname(td, s, &sa, &datalen); if (error != 0) goto bad; @@ -1140,6 +1141,8 @@ linux_sendmsg_common(struct thread *td, l_int s, struc data = mtod(control, void *); datalen = 0; + ptr_cmsg = PTRIN(linux_msg.msg_control); + clen = linux_msg.msg_controllen; do { error = copyin(ptr_cmsg, &linux_cmsg, sizeof(struct l_cmsghdr)); @@ -1147,7 +1150,8 @@ linux_sendmsg_common(struct thread *td, l_int s, struc goto bad; error = EINVAL; - if (linux_cmsg.cmsg_len < sizeof(struct l_cmsghdr)) + if (linux_cmsg.cmsg_len < sizeof(struct l_cmsghdr) || + linux_cmsg.cmsg_len > clen) goto bad; if (datalen + CMSG_HDRSZ > MCLBYTES) @@ -1199,7 +1203,14 @@ linux_sendmsg_common(struct thread *td, l_int s, struc cmsg->cmsg_len = CMSG_LEN(len); data = (char *)data + CMSG_SPACE(len); datalen += CMSG_SPACE(len); - } while ((ptr_cmsg = LINUX_CMSG_NXTHDR(&linux_msg, ptr_cmsg))); + + if (clen <= LINUX_CMSG_ALIGN(linux_cmsg.cmsg_len)) + break; + + clen -= LINUX_CMSG_ALIGN(linux_cmsg.cmsg_len); + ptr_cmsg = (struct l_cmsghdr *)((char *)ptr_cmsg + + LINUX_CMSG_ALIGN(linux_cmsg.cmsg_len)); + } while(clen >= sizeof(struct l_cmsghdr)); control->m_len = datalen; if (datalen == 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: r340761 - releng/12.0/sys/compat/linux
Author: tijl Date: Thu Nov 22 13:09:42 2018 New Revision: 340761 URL: https://svnweb.freebsd.org/changeset/base/340761 Log: MFS r340755: Do proper copyin of control message data in the Linux sendmsg syscall. Instead of calling m_append with a user address, allocate an mbuf cluster and copy data into it using copyin. For the SCM_CREDS case, instead of zeroing a stack variable and appending that to the mbuf, zero part of the mbuf cluster directly. One mbuf cluster is also the size limit used by the FreeBSD sendmsg syscall (uipc_syscalls.c:sockargs()). PR: 217901 Reviewed by: kib Approved by: re (marius) Modified: releng/12.0/sys/compat/linux/linux_socket.c Directory Properties: releng/12.0/ (props changed) Modified: releng/12.0/sys/compat/linux/linux_socket.c == --- releng/12.0/sys/compat/linux/linux_socket.c Thu Nov 22 13:09:03 2018 (r340760) +++ releng/12.0/sys/compat/linux/linux_socket.c Thu Nov 22 13:09:42 2018 (r340761) @@ -1085,7 +1085,6 @@ linux_sendmsg_common(struct thread *td, l_int s, struc l_uint flags) { struct cmsghdr *cmsg; - struct cmsgcred cmcred; struct mbuf *control; struct msghdr msg; struct l_cmsghdr linux_cmsg; @@ -1096,6 +1095,7 @@ linux_sendmsg_common(struct thread *td, l_int s, struc struct sockaddr *sa; sa_family_t sa_family; void *data; + l_size_t len; int error; error = copyin(msghdr, &linux_msg, sizeof(linux_msg)); @@ -1126,7 +1126,6 @@ linux_sendmsg_common(struct thread *td, l_int s, struc return (error); control = NULL; - cmsg = NULL; if ((ptr_cmsg = LINUX_CMSG_FIRSTHDR(&linux_msg)) != NULL) { error = kern_getsockname(td, s, &sa, &datalen); @@ -1136,8 +1135,10 @@ linux_sendmsg_common(struct thread *td, l_int s, struc free(sa, M_SONAME); error = ENOBUFS; - cmsg = malloc(CMSG_HDRSZ, M_LINUX, M_WAITOK|M_ZERO); control = m_get(M_WAITOK, MT_CONTROL); + MCLGET(control, M_WAITOK); + data = mtod(control, void *); + datalen = 0; do { error = copyin(ptr_cmsg, &linux_cmsg, @@ -1149,10 +1150,14 @@ linux_sendmsg_common(struct thread *td, l_int s, struc if (linux_cmsg.cmsg_len < sizeof(struct l_cmsghdr)) goto bad; + if (datalen + CMSG_HDRSZ > MCLBYTES) + goto bad; + /* * Now we support only SCM_RIGHTS and SCM_CRED, * so return EINVAL in any other cmsg_type */ + cmsg = data; cmsg->cmsg_type = linux_to_bsd_cmsg_type(linux_cmsg.cmsg_type); cmsg->cmsg_level = @@ -1170,35 +1175,34 @@ linux_sendmsg_common(struct thread *td, l_int s, struc if (sa_family != AF_UNIX) continue; - data = LINUX_CMSG_DATA(ptr_cmsg); - datalen = linux_cmsg.cmsg_len - L_CMSG_HDRSZ; + if (cmsg->cmsg_type == SCM_CREDS) { + len = sizeof(struct cmsgcred); + if (datalen + CMSG_SPACE(len) > MCLBYTES) + goto bad; - switch (cmsg->cmsg_type) - { - case SCM_RIGHTS: - break; - - case SCM_CREDS: - data = &cmcred; - datalen = sizeof(cmcred); - /* * The lower levels will fill in the structure */ - bzero(data, datalen); - break; + memset(CMSG_DATA(data), 0, len); + } else { + len = linux_cmsg.cmsg_len - L_CMSG_HDRSZ; + if (datalen + CMSG_SPACE(len) < datalen || + datalen + CMSG_SPACE(len) > MCLBYTES) + goto bad; + + error = copyin(LINUX_CMSG_DATA(ptr_cmsg), + CMSG_DATA(data), len); + if (error != 0) + goto bad; } - cmsg->cmsg_len = CMSG_LEN(datalen); - - error = ENOBUFS; - if (!m_append(control, CMSG_HDRSZ, (c_caddr_t)cmsg)) -
svn commit: r340758 - stable/11/sys/compat/linux
Author: tijl Date: Thu Nov 22 09:47:51 2018 New Revision: 340758 URL: https://svnweb.freebsd.org/changeset/base/340758 Log: MFC r340674: Fix another user address dereference in linux_sendmsg syscall. This was hidden behind the LINUX_CMSG_NXTHDR macro which dereferences its second argument. Stop using the macro as well as LINUX_CMSG_FIRSTHDR. Use the size field of the kernel copy of the control message header to obtain the next control message. PR: 217901 Modified: stable/11/sys/compat/linux/linux_socket.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_socket.c == --- stable/11/sys/compat/linux/linux_socket.c Thu Nov 22 09:47:42 2018 (r340757) +++ stable/11/sys/compat/linux/linux_socket.c Thu Nov 22 09:47:51 2018 (r340758) @@ -1099,6 +1099,7 @@ linux_sendmsg_common(struct thread *td, l_int s, struc sa_family_t sa_family; void *data; l_size_t len; + l_size_t clen; int error; error = copyin(msghdr, &linux_msg, sizeof(linux_msg)); @@ -1130,7 +1131,7 @@ linux_sendmsg_common(struct thread *td, l_int s, struc control = NULL; - if ((ptr_cmsg = LINUX_CMSG_FIRSTHDR(&linux_msg)) != NULL) { + if (linux_msg.msg_controllen >= sizeof(struct l_cmsghdr)) { error = kern_getsockname(td, s, &sa, &datalen); if (error != 0) goto bad; @@ -1143,6 +1144,8 @@ linux_sendmsg_common(struct thread *td, l_int s, struc data = mtod(control, void *); datalen = 0; + ptr_cmsg = PTRIN(linux_msg.msg_control); + clen = linux_msg.msg_controllen; do { error = copyin(ptr_cmsg, &linux_cmsg, sizeof(struct l_cmsghdr)); @@ -1150,7 +1153,8 @@ linux_sendmsg_common(struct thread *td, l_int s, struc goto bad; error = EINVAL; - if (linux_cmsg.cmsg_len < sizeof(struct l_cmsghdr)) + if (linux_cmsg.cmsg_len < sizeof(struct l_cmsghdr) || + linux_cmsg.cmsg_len > clen) goto bad; if (datalen + CMSG_HDRSZ > MCLBYTES) @@ -1202,7 +1206,14 @@ linux_sendmsg_common(struct thread *td, l_int s, struc cmsg->cmsg_len = CMSG_LEN(len); data = (char *)data + CMSG_SPACE(len); datalen += CMSG_SPACE(len); - } while ((ptr_cmsg = LINUX_CMSG_NXTHDR(&linux_msg, ptr_cmsg))); + + if (clen <= LINUX_CMSG_ALIGN(linux_cmsg.cmsg_len)) + break; + + clen -= LINUX_CMSG_ALIGN(linux_cmsg.cmsg_len); + ptr_cmsg = (struct l_cmsghdr *)((char *)ptr_cmsg + + LINUX_CMSG_ALIGN(linux_cmsg.cmsg_len)); + } while(clen >= sizeof(struct l_cmsghdr)); control->m_len = datalen; if (datalen == 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: r340757 - stable/12/sys/compat/linux
Author: tijl Date: Thu Nov 22 09:47:42 2018 New Revision: 340757 URL: https://svnweb.freebsd.org/changeset/base/340757 Log: MFC r340674: Fix another user address dereference in linux_sendmsg syscall. This was hidden behind the LINUX_CMSG_NXTHDR macro which dereferences its second argument. Stop using the macro as well as LINUX_CMSG_FIRSTHDR. Use the size field of the kernel copy of the control message header to obtain the next control message. PR: 217901 Modified: stable/12/sys/compat/linux/linux_socket.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linux/linux_socket.c == --- stable/12/sys/compat/linux/linux_socket.c Thu Nov 22 09:41:54 2018 (r340756) +++ stable/12/sys/compat/linux/linux_socket.c Thu Nov 22 09:47:42 2018 (r340757) @@ -1096,6 +1096,7 @@ linux_sendmsg_common(struct thread *td, l_int s, struc sa_family_t sa_family; void *data; l_size_t len; + l_size_t clen; int error; error = copyin(msghdr, &linux_msg, sizeof(linux_msg)); @@ -1127,7 +1128,7 @@ linux_sendmsg_common(struct thread *td, l_int s, struc control = NULL; - if ((ptr_cmsg = LINUX_CMSG_FIRSTHDR(&linux_msg)) != NULL) { + if (linux_msg.msg_controllen >= sizeof(struct l_cmsghdr)) { error = kern_getsockname(td, s, &sa, &datalen); if (error != 0) goto bad; @@ -1140,6 +1141,8 @@ linux_sendmsg_common(struct thread *td, l_int s, struc data = mtod(control, void *); datalen = 0; + ptr_cmsg = PTRIN(linux_msg.msg_control); + clen = linux_msg.msg_controllen; do { error = copyin(ptr_cmsg, &linux_cmsg, sizeof(struct l_cmsghdr)); @@ -1147,7 +1150,8 @@ linux_sendmsg_common(struct thread *td, l_int s, struc goto bad; error = EINVAL; - if (linux_cmsg.cmsg_len < sizeof(struct l_cmsghdr)) + if (linux_cmsg.cmsg_len < sizeof(struct l_cmsghdr) || + linux_cmsg.cmsg_len > clen) goto bad; if (datalen + CMSG_HDRSZ > MCLBYTES) @@ -1199,7 +1203,14 @@ linux_sendmsg_common(struct thread *td, l_int s, struc cmsg->cmsg_len = CMSG_LEN(len); data = (char *)data + CMSG_SPACE(len); datalen += CMSG_SPACE(len); - } while ((ptr_cmsg = LINUX_CMSG_NXTHDR(&linux_msg, ptr_cmsg))); + + if (clen <= LINUX_CMSG_ALIGN(linux_cmsg.cmsg_len)) + break; + + clen -= LINUX_CMSG_ALIGN(linux_cmsg.cmsg_len); + ptr_cmsg = (struct l_cmsghdr *)((char *)ptr_cmsg + + LINUX_CMSG_ALIGN(linux_cmsg.cmsg_len)); + } while(clen >= sizeof(struct l_cmsghdr)); control->m_len = datalen; if (datalen == 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: r340756 - stable/11/sys/compat/linux
Author: tijl Date: Thu Nov 22 09:41:54 2018 New Revision: 340756 URL: https://svnweb.freebsd.org/changeset/base/340756 Log: MFC r340631: Do proper copyin of control message data in the Linux sendmsg syscall. Instead of calling m_append with a user address, allocate an mbuf cluster and copy data into it using copyin. For the SCM_CREDS case, instead of zeroing a stack variable and appending that to the mbuf, zero part of the mbuf cluster directly. One mbuf cluster is also the size limit used by the FreeBSD sendmsg syscall (uipc_syscalls.c:sockargs()). PR: 217901 Reviewed by: kib Modified: stable/11/sys/compat/linux/linux_socket.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_socket.c == --- stable/11/sys/compat/linux/linux_socket.c Thu Nov 22 09:41:45 2018 (r340755) +++ stable/11/sys/compat/linux/linux_socket.c Thu Nov 22 09:41:54 2018 (r340756) @@ -1088,7 +1088,6 @@ linux_sendmsg_common(struct thread *td, l_int s, struc l_uint flags) { struct cmsghdr *cmsg; - struct cmsgcred cmcred; struct mbuf *control; struct msghdr msg; struct l_cmsghdr linux_cmsg; @@ -1099,6 +1098,7 @@ linux_sendmsg_common(struct thread *td, l_int s, struc struct sockaddr *sa; sa_family_t sa_family; void *data; + l_size_t len; int error; error = copyin(msghdr, &linux_msg, sizeof(linux_msg)); @@ -1129,7 +1129,6 @@ linux_sendmsg_common(struct thread *td, l_int s, struc return (error); control = NULL; - cmsg = NULL; if ((ptr_cmsg = LINUX_CMSG_FIRSTHDR(&linux_msg)) != NULL) { error = kern_getsockname(td, s, &sa, &datalen); @@ -1139,8 +1138,10 @@ linux_sendmsg_common(struct thread *td, l_int s, struc free(sa, M_SONAME); error = ENOBUFS; - cmsg = malloc(CMSG_HDRSZ, M_LINUX, M_WAITOK|M_ZERO); control = m_get(M_WAITOK, MT_CONTROL); + MCLGET(control, M_WAITOK); + data = mtod(control, void *); + datalen = 0; do { error = copyin(ptr_cmsg, &linux_cmsg, @@ -1152,10 +1153,14 @@ linux_sendmsg_common(struct thread *td, l_int s, struc if (linux_cmsg.cmsg_len < sizeof(struct l_cmsghdr)) goto bad; + if (datalen + CMSG_HDRSZ > MCLBYTES) + goto bad; + /* * Now we support only SCM_RIGHTS and SCM_CRED, * so return EINVAL in any other cmsg_type */ + cmsg = data; cmsg->cmsg_type = linux_to_bsd_cmsg_type(linux_cmsg.cmsg_type); cmsg->cmsg_level = @@ -1173,35 +1178,34 @@ linux_sendmsg_common(struct thread *td, l_int s, struc if (sa_family != AF_UNIX) continue; - data = LINUX_CMSG_DATA(ptr_cmsg); - datalen = linux_cmsg.cmsg_len - L_CMSG_HDRSZ; + if (cmsg->cmsg_type == SCM_CREDS) { + len = sizeof(struct cmsgcred); + if (datalen + CMSG_SPACE(len) > MCLBYTES) + goto bad; - switch (cmsg->cmsg_type) - { - case SCM_RIGHTS: - break; - - case SCM_CREDS: - data = &cmcred; - datalen = sizeof(cmcred); - /* * The lower levels will fill in the structure */ - bzero(data, datalen); - break; + memset(CMSG_DATA(data), 0, len); + } else { + len = linux_cmsg.cmsg_len - L_CMSG_HDRSZ; + if (datalen + CMSG_SPACE(len) < datalen || + datalen + CMSG_SPACE(len) > MCLBYTES) + goto bad; + + error = copyin(LINUX_CMSG_DATA(ptr_cmsg), + CMSG_DATA(data), len); + if (error != 0) + goto bad; } - cmsg->cmsg_len = CMSG_LEN(datalen); - - error = ENOBUFS; - if (!m_append(control, CMSG_HDRSZ, (c_caddr_t)cmsg)) - goto bad; -
svn commit: r340755 - stable/12/sys/compat/linux
Author: tijl Date: Thu Nov 22 09:41:45 2018 New Revision: 340755 URL: https://svnweb.freebsd.org/changeset/base/340755 Log: MFC r340631: Do proper copyin of control message data in the Linux sendmsg syscall. Instead of calling m_append with a user address, allocate an mbuf cluster and copy data into it using copyin. For the SCM_CREDS case, instead of zeroing a stack variable and appending that to the mbuf, zero part of the mbuf cluster directly. One mbuf cluster is also the size limit used by the FreeBSD sendmsg syscall (uipc_syscalls.c:sockargs()). PR: 217901 Reviewed by: kib Modified: stable/12/sys/compat/linux/linux_socket.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linux/linux_socket.c == --- stable/12/sys/compat/linux/linux_socket.c Thu Nov 22 04:48:27 2018 (r340754) +++ stable/12/sys/compat/linux/linux_socket.c Thu Nov 22 09:41:45 2018 (r340755) @@ -1085,7 +1085,6 @@ linux_sendmsg_common(struct thread *td, l_int s, struc l_uint flags) { struct cmsghdr *cmsg; - struct cmsgcred cmcred; struct mbuf *control; struct msghdr msg; struct l_cmsghdr linux_cmsg; @@ -1096,6 +1095,7 @@ linux_sendmsg_common(struct thread *td, l_int s, struc struct sockaddr *sa; sa_family_t sa_family; void *data; + l_size_t len; int error; error = copyin(msghdr, &linux_msg, sizeof(linux_msg)); @@ -1126,7 +1126,6 @@ linux_sendmsg_common(struct thread *td, l_int s, struc return (error); control = NULL; - cmsg = NULL; if ((ptr_cmsg = LINUX_CMSG_FIRSTHDR(&linux_msg)) != NULL) { error = kern_getsockname(td, s, &sa, &datalen); @@ -1136,8 +1135,10 @@ linux_sendmsg_common(struct thread *td, l_int s, struc free(sa, M_SONAME); error = ENOBUFS; - cmsg = malloc(CMSG_HDRSZ, M_LINUX, M_WAITOK|M_ZERO); control = m_get(M_WAITOK, MT_CONTROL); + MCLGET(control, M_WAITOK); + data = mtod(control, void *); + datalen = 0; do { error = copyin(ptr_cmsg, &linux_cmsg, @@ -1149,10 +1150,14 @@ linux_sendmsg_common(struct thread *td, l_int s, struc if (linux_cmsg.cmsg_len < sizeof(struct l_cmsghdr)) goto bad; + if (datalen + CMSG_HDRSZ > MCLBYTES) + goto bad; + /* * Now we support only SCM_RIGHTS and SCM_CRED, * so return EINVAL in any other cmsg_type */ + cmsg = data; cmsg->cmsg_type = linux_to_bsd_cmsg_type(linux_cmsg.cmsg_type); cmsg->cmsg_level = @@ -1170,35 +1175,34 @@ linux_sendmsg_common(struct thread *td, l_int s, struc if (sa_family != AF_UNIX) continue; - data = LINUX_CMSG_DATA(ptr_cmsg); - datalen = linux_cmsg.cmsg_len - L_CMSG_HDRSZ; + if (cmsg->cmsg_type == SCM_CREDS) { + len = sizeof(struct cmsgcred); + if (datalen + CMSG_SPACE(len) > MCLBYTES) + goto bad; - switch (cmsg->cmsg_type) - { - case SCM_RIGHTS: - break; - - case SCM_CREDS: - data = &cmcred; - datalen = sizeof(cmcred); - /* * The lower levels will fill in the structure */ - bzero(data, datalen); - break; + memset(CMSG_DATA(data), 0, len); + } else { + len = linux_cmsg.cmsg_len - L_CMSG_HDRSZ; + if (datalen + CMSG_SPACE(len) < datalen || + datalen + CMSG_SPACE(len) > MCLBYTES) + goto bad; + + error = copyin(LINUX_CMSG_DATA(ptr_cmsg), + CMSG_DATA(data), len); + if (error != 0) + goto bad; } - cmsg->cmsg_len = CMSG_LEN(datalen); - - error = ENOBUFS; - if (!m_append(control, CMSG_HDRSZ, (c_caddr_t)cmsg)) - goto bad; -
svn commit: r340674 - head/sys/compat/linux
Author: tijl Date: Tue Nov 20 14:18:57 2018 New Revision: 340674 URL: https://svnweb.freebsd.org/changeset/base/340674 Log: Fix another user address dereference in linux_sendmsg syscall. This was hidden behind the LINUX_CMSG_NXTHDR macro which dereferences its second argument. Stop using the macro as well as LINUX_CMSG_FIRSTHDR. Use the size field of the kernel copy of the control message header to obtain the next control message. PR: 217901 MFC after:2 days X-MFC-With: r340631 Modified: head/sys/compat/linux/linux_socket.c Modified: head/sys/compat/linux/linux_socket.c == --- head/sys/compat/linux/linux_socket.cTue Nov 20 11:23:33 2018 (r340673) +++ head/sys/compat/linux/linux_socket.cTue Nov 20 14:18:57 2018 (r340674) @@ -1096,6 +1096,7 @@ linux_sendmsg_common(struct thread *td, l_int s, struc sa_family_t sa_family; void *data; l_size_t len; + l_size_t clen; int error; error = copyin(msghdr, &linux_msg, sizeof(linux_msg)); @@ -1127,7 +1128,7 @@ linux_sendmsg_common(struct thread *td, l_int s, struc control = NULL; - if ((ptr_cmsg = LINUX_CMSG_FIRSTHDR(&linux_msg)) != NULL) { + if (linux_msg.msg_controllen >= sizeof(struct l_cmsghdr)) { error = kern_getsockname(td, s, &sa, &datalen); if (error != 0) goto bad; @@ -1140,6 +1141,8 @@ linux_sendmsg_common(struct thread *td, l_int s, struc data = mtod(control, void *); datalen = 0; + ptr_cmsg = PTRIN(linux_msg.msg_control); + clen = linux_msg.msg_controllen; do { error = copyin(ptr_cmsg, &linux_cmsg, sizeof(struct l_cmsghdr)); @@ -1147,7 +1150,8 @@ linux_sendmsg_common(struct thread *td, l_int s, struc goto bad; error = EINVAL; - if (linux_cmsg.cmsg_len < sizeof(struct l_cmsghdr)) + if (linux_cmsg.cmsg_len < sizeof(struct l_cmsghdr) || + linux_cmsg.cmsg_len > clen) goto bad; if (datalen + CMSG_HDRSZ > MCLBYTES) @@ -1199,7 +1203,14 @@ linux_sendmsg_common(struct thread *td, l_int s, struc cmsg->cmsg_len = CMSG_LEN(len); data = (char *)data + CMSG_SPACE(len); datalen += CMSG_SPACE(len); - } while ((ptr_cmsg = LINUX_CMSG_NXTHDR(&linux_msg, ptr_cmsg))); + + if (clen <= LINUX_CMSG_ALIGN(linux_cmsg.cmsg_len)) + break; + + clen -= LINUX_CMSG_ALIGN(linux_cmsg.cmsg_len); + ptr_cmsg = (struct l_cmsghdr *)((char *)ptr_cmsg + + LINUX_CMSG_ALIGN(linux_cmsg.cmsg_len)); + } while(clen >= sizeof(struct l_cmsghdr)); control->m_len = datalen; if (datalen == 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: r340631 - head/sys/compat/linux
Author: tijl Date: Mon Nov 19 15:31:54 2018 New Revision: 340631 URL: https://svnweb.freebsd.org/changeset/base/340631 Log: Do proper copyin of control message data in the Linux sendmsg syscall. Instead of calling m_append with a user address, allocate an mbuf cluster and copy data into it using copyin. For the SCM_CREDS case, instead of zeroing a stack variable and appending that to the mbuf, zero part of the mbuf cluster directly. One mbuf cluster is also the size limit used by the FreeBSD sendmsg syscall (uipc_syscalls.c:sockargs()). PR: 217901 Reviewed by: kib MFC after:3 days Modified: head/sys/compat/linux/linux_socket.c Modified: head/sys/compat/linux/linux_socket.c == --- head/sys/compat/linux/linux_socket.cMon Nov 19 15:29:40 2018 (r340630) +++ head/sys/compat/linux/linux_socket.cMon Nov 19 15:31:54 2018 (r340631) @@ -1085,7 +1085,6 @@ linux_sendmsg_common(struct thread *td, l_int s, struc l_uint flags) { struct cmsghdr *cmsg; - struct cmsgcred cmcred; struct mbuf *control; struct msghdr msg; struct l_cmsghdr linux_cmsg; @@ -1096,6 +1095,7 @@ linux_sendmsg_common(struct thread *td, l_int s, struc struct sockaddr *sa; sa_family_t sa_family; void *data; + l_size_t len; int error; error = copyin(msghdr, &linux_msg, sizeof(linux_msg)); @@ -1126,7 +1126,6 @@ linux_sendmsg_common(struct thread *td, l_int s, struc return (error); control = NULL; - cmsg = NULL; if ((ptr_cmsg = LINUX_CMSG_FIRSTHDR(&linux_msg)) != NULL) { error = kern_getsockname(td, s, &sa, &datalen); @@ -1136,8 +1135,10 @@ linux_sendmsg_common(struct thread *td, l_int s, struc free(sa, M_SONAME); error = ENOBUFS; - cmsg = malloc(CMSG_HDRSZ, M_LINUX, M_WAITOK|M_ZERO); control = m_get(M_WAITOK, MT_CONTROL); + MCLGET(control, M_WAITOK); + data = mtod(control, void *); + datalen = 0; do { error = copyin(ptr_cmsg, &linux_cmsg, @@ -1149,10 +1150,14 @@ linux_sendmsg_common(struct thread *td, l_int s, struc if (linux_cmsg.cmsg_len < sizeof(struct l_cmsghdr)) goto bad; + if (datalen + CMSG_HDRSZ > MCLBYTES) + goto bad; + /* * Now we support only SCM_RIGHTS and SCM_CRED, * so return EINVAL in any other cmsg_type */ + cmsg = data; cmsg->cmsg_type = linux_to_bsd_cmsg_type(linux_cmsg.cmsg_type); cmsg->cmsg_level = @@ -1170,35 +1175,34 @@ linux_sendmsg_common(struct thread *td, l_int s, struc if (sa_family != AF_UNIX) continue; - data = LINUX_CMSG_DATA(ptr_cmsg); - datalen = linux_cmsg.cmsg_len - L_CMSG_HDRSZ; + if (cmsg->cmsg_type == SCM_CREDS) { + len = sizeof(struct cmsgcred); + if (datalen + CMSG_SPACE(len) > MCLBYTES) + goto bad; - switch (cmsg->cmsg_type) - { - case SCM_RIGHTS: - break; - - case SCM_CREDS: - data = &cmcred; - datalen = sizeof(cmcred); - /* * The lower levels will fill in the structure */ - bzero(data, datalen); - break; + memset(CMSG_DATA(data), 0, len); + } else { + len = linux_cmsg.cmsg_len - L_CMSG_HDRSZ; + if (datalen + CMSG_SPACE(len) < datalen || + datalen + CMSG_SPACE(len) > MCLBYTES) + goto bad; + + error = copyin(LINUX_CMSG_DATA(ptr_cmsg), + CMSG_DATA(data), len); + if (error != 0) + goto bad; } - cmsg->cmsg_len = CMSG_LEN(datalen); - - error = ENOBUFS; - if (!m_append(control, CMSG_HDRSZ, (c_caddr_t)cmsg)) - goto bad; - if (!m_append(control, datalen, (c_caddr_t)data)) -
svn commit: r340258 - in stable/12/sys: amd64/linux32 compat/linux
Author: tijl Date: Thu Nov 8 19:56:29 2018 New Revision: 340258 URL: https://svnweb.freebsd.org/changeset/base/340258 Log: MFC r340181, r340185: On amd64 both Linux compat modules, linux.ko and linux64.ko, provide linux_ioctl_(un)register_handler that allows other driver modules to register ioctl handlers. The ioctl syscall implementation in each Linux compat module iterates over the list of handlers and forwards the call to the appropriate driver. Because the registration functions have the same name in each module it is not possible for a driver to support both 32 and 64 bit linux compatibility. Move the list of ioctl handlers to linux_common.ko so it is shared by both Linux modules and all drivers receive both 32 and 64 bit ioctl calls with one registration. These ioctl handlers normally forward the call to the FreeBSD ioctl handler which can handle both 32 and 64 bit. Keep the special COMPAT_LINUX32 ioctl handlers in linux.ko in a separate list for now and let the ioctl syscall iterate over that list first. Later, COMPAT_LINUX32 support can be added to the 64 bit ioctl handlers via a runtime check for ILP32 like is done for COMPAT_FREEBSD32 and then this separate list would disappear again. That is a much bigger effort however and this commit is meant to be MFCable. This enables linux64 support in x11/nvidia-driver*. PR: 206711 Reviewed by: kib Approved by: re (gjb) Modified: stable/12/sys/amd64/linux32/linux32_sysvec.c stable/12/sys/compat/linux/linux_common.c stable/12/sys/compat/linux/linux_ioctl.c stable/12/sys/compat/linux/linux_ioctl.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/linux32/linux32_sysvec.c == --- stable/12/sys/amd64/linux32/linux32_sysvec.cThu Nov 8 19:50:23 2018(r340257) +++ stable/12/sys/amd64/linux32/linux32_sysvec.cThu Nov 8 19:56:29 2018(r340258) @@ -32,6 +32,8 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "opt_compat.h" + #include __FBSDID("$FreeBSD$"); @@ -1071,7 +1073,7 @@ linux_elf_modevent(module_t mod, int type, void *data) error = EINVAL; if (error == 0) { SET_FOREACH(lihp, linux_ioctl_handler_set) - linux_ioctl_register_handler(*lihp); + linux32_ioctl_register_handler(*lihp); LIST_INIT(&futex_list); mtx_init(&futex_mtx, "ftllk", NULL, MTX_DEF); stclohz = (stathz ? stathz : hz); @@ -1093,7 +1095,7 @@ linux_elf_modevent(module_t mod, int type, void *data) } if (error == 0) { SET_FOREACH(lihp, linux_ioctl_handler_set) - linux_ioctl_unregister_handler(*lihp); + linux32_ioctl_unregister_handler(*lihp); mtx_destroy(&futex_mtx); if (bootverbose) printf("Linux ELF exec handler removed\n"); Modified: stable/12/sys/compat/linux/linux_common.c == --- stable/12/sys/compat/linux/linux_common.c Thu Nov 8 19:50:23 2018 (r340257) +++ stable/12/sys/compat/linux/linux_common.c Thu Nov 8 19:56:29 2018 (r340258) @@ -35,9 +35,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include #include #include @@ -47,6 +49,11 @@ FEATURE(linuxulator_v4l2, "V4L2 ioctl wrapper support MODULE_VERSION(linux_common, 1); SET_DECLARE(linux_device_handler_set, struct linux_device_handler); + +TAILQ_HEAD(, linux_ioctl_handler_element) linux_ioctl_handlers = +TAILQ_HEAD_INITIALIZER(linux_ioctl_handlers); +struct sx linux_ioctl_sx; +SX_SYSINIT(linux_ioctl, &linux_ioctl_sx, "Linux ioctl handlers"); static eventhandler_tag linux_exec_tag; static eventhandler_tag linux_thread_dtor_tag; Modified: stable/12/sys/compat/linux/linux_ioctl.c == --- stable/12/sys/compat/linux/linux_ioctl.cThu Nov 8 19:50:23 2018 (r340257) +++ stable/12/sys/compat/linux/linux_ioctl.cThu Nov 8 19:56:29 2018 (r340258) @@ -161,17 +161,19 @@ DATA_SET(linux_ioctl_handler_set, video2_handler); DATA_SET(linux_ioctl_handler_set, fbsd_usb); DATA_SET(linux_ioctl_handler_set, evdev_handler); -struct handler_element -{ - TAILQ_ENTRY(handler_element) list; - int (*func)(struct thread *, struct linux_ioctl_args *); - int low, high, span; -}; - -static TAILQ_HEAD(, handler_element) handlers = -TAILQ_HEAD_INITIALIZER(handlers); +#ifdef __i386__ +static TAILQ_HEAD(, linux_ioctl_handl
svn commit: r340259 - in stable/11/sys: amd64/linux32 compat/linux
Author: tijl Date: Thu Nov 8 19:56:45 2018 New Revision: 340259 URL: https://svnweb.freebsd.org/changeset/base/340259 Log: MFC r340181, r340185: On amd64 both Linux compat modules, linux.ko and linux64.ko, provide linux_ioctl_(un)register_handler that allows other driver modules to register ioctl handlers. The ioctl syscall implementation in each Linux compat module iterates over the list of handlers and forwards the call to the appropriate driver. Because the registration functions have the same name in each module it is not possible for a driver to support both 32 and 64 bit linux compatibility. Move the list of ioctl handlers to linux_common.ko so it is shared by both Linux modules and all drivers receive both 32 and 64 bit ioctl calls with one registration. These ioctl handlers normally forward the call to the FreeBSD ioctl handler which can handle both 32 and 64 bit. Keep the special COMPAT_LINUX32 ioctl handlers in linux.ko in a separate list for now and let the ioctl syscall iterate over that list first. Later, COMPAT_LINUX32 support can be added to the 64 bit ioctl handlers via a runtime check for ILP32 like is done for COMPAT_FREEBSD32 and then this separate list would disappear again. That is a much bigger effort however and this commit is meant to be MFCable. This enables linux64 support in x11/nvidia-driver*. PR: 206711 Reviewed by: kib Modified: stable/11/sys/amd64/linux32/linux32_sysvec.c stable/11/sys/compat/linux/linux_common.c stable/11/sys/compat/linux/linux_ioctl.c stable/11/sys/compat/linux/linux_ioctl.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux32/linux32_sysvec.c == --- stable/11/sys/amd64/linux32/linux32_sysvec.cThu Nov 8 19:56:29 2018(r340258) +++ stable/11/sys/amd64/linux32/linux32_sysvec.cThu Nov 8 19:56:45 2018(r340259) @@ -30,6 +30,8 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "opt_compat.h" + #include __FBSDID("$FreeBSD$"); #include "opt_compat.h" @@ -1134,7 +1136,7 @@ linux_elf_modevent(module_t mod, int type, void *data) error = EINVAL; if (error == 0) { SET_FOREACH(lihp, linux_ioctl_handler_set) - linux_ioctl_register_handler(*lihp); + linux32_ioctl_register_handler(*lihp); LIST_INIT(&futex_list); mtx_init(&futex_mtx, "ftllk", NULL, MTX_DEF); stclohz = (stathz ? stathz : hz); @@ -1156,7 +1158,7 @@ linux_elf_modevent(module_t mod, int type, void *data) } if (error == 0) { SET_FOREACH(lihp, linux_ioctl_handler_set) - linux_ioctl_unregister_handler(*lihp); + linux32_ioctl_unregister_handler(*lihp); mtx_destroy(&futex_mtx); if (bootverbose) printf("Linux ELF exec handler removed\n"); Modified: stable/11/sys/compat/linux/linux_common.c == --- stable/11/sys/compat/linux/linux_common.c Thu Nov 8 19:56:29 2018 (r340258) +++ stable/11/sys/compat/linux/linux_common.c Thu Nov 8 19:56:45 2018 (r340259) @@ -35,9 +35,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include #include #include @@ -47,6 +49,11 @@ FEATURE(linuxulator_v4l2, "V4L2 ioctl wrapper support MODULE_VERSION(linux_common, 1); SET_DECLARE(linux_device_handler_set, struct linux_device_handler); + +TAILQ_HEAD(, linux_ioctl_handler_element) linux_ioctl_handlers = +TAILQ_HEAD_INITIALIZER(linux_ioctl_handlers); +struct sx linux_ioctl_sx; +SX_SYSINIT(linux_ioctl, &linux_ioctl_sx, "Linux ioctl handlers"); static eventhandler_tag linux_exec_tag; static eventhandler_tag linux_thread_dtor_tag; Modified: stable/11/sys/compat/linux/linux_ioctl.c == --- stable/11/sys/compat/linux/linux_ioctl.cThu Nov 8 19:56:29 2018 (r340258) +++ stable/11/sys/compat/linux/linux_ioctl.cThu Nov 8 19:56:45 2018 (r340259) @@ -161,17 +161,19 @@ DATA_SET(linux_ioctl_handler_set, video2_handler); DATA_SET(linux_ioctl_handler_set, fbsd_usb); DATA_SET(linux_ioctl_handler_set, evdev_handler); -struct handler_element -{ - TAILQ_ENTRY(handler_element) list; - int (*func)(struct thread *, struct linux_ioctl_args *); - int low, high, span; -}; - -static TAILQ_HEAD(, handler_element) handlers = -TAILQ_HEAD_INITIALIZER(handlers); +#ifdef __i386__ +static TAILQ_HEAD(, linux_ioctl_handler
svn commit: r340185 - head/sys/amd64/linux32
Author: tijl Date: Tue Nov 6 15:29:44 2018 New Revision: 340185 URL: https://svnweb.freebsd.org/changeset/base/340185 Log: Fix builds with COMPAT_LINUX32 in the kernel config. MFC after:3 days Modified: head/sys/amd64/linux32/linux32_sysvec.c Modified: head/sys/amd64/linux32/linux32_sysvec.c == --- head/sys/amd64/linux32/linux32_sysvec.c Tue Nov 6 14:22:44 2018 (r340184) +++ head/sys/amd64/linux32/linux32_sysvec.c Tue Nov 6 15:29:44 2018 (r340185) @@ -32,6 +32,8 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "opt_compat.h" + #include __FBSDID("$FreeBSD$"); ___ 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: r340181 - in head/sys: amd64/linux32 compat/linux
Author: tijl Date: Tue Nov 6 13:51:08 2018 New Revision: 340181 URL: https://svnweb.freebsd.org/changeset/base/340181 Log: On amd64 both Linux compat modules, linux.ko and linux64.ko, provide linux_ioctl_(un)register_handler that allows other driver modules to register ioctl handlers. The ioctl syscall implementation in each Linux compat module iterates over the list of handlers and forwards the call to the appropriate driver. Because the registration functions have the same name in each module it is not possible for a driver to support both 32 and 64 bit linux compatibility. Move the list of ioctl handlers to linux_common.ko so it is shared by both Linux modules and all drivers receive both 32 and 64 bit ioctl calls with one registration. These ioctl handlers normally forward the call to the FreeBSD ioctl handler which can handle both 32 and 64 bit. Keep the special COMPAT_LINUX32 ioctl handlers in linux.ko in a separate list for now and let the ioctl syscall iterate over that list first. Later, COMPAT_LINUX32 support can be added to the 64 bit ioctl handlers via a runtime check for ILP32 like is done for COMPAT_FREEBSD32 and then this separate list would disappear again. That is a much bigger effort however and this commit is meant to be MFCable. This enables linux64 support in x11/nvidia-driver*. PR: 206711 Reviewed by: kib MFC after:3 days Modified: head/sys/amd64/linux32/linux32_sysvec.c head/sys/compat/linux/linux_common.c head/sys/compat/linux/linux_ioctl.c head/sys/compat/linux/linux_ioctl.h Modified: head/sys/amd64/linux32/linux32_sysvec.c == --- head/sys/amd64/linux32/linux32_sysvec.c Tue Nov 6 12:57:38 2018 (r340180) +++ head/sys/amd64/linux32/linux32_sysvec.c Tue Nov 6 13:51:08 2018 (r340181) @@ -1071,7 +1071,7 @@ linux_elf_modevent(module_t mod, int type, void *data) error = EINVAL; if (error == 0) { SET_FOREACH(lihp, linux_ioctl_handler_set) - linux_ioctl_register_handler(*lihp); + linux32_ioctl_register_handler(*lihp); LIST_INIT(&futex_list); mtx_init(&futex_mtx, "ftllk", NULL, MTX_DEF); stclohz = (stathz ? stathz : hz); @@ -1093,7 +1093,7 @@ linux_elf_modevent(module_t mod, int type, void *data) } if (error == 0) { SET_FOREACH(lihp, linux_ioctl_handler_set) - linux_ioctl_unregister_handler(*lihp); + linux32_ioctl_unregister_handler(*lihp); mtx_destroy(&futex_mtx); if (bootverbose) printf("Linux ELF exec handler removed\n"); Modified: head/sys/compat/linux/linux_common.c == --- head/sys/compat/linux/linux_common.cTue Nov 6 12:57:38 2018 (r340180) +++ head/sys/compat/linux/linux_common.cTue Nov 6 13:51:08 2018 (r340181) @@ -35,9 +35,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include #include #include @@ -47,6 +49,11 @@ FEATURE(linuxulator_v4l2, "V4L2 ioctl wrapper support MODULE_VERSION(linux_common, 1); SET_DECLARE(linux_device_handler_set, struct linux_device_handler); + +TAILQ_HEAD(, linux_ioctl_handler_element) linux_ioctl_handlers = +TAILQ_HEAD_INITIALIZER(linux_ioctl_handlers); +struct sx linux_ioctl_sx; +SX_SYSINIT(linux_ioctl, &linux_ioctl_sx, "Linux ioctl handlers"); static eventhandler_tag linux_exec_tag; static eventhandler_tag linux_thread_dtor_tag; Modified: head/sys/compat/linux/linux_ioctl.c == --- head/sys/compat/linux/linux_ioctl.c Tue Nov 6 12:57:38 2018 (r340180) +++ head/sys/compat/linux/linux_ioctl.c Tue Nov 6 13:51:08 2018 (r340181) @@ -161,17 +161,19 @@ DATA_SET(linux_ioctl_handler_set, video2_handler); DATA_SET(linux_ioctl_handler_set, fbsd_usb); DATA_SET(linux_ioctl_handler_set, evdev_handler); -struct handler_element -{ - TAILQ_ENTRY(handler_element) list; - int (*func)(struct thread *, struct linux_ioctl_args *); - int low, high, span; -}; - -static TAILQ_HEAD(, handler_element) handlers = -TAILQ_HEAD_INITIALIZER(handlers); +#ifdef __i386__ +static TAILQ_HEAD(, linux_ioctl_handler_element) linux_ioctl_handlers = +TAILQ_HEAD_INITIALIZER(linux_ioctl_handlers); static struct sx linux_ioctl_sx; SX_SYSINIT(linux_ioctl, &linux_ioctl_sx, "Linux ioctl handlers"); +#else +extern TAILQ_HEAD(, linux_ioctl_handler_element) linux_ioctl_handlers; +extern struct sx linux_ioctl_sx; +#endif
svn commit: r339734 - stable/11/sys/compat/linuxkpi/common/include/linux
Author: tijl Date: Thu Oct 25 16:01:19 2018 New Revision: 339734 URL: https://svnweb.freebsd.org/changeset/base/339734 Log: MFC r339618: Define linuxkpi readq for 64-bit architectures. It is used by drm-kmod. Currently the compiler picks up the definition in machine/cpufunc.h. Add compiler memory barriers to read* and write*. The Linux x86 implementation of these functions uses inline asm with "memory" clobber. The Linux x86 implementation of read_relaxed* and write_relaxed* uses the same inline asm without "memory" clobber. Implement ioread* and iowrite* in terms of read* and write* so they also have memory barriers. Qualify the addr parameter in write* as volatile. Like Linux, define macros with the same name as the inline functions. Only define 64-bit versions on 64-bit architectures because generally 32-bit architectures can't do atomic 64-bit loads and stores. Regroup the functions a bit and add brief comments explaining what they do: - __raw_read*, __raw_write*: atomic, no barriers, no byte swapping - read_relaxed*, write_relaxed*: atomic, no barriers, little-endian - read*, write*: atomic, with barriers, little-endian Add a comment that says our implementation of ioread* and iowrite* only handles MMIO and does not support port IO. Reviewed by: hselasky Modified: stable/11/sys/compat/linuxkpi/common/include/linux/io.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/io.h == --- stable/11/sys/compat/linuxkpi/common/include/linux/io.h Thu Oct 25 16:01:10 2018(r339733) +++ stable/11/sys/compat/linuxkpi/common/include/linux/io.h Thu Oct 25 16:01:19 2018(r339734) @@ -38,153 +38,309 @@ #include #include +/* + * XXX This is all x86 specific. It should be bus space access. + */ + +/* Access MMIO registers atomically without barriers and byte swapping. */ + +static inline uint8_t +__raw_readb(const volatile void *addr) +{ + return (*(const volatile uint8_t *)addr); +} +#define__raw_readb(addr) __raw_readb(addr) + +static inline void +__raw_writeb(uint8_t v, volatile void *addr) +{ + *(volatile uint8_t *)addr = v; +} +#define__raw_writeb(v, addr) __raw_writeb(v, addr) + +static inline uint16_t +__raw_readw(const volatile void *addr) +{ + return (*(const volatile uint16_t *)addr); +} +#define__raw_readw(addr) __raw_readw(addr) + +static inline void +__raw_writew(uint16_t v, volatile void *addr) +{ + *(volatile uint16_t *)addr = v; +} +#define__raw_writew(v, addr) __raw_writew(v, addr) + static inline uint32_t __raw_readl(const volatile void *addr) { - return *(const volatile uint32_t *)addr; + return (*(const volatile uint32_t *)addr); } +#define__raw_readl(addr) __raw_readl(addr) static inline void -__raw_writel(uint32_t b, volatile void *addr) +__raw_writel(uint32_t v, volatile void *addr) { - *(volatile uint32_t *)addr = b; + *(volatile uint32_t *)addr = v; } +#define__raw_writel(v, addr) __raw_writel(v, addr) +#ifdef __LP64__ static inline uint64_t __raw_readq(const volatile void *addr) { - return *(const volatile uint64_t *)addr; + return (*(const volatile uint64_t *)addr); } +#define__raw_readq(addr) __raw_readq(addr) static inline void -__raw_writeq(uint64_t b, volatile void *addr) +__raw_writeq(uint64_t v, volatile void *addr) { - *(volatile uint64_t *)addr = b; + *(volatile uint64_t *)addr = v; } +#define__raw_writeq(v, addr) __raw_writeq(v, addr) +#endif -/* - * XXX This is all x86 specific. It should be bus space access. - */ #definemmiowb()barrier() -#undef writel +/* Access little-endian MMIO registers atomically with memory barriers. */ + +#undef readb +static inline uint8_t +readb(const volatile void *addr) +{ + uint8_t v; + + __compiler_membar(); + v = *(const volatile uint8_t *)addr; + __compiler_membar(); + return (v); +} +#definereadb(addr) readb(addr) + +#undef writeb static inline void -writel(uint32_t b, void *addr) +writeb(uint8_t v, volatile void *addr) { - *(volatile uint32_t *)addr = b; + __compiler_membar(); + *(volatile uint8_t *)addr = v; + __compiler_membar(); } +#definewriteb(v, addr) writeb(v, addr) -#undef writel_relaxed +#undef readw +static inline uint16_t +readw(const volatile void *addr) +{ + uint16_t v; + + __compiler_membar(); + v = *(const volatile uint16_t *)addr; + __compiler_membar(); + return (v); +} +#definereadw(addr) readw(addr) + +#undef writew static inline void -writel_relaxed(uint32_t b, void *addr) +writew(uint16_t v, volatile void *addr) { - *(volatile uint32
svn commit: r339733 - stable/12/sys/compat/linuxkpi/common/include/linux
Author: tijl Date: Thu Oct 25 16:01:10 2018 New Revision: 339733 URL: https://svnweb.freebsd.org/changeset/base/339733 Log: MFC r339618: Define linuxkpi readq for 64-bit architectures. It is used by drm-kmod. Currently the compiler picks up the definition in machine/cpufunc.h. Add compiler memory barriers to read* and write*. The Linux x86 implementation of these functions uses inline asm with "memory" clobber. The Linux x86 implementation of read_relaxed* and write_relaxed* uses the same inline asm without "memory" clobber. Implement ioread* and iowrite* in terms of read* and write* so they also have memory barriers. Qualify the addr parameter in write* as volatile. Like Linux, define macros with the same name as the inline functions. Only define 64-bit versions on 64-bit architectures because generally 32-bit architectures can't do atomic 64-bit loads and stores. Regroup the functions a bit and add brief comments explaining what they do: - __raw_read*, __raw_write*: atomic, no barriers, no byte swapping - read_relaxed*, write_relaxed*: atomic, no barriers, little-endian - read*, write*: atomic, with barriers, little-endian Add a comment that says our implementation of ioread* and iowrite* only handles MMIO and does not support port IO. Reviewed by: hselasky Approved by: re (gjb) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/io.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/io.h == --- stable/12/sys/compat/linuxkpi/common/include/linux/io.h Thu Oct 25 15:49:59 2018(r339732) +++ stable/12/sys/compat/linuxkpi/common/include/linux/io.h Thu Oct 25 16:01:10 2018(r339733) @@ -38,153 +38,309 @@ #include #include +/* + * XXX This is all x86 specific. It should be bus space access. + */ + +/* Access MMIO registers atomically without barriers and byte swapping. */ + +static inline uint8_t +__raw_readb(const volatile void *addr) +{ + return (*(const volatile uint8_t *)addr); +} +#define__raw_readb(addr) __raw_readb(addr) + +static inline void +__raw_writeb(uint8_t v, volatile void *addr) +{ + *(volatile uint8_t *)addr = v; +} +#define__raw_writeb(v, addr) __raw_writeb(v, addr) + +static inline uint16_t +__raw_readw(const volatile void *addr) +{ + return (*(const volatile uint16_t *)addr); +} +#define__raw_readw(addr) __raw_readw(addr) + +static inline void +__raw_writew(uint16_t v, volatile void *addr) +{ + *(volatile uint16_t *)addr = v; +} +#define__raw_writew(v, addr) __raw_writew(v, addr) + static inline uint32_t __raw_readl(const volatile void *addr) { - return *(const volatile uint32_t *)addr; + return (*(const volatile uint32_t *)addr); } +#define__raw_readl(addr) __raw_readl(addr) static inline void -__raw_writel(uint32_t b, volatile void *addr) +__raw_writel(uint32_t v, volatile void *addr) { - *(volatile uint32_t *)addr = b; + *(volatile uint32_t *)addr = v; } +#define__raw_writel(v, addr) __raw_writel(v, addr) +#ifdef __LP64__ static inline uint64_t __raw_readq(const volatile void *addr) { - return *(const volatile uint64_t *)addr; + return (*(const volatile uint64_t *)addr); } +#define__raw_readq(addr) __raw_readq(addr) static inline void -__raw_writeq(uint64_t b, volatile void *addr) +__raw_writeq(uint64_t v, volatile void *addr) { - *(volatile uint64_t *)addr = b; + *(volatile uint64_t *)addr = v; } +#define__raw_writeq(v, addr) __raw_writeq(v, addr) +#endif -/* - * XXX This is all x86 specific. It should be bus space access. - */ #definemmiowb()barrier() -#undef writel +/* Access little-endian MMIO registers atomically with memory barriers. */ + +#undef readb +static inline uint8_t +readb(const volatile void *addr) +{ + uint8_t v; + + __compiler_membar(); + v = *(const volatile uint8_t *)addr; + __compiler_membar(); + return (v); +} +#definereadb(addr) readb(addr) + +#undef writeb static inline void -writel(uint32_t b, void *addr) +writeb(uint8_t v, volatile void *addr) { - *(volatile uint32_t *)addr = b; + __compiler_membar(); + *(volatile uint8_t *)addr = v; + __compiler_membar(); } +#definewriteb(v, addr) writeb(v, addr) -#undef writel_relaxed +#undef readw +static inline uint16_t +readw(const volatile void *addr) +{ + uint16_t v; + + __compiler_membar(); + v = *(const volatile uint16_t *)addr; + __compiler_membar(); + return (v); +} +#definereadw(addr) readw(addr) + +#undef writew static inline void -writel_relaxed(uint32_t b, void *addr) +writew(uint16_t v, volatile void *addr) {
svn commit: r339618 - head/sys/compat/linuxkpi/common/include/linux
Author: tijl Date: Mon Oct 22 20:55:35 2018 New Revision: 339618 URL: https://svnweb.freebsd.org/changeset/base/339618 Log: Define linuxkpi readq for 64-bit architectures. It is used by drm-kmod. Currently the compiler picks up the definition in machine/cpufunc.h. Add compiler memory barriers to read* and write*. The Linux x86 implementation of these functions uses inline asm with "memory" clobber. The Linux x86 implementation of read_relaxed* and write_relaxed* uses the same inline asm without "memory" clobber. Implement ioread* and iowrite* in terms of read* and write* so they also have memory barriers. Qualify the addr parameter in write* as volatile. Like Linux, define macros with the same name as the inline functions. Only define 64-bit versions on 64-bit architectures because generally 32-bit architectures can't do atomic 64-bit loads and stores. Regroup the functions a bit and add brief comments explaining what they do: - __raw_read*, __raw_write*: atomic, no barriers, no byte swapping - read_relaxed*, write_relaxed*: atomic, no barriers, little-endian - read*, write*: atomic, with barriers, little-endian Add a comment that says our implementation of ioread* and iowrite* only handles MMIO and does not support port IO. Reviewed by: hselasky MFC after:3 days Modified: head/sys/compat/linuxkpi/common/include/linux/io.h Modified: head/sys/compat/linuxkpi/common/include/linux/io.h == --- head/sys/compat/linuxkpi/common/include/linux/io.h Mon Oct 22 20:22:33 2018(r339617) +++ head/sys/compat/linuxkpi/common/include/linux/io.h Mon Oct 22 20:55:35 2018(r339618) @@ -38,153 +38,309 @@ #include #include +/* + * XXX This is all x86 specific. It should be bus space access. + */ + +/* Access MMIO registers atomically without barriers and byte swapping. */ + +static inline uint8_t +__raw_readb(const volatile void *addr) +{ + return (*(const volatile uint8_t *)addr); +} +#define__raw_readb(addr) __raw_readb(addr) + +static inline void +__raw_writeb(uint8_t v, volatile void *addr) +{ + *(volatile uint8_t *)addr = v; +} +#define__raw_writeb(v, addr) __raw_writeb(v, addr) + +static inline uint16_t +__raw_readw(const volatile void *addr) +{ + return (*(const volatile uint16_t *)addr); +} +#define__raw_readw(addr) __raw_readw(addr) + +static inline void +__raw_writew(uint16_t v, volatile void *addr) +{ + *(volatile uint16_t *)addr = v; +} +#define__raw_writew(v, addr) __raw_writew(v, addr) + static inline uint32_t __raw_readl(const volatile void *addr) { - return *(const volatile uint32_t *)addr; + return (*(const volatile uint32_t *)addr); } +#define__raw_readl(addr) __raw_readl(addr) static inline void -__raw_writel(uint32_t b, volatile void *addr) +__raw_writel(uint32_t v, volatile void *addr) { - *(volatile uint32_t *)addr = b; + *(volatile uint32_t *)addr = v; } +#define__raw_writel(v, addr) __raw_writel(v, addr) +#ifdef __LP64__ static inline uint64_t __raw_readq(const volatile void *addr) { - return *(const volatile uint64_t *)addr; + return (*(const volatile uint64_t *)addr); } +#define__raw_readq(addr) __raw_readq(addr) static inline void -__raw_writeq(uint64_t b, volatile void *addr) +__raw_writeq(uint64_t v, volatile void *addr) { - *(volatile uint64_t *)addr = b; + *(volatile uint64_t *)addr = v; } +#define__raw_writeq(v, addr) __raw_writeq(v, addr) +#endif -/* - * XXX This is all x86 specific. It should be bus space access. - */ #definemmiowb()barrier() -#undef writel +/* Access little-endian MMIO registers atomically with memory barriers. */ + +#undef readb +static inline uint8_t +readb(const volatile void *addr) +{ + uint8_t v; + + __compiler_membar(); + v = *(const volatile uint8_t *)addr; + __compiler_membar(); + return (v); +} +#definereadb(addr) readb(addr) + +#undef writeb static inline void -writel(uint32_t b, void *addr) +writeb(uint8_t v, volatile void *addr) { - *(volatile uint32_t *)addr = b; + __compiler_membar(); + *(volatile uint8_t *)addr = v; + __compiler_membar(); } +#definewriteb(v, addr) writeb(v, addr) -#undef writel_relaxed +#undef readw +static inline uint16_t +readw(const volatile void *addr) +{ + uint16_t v; + + __compiler_membar(); + v = *(const volatile uint16_t *)addr; + __compiler_membar(); + return (v); +} +#definereadw(addr) readw(addr) + +#undef writew static inline void -writel_relaxed(uint32_t b, void *addr) +writew(uint16_t v, volatile void *addr) { - *(volatile uint32_t *)addr = b; + __compiler_membar(); + *(volatile uint16_t *)
Re: svn commit: r333919 - in head/contrib/file: . doc magic magic/Magdir python src tests
On Mon, 21 May 2018 00:10:23 +0200 Antoine Brodin wrote: > On Sun, May 20, 2018 at 10:39 PM, Antoine Brodin wrote: >> On Sun, May 20, 2018 at 10:30 PM, Antoine Brodin >> wrote: >>> On Sun, May 20, 2018 at 7:06 AM, Eitan Adler wrote: Author: eadler Date: Sun May 20 05:06:42 2018 New Revision: 333919 URL: https://svnweb.freebsd.org/changeset/base/333919 Log: MFV: file 5.33 Merge the latest file(1) in. Relevent Changelog: - extend the support for ${x?:} expansions for magic descriptions - add support for ${x?:} in mime types to handle pie binaries. - add support for negative offsets (offsets from the end of file) - close the file on error when writing magic Relnotes: yes >>> >>> This breaks the ports tree, please revert and request an exp-run. >> >> At least revert the changes to contrib/file/magic/Magdir/elf > > The problematic part was reverted in r333944 Seems to affect libraries that are installed +x. ___ 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: r332489 - in head: gnu/usr.bin/gdb/kgdb sys/conf sys/dev/dcons sys/dev/hyperv/vmbus/i386 sys/dev/ppc sys/dev/syscons sys/i386/conf sys/i386/i386 sys/i386/include sys/i386/include/pc sy
On Sun, 22 Apr 2018 23:51:03 +0300 Konstantin Belousov wrote: > On Sun, Apr 22, 2018 at 10:26:14PM +0300, Konstantin Belousov wrote: >> On Sun, Apr 22, 2018 at 09:06:56PM +0200, Tijl Coosemans wrote: >>> Could this have broken the linux futex syscall? I have a linux program >>> that gets stuck in linux_sys_futex and becomes unkillable. Note that the >>> routines in sys/i386/linux/linux_support.s try to do atomic operations on >>> user space addresses. >> >> Yes, it is quite possible. I will try to look next week. > > Try this. I only compile-tested it as a module. Yes, this fixes it. That was quick, thanks! ___ 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: r332489 - in head: gnu/usr.bin/gdb/kgdb sys/conf sys/dev/dcons sys/dev/hyperv/vmbus/i386 sys/dev/ppc sys/dev/syscons sys/i386/conf sys/i386/i386 sys/i386/include sys/i386/include/pc sy
On Fri, 13 Apr 2018 20:30:49 + (UTC) Konstantin Belousov wrote: > Author: kib > Date: Fri Apr 13 20:30:49 2018 > New Revision: 332489 > URL: https://svnweb.freebsd.org/changeset/base/332489 > > Log: > i386 4/4G split. > > The change makes the user and kernel address spaces on i386 > independent, giving each almost the full 4G of usable virtual addresses > except for one PDE at top used for trampoline and per-CPU trampoline > stacks, and system structures that must be always mapped, namely IDT, > GDT, common TSS and LDT, and process-private TSS and LDT if allocated. Could this have broken the linux futex syscall? I have a linux program that gets stuck in linux_sys_futex and becomes unkillable. Note that the routines in sys/i386/linux/linux_support.s try to do atomic operations on user space addresses. ___ 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: r332871 - head/sys/kern
Author: tijl Date: Sun Apr 22 16:05:29 2018 New Revision: 332871 URL: https://svnweb.freebsd.org/changeset/base/332871 Log: Make bufdaemon and bufspacedaemon use kthread_suspend_check instead of kproc_suspend_check. In r329612 bufspacedaemon was turned into a thread of the bufdaemon process causing both to call kproc_suspend_check with the same proc argument and that function contains the following while loop: while (SIGISMEMBER(p->p_siglist, SIGSTOP)) { wakeup(&p->p_siglist); msleep(&p->p_siglist, &p->p_mtx, PPAUSE, "kpsusp", 0); } So one thread wakes up the other and the other wakes up the first again, locking up UP machines on shutdown. Also register the shutdown handlers with SHUTDOWN_PRI_LAST + 100 so they run after the syncer has shutdown, because the syncer can cause a situation where bufdaemon help is needed to proceed. PR: 227404 Reviewed by: kib Tested by:cy, rmacklem Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c == --- head/sys/kern/vfs_bio.c Sun Apr 22 09:30:07 2018(r332870) +++ head/sys/kern/vfs_bio.c Sun Apr 22 16:05:29 2018(r332871) @@ -791,9 +791,12 @@ bufspace_daemon(void *arg) { struct bufdomain *bd; + EVENTHANDLER_REGISTER(shutdown_pre_sync, kthread_shutdown, curthread, + SHUTDOWN_PRI_LAST + 100); + bd = arg; for (;;) { - kproc_suspend_check(curproc); + kthread_suspend_check(); /* * Free buffers from the clean queue until we meet our @@ -3357,8 +3360,8 @@ buf_daemon() /* * This process needs to be suspended prior to shutdown sync. */ - EVENTHANDLER_REGISTER(shutdown_pre_sync, kproc_shutdown, bufdaemonproc, - SHUTDOWN_PRI_LAST); + EVENTHANDLER_REGISTER(shutdown_pre_sync, kthread_shutdown, curthread, + SHUTDOWN_PRI_LAST + 100); /* * Start the buf clean daemons as children threads. @@ -3381,7 +3384,7 @@ buf_daemon() bd_request = 0; mtx_unlock(&bdlock); - kproc_suspend_check(bufdaemonproc); + kthread_suspend_check(); /* * Save speedupreq for this pass and reset to capture new ___ 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: r331732 - head/sys/vm
On Sun, 1 Apr 2018 12:27:03 -0400 Mark Johnston wrote: > On Sun, Apr 01, 2018 at 05:20:21PM +0200, Tijl Coosemans wrote: >> On Sat, 31 Mar 2018 18:54:32 -0400 Mark Johnston wrote: >>> On Sat, Mar 31, 2018 at 08:21:18PM +0200, Tijl Coosemans wrote: >>>> On Thu, 29 Mar 2018 14:27:40 + (UTC) Mark Johnston >>>> wrote: >>>>> Author: markj >>>>> Date: Thu Mar 29 14:27:40 2018 >>>>> New Revision: 331732 >>>>> URL: https://svnweb.freebsd.org/changeset/base/331732 >>>>> >>>>> Log: >>>>> Fix the background laundering mechanism after r329882. >>>>> >>>>> Rather than using the number of inactive queue scans as a metric for >>>>> how many clean pages are being freed by the page daemon, have the >>>>> page daemon keep a running counter of the number of pages it has freed, >>>>> and have the laundry thread use that when computing the background >>>>> laundering threshold. >>>>> [...] >>>> >>>> I'm seeing big processes being killed with an "out of swap space" message >>>> even though there's still plenty of swap available. It seems to be fixed >>>> by making this division round upwards: >>>> >>>>if (target == 0 && ndirty * isqrt((nfreed + >>>>(vmd->vmd_free_target - vmd->vmd_free_min) - 1) / >>>>(vmd->vmd_free_target - vmd->vmd_free_min)) >= nclean) { >>>> >>>> I don't know where this formula comes from, so I don't know if this >>>> change is correct. >>> >>> Hm, that's somewhat surprising. This code shouldn't be executing in >>> situations where the OOM kill logic is invoked (i.e., memory pressure >>> plus a shortage of clean pages in the inactive queue). >>> >>> How much RAM does the system have? Could you collect "sysctl vm" output >>> around the time of an OOM kill? >> >> 1GiB RAM. I've sampled sysctl vm every 5s from the moment the process >> starts swapping until it is killed and uploaded that to >> https://people.freebsd.org/~tijl/sysctl/ > > Thank you. Now I agree with your change. Would you like to commit it? > I can take care of it if you prefer. Please go ahead. You can probably write a better commit log. ___ 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: r331732 - head/sys/vm
On Sat, 31 Mar 2018 18:54:32 -0400 Mark Johnston wrote: > On Sat, Mar 31, 2018 at 08:21:18PM +0200, Tijl Coosemans wrote: > > On Thu, 29 Mar 2018 14:27:40 + (UTC) Mark Johnston > > wrote: > > > Author: markj > > > Date: Thu Mar 29 14:27:40 2018 > > > New Revision: 331732 > > > URL: https://svnweb.freebsd.org/changeset/base/331732 > > > > > > Log: > > > Fix the background laundering mechanism after r329882. > > > > > > Rather than using the number of inactive queue scans as a metric for > > > how many clean pages are being freed by the page daemon, have the > > > page daemon keep a running counter of the number of pages it has freed, > > > and have the laundry thread use that when computing the background > > > laundering threshold. > > > [...] > > > > I'm seeing big processes being killed with an "out of swap space" message > > even though there's still plenty of swap available. It seems to be fixed > > by making this division round upwards: > > > > if (target == 0 && ndirty * isqrt((nfreed + > > (vmd->vmd_free_target - vmd->vmd_free_min) - 1) / > > (vmd->vmd_free_target - vmd->vmd_free_min)) >= nclean) { > > > > I don't know where this formula comes from, so I don't know if this > > change is correct. > > Hm, that's somewhat surprising. This code shouldn't be executing in > situations where the OOM kill logic is invoked (i.e., memory pressure > plus a shortage of clean pages in the inactive queue). > > How much RAM does the system have? Could you collect "sysctl vm" output > around the time of an OOM kill? 1GiB RAM. I've sampled sysctl vm every 5s from the moment the process starts swapping until it is killed and uploaded that to https://people.freebsd.org/~tijl/sysctl/ > I'm wondering if the higher inactive queue scan frequency after r329882 > might be responsible: OOM kills are performed after vm.pageout_oom_seq > back-to-back scans fail to reclaim any pages. Does your problem persist > if you increase the value of that sysctl, say to 60? This didn't help. ___ 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: r331732 - head/sys/vm
On Thu, 29 Mar 2018 14:27:40 + (UTC) Mark Johnston wrote: > Author: markj > Date: Thu Mar 29 14:27:40 2018 > New Revision: 331732 > URL: https://svnweb.freebsd.org/changeset/base/331732 > > Log: > Fix the background laundering mechanism after r329882. > > Rather than using the number of inactive queue scans as a metric for > how many clean pages are being freed by the page daemon, have the > page daemon keep a running counter of the number of pages it has freed, > and have the laundry thread use that when computing the background > laundering threshold. > > Reviewed by:kib > Differential Revision: https://reviews.freebsd.org/D14884 > > Modified: > head/sys/vm/vm_pageout.c > head/sys/vm/vm_pagequeue.h > > Modified: head/sys/vm/vm_pageout.c > == > --- head/sys/vm/vm_pageout.c Thu Mar 29 13:55:23 2018(r331731) > +++ head/sys/vm/vm_pageout.c Thu Mar 29 14:27:40 2018(r331732) > @@ -943,8 +943,7 @@ vm_pageout_laundry_worker(void *arg) > { > struct vm_domain *vmd; > struct vm_pagequeue *pq; > - uint64_t nclean, ndirty; > - u_int inactq_scans, last_launder; > + uint64_t nclean, ndirty, nfreed; > int domain, last_target, launder, shortfall, shortfall_cycle, target; > bool in_shortfall; > > @@ -958,8 +957,7 @@ vm_pageout_laundry_worker(void *arg) > in_shortfall = false; > shortfall_cycle = 0; > target = 0; > - inactq_scans = 0; > - last_launder = 0; > + nfreed = 0; > > /* >* Calls to these handlers are serialized by the swap syscall lock. > @@ -1000,7 +998,6 @@ vm_pageout_laundry_worker(void *arg) > target = 0; > goto trybackground; > } > - last_launder = inactq_scans; > launder = target / shortfall_cycle--; > goto dolaundry; > > @@ -1009,24 +1006,23 @@ vm_pageout_laundry_worker(void *arg) >* meet the conditions to perform background laundering: >* >* 1. The ratio of dirty to clean inactive pages exceeds the > - *background laundering threshold and the pagedaemon has > - *been woken up to reclaim pages since our last > - *laundering, or > + *background laundering threshold, or >* 2. we haven't yet reached the target of the current >*background laundering run. >* >* The background laundering threshold is not a constant. >* Instead, it is a slowly growing function of the number of > - * page daemon scans since the last laundering. Thus, as the > - * ratio of dirty to clean inactive pages grows, the amount of > - * memory pressure required to trigger laundering decreases. > + * clean pages freed by the page daemon since the last > + * background laundering. Thus, as the ratio of dirty to > + * clean inactive pages grows, the amount of memory pressure > + * required to trigger laundering decreases. >*/ > trybackground: > nclean = vmd->vmd_free_count + > vmd->vmd_pagequeues[PQ_INACTIVE].pq_cnt; > ndirty = vmd->vmd_pagequeues[PQ_LAUNDRY].pq_cnt; > - if (target == 0 && inactq_scans != last_launder && > - ndirty * isqrt(inactq_scans - last_launder) >= nclean) { > + if (target == 0 && ndirty * isqrt(nfreed / > + (vmd->vmd_free_target - vmd->vmd_free_min)) >= nclean) { I'm seeing big processes being killed with an "out of swap space" message even though there's still plenty of swap available. It seems to be fixed by making this division round upwards: if (target == 0 && ndirty * isqrt((nfreed + (vmd->vmd_free_target - vmd->vmd_free_min) - 1) / (vmd->vmd_free_target - vmd->vmd_free_min)) >= nclean) { I don't know where this formula comes from, so I don't know if this change is correct. ___ 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: r330926 - in stable/11/sys/cam: . scsi
Author: tijl Date: Wed Mar 14 09:57:58 2018 New Revision: 330926 URL: https://svnweb.freebsd.org/changeset/base/330926 Log: MFC r314624: Reject userland CCBs that have CAM_UNLOCKED set. CAM_UNLOCKED is internal flag and cannot correctly be set by userland. Return EINVAL from CAMIOCOMMAND and CAMIOQUEUE if it is set. Also fix leaks in some of the error paths for CAMIOQUEUE. PR: 215356 Modified: stable/11/sys/cam/cam_xpt.c stable/11/sys/cam/scsi/scsi_pass.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/cam_xpt.c == --- stable/11/sys/cam/cam_xpt.c Wed Mar 14 09:20:03 2018(r330925) +++ stable/11/sys/cam/cam_xpt.c Wed Mar 14 09:57:58 2018(r330926) @@ -414,6 +414,9 @@ xptdoioctl(struct cdev *dev, u_long cmd, caddr_t addr, inccb = (union ccb *)addr; + if (inccb->ccb_h.flags & CAM_UNLOCKED) + return (EINVAL); + bus = xpt_find_bus(inccb->ccb_h.path_id); if (bus == NULL) return (EINVAL); Modified: stable/11/sys/cam/scsi/scsi_pass.c == --- stable/11/sys/cam/scsi/scsi_pass.c Wed Mar 14 09:20:03 2018 (r330925) +++ stable/11/sys/cam/scsi/scsi_pass.c Wed Mar 14 09:57:58 2018 (r330926) @@ -1798,6 +1798,11 @@ passdoioctl(struct cdev *dev, u_long cmd, caddr_t addr inccb = (union ccb *)addr; + if (inccb->ccb_h.flags & CAM_UNLOCKED) { + error = EINVAL; + break; + } + /* * Some CCB types, like scan bus and scan lun can only go * through the transport layer device. @@ -1891,20 +1896,23 @@ passdoioctl(struct cdev *dev, u_long cmd, caddr_t addr xpt_print(periph->path, "Copy of user CCB %p to " "kernel address %p failed with error %d\n", *user_ccb, ccb, error); - uma_zfree(softc->pass_zone, io_req); - cam_periph_lock(periph); - break; + goto camioqueue_error; } + if (ccb->ccb_h.flags & CAM_UNLOCKED) { + error = EINVAL; + goto camioqueue_error; + } + if (ccb->ccb_h.flags & CAM_CDB_POINTER) { if (ccb->csio.cdb_len > IOCDBLEN) { error = EINVAL; - break; + goto camioqueue_error; } error = copyin(ccb->csio.cdb_io.cdb_ptr, ccb->csio.cdb_io.cdb_bytes, ccb->csio.cdb_len); - if (error) - break; + if (error != 0) + goto camioqueue_error; ccb->ccb_h.flags &= ~CAM_CDB_POINTER; } @@ -1916,10 +1924,8 @@ passdoioctl(struct cdev *dev, u_long cmd, caddr_t addr xpt_print(periph->path, "CCB function code %#x is " "restricted to the XPT device\n", ccb->ccb_h.func_code); - uma_zfree(softc->pass_zone, io_req); - cam_periph_lock(periph); error = ENODEV; - break; + goto camioqueue_error; } /* @@ -1966,11 +1972,8 @@ passdoioctl(struct cdev *dev, u_long cmd, caddr_t addr || (fc == XPT_DEV_ADVINFO) || (fc == XPT_NVME_ADMIN) || (fc == XPT_NVME_IO)) { error = passmemsetup(periph, io_req); - if (error != 0) { - uma_zfree(softc->pass_zone, io_req); - cam_periph_lock(periph); - break; - } + if (error != 0) + goto camioqueue_error; } else io_req->mapinfo.num_bufs_used = 0; @@ -2014,6 +2017,11 @@ passdoioctl(struct cdev *dev, u_long cmd, caddr_t addr TAILQ_REMOVE(&softc->active_queue, io_req, links); TAILQ_INSERT_TAIL(&softc->done_queue, io_req, links); } + break; + +camioqueue_error: + uma_zfree(softc->pass_zone, io_req); + cam_periph_lock(periph); break; } case CAMIOGET: ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-a
Re: svn commit: r324938 - head/contrib/jemalloc/include/jemalloc/internal
On Mon, 23 Oct 2017 21:31:04 + (UTC) Dimitry Andric wrote: > Author: dim > Date: Mon Oct 23 21:31:04 2017 > New Revision: 324938 > URL: https://svnweb.freebsd.org/changeset/base/324938 > > Log: > After jemalloc was updated to version 5.0.0 in r319971, i386 executables > linked with AddressSanitizer (even those linked on earlier versions of > FreeBSD, or with external versions of clang) started failing with errors > similar to: > > ==14688==AddressSanitizer CHECK failed: > /usr/src/contrib/compiler-rt/lib/asan/asan_poisoning.cc:36 > "((AddrIsAlignedByGranularity(addr))) != (0)" (0x0, 0x0) > > This is because AddressSanitizer expects all the TLS data in the program > to be aligned to at least 8 bytes. > > Before the jemalloc 5.0.0 update, all the TLS data in the i386 version > of libc.so added up to 80 bytes (a multiple of 8), but 5.0.0 made this > grow to 2404 bytes (not a multiple of 8). This is due to added caching > data in jemalloc's internal struct tsd_s. > > To fix AddressSanitizer, ensure this struct is aligned to at least 16 > bytes, which can be done unconditionally for all architectures. (An > earlier version of the fix aligned the struct to 8 bytes, but only for > ILP32 architectures. This was deemed unnecessarily complicated.) > > PR: 221337 > X-MFC-With: r319971 > > Modified: > head/contrib/jemalloc/include/jemalloc/internal/tsd.h > > Modified: head/contrib/jemalloc/include/jemalloc/internal/tsd.h > == > --- head/contrib/jemalloc/include/jemalloc/internal/tsd.h Mon Oct 23 > 20:50:08 2017(r324937) > +++ head/contrib/jemalloc/include/jemalloc/internal/tsd.h Mon Oct 23 > 21:31:04 2017(r324938) > @@ -120,7 +120,8 @@ struct tsd_s { > t use_a_getter_or_setter_instead_##n; > MALLOC_TSD > #undef O > -}; > +/* AddressSanitizer requires TLS data to be aligned to at least 8 bytes. */ > +} JEMALLOC_ALIGNED(16); > > /* > * Wrapper around tsd_t that makes it possible to avoid implicit conversion > On amd64 this commit causes kded4 to crash in libnvidia-tls.so.1 (from x11/nvidia-driver-304) during KDE startup. Lowering to 8 byte alignment fixes the crash. Note that in libc the TLS segment alignment is 16 now but the memory size isn't a multiple of 16. Does rtld handle this correctly? Application: KDE Daemon (kded4), signal: Segmentation fault [KCrash Handler] #8 0x00081cea3761 in _nv024tls () from /usr/local/lib/libnvidia-tls.so.1 #9 0x00081c7a698c in ?? () from /usr/local/lib/libGL-NVIDIA.so.1 #10 0x00081c78915d in ?? () from /usr/local/lib/libGL-NVIDIA.so.1 #11 0x00081c78966a in ?? () from /usr/local/lib/libGL-NVIDIA.so.1 #12 0x000800616c08 in objlist_call_init (list=0x7fffd100, lockstate=0x7fffd098) at /usr/src/libexec/rtld-elf/rtld.c:2670 #13 0x00080061cae2 in dlopen_object (name=0x801fd0c98 "/usr/local/lib/kde4/kded_powerdevil.so", fd=-1, refobj=0x80063b000, lo_flags=2, mode=1, lockstate=0x7fffd098) at /usr/src/libexec/rtld-elf/rtld.c:3389 #14 0x000800617fba in rtld_dlopen (name=0x801fd0c98 "/usr/local/lib/kde4/kded_powerdevil.so", fd=-1, mode=1) at /usr/src/libexec/rtld-elf/rtld.c:3264 #15 0x000800617e52 in dlopen (name=0x801fd0c98 "/usr/local/lib/kde4/kded_powerdevil.so", mode=1) at /usr/src/libexec/rtld-elf/rtld.c:3231 #16 0x000802190ddf in ?? () from /usr/local/lib/qt4/libQtCore.so.4 #17 0x00080218959b in ?? () from /usr/local/lib/qt4/libQtCore.so.4 #18 0x000801898d47 in KPluginLoader::load() () from /usr/local/lib/libkdecore.so.5 #19 0x000801898b37 in KPluginLoader::factory() () from /usr/local/lib/libkdecore.so.5 #20 0x00080c31b473 in ?? () from /usr/local/lib/libkdeinit4_kded4.so #21 0x00080c31ab29 in ?? () from /usr/local/lib/libkdeinit4_kded4.so . % readelf -l /usr/local/lib/libnvidia-tls.so Elf file type is DYN (Shared object file) Entry point 0x640 There are 6 program headers, starting at offset 64 Program Headers: Type Offset VirtAddr PhysAddr FileSizMemSiz FlgAlign LOAD 0x 0x 0x 0x0af0 0x0af0 R E0x20 LOAD 0x0af0 0x00200af0 0x00200af0 0x01fc 0x0260 RW 0x20 DYNAMIC0x0af8 0x00200af8 0x00200af8 0x0190 0x0190 RW 0x8 NOTE 0x0ad0 0x0ad0 0x0ad0 0x0020 0x0020 R 0x4 TLS0x0af0 0x00200af0 0x00200af0 0x 0x0030 R 0x8 GNU_STACK 0x 0x 0x000
svn commit: r325640 - head/share/man/man7
Author: tijl Date: Fri Nov 10 11:19:47 2017 New Revision: 325640 URL: https://svnweb.freebsd.org/changeset/base/325640 Log: Remove deprecated OVERRIDE_LINUX_BASE_PORT. It can be set via DEFAULT_VERSIONS now (e.g. DEFAULT_VERSIONS+=linux=c7). Noticed by: xmj MFC after:2 weeks Modified: head/share/man/man7/ports.7 Modified: head/share/man/man7/ports.7 == --- head/share/man/man7/ports.7 Fri Nov 10 11:19:33 2017(r325639) +++ head/share/man/man7/ports.7 Fri Nov 10 11:19:47 2017(r325640) @@ -494,7 +494,7 @@ More information on these and other related variables and the .Fx Porter's Handbook. -.Bl -tag -width ".Va OVERRIDE_LINUX_BASE_PORT" +.Bl -tag -width ".Va WITH_GHOSTSCRIPT_VER" .It Va WITH_OPENSSL_PORT .Pq Vt bool If set, causes ports that make use of OpenSSL to use the OpenSSL from @@ -514,8 +514,6 @@ If set, enables for most ports. .It Va WITH_GHOSTSCRIPT_VER If set, the version of ghostscript to be used by ports. -.It Va OVERRIDE_LINUX_BASE_PORT -The default linux base to use. .It Va WITH_CCACHE_BUILD .Pq Vt bool If set, enables the use of ___ 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: r325518 - in stable/11/sys: amd64/amd64 i386/i386
Author: tijl Date: Tue Nov 7 17:07:45 2017 New Revision: 325518 URL: https://svnweb.freebsd.org/changeset/base/325518 Log: MFC r325232 Set the return address for stack entry points to zero. Stack unwinders treat zero as a stop condition. The value on the stack can be non-zero because thread stacks may be arbitrary memory provided via pthread_attr_setstack(3) or may be recycled from previous threads. Reference: https://lists.freebsd.org/pipermail/freebsd-current/2017-August/066855.html https://lists.freebsd.org/pipermail/freebsd-current/2017-October/067254.html Discussed with: kib Modified: stable/11/sys/amd64/amd64/vm_machdep.c stable/11/sys/i386/i386/vm_machdep.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/vm_machdep.c == --- stable/11/sys/amd64/amd64/vm_machdep.c Tue Nov 7 16:59:52 2017 (r325517) +++ stable/11/sys/amd64/amd64/vm_machdep.c Tue Nov 7 17:07:45 2017 (r325518) @@ -511,6 +511,9 @@ cpu_set_upcall(struct thread *td, void (*entry)(void * (((uintptr_t)stack->ss_sp + stack->ss_size - 4) & ~0x0f) - 4; td->td_frame->tf_rip = (uintptr_t)entry; + /* Return address sentinel value to stop stack unwinding. */ + suword32((void *)td->td_frame->tf_rsp, 0); + /* Pass the argument to the entry point. */ suword32((void *)(td->td_frame->tf_rsp + sizeof(int32_t)), (uint32_t)(uintptr_t)arg); @@ -533,6 +536,9 @@ cpu_set_upcall(struct thread *td, void (*entry)(void * td->td_frame->tf_fs = _ufssel; td->td_frame->tf_gs = _ugssel; td->td_frame->tf_flags = TF_HASSEGS; + + /* Return address sentinel value to stop stack unwinding. */ + suword((void *)td->td_frame->tf_rsp, 0); /* Pass the argument to the entry point. */ td->td_frame->tf_rdi = (register_t)arg; Modified: stable/11/sys/i386/i386/vm_machdep.c == --- stable/11/sys/i386/i386/vm_machdep.cTue Nov 7 16:59:52 2017 (r325517) +++ stable/11/sys/i386/i386/vm_machdep.cTue Nov 7 17:07:45 2017 (r325518) @@ -530,6 +530,9 @@ cpu_set_upcall(struct thread *td, void (*entry)(void * (((int)stack->ss_sp + stack->ss_size - 4) & ~0x0f) - 4; td->td_frame->tf_eip = (int)entry; + /* Return address sentinel value to stop stack unwinding. */ + suword((void *)td->td_frame->tf_esp, 0); + /* Pass the argument to the entry point. */ suword((void *)(td->td_frame->tf_esp + sizeof(void *)), (int)arg); ___ 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: r325232 - in head/sys: amd64/amd64 i386/i386
Author: tijl Date: Tue Oct 31 11:51:34 2017 New Revision: 325232 URL: https://svnweb.freebsd.org/changeset/base/325232 Log: Set the return address for stack entry points to zero. Stack unwinders treat zero as a stop condition. The value on the stack can be non-zero because thread stacks may be arbitrary memory provided via pthread_attr_setstack(3) or may be recycled from previous threads. Reference: https://lists.freebsd.org/pipermail/freebsd-current/2017-August/066855.html https://lists.freebsd.org/pipermail/freebsd-current/2017-October/067254.html Discussed with: kib MFC after:1 week Modified: head/sys/amd64/amd64/vm_machdep.c head/sys/i386/i386/vm_machdep.c Modified: head/sys/amd64/amd64/vm_machdep.c == --- head/sys/amd64/amd64/vm_machdep.c Tue Oct 31 11:29:16 2017 (r325231) +++ head/sys/amd64/amd64/vm_machdep.c Tue Oct 31 11:51:34 2017 (r325232) @@ -508,6 +508,9 @@ cpu_set_upcall(struct thread *td, void (*entry)(void * (((uintptr_t)stack->ss_sp + stack->ss_size - 4) & ~0x0f) - 4; td->td_frame->tf_rip = (uintptr_t)entry; + /* Return address sentinel value to stop stack unwinding. */ + suword32((void *)td->td_frame->tf_rsp, 0); + /* Pass the argument to the entry point. */ suword32((void *)(td->td_frame->tf_rsp + sizeof(int32_t)), (uint32_t)(uintptr_t)arg); @@ -530,6 +533,9 @@ cpu_set_upcall(struct thread *td, void (*entry)(void * td->td_frame->tf_fs = _ufssel; td->td_frame->tf_gs = _ugssel; td->td_frame->tf_flags = TF_HASSEGS; + + /* Return address sentinel value to stop stack unwinding. */ + suword((void *)td->td_frame->tf_rsp, 0); /* Pass the argument to the entry point. */ td->td_frame->tf_rdi = (register_t)arg; Modified: head/sys/i386/i386/vm_machdep.c == --- head/sys/i386/i386/vm_machdep.c Tue Oct 31 11:29:16 2017 (r325231) +++ head/sys/i386/i386/vm_machdep.c Tue Oct 31 11:51:34 2017 (r325232) @@ -524,6 +524,9 @@ cpu_set_upcall(struct thread *td, void (*entry)(void * (((int)stack->ss_sp + stack->ss_size - 4) & ~0x0f) - 4; td->td_frame->tf_eip = (int)entry; + /* Return address sentinel value to stop stack unwinding. */ + suword((void *)td->td_frame->tf_esp, 0); + /* Pass the argument to the entry point. */ suword((void *)(td->td_frame->tf_esp + sizeof(void *)), (int)arg); ___ 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: r325015 - in stable/11/sys: compat/linsysfs compat/linux kern
Author: tijl Date: Thu Oct 26 17:45:01 2017 New Revision: 325015 URL: https://svnweb.freebsd.org/changeset/base/325015 Log: MFC r323692,r323710,r323714,r324628,r324629,r324635,r324636,r324637 Merge Linux emulation changes to support newer Linux libdrm. Modified: stable/11/sys/compat/linsysfs/linsysfs.c stable/11/sys/compat/linux/linux_util.c stable/11/sys/kern/vfs_lookup.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linsysfs/linsysfs.c == --- stable/11/sys/compat/linsysfs/linsysfs.cThu Oct 26 16:36:27 2017 (r325014) +++ stable/11/sys/compat/linsysfs/linsysfs.cThu Oct 26 17:45:01 2017 (r325015) @@ -133,20 +133,162 @@ linsysfs_link_scsi_host(PFS_FILL_ARGS) return (0); } +static int +linsysfs_fill_data(PFS_FILL_ARGS) +{ + sbuf_printf(sb, "%s", (char *)pn->pn_data); + return (0); +} + +static int +linsysfs_fill_vendor(PFS_FILL_ARGS) +{ + sbuf_printf(sb, "0x%04x\n", pci_get_vendor((device_t)pn->pn_data)); + return (0); +} + +static int +linsysfs_fill_device(PFS_FILL_ARGS) +{ + sbuf_printf(sb, "0x%04x\n", pci_get_device((device_t)pn->pn_data)); + return (0); +} + +static int +linsysfs_fill_subvendor(PFS_FILL_ARGS) +{ + sbuf_printf(sb, "0x%04x\n", pci_get_subvendor((device_t)pn->pn_data)); + return (0); +} + +static int +linsysfs_fill_subdevice(PFS_FILL_ARGS) +{ + sbuf_printf(sb, "0x%04x\n", pci_get_subdevice((device_t)pn->pn_data)); + return (0); +} + +static int +linsysfs_fill_revid(PFS_FILL_ARGS) +{ + sbuf_printf(sb, "0x%x\n", pci_get_revid((device_t)pn->pn_data)); + return (0); +} + +static int +linsysfs_fill_config(PFS_FILL_ARGS) +{ + uint8_t config[48]; + device_t dev; + uint32_t reg; + + dev = (device_t)pn->pn_data; + bzero(config, sizeof(config)); + reg = pci_get_vendor(dev); + config[0] = reg; + config[1] = reg >> 8; + reg = pci_get_device(dev); + config[2] = reg; + config[3] = reg >> 8; + reg = pci_get_revid(dev); + config[8] = reg; + reg = pci_get_subvendor(dev); + config[44] = reg; + config[45] = reg >> 8; + reg = pci_get_subdevice(dev); + config[46] = reg; + config[47] = reg >> 8; + sbuf_bcat(sb, config, sizeof(config)); + return (0); +} + +/* + * Filler function for PCI uevent file + */ +static int +linsysfs_fill_uevent_pci(PFS_FILL_ARGS) +{ + device_t dev; + + dev = (device_t)pn->pn_data; + sbuf_printf(sb, "DRIVER=%s\nPCI_CLASS=%X\nPCI_ID=%04X:%04X\n" + "PCI_SUBSYS_ID=%04X:%04X\nPCI_SLOT_NAME=%04d:%02x:%02x.%x\n", + linux_driver_get_name_dev(dev), pci_get_class(dev), + pci_get_vendor(dev), pci_get_device(dev), pci_get_subvendor(dev), + pci_get_subdevice(dev), pci_get_domain(dev), pci_get_bus(dev), + pci_get_slot(dev), pci_get_function(dev)); + return (0); +} + +/* + * Filler function for drm uevent file + */ +static int +linsysfs_fill_uevent_drm(PFS_FILL_ARGS) +{ + device_t dev; + int unit; + + dev = (device_t)pn->pn_data; + unit = device_get_unit(dev); + sbuf_printf(sb, + "MAJOR=226\nMINOR=%d\nDEVNAME=dri/card%d\nDEVTYPE=dri_minor\n", + unit, unit); + return (0); +} + +static char * +get_full_pfs_path(struct pfs_node *cur) +{ + char *temp, *path; + + temp = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); + path = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); + path[0] = '\0'; + + do { + snprintf(temp, MAXPATHLEN, "%s/%s", cur->pn_name, path); + strlcpy(path, temp, MAXPATHLEN); + cur = cur->pn_parent; + } while (cur->pn_parent != NULL); + + path[strlen(path) - 1] = '\0'; /* remove extra slash */ + free(temp, M_TEMP); + return (path); +} + +/* + * Filler function for symlink from drm char device to PCI device + */ +static int +linsysfs_fill_vgapci(PFS_FILL_ARGS) +{ + char *path; + + path = get_full_pfs_path((struct pfs_node*)pn->pn_data); + sbuf_printf(sb, "../../../%s", path); + free(path, M_TEMP); + return (0); +} + #define PCI_DEV "pci" +#define DRMN_DEV "drmn" static int -linsysfs_run_bus(device_t dev, struct pfs_node *dir, struct pfs_node *scsi, char *path, - char *prefix) +linsysfs_run_bus(device_t dev, struct pfs_node *dir, struct pfs_node *scsi, +struct pfs_node *chardev, struct pfs_node *drm, char *path, char *prefix) { struct scsi_host_queue *scsi_host; - struct pfs_node *sub_dir; - int i, nchildren; + struct pfs_node *sub_dir, *cur_file; + int i, nchildren, error; device_t *children, parent; devclass_t devclass; const char *name = NULL; struct pci_devinfo *dinfo; - char *device, *host, *new_path = path; + char *d
svn commit: r324637 - head/sys/compat/linsysfs
Author: tijl Date: Sun Oct 15 19:28:14 2017 New Revision: 324637 URL: https://svnweb.freebsd.org/changeset/base/324637 Log: Add information needed by Linux libdrm 2.4.74 (shipped with CentOS 7.4). Create a config file for PCI devices that exposes their configuration space. Only fields needed by libdrm are filled in (vendor, device, revision, subvendor and subdevice). Link /sys/class/drm/card%d/device to the PCI device directory. Modified: head/sys/compat/linsysfs/linsysfs.c Modified: head/sys/compat/linsysfs/linsysfs.c == --- head/sys/compat/linsysfs/linsysfs.c Sun Oct 15 19:21:15 2017 (r324636) +++ head/sys/compat/linsysfs/linsysfs.c Sun Oct 15 19:28:14 2017 (r324637) @@ -175,6 +175,33 @@ linsysfs_fill_revid(PFS_FILL_ARGS) return (0); } +static int +linsysfs_fill_config(PFS_FILL_ARGS) +{ + uint8_t config[48]; + device_t dev; + uint32_t reg; + + dev = (device_t)pn->pn_data; + bzero(config, sizeof(config)); + reg = pci_get_vendor(dev); + config[0] = reg; + config[1] = reg >> 8; + reg = pci_get_device(dev); + config[2] = reg; + config[3] = reg >> 8; + reg = pci_get_revid(dev); + config[8] = reg; + reg = pci_get_subvendor(dev); + config[44] = reg; + config[45] = reg >> 8; + reg = pci_get_subdevice(dev); + config[46] = reg; + config[47] = reg >> 8; + sbuf_bcat(sb, config, sizeof(config)); + return (0); +} + /* * Filler function for PCI uevent file */ @@ -247,20 +274,20 @@ linsysfs_fill_vgapci(PFS_FILL_ARGS) #define PCI_DEV "pci" #define DRMN_DEV "drmn" static int -linsysfs_run_bus(device_t dev, struct pfs_node *dir, struct pfs_node *scsi, struct pfs_node *chardev, - char *path, char *prefix) +linsysfs_run_bus(device_t dev, struct pfs_node *dir, struct pfs_node *scsi, +struct pfs_node *chardev, struct pfs_node *drm, char *path, char *prefix) { struct scsi_host_queue *scsi_host; - struct pfs_node *sub_dir, *cur_file, *cur_chardev; + struct pfs_node *sub_dir, *cur_file; int i, nchildren, error; device_t *children, parent; devclass_t devclass; const char *name = NULL; struct pci_devinfo *dinfo; - char *device, *host, *new_path, *chardevname; + char *device, *host, *new_path, *devname; new_path = path; - chardevname = malloc(16, M_TEMP, M_WAITOK); + devname = malloc(16, M_TEMP, M_WAITOK); parent = device_get_parent(dev); if (parent) { @@ -308,6 +335,10 @@ linsysfs_run_bus(device_t dev, struct pfs_node *dir, s &linsysfs_fill_revid, NULL, NULL, NULL, PFS_RD); cur_file->pn_data = (void*)dev; + cur_file = pfs_create_file(dir, "config", + &linsysfs_fill_config, NULL, NULL, NULL, + PFS_RD); + cur_file->pn_data = (void*)dev; cur_file = pfs_create_file(dir, "uevent", &linsysfs_fill_uevent_pci, NULL, NULL, NULL, PFS_RD); @@ -362,18 +393,26 @@ linsysfs_run_bus(device_t dev, struct pfs_node *dir, s device_get_unit(dev) >= 0) { dinfo = device_get_ivars(parent); if (dinfo != NULL && dinfo->cfg.baseclass == PCIC_DISPLAY) { - sprintf(chardevname, "226:%d", + sprintf(devname, "226:%d", device_get_unit(dev)); - cur_chardev = pfs_create_dir(chardev, - chardevname, NULL, NULL, NULL, 0); - cur_file = pfs_create_link(cur_chardev, + sub_dir = pfs_create_dir(chardev, + devname, NULL, NULL, NULL, 0); + cur_file = pfs_create_link(sub_dir, "device", &linsysfs_fill_vgapci, NULL, NULL, NULL, PFS_RD); cur_file->pn_data = (void*)dir; - cur_file = pfs_create_file(cur_chardev, + cur_file = pfs_create_file(sub_dir, "uevent", &linsysfs_fill_uevent_drm, NULL, NULL, NULL, PFS_RD); cur_file->pn_data = (void*)dev; + sprintf(devname, "card%d", + device_get_unit(dev)); + sub_dir = pfs_create_dir(drm, + devname, NULL
svn commit: r324636 - head/sys/compat/linsysfs
Author: tijl Date: Sun Oct 15 19:21:15 2017 New Revision: 324636 URL: https://svnweb.freebsd.org/changeset/base/324636 Log: Set DEVNAME to dri/card%d. This works with both in-tree drm and drm-next and is also the value used on Linux. Tested by:Greg V Modified: head/sys/compat/linsysfs/linsysfs.c Modified: head/sys/compat/linsysfs/linsysfs.c == --- head/sys/compat/linsysfs/linsysfs.c Sun Oct 15 18:53:21 2017 (r324635) +++ head/sys/compat/linsysfs/linsysfs.c Sun Oct 15 19:21:15 2017 (r324636) @@ -205,8 +205,8 @@ linsysfs_fill_uevent_drm(PFS_FILL_ARGS) dev = (device_t)pn->pn_data; unit = device_get_unit(dev); sbuf_printf(sb, - "MAJOR=226\nMINOR=%d\nDEVNAME=drm/%d\nDEVTYPE=dri_minor\n", unit, - unit); + "MAJOR=226\nMINOR=%d\nDEVNAME=dri/card%d\nDEVTYPE=dri_minor\n", + unit, unit); 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: r324635 - head/sys/kern
Author: tijl Date: Sun Oct 15 18:53:21 2017 New Revision: 324635 URL: https://svnweb.freebsd.org/changeset/base/324635 Log: When a Linux program tries to access a /path the kernel tries /compat/linux/path before /path. Stop following symbolic links when looking up /compat/linux/path so dead symbolic links aren't ignored. This allows syscalls like readlink(2) and lstat(2) to work on such links. And open(2) will return an error now instead of trying /path. Modified: head/sys/kern/vfs_lookup.c Modified: head/sys/kern/vfs_lookup.c == --- head/sys/kern/vfs_lookup.c Sun Oct 15 16:19:09 2017(r324634) +++ head/sys/kern/vfs_lookup.c Sun Oct 15 18:53:21 2017(r324635) @@ -1390,13 +1390,13 @@ kern_alternate_path(struct thread *td, const char *pre for (cp = &ptr[len] - 1; *cp != '/'; cp--); *cp = '\0'; - NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, buf, td); + NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, buf, td); error = namei(&nd); *cp = '/'; if (error != 0) goto keeporig; } else { - NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, buf, td); + NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, buf, td); error = namei(&nd); if (error != 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: r324629 - head/sys/compat/linux
Author: tijl Date: Sun Oct 15 16:08:22 2017 New Revision: 324629 URL: https://svnweb.freebsd.org/changeset/base/324629 Log: Add special handling for current in-tree drm devices, like r323692 added for drm-next. Modified: head/sys/compat/linux/linux_util.c Modified: head/sys/compat/linux/linux_util.c == --- head/sys/compat/linux/linux_util.c Sun Oct 15 16:03:45 2017 (r324628) +++ head/sys/compat/linux/linux_util.c Sun Oct 15 16:08:22 2017 (r324629) @@ -146,6 +146,27 @@ linux_driver_get_major_minor(const char *node, int *ma return (0); } + sz = sizeof("dri/card") - 1; + if (strncmp(node, "dri/card", sz) == 0 && node[sz] != '\0') { + devno = strtoul(node + sz, NULL, 10); + *major = 226 + (devno / 256); + *minor = devno % 256; + return (0); + } + sz = sizeof("dri/controlD") - 1; + if (strncmp(node, "dri/controlD", sz) == 0 && node[sz] != '\0') { + devno = strtoul(node + sz, NULL, 10); + *major = 226 + (devno / 256); + *minor = devno % 256; + return (0); + } + sz = sizeof("dri/renderD") - 1; + if (strncmp(node, "dri/renderD", sz) == 0 && node[sz] != '\0') { + devno = strtoul(node + sz, NULL, 10); + *major = 226 + (devno / 256); + *minor = devno % 256; + return (0); + } sz = sizeof("drm/") - 1; if (strncmp(node, "drm/", sz) == 0 && node[sz] != '\0') { devno = strtoul(node + sz, NULL, 10); ___ 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: r324628 - head/sys/compat/linux
Author: tijl Date: Sun Oct 15 16:03:45 2017 New Revision: 324628 URL: https://svnweb.freebsd.org/changeset/base/324628 Log: Use sizeof instead of strlen on string constants. The compiler doesn't optimise the strlen calls away with -ffreestanding. Modified: head/sys/compat/linux/linux_util.c Modified: head/sys/compat/linux/linux_util.c == --- head/sys/compat/linux/linux_util.c Sun Oct 15 14:03:53 2017 (r324627) +++ head/sys/compat/linux/linux_util.c Sun Oct 15 16:03:45 2017 (r324628) @@ -128,32 +128,31 @@ linux_driver_get_major_minor(const char *node, int *ma { struct device_element *de; unsigned long devno; + size_t sz; if (node == NULL || major == NULL || minor == NULL) return 1; - if (strlen(node) > strlen("pts/") && - strncmp(node, "pts/", strlen("pts/")) == 0) { + sz = sizeof("pts/") - 1; + if (strncmp(node, "pts/", sz) == 0 && node[sz] != '\0') { /* * Linux checks major and minors of the slave device * to make sure it's a pty device, so let's make him * believe it is. */ - devno = strtoul(node + strlen("pts/"), NULL, 10); + devno = strtoul(node + sz, NULL, 10); *major = 136 + (devno / 256); *minor = devno % 256; - return (0); } - if ((strlen(node) > strlen("drm/") && - strncmp(node, "drm/", strlen("drm/")) == 0) ) { - devno = strtoul(node + strlen("drm/"), NULL, 10); + sz = sizeof("drm/") - 1; + if (strncmp(node, "drm/", sz) == 0 && node[sz] != '\0') { + devno = strtoul(node + sz, NULL, 10); *major = 226 + (devno / 256); *minor = devno % 256; return (0); } - TAILQ_FOREACH(de, &devices, list) { if (strcmp(node, de->entry.bsd_device_name) == 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"
Re: svn commit: r315522 - in head: contrib/binutils/ld/emulparams sys/conf
On Sun, 19 Mar 2017 13:04:50 +1100 (EST) Bruce Evans wrote: > On Sun, 19 Mar 2017, Ed Maste wrote: >> Log: >> use INT3 instead of NOP for x86 binary padding >> >> We should never end up executing the inter-function padding, so we >> are better off faulting than silently carrying on to whatever function >> happens to be next. >> >> Note that LLD will soon do this by default (although it currently pads >> with zeros). >> >> Reviewed by:dim, kib >> MFC after: 1 month >> Sponsored by: The FreeBSD Foundation >> Differential Revision: https://reviews.freebsd.org/D10047 > > Is this a pessimization? Instruction prefetch near the end of almost > every function now fetches INT3 instead of NOP. Both have to be > decoded to decoded whether to speculatively execute them. INT3 is > unlikely to be speculatively executed, but it takes extra work to > decide not to do so. I seem to vaguely remember that ud2 should be used to stop speculative execution (and the instruction fetching and possible cache invalidation because of it). ___ 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: r315142 - head/usr.bin/man
Author: tijl Date: Sun Mar 12 10:56:19 2017 New Revision: 315142 URL: https://svnweb.freebsd.org/changeset/base/315142 Log: - Remove separate handling of /bin and /usr/bin in manpath. They are no longer a special case. - Prefer PREFIX/share/man over PREFIX/man. - Add /usr/local/share/man to man_default_path. - Update manpath man page. Reviewed by: bapt Modified: head/usr.bin/man/man.sh head/usr.bin/man/manpath.1 Modified: head/usr.bin/man/man.sh == --- head/usr.bin/man/man.sh Sun Mar 12 07:09:50 2017(r315141) +++ head/usr.bin/man/man.sh Sun Mar 12 10:56:19 2017(r315142) @@ -778,26 +778,19 @@ search_path() { IFS=: for path in $PATH; do - # Do a little special casing since the base manpages - # are in /usr/share/man instead of /usr/man or /man. - case "$path" in - /bin|/usr/bin) add_to_manpath "/usr/share/man" ;; - *) if add_to_manpath "$path/man"; then - : - elif add_to_manpath "$path/MAN"; then - : - else - case "$path" in - */bin) p="${path%/bin}/man" - add_to_manpath "$p" - p="${path%/bin}/share/man" - add_to_manpath "$p" - ;; - *) ;; - esac - fi - ;; - esac + if add_to_manpath "$path/man"; then + : + elif add_to_manpath "$path/MAN"; then + : + else + case "$path" in + */bin) p="${path%/bin}/share/man" + add_to_manpath "$p" + p="${path%/bin}/man" + add_to_manpath "$p" + ;; + esac + fi done unset IFS @@ -1007,7 +1000,7 @@ SYSCTL=/sbin/sysctl debug=0 man_default_sections='1:8:2:3:n:4:5:6:7:9:l' -man_default_path='/usr/share/man:/usr/share/openssl/man:/usr/local/man' +man_default_path='/usr/share/man:/usr/share/openssl/man:/usr/local/share/man:/usr/local/man' cattool='/usr/bin/zcat -f' config_global='/etc/man.conf' Modified: head/usr.bin/man/manpath.1 == --- head/usr.bin/man/manpath.1 Sun Mar 12 07:09:50 2017(r315141) +++ head/usr.bin/man/manpath.1 Sun Mar 12 10:56:19 2017(r315142) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 1, 2010 +.Dd March 11, 2017 .Dt MANPATH 1 .Os .Sh NAME @@ -66,15 +66,10 @@ for the first of: .Pa pathname/MAN .It If pathname ends with /bin: +.Pa pathname/../share/man +and .Pa pathname/../man .El -Note: Special logic exists to make -.Pa /bin -and -.Pa /usr/bin -look in -.Pa /usr/share/man -for manual files. .It The configuration files listed in the .Sx FILES ___ 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: r312874 - stable/11/sys/amd64/linux
Author: tijl Date: Fri Jan 27 10:06:20 2017 New Revision: 312874 URL: https://svnweb.freebsd.org/changeset/base/312874 Log: MFC r312699: Apply r210555 to 64 bit linux support: The interpreter name should no longer be treated as a buffer that can be overwritten. PR: 216346 Modified: stable/11/sys/amd64/linux/linux_sysvec.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux/linux_sysvec.c == --- stable/11/sys/amd64/linux/linux_sysvec.cFri Jan 27 10:05:17 2017 (r312873) +++ stable/11/sys/amd64/linux/linux_sysvec.cFri Jan 27 10:06:20 2017 (r312874) @@ -718,7 +718,7 @@ exec_linux_imgact_try(struct image_param { const char *head = (const char *)imgp->image_header; char *rpath; - int error = -1, len; + int error = -1; /* * The interpreter for shell scripts run from a linux binary needs @@ -736,17 +736,12 @@ exec_linux_imgact_try(struct image_param linux_emul_convpath(FIRST_THREAD_IN_PROC(imgp->proc), imgp->interpreter_name, UIO_SYSSPACE, &rpath, 0, AT_FDCWD); - if (rpath != NULL) { - len = strlen(rpath) + 1; - - if (len <= MAXSHELLCMDLEN) - memcpy(imgp->interpreter_name, - rpath, len); - free(rpath, M_TEMP); - } + if (rpath != NULL) + imgp->args->fname_buf = + imgp->interpreter_name = rpath; } } - return(error); + return (error); } #defineLINUX_VSYSCALL_START(-10UL << 20) ___ 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: r312873 - stable/10/sys/amd64/linux
Author: tijl Date: Fri Jan 27 10:05:17 2017 New Revision: 312873 URL: https://svnweb.freebsd.org/changeset/base/312873 Log: MFC r312699: Apply r210555 to 64 bit linux support: The interpreter name should no longer be treated as a buffer that can be overwritten. PR: 216346 Modified: stable/10/sys/amd64/linux/linux_sysvec.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux/linux_sysvec.c == --- stable/10/sys/amd64/linux/linux_sysvec.cFri Jan 27 10:03:50 2017 (r312872) +++ stable/10/sys/amd64/linux/linux_sysvec.cFri Jan 27 10:05:17 2017 (r312873) @@ -718,7 +718,7 @@ exec_linux_imgact_try(struct image_param { const char *head = (const char *)imgp->image_header; char *rpath; - int error = -1, len; + int error = -1; /* * The interpreter for shell scripts run from a linux binary needs @@ -736,17 +736,12 @@ exec_linux_imgact_try(struct image_param linux_emul_convpath(FIRST_THREAD_IN_PROC(imgp->proc), imgp->interpreter_name, UIO_SYSSPACE, &rpath, 0, AT_FDCWD); - if (rpath != NULL) { - len = strlen(rpath) + 1; - - if (len <= MAXSHELLCMDLEN) - memcpy(imgp->interpreter_name, - rpath, len); - free(rpath, M_TEMP); - } + if (rpath != NULL) + imgp->args->fname_buf = + imgp->interpreter_name = rpath; } } - return(error); + return (error); } #defineLINUX_VSYSCALL_START(-10UL << 20) ___ 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: r312699 - head/sys/amd64/linux
Author: tijl Date: Tue Jan 24 16:13:59 2017 New Revision: 312699 URL: https://svnweb.freebsd.org/changeset/base/312699 Log: Apply r210555 to 64 bit linux support: The interpreter name should no longer be treated as a buffer that can be overwritten. PR: 216346 MFC after:3 days Modified: head/sys/amd64/linux/linux_sysvec.c Modified: head/sys/amd64/linux/linux_sysvec.c == --- head/sys/amd64/linux/linux_sysvec.c Tue Jan 24 16:05:42 2017 (r312698) +++ head/sys/amd64/linux/linux_sysvec.c Tue Jan 24 16:13:59 2017 (r312699) @@ -718,7 +718,7 @@ exec_linux_imgact_try(struct image_param { const char *head = (const char *)imgp->image_header; char *rpath; - int error = -1, len; + int error = -1; /* * The interpreter for shell scripts run from a linux binary needs @@ -736,17 +736,12 @@ exec_linux_imgact_try(struct image_param linux_emul_convpath(FIRST_THREAD_IN_PROC(imgp->proc), imgp->interpreter_name, UIO_SYSSPACE, &rpath, 0, AT_FDCWD); - if (rpath != NULL) { - len = strlen(rpath) + 1; - - if (len <= MAXSHELLCMDLEN) - memcpy(imgp->interpreter_name, - rpath, len); - free(rpath, M_TEMP); - } + if (rpath != NULL) + imgp->args->fname_buf = + imgp->interpreter_name = rpath; } } - return(error); + return (error); } #defineLINUX_VSYSCALL_START(-10UL << 20) ___ 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: r307936 - head/sys/amd64/amd64
On Wed, 26 Oct 2016 16:25:50 +0300 Konstantin Belousov wrote: > On Tue, Oct 25, 2016 at 09:26:00PM +0200, Tijl Coosemans wrote: >> On Tue, 25 Oct 2016 17:13:46 + (UTC) Gleb Smirnoff >> wrote: >>> Author: glebius >>> Date: Tue Oct 25 17:13:46 2016 >>> New Revision: 307936 >>> URL: https://svnweb.freebsd.org/changeset/base/307936 >>> >>> Log: >>> The argument validation in r296956 was not enough to close all possible >>> overflows in sysarch(2). >>> >>> Submitted by: Kun Yang >>> Patch by: kib >>> Security: SA-16:15 >>> >>> Modified: >>> head/sys/amd64/amd64/sys_machdep.c >> >> This patch and r296956 need to be applied to i386 too, don't they? > I do not think so. The amd64 bug is that I thought that the overflow > checks were not needed, which appeared to be not true. > > i386_set_ldt(), which is the i386 version of amd64_set_ldt(), already > contained the comparisions of largest_ld with pldt->ldt_len etc. > > Still, independend look at the i386 (and amd64 version as well) is more > than welcomed, so please read the code yourself. It looks ok to me. i386 checks kargs.largs.num > MAX_LD early in sysarch so start + num cannot overflow. On amd64 this check was removed in https://svnweb.freebsd.org/base?view=revision&revision=217543 ___ 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: r307936 - head/sys/amd64/amd64
On Tue, 25 Oct 2016 17:13:46 + (UTC) Gleb Smirnoff wrote: > Author: glebius > Date: Tue Oct 25 17:13:46 2016 > New Revision: 307936 > URL: https://svnweb.freebsd.org/changeset/base/307936 > > Log: > The argument validation in r296956 was not enough to close all possible > overflows in sysarch(2). > > Submitted by: Kun Yang > Patch by: kib > Security: SA-16:15 > > Modified: > head/sys/amd64/amd64/sys_machdep.c This patch and r296956 need to be applied to i386 too, don't they? ___ 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: r307231 - head/lib/libgcc_s
On Fri, 14 Oct 2016 20:55:30 +0200 Dimitry Andric wrote: > On 14 Oct 2016, at 04:06, Ed Maste wrote: >> On 14 October 2016 at 01:53, Bruce Evans wrote: compiler-rt's complex division support routines contain calls to compiler builtins such as `__builtin_scalbnl`. Unfortunately Clang turns these back into a call to `scalbnl`. >>> >>> gcc-4.2 has the same bug. >> >> Oh, interesting. Do you know off hand if it's resolved in later GCC? > > Not for x86, in any case (I think I talked about this with you on IRC > before). For example, using the latest gcc 7.0.0 20160911 on this > program: > > float f1(float x, int n) > { > return __builtin_scalbnf(x, n); > } > > double f2(double x, int n) > { > return __builtin_scalbn(x, n); > } > > long double f3(long double x, long n) > { > return __builtin_scalbnl(x, n); > } > > gives this assembly: > > .p2align 4,,15 > .globl f1 > .type f1, @function > f1: > .LFB0: > .cfi_startproc > jmp scalbnf > .cfi_endproc > .LFE0: > .size f1, .-f1 > .p2align 4,,15 > .globl f2 > .type f2, @function > f2: > .LFB1: > .cfi_startproc > jmp scalbn > .cfi_endproc > .LFE1: > .size f2, .-f2 > .p2align 4,,15 > .globl f3 > .type f3, @function > f3: > .LFB2: > .cfi_startproc > jmp scalbnl > .cfi_endproc > .LFE2: > .size f3, .-f3 > > E.g., it looks like the __builtin_scalbn functions were always a red > herring. :-) >From https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html: GCC includes built-in versions of many of the functions in the standard C library. These functions come in two forms: one whose names start with the __builtin_ prefix, and the other without. Both forms have the same type (including prototype), the same address (when their address is taken), and the same meaning as the C library functions even if you specify the -fno-builtin option see C Dialect Options). Many of these functions are only optimized in certain cases; if they are not optimized in a particular case, a call to the library function is emitted. ___ 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: r306961 - stable/10/sys/i386/i386
Author: tijl Date: Mon Oct 10 11:53:54 2016 New Revision: 306961 URL: https://svnweb.freebsd.org/changeset/base/306961 Log: MFC: r306318 Allocate a zeroed LDT. Failing to do this might result in the LDT appearing to run out of free descriptors because of random junk in the descriptor's 'sd_type' field. http://lists.freebsd.org/pipermail/freebsd-amd64/2014-May/016088.html PR: 212639 Submitted by: wheelcomp...@gmail.com Modified: stable/10/sys/i386/i386/sys_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/i386/i386/sys_machdep.c == --- stable/10/sys/i386/i386/sys_machdep.c Mon Oct 10 11:51:47 2016 (r306960) +++ stable/10/sys/i386/i386/sys_machdep.c Mon Oct 10 11:53:54 2016 (r306961) @@ -509,7 +509,7 @@ user_ldt_alloc(struct mdproc *mdp, int l new_ldt->ldt_len = len = NEW_MAX_LD(len); new_ldt->ldt_base = (caddr_t)kmem_malloc(kernel_arena, - len * sizeof(union descriptor), M_WAITOK); + len * sizeof(union descriptor), M_WAITOK | M_ZERO); new_ldt->ldt_refcnt = 1; new_ldt->ldt_active = 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: r306960 - stable/11/sys/i386/i386
Author: tijl Date: Mon Oct 10 11:51:47 2016 New Revision: 306960 URL: https://svnweb.freebsd.org/changeset/base/306960 Log: MFC: r306318 Allocate a zeroed LDT. Failing to do this might result in the LDT appearing to run out of free descriptors because of random junk in the descriptor's 'sd_type' field. http://lists.freebsd.org/pipermail/freebsd-amd64/2014-May/016088.html PR: 212639 Submitted by: wheelcomp...@gmail.com Modified: stable/11/sys/i386/i386/sys_machdep.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/i386/i386/sys_machdep.c == --- stable/11/sys/i386/i386/sys_machdep.c Mon Oct 10 11:49:43 2016 (r306959) +++ stable/11/sys/i386/i386/sys_machdep.c Mon Oct 10 11:51:47 2016 (r306960) @@ -438,7 +438,7 @@ user_ldt_alloc(struct mdproc *mdp, int l new_ldt->ldt_len = len = NEW_MAX_LD(len); new_ldt->ldt_base = (caddr_t)kmem_malloc(kernel_arena, - len * sizeof(union descriptor), M_WAITOK); + len * sizeof(union descriptor), M_WAITOK | M_ZERO); new_ldt->ldt_refcnt = 1; new_ldt->ldt_active = 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: r306318 - head/sys/i386/i386
Author: tijl Date: Sun Sep 25 18:29:02 2016 New Revision: 306318 URL: https://svnweb.freebsd.org/changeset/base/306318 Log: MFamd64: r266901 Allocate a zeroed LDT. Failing to do this might result in the LDT appearing to run out of free descriptors because of random junk in the descriptor's 'sd_type' field. http://lists.freebsd.org/pipermail/freebsd-amd64/2014-May/016088.html PR: 212639 Submitted by: wheelcomp...@gmail.com MFC after:2 weeks Modified: head/sys/i386/i386/sys_machdep.c Modified: head/sys/i386/i386/sys_machdep.c == --- head/sys/i386/i386/sys_machdep.cSun Sep 25 17:58:55 2016 (r306317) +++ head/sys/i386/i386/sys_machdep.cSun Sep 25 18:29:02 2016 (r306318) @@ -438,7 +438,7 @@ user_ldt_alloc(struct mdproc *mdp, int l new_ldt->ldt_len = len = NEW_MAX_LD(len); new_ldt->ldt_base = (caddr_t)kmem_malloc(kernel_arena, - len * sizeof(union descriptor), M_WAITOK); + len * sizeof(union descriptor), M_WAITOK | M_ZERO); new_ldt->ldt_refcnt = 1; new_ldt->ldt_active = 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"
Re: svn commit: r290547 - in head/sys: arm/annapurna/alpine arm/mv/armadaxp arm/qemu arm/ti/omap4 arm/xilinx kern x86/x86
On Mon, 9 Nov 2015 17:45:46 + "Bjoern A. Zeeb" wrote: >> On 08 Nov 2015, at 14:26 , Tijl Coosemans wrote: >> >> Author: tijl >> Date: Sun Nov 8 14:26:50 2015 >> New Revision: 290547 >> URL: https://svnweb.freebsd.org/changeset/base/290547 >> >> Log: >> Since r289279 bufinit() uses mp_ncpus, but some architectures set this >> variable during mp_start() which is too late. Move this to mp_setmaxid() >> where other architectures set it and move x86 assertions to MI code. >> >> Reviewed by:kib (x86 part) >> >> Modified: >> head/sys/arm/annapurna/alpine/alpine_machdep_mp.c >> head/sys/arm/mv/armadaxp/armadaxp_mp.c >> head/sys/arm/qemu/virt_mp.c > > Seems copy and paste from the old to the new function brought some > confusion n variable naming; can you please fix? > > > /home/baz21/SVN/head-ipv6-fix.svn/sys/arm/qemu/virt_mp.c:74:17: error: use of > undeclared identifier 'ncpus'; did you mean 'pcpup'? > mp_ncpus = MIN(ncpus, MAXCPU); >^ >pcpup > /home/baz21/SVN/head-ipv6-fix.svn/sys/sys/param.h:301:21: note: expanded from > macro 'MIN' > #define MIN(a,b) (((a)<(b))?(a):(b)) > ^ > ./machine/pcpu.h:65:21: note: 'pcpup' declared here > extern struct pcpu *pcpup; > ^ > /home/baz21/SVN/head-ipv6-fix.svn/sys/arm/qemu/virt_mp.c:74:13: error: > ordered comparison between pointer and integer ('struct pcpu *' and 'int') > [-Werror] > mp_ncpus = MIN(ncpus, MAXCPU); >^~ > /home/baz21/SVN/head-ipv6-fix.svn/sys/sys/param.h:301:23: note: expanded from > macro 'MIN' > #define MIN(a,b) (((a)<(b))?(a):(b)) >~~~^~~~ > /home/baz21/SVN/head-ipv6-fix.svn/sys/arm/qemu/virt_mp.c:74:17: error: use of > undeclared identifier 'ncpus'; did you mean 'pcpup'? > mp_ncpus = MIN(ncpus, MAXCPU); >^ >pcpup > /home/baz21/SVN/head-ipv6-fix.svn/sys/sys/param.h:301:30: note: expanded from > macro 'MIN' > #define MIN(a,b) (((a)<(b))?(a):(b)) > ^ > ./machine/pcpu.h:65:21: note: 'pcpup' declared here > extern struct pcpu *pcpup; > ^ > /home/baz21/SVN/head-ipv6-fix.svn/sys/arm/qemu/virt_mp.c:74:13: error: > pointer/integer type mismatch in conditional expression ('struct pcpu *' and > 'int') [-Werror,-Wconditional-type-mismatch] > mp_ncpus = MIN(ncpus, MAXCPU); >^~ > /home/baz21/SVN/head-ipv6-fix.svn/sys/sys/param.h:301:28: note: expanded from > macro 'MIN' > #define MIN(a,b) (((a)<(b))?(a):(b)) >^~~~ ~~~ > /home/baz21/SVN/head-ipv6-fix.svn/sys/arm/qemu/virt_mp.c:74:11: error: > incompatible pointer to integer conversion assigning to 'int' from 'struct > pcpu *' [-Werror,-Wint-conversion] > mp_ncpus = MIN(ncpus, MAXCPU); > ^ ~~ > 5 errors generated. > --- virt_mp.o --- > *** [virt_mp.o] Error code 1 Fixed in r290621. ___ 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: r290621 - head/sys/arm/qemu
Author: tijl Date: Mon Nov 9 22:12:29 2015 New Revision: 290621 URL: https://svnweb.freebsd.org/changeset/base/290621 Log: Fix typo (s/ncpus/mp_ncpus/) Reported by: bz Modified: head/sys/arm/qemu/virt_mp.c Modified: head/sys/arm/qemu/virt_mp.c == --- head/sys/arm/qemu/virt_mp.c Mon Nov 9 22:11:37 2015(r290620) +++ head/sys/arm/qemu/virt_mp.c Mon Nov 9 22:12:29 2015(r290621) @@ -71,7 +71,7 @@ platform_mp_setmaxid(void) mp_ncpus = ofw_cpu_early_foreach(virt_maxid, true); if (mp_ncpus < 1) mp_ncpus = 1; - mp_ncpus = MIN(ncpus, MAXCPU); + mp_ncpus = MIN(mp_ncpus, MAXCPU); } static boolean_t ___ 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: r290547 - in head/sys: arm/annapurna/alpine arm/mv/armadaxp arm/qemu arm/ti/omap4 arm/xilinx kern x86/x86
Author: tijl Date: Sun Nov 8 14:26:50 2015 New Revision: 290547 URL: https://svnweb.freebsd.org/changeset/base/290547 Log: Since r289279 bufinit() uses mp_ncpus, but some architectures set this variable during mp_start() which is too late. Move this to mp_setmaxid() where other architectures set it and move x86 assertions to MI code. Reviewed by: kib (x86 part) Modified: head/sys/arm/annapurna/alpine/alpine_machdep_mp.c head/sys/arm/mv/armadaxp/armadaxp_mp.c head/sys/arm/qemu/virt_mp.c head/sys/arm/ti/omap4/omap4_mp.c head/sys/arm/xilinx/zy7_mp.c head/sys/kern/subr_smp.c head/sys/x86/x86/mp_x86.c Modified: head/sys/arm/annapurna/alpine/alpine_machdep_mp.c == --- head/sys/arm/annapurna/alpine/alpine_machdep_mp.c Sun Nov 8 14:22:57 2015(r290546) +++ head/sys/arm/annapurna/alpine/alpine_machdep_mp.c Sun Nov 8 14:26:50 2015(r290547) @@ -128,16 +128,14 @@ platform_mp_init_secondary(void) void platform_mp_setmaxid(void) { - int core_cnt; - core_cnt = platform_mp_get_core_cnt(); - mp_maxid = core_cnt - 1; + mp_ncpus = platform_mp_get_core_cnt(); + mp_maxid = mp_ncpus - 1; } int platform_mp_probe(void) { - mp_ncpus = platform_mp_get_core_cnt(); return (1); } Modified: head/sys/arm/mv/armadaxp/armadaxp_mp.c == --- head/sys/arm/mv/armadaxp/armadaxp_mp.c Sun Nov 8 14:22:57 2015 (r290546) +++ head/sys/arm/mv/armadaxp/armadaxp_mp.c Sun Nov 8 14:26:50 2015 (r290547) @@ -82,15 +82,14 @@ void platform_mp_setmaxid(void) { - mp_maxid = 3; + mp_ncpus = platform_get_ncpus(); + mp_maxid = mp_ncpus - 1; } int platform_mp_probe(void) { - mp_ncpus = platform_get_ncpus(); - return (mp_ncpus > 1); } Modified: head/sys/arm/qemu/virt_mp.c == --- head/sys/arm/qemu/virt_mp.c Sun Nov 8 14:22:57 2015(r290546) +++ head/sys/arm/qemu/virt_mp.c Sun Nov 8 14:26:50 2015(r290547) @@ -49,17 +49,8 @@ static int running_cpus; int platform_mp_probe(void) { - int ncpus; - ncpus = ofw_cpu_early_foreach(NULL, true); - if (ncpus <= 1) { - mp_ncpus = 1; - return (0); - } - - mp_ncpus = MIN(ncpus, MAXCPU); - - return (1); + return (mp_ncpus > 1); } static boolean_t @@ -77,7 +68,10 @@ platform_mp_setmaxid(void) { mp_maxid = PCPU_GET(cpuid); - ofw_cpu_early_foreach(virt_maxid, true); + mp_ncpus = ofw_cpu_early_foreach(virt_maxid, true); + if (mp_ncpus < 1) + mp_ncpus = 1; + mp_ncpus = MIN(ncpus, MAXCPU); } static boolean_t Modified: head/sys/arm/ti/omap4/omap4_mp.c == --- head/sys/arm/ti/omap4/omap4_mp.cSun Nov 8 14:22:57 2015 (r290546) +++ head/sys/arm/ti/omap4/omap4_mp.cSun Nov 8 14:26:50 2015 (r290547) @@ -51,14 +51,14 @@ void platform_mp_setmaxid(void) { -mp_maxid = 1; + mp_maxid = 1; + mp_ncpus = 2; } int platform_mp_probe(void) { - mp_ncpus = 2; return (1); } Modified: head/sys/arm/xilinx/zy7_mp.c == --- head/sys/arm/xilinx/zy7_mp.cSun Nov 8 14:22:57 2015 (r290546) +++ head/sys/arm/xilinx/zy7_mp.cSun Nov 8 14:26:50 2015 (r290547) @@ -57,13 +57,13 @@ platform_mp_setmaxid(void) { mp_maxid = 1; + mp_ncpus = 2; } int platform_mp_probe(void) { - mp_ncpus = 2; return (1); } Modified: head/sys/kern/subr_smp.c == --- head/sys/kern/subr_smp.cSun Nov 8 14:22:57 2015(r290546) +++ head/sys/kern/subr_smp.cSun Nov 8 14:26:50 2015(r290547) @@ -125,7 +125,15 @@ struct mtx smp_ipi_mtx; static void mp_setmaxid(void *dummy) { + cpu_mp_setmaxid(); + + KASSERT(mp_ncpus >= 1, ("%s: CPU count < 1", __func__)); + KASSERT(mp_ncpus > 1 || mp_maxid == 0, + ("%s: one CPU but mp_maxid is not zero", __func__)); + KASSERT(mp_maxid >= mp_ncpus - 1, + ("%s: counters out of sync: max %d, count %d", __func__, + mp_maxid, mp_ncpus)); } SYSINIT(cpu_mp_setmaxid, SI_SUB_TUNABLES, SI_ORDER_FIRST, mp_setmaxid, NULL); Modified: head/sys/x86/x86/mp_x86.c == --- head/sys/x86/x86/mp_x86.c Sun Nov 8 14:22:57 2015(r290546) +++ head/sys/x86/x86/mp_x86.c Sun Nov 8 14:26:50 2015(r290547) @@ -425,18 +425,11 @@ cpu_mp_setmaxid(void) { /* -* mp_maxid should be alr
Re: svn commit: r289279 - in head/sys: kern vm
On Thu, 29 Oct 2015 22:33:34 +0200 Konstantin Belousov wrote: > On Thu, Oct 29, 2015 at 09:25:54PM +0100, Tijl Coosemans wrote: >> On Wed, 14 Oct 2015 02:10:07 + (UTC) Jeff Roberson >> wrote: >>> Author: jeff >>> Date: Wed Oct 14 02:10:07 2015 >>> New Revision: 289279 >>> URL: https://svnweb.freebsd.org/changeset/base/289279 >>> >>> Log: >>> Parallelize the buffer cache and rewrite getnewbuf(). This results in a >>> 8x performance improvement in a micro benchmark on a 4 socket machine. >>> >>>- Get buffer headers from a per-cpu uma cache that sits in from of the >>> free queue. >>>- Use a per-cpu quantum cache in vmem to eliminate contention for kva. >>>- Use multiple clean queues according to buffer cache size to eliminate >>> clean queue lock contention. >>>- Introduce a bufspace daemon that attempts to prevent getnewbuf() >>> callers >>> from blocking or doing direct recycling. >>>- Close some bufspace allocation races that could lead to endless >>> recycling. >>>- Further the transition to a more modern style of small functions >>> grouped >>> by prefix in order to improve growing complexity. >> >> I have an i386 system that locks up easily after this commit. Booting >> into single user and running make installkernel triggers it consistently. >> I haven't been able to reproduce it on amd64. Examining threads with >> DDB shows that they are all at sched_switch (a few at fork_trampoline). >> The only lock being held is Giant (by the interrupt handler for >> ctrl+alt+esc I think). So it doesn't look like a dead lock. It's more >> a sleeping beauty situation. All threads in the castle are sleeping and >> there's no prince to wake them up. >> >> (kgdb) info thread >> Id Target Id Frame >> >> These are from make installkernel: >> >> 72 Thread 100071 (PID=107: install) sched_switch (td=0xc667d000, >> newtd=0xc6407000, flags=) >> at /usr/src/sys/kern/sched_ule.c:1969 >> 71 Thread 100070 (PID=81: make) sched_switch (td=0xc667d340, >> newtd=0xc667d000, flags=) >> at /usr/src/sys/kern/sched_ule.c:1969 >> 70 Thread 100067 (PID=30: make) sched_switch (td=0xc667e000, >> newtd=0xc667d340, flags=) >> at /usr/src/sys/kern/sched_ule.c:1969 >> 69 Thread 100066 (PID=25: make) sched_switch (td=0xc667e340, >> newtd=0xc667e000, flags=) >> at /usr/src/sys/kern/sched_ule.c:1969 >> >> Single user shell: >> >> 68 Thread 100065 (PID=17: sh) sched_switch (td=0xc6406000, >> newtd=0xc667e340, flags=) >> at /usr/src/sys/kern/sched_ule.c:1969 >> >> Kernel threads: >> >> 67 Thread 100063 (PID=16: vnlru) sched_switch (td=0xc6406680, >> newtd=0xc6407340, flags=) >> at /usr/src/sys/kern/sched_ule.c:1969 >> 66 Thread 100062 (PID=9: syncer) sched_switch (td=0xc64069c0, >> newtd=0xc667d000, flags=) >> at /usr/src/sys/kern/sched_ule.c:1969 >> 65 Thread 100061 (PID=8: bufspacedaemon) sched_switch (td=0xc6407000, >> newtd=0xc62dc000, flags=) >> at /usr/src/sys/kern/sched_ule.c:1969 >> 64 Thread 100060 (PID=7: bufdaemon) sched_switch (td=0xc6407340, >> newtd=0xc6408000, flags=) >> at /usr/src/sys/kern/sched_ule.c:1969 >> 63 Thread 100068 (PID=7: bufdaemon//var worker) sched_switch ( >> td=0xc667d9c0, newtd=0xc6407000, flags=) >> at /usr/src/sys/kern/sched_ule.c:1969 >> 62 Thread 100069 (PID=7: bufdaemon//usr worker) sched_switch ( >> td=0xc667d680, newtd=0xc667d000, flags=) >> at /usr/src/sys/kern/sched_ule.c:1969 >> 61 Thread 100059 (PID=6: pagezero) sched_switch (td=0xc6407680, >> newtd=0xc55ba680, flags=) >> at /usr/src/sys/kern/sched_ule.c:1969 >> 60 Thread 100058 (PID=5: vmdaemon) sched_switch (td=0xc64079c0, >> newtd=0xc6407340, flags=) >> at /usr/src/sys/kern/sched_ule.c:1969 >> 59 Thread 100057 (PID=4: pagedaemon) sched_switch (td=0xc6408000, >> newtd=0xc6407000, flags=) >> at /usr/src/sys/kern/sched_ule.c:1969 >> 58 Thread 100064 (PID=4: pagedaemon/uma) sched_switch (td=0xc6406340, >> newtd=0xc55b9340, flags=) >> at /usr/src/sys/kern/sched_ule.c:1969 >> 57 Thread 100050 (PID=15: acpi_cooling0) sched_switch (td=0xc62dc340, >> newtd=0xc6407000, flags=) >> at /usr/src/sys/kern/sched_ule.c:1969 >> >> >> Anything else you need to debug this? > > Start with gathering the information listed in > https://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/kerneldebug-deadlocks.html https://people.freebsd.org/~tijl/r289279-dead.txt r290155 doesn't fix it by the way. ___ 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: r289279 - in head/sys: kern vm
On Wed, 14 Oct 2015 02:10:07 + (UTC) Jeff Roberson wrote: > Author: jeff > Date: Wed Oct 14 02:10:07 2015 > New Revision: 289279 > URL: https://svnweb.freebsd.org/changeset/base/289279 > > Log: > Parallelize the buffer cache and rewrite getnewbuf(). This results in a > 8x performance improvement in a micro benchmark on a 4 socket machine. > >- Get buffer headers from a per-cpu uma cache that sits in from of the > free queue. >- Use a per-cpu quantum cache in vmem to eliminate contention for kva. >- Use multiple clean queues according to buffer cache size to eliminate > clean queue lock contention. >- Introduce a bufspace daemon that attempts to prevent getnewbuf() callers > from blocking or doing direct recycling. >- Close some bufspace allocation races that could lead to endless > recycling. >- Further the transition to a more modern style of small functions grouped > by prefix in order to improve growing complexity. I have an i386 system that locks up easily after this commit. Booting into single user and running make installkernel triggers it consistently. I haven't been able to reproduce it on amd64. Examining threads with DDB shows that they are all at sched_switch (a few at fork_trampoline). The only lock being held is Giant (by the interrupt handler for ctrl+alt+esc I think). So it doesn't look like a dead lock. It's more a sleeping beauty situation. All threads in the castle are sleeping and there's no prince to wake them up. (kgdb) info thread Id Target Id Frame These are from make installkernel: 72 Thread 100071 (PID=107: install) sched_switch (td=0xc667d000, newtd=0xc6407000, flags=) at /usr/src/sys/kern/sched_ule.c:1969 71 Thread 100070 (PID=81: make) sched_switch (td=0xc667d340, newtd=0xc667d000, flags=) at /usr/src/sys/kern/sched_ule.c:1969 70 Thread 100067 (PID=30: make) sched_switch (td=0xc667e000, newtd=0xc667d340, flags=) at /usr/src/sys/kern/sched_ule.c:1969 69 Thread 100066 (PID=25: make) sched_switch (td=0xc667e340, newtd=0xc667e000, flags=) at /usr/src/sys/kern/sched_ule.c:1969 Single user shell: 68 Thread 100065 (PID=17: sh) sched_switch (td=0xc6406000, newtd=0xc667e340, flags=) at /usr/src/sys/kern/sched_ule.c:1969 Kernel threads: 67 Thread 100063 (PID=16: vnlru) sched_switch (td=0xc6406680, newtd=0xc6407340, flags=) at /usr/src/sys/kern/sched_ule.c:1969 66 Thread 100062 (PID=9: syncer) sched_switch (td=0xc64069c0, newtd=0xc667d000, flags=) at /usr/src/sys/kern/sched_ule.c:1969 65 Thread 100061 (PID=8: bufspacedaemon) sched_switch (td=0xc6407000, newtd=0xc62dc000, flags=) at /usr/src/sys/kern/sched_ule.c:1969 64 Thread 100060 (PID=7: bufdaemon) sched_switch (td=0xc6407340, newtd=0xc6408000, flags=) at /usr/src/sys/kern/sched_ule.c:1969 63 Thread 100068 (PID=7: bufdaemon//var worker) sched_switch ( td=0xc667d9c0, newtd=0xc6407000, flags=) at /usr/src/sys/kern/sched_ule.c:1969 62 Thread 100069 (PID=7: bufdaemon//usr worker) sched_switch ( td=0xc667d680, newtd=0xc667d000, flags=) at /usr/src/sys/kern/sched_ule.c:1969 61 Thread 100059 (PID=6: pagezero) sched_switch (td=0xc6407680, newtd=0xc55ba680, flags=) at /usr/src/sys/kern/sched_ule.c:1969 60 Thread 100058 (PID=5: vmdaemon) sched_switch (td=0xc64079c0, newtd=0xc6407340, flags=) at /usr/src/sys/kern/sched_ule.c:1969 59 Thread 100057 (PID=4: pagedaemon) sched_switch (td=0xc6408000, newtd=0xc6407000, flags=) at /usr/src/sys/kern/sched_ule.c:1969 58 Thread 100064 (PID=4: pagedaemon/uma) sched_switch (td=0xc6406340, newtd=0xc55b9340, flags=) at /usr/src/sys/kern/sched_ule.c:1969 57 Thread 100050 (PID=15: acpi_cooling0) sched_switch (td=0xc62dc340, newtd=0xc6407000, flags=) at /usr/src/sys/kern/sched_ule.c:1969 Anything else you need to debug this? ___ 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: r287467 - head/sys/dev/e1000
On Fri, 4 Sep 2015 16:30:49 + (UTC) Sean Bruno wrote: > Author: sbruno > Date: Fri Sep 4 16:30:48 2015 > New Revision: 287467 > URL: https://svnweb.freebsd.org/changeset/base/287467 > > Log: > e1000: Shared code updates > -Fix compiler warning in 80003es2lan.c > -Add return value handler for e1000_*_kmrn_reg_80003es2lan > -Fix usage of DEBUGOUT > -Remove unnecessary variable initializations. > -Removed unused variables (complaints from gcc). > -Edit defines in 82571.h. > -Add workaround for igb hw errata. > -Shared code changes for Skylake/I219 support. > -Remove unused OBFF and LTR functions. > > Differential Revision: https://reviews.freebsd.org/D3162 > Submitted by: erj > MFC after: 1 month > Sponsored by: Intel Corporation > > Modified: > head/sys/dev/e1000/e1000_80003es2lan.c > head/sys/dev/e1000/e1000_82540.c > head/sys/dev/e1000/e1000_82541.c > head/sys/dev/e1000/e1000_82542.c > head/sys/dev/e1000/e1000_82543.c > head/sys/dev/e1000/e1000_82571.h > head/sys/dev/e1000/e1000_82575.c > head/sys/dev/e1000/e1000_82575.h > head/sys/dev/e1000/e1000_api.c > head/sys/dev/e1000/e1000_api.h > head/sys/dev/e1000/e1000_defines.h > head/sys/dev/e1000/e1000_hw.h > head/sys/dev/e1000/e1000_i210.c > head/sys/dev/e1000/e1000_i210.h > head/sys/dev/e1000/e1000_ich8lan.c > head/sys/dev/e1000/e1000_ich8lan.h > head/sys/dev/e1000/e1000_mac.c > head/sys/dev/e1000/e1000_mac.h > head/sys/dev/e1000/e1000_nvm.c > head/sys/dev/e1000/e1000_nvm.h > head/sys/dev/e1000/e1000_osdep.h > head/sys/dev/e1000/e1000_phy.c > head/sys/dev/e1000/e1000_regs.h > head/sys/dev/e1000/if_igb.c I have an em device that fails to attach after this commit: em0@pci0:0:25:0: class=0x02 card=0x00018086 chip=0x294c8086 rev=0x02 hdr=0x00 vendor = 'Intel Corporation' device = '82566DC-2 Gigabit Network Connection' class = network subclass = ethernet em0: port 0x3400-0x341f mem 0x9220-0x9221,0x92224000-0x92224fff irq 20 at device 25.0 on pci0 em0: Using an MSI interrupt At this point the machine waits for about half a minute and then continues with this: em0: The EEPROM Checksum Is Not Valid device_attach: em0 attach returned 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"
Re: svn commit: r287442 - in head: lib/libprocstat lib/libutil share/man/man5 sys/kern sys/sys
On Thu, 3 Sep 2015 20:32:10 + (UTC) "Conrad E. Meyer" wrote: > Author: cem > Date: Thu Sep 3 20:32:10 2015 > New Revision: 287442 > URL: https://svnweb.freebsd.org/changeset/base/287442 > > Log: > Detect badly behaved coredump note helpers > > Coredump notes depend on being able to invoke dump routines twice; once > in a dry-run mode to get the size of the note, and another to actually > emit the note to the corefile. > > When a note helper emits a different length section the second time > around than the length it requested the first time, the kernel produces > a corrupt coredump. > > NT_PROCSTAT_FILES output length, when packing kinfo structs, is tied to > the length of filenames corresponding to vnodes in the process' fd table > via vn_fullpath. As vnodes may move around during dump, this is racy. > > So: > >- Detect badly behaved notes in putnote() and pad underfilled notes. > >- Add a fail point, debug.fail_point.fill_kinfo_vnode__random_path to > exercise the NT_PROCSTAT_FILES corruption. It simply picks random > lengths to expand or truncate paths to in fo_fill_kinfo_vnode(). > >- Add a sysctl, kern.coredump_pack_fileinfo, to allow users to > disable kinfo packing for PROCSTAT_FILES notes. This should avoid > both FILES note corruption and truncation, even if filenames change, > at the cost of about 1 kiB in padding bloat per open fd. Document > the new sysctl in core.5. > >- Fix note_procstat_files to self-limit in the 2nd pass. Since > sometimes this will result in a short write, pad up to our advertised > size. This addresses note corruption, at the risk of sometimes > truncating the last several fd info entries. > >- Fix NT_PROCSTAT_FILES consumers libutil and libprocstat to grok the > zero padding. > > With suggestions from: bjk, jhb, kib, wblock > Approved by:markj (mentor) > Relnotes: yes > Sponsored by: EMC / Isilon Storage Division > Differential Revision: https://reviews.freebsd.org/D3548 > > Modified: > head/lib/libprocstat/libprocstat.c > head/lib/libutil/kinfo_getfile.c > head/share/man/man5/core.5 > head/sys/kern/imgact_elf.c > head/sys/kern/kern_descrip.c > head/sys/kern/vfs_vnops.c > head/sys/sys/user.h > > Modified: head/sys/kern/imgact_elf.c > == > --- head/sys/kern/imgact_elf.cThu Sep 3 19:42:56 2015 > (r287441) > +++ head/sys/kern/imgact_elf.cThu Sep 3 20:32:10 2015 > (r287442) > @@ -1875,29 +1902,56 @@ __elfN(note_procstat_proc)(void *arg, st > CTASSERT(sizeof(struct kinfo_file) == KINFO_FILE_SIZE); > #endif > > +static int pack_fileinfo = 1; > +SYSCTL_INT(_kern, OID_AUTO, coredump_pack_fileinfo, CTLFLAG_RWTUN, > +&pack_fileinfo, 0, > +"Enable file path packing in 'procstat -f' coredump notes"); This file can be compiled twice (included by both imgact_elf32.c and imgact_elf64.c) so this sysctl can be added twice and the second time results in an error message in dmesg: "can't re-use a leaf". ___ 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: r287254 - head/sys/sys
On Fri, 28 Aug 2015 14:06:29 + (UTC) "Pedro F. Giffuni" wrote: > Author: pfg > Date: Fri Aug 28 14:06:28 2015 > New Revision: 287254 > URL: https://svnweb.freebsd.org/changeset/base/287254 > > Log: > Be more GCC-friendly with attributes > > Being clang the default compiler, we were always giving precedence to > the __has_attribute check. Unfortunately clang generally doesn't support > the new attributes (alloc_size was briefly supported and then reverted) > so we were always doing both checks. Give the precedence to GCC as that is > the working case now. > > Do the same for __has_builtin() for consistency. > > Modified: > head/sys/sys/cdefs.h > > Modified: head/sys/sys/cdefs.h > == > --- head/sys/sys/cdefs.h Fri Aug 28 13:57:30 2015(r287253) > +++ head/sys/sys/cdefs.h Fri Aug 28 14:06:28 2015(r287254) > @@ -237,12 +237,12 @@ > #define __aligned(x)__attribute__((__aligned__(x))) > #define __section(x)__attribute__((__section__(x))) > #endif > -#if __has_attribute(alloc_size) || __GNUC_PREREQ__(4, 3) > +#if __GNUC_PREREQ__(4, 3) || __has_attribute(alloc_size) I think you have to add underscores to the __has_attribute argument, like __alloc_size__ here, because user code is allowed to use alloc_size. ___ 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: r285140 - in head: include lib/libc/stdio
On Sat, 4 Jul 2015 16:42:15 + (UTC) Mariusz Zaborski wrote: > Author: oshogbo > Date: Sat Jul 4 16:42:14 2015 > New Revision: 285140 > URL: https://svnweb.freebsd.org/changeset/base/285140 > > Log: > Add fdclose(3) function. > > This function is equivalent to fclose(3) function except that it > does not close the underlying file descriptor. > fdclose(3) is step forward to make FILE structure private. You can probably close this bug now: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=75767 ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r284948 - stable/10/sys/sys
Author: tijl Date: Tue Jun 30 08:40:15 2015 New Revision: 284948 URL: https://svnweb.freebsd.org/changeset/base/284948 Log: MFC r284858: Enable the use of __builtin_va_* for ICC. PR: 198822 Submitted by: Sergey Melnikov Modified: stable/10/sys/sys/cdefs.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/cdefs.h == --- stable/10/sys/sys/cdefs.h Tue Jun 30 08:39:34 2015(r284947) +++ stable/10/sys/sys/cdefs.h Tue Jun 30 08:40:15 2015(r284948) @@ -92,7 +92,7 @@ # undef __GNUCLIKE_BUILTIN_CONSTANT_P # endif -#if (__GNUC_MINOR__ > 95 || __GNUC__ >= 3) && !defined(__INTEL_COMPILER) +#if (__GNUC_MINOR__ > 95 || __GNUC__ >= 3) # define __GNUCLIKE_BUILTIN_VARARGS 1 # define __GNUCLIKE_BUILTIN_STDARG 1 # define __GNUCLIKE_BUILTIN_VAALIST 1 ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r284947 - stable/9/sys/sys
Author: tijl Date: Tue Jun 30 08:39:34 2015 New Revision: 284947 URL: https://svnweb.freebsd.org/changeset/base/284947 Log: MFC r284858: Enable the use of __builtin_va_* for ICC. PR: 198822 Submitted by: Sergey Melnikov Modified: stable/9/sys/sys/cdefs.h Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/sys/cdefs.h == --- stable/9/sys/sys/cdefs.hTue Jun 30 07:46:06 2015(r284946) +++ stable/9/sys/sys/cdefs.hTue Jun 30 08:39:34 2015(r284947) @@ -72,7 +72,7 @@ # undef __GNUCLIKE_BUILTIN_CONSTANT_P # endif -#if (__GNUC_MINOR__ > 95 || __GNUC__ >= 3) && !defined(__INTEL_COMPILER) +#if (__GNUC_MINOR__ > 95 || __GNUC__ >= 3) # define __GNUCLIKE_BUILTIN_VARARGS 1 # define __GNUCLIKE_BUILTIN_STDARG 1 # define __GNUCLIKE_BUILTIN_VAALIST 1 ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r284858 - head/sys/sys
Author: tijl Date: Thu Jun 25 19:39:07 2015 New Revision: 284858 URL: https://svnweb.freebsd.org/changeset/base/284858 Log: Enable the use of __builtin_va_* for ICC. PR: 198822 Submitted by: Sergey Melnikov MFC after:5 days Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h == --- head/sys/sys/cdefs.hThu Jun 25 18:45:37 2015(r284857) +++ head/sys/sys/cdefs.hThu Jun 25 19:39:07 2015(r284858) @@ -92,7 +92,7 @@ #undef __GNUCLIKE_BUILTIN_CONSTANT_P #endif -#if (__GNUC_MINOR__ > 95 || __GNUC__ >= 3) && !defined(__INTEL_COMPILER) +#if (__GNUC_MINOR__ > 95 || __GNUC__ >= 3) #define__GNUCLIKE_BUILTIN_VARARGS 1 #define__GNUCLIKE_BUILTIN_STDARG 1 #define__GNUCLIKE_BUILTIN_VAALIST 1 ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r284810 - in stable/10/lib/msun: . ld128 ld80 man src
Author: tijl Date: Thu Jun 25 13:01:10 2015 New Revision: 284810 URL: https://svnweb.freebsd.org/changeset/base/284810 Log: MFC r271651, r271719, r272138, r272457, r272845, r275476, r275518, r275614, r275819, r276176, r278154, r278160, r278339, r279127, r279240, r279491, r279493, r279856, r283032, r284423, r284426, r284427, r284428 Merge changes to libm from the past 9 months. This includes improvements to the Bessel functions and adds the C99 function lgammal. Added: stable/10/lib/msun/ld128/e_lgammal_r.c - copied, changed from r271651, head/lib/msun/ld128/e_lgammal_r.c stable/10/lib/msun/ld80/e_lgammal_r.c - copied, changed from r271651, head/lib/msun/ld80/e_lgammal_r.c stable/10/lib/msun/src/e_lgammal.c - copied unchanged from r271651, head/lib/msun/src/e_lgammal.c Modified: stable/10/lib/msun/Makefile stable/10/lib/msun/Symbol.map stable/10/lib/msun/ld128/k_expl.h stable/10/lib/msun/ld80/k_expl.h stable/10/lib/msun/man/j0.3 stable/10/lib/msun/man/lgamma.3 stable/10/lib/msun/src/catrig.c stable/10/lib/msun/src/catrigf.c stable/10/lib/msun/src/e_j0.c stable/10/lib/msun/src/e_j0f.c stable/10/lib/msun/src/e_j1.c stable/10/lib/msun/src/e_j1f.c stable/10/lib/msun/src/e_jn.c stable/10/lib/msun/src/e_jnf.c stable/10/lib/msun/src/e_lgamma.c stable/10/lib/msun/src/e_lgamma_r.c stable/10/lib/msun/src/e_lgammaf_r.c stable/10/lib/msun/src/imprecise.c stable/10/lib/msun/src/k_exp.c stable/10/lib/msun/src/k_expf.c stable/10/lib/msun/src/math.h stable/10/lib/msun/src/math_private.h stable/10/lib/msun/src/s_ccosh.c stable/10/lib/msun/src/s_ccoshf.c stable/10/lib/msun/src/s_cexp.c stable/10/lib/msun/src/s_cexpf.c stable/10/lib/msun/src/s_conj.c stable/10/lib/msun/src/s_conjf.c stable/10/lib/msun/src/s_conjl.c stable/10/lib/msun/src/s_cproj.c stable/10/lib/msun/src/s_cprojf.c stable/10/lib/msun/src/s_cprojl.c stable/10/lib/msun/src/s_csinh.c stable/10/lib/msun/src/s_csinhf.c stable/10/lib/msun/src/s_csqrt.c stable/10/lib/msun/src/s_csqrtf.c stable/10/lib/msun/src/s_csqrtl.c stable/10/lib/msun/src/s_ctanh.c stable/10/lib/msun/src/s_ctanhf.c stable/10/lib/msun/src/s_scalbln.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/msun/Makefile == --- stable/10/lib/msun/Makefile Thu Jun 25 11:32:41 2015(r284809) +++ stable/10/lib/msun/Makefile Thu Jun 25 13:01:10 2015(r284810) @@ -98,6 +98,7 @@ COMMON_SRCS+= s_copysignl.c s_fabsl.c s_ # If long double != double use these; otherwise, we alias the double versions. COMMON_SRCS+= e_acoshl.c e_acosl.c e_asinl.c e_atan2l.c e_atanhl.c \ e_coshl.c e_fmodl.c e_hypotl.c \ + e_lgammal.c e_lgammal_r.c \ e_remainderl.c e_sinhl.c e_sqrtl.c \ invtrig.c k_cosl.c k_sinl.c k_tanl.c \ s_asinhl.c s_atanl.c s_cbrtl.c s_ceill.c s_cosl.c s_cprojl.c \ @@ -188,7 +189,8 @@ MLINKS+=ilogb.3 ilogbf.3 ilogb.3 ilogbl. ilogb.3 logb.3 ilogb.3 logbf.3 ilogb.3 logbl.3 MLINKS+=j0.3 j1.3 j0.3 jn.3 j0.3 y0.3 j0.3 y1.3 j0.3 y1f.3 j0.3 yn.3 MLINKS+=j0.3 j0f.3 j0.3 j1f.3 j0.3 jnf.3 j0.3 y0f.3 j0.3 ynf.3 -MLINKS+=lgamma.3 gamma.3 lgamma.3 gammaf.3 lgamma.3 lgammaf.3 \ +MLINKS+=lgamma.3 gamma.3 lgamma.3 gammaf.3 \ + lgamma.3 lgammaf.3 lgamma.3 lgammal.3 \ lgamma.3 tgamma.3 lgamma.3 tgammaf.3 MLINKS+=log.3 log10.3 log.3 log10f.3 log.3 log10l.3 \ log.3 log1p.3 log.3 log1pf.3 log.3 log1pl.3 \ Modified: stable/10/lib/msun/Symbol.map == --- stable/10/lib/msun/Symbol.map Thu Jun 25 11:32:41 2015 (r284809) +++ stable/10/lib/msun/Symbol.map Thu Jun 25 13:01:10 2015 (r284810) @@ -269,6 +269,7 @@ FBSD_1.3 { erfl; expl; expm1l; + lgammal; log10l; log1pl; log2l; @@ -276,7 +277,11 @@ FBSD_1.3 { sinhl; tanhl; /* Implemented as weak aliases for imprecise versions */ - lgammal; powl; tgammal; }; + +/* First added in 11.0-CURRENT */ +FBSD_1.4 { + lgammal_r; +}; Copied and modified: stable/10/lib/msun/ld128/e_lgammal_r.c (from r271651, head/lib/msun/ld128/e_lgammal_r.c) == --- head/lib/msun/ld128/e_lgammal_r.c Mon Sep 15 23:21:57 2014 (r271651, copy source) +++ stable/10/lib/msun/ld128/e_lgammal_r.c Thu Jun 25 13:01:10 2015 (r284810) @@ -206,13 +206,13 @@ sin_pil(long double x) n--; } n &= 7; - y = y - z + n * 0.25L; + y = y - z + n * 0.25; switch (n) { case 0: y = __kernel_sinl(pi*y,zero,0); break; case 1: case 2: y = __kernel_cosl(pi*(0.5-y),zero); break; - case 3: + case 3: case 4: y = __ke
svn commit: r284428 - head/lib/msun/src
Author: tijl Date: Mon Jun 15 20:47:26 2015 New Revision: 284428 URL: https://svnweb.freebsd.org/changeset/base/284428 Log: Follow up to r284427: fix NaN mixing for ctanhf too. Modified: head/lib/msun/src/s_ctanhf.c Modified: head/lib/msun/src/s_ctanhf.c == --- head/lib/msun/src/s_ctanhf.cMon Jun 15 20:40:44 2015 (r284427) +++ head/lib/msun/src/s_ctanhf.cMon Jun 15 20:47:26 2015 (r284428) @@ -51,7 +51,8 @@ ctanhf(float complex z) if (ix >= 0x7f80) { if (ix & 0x7f) - return (CMPLXF(x, (y == 0 ? y : x * y))); + return (CMPLXF((x + 0) * (y + 0), + y == 0 ? y : (x + 0) * (y + 0))); SET_FLOAT_WORD(x, hx - 0x4000); return (CMPLXF(x, copysignf(0, isinf(y) ? y : sinf(y) * cosf(y; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r284427 - head/lib/msun/src
Author: tijl Date: Mon Jun 15 20:40:44 2015 New Revision: 284427 URL: https://svnweb.freebsd.org/changeset/base/284427 Log: - Change comments to be more consistent with s_ccosh.c and s_csinh.c. - Fix a case where NaNs were not mixed correctly and signalling NaNs were not converted to quiet NaNs. - Eliminate two negations from ctan(z). In collaboration with:bde Modified: head/lib/msun/src/s_ctanh.c head/lib/msun/src/s_ctanhf.c Modified: head/lib/msun/src/s_ctanh.c == --- head/lib/msun/src/s_ctanh.c Mon Jun 15 20:16:53 2015(r284426) +++ head/lib/msun/src/s_ctanh.c Mon Jun 15 20:40:44 2015(r284427) @@ -25,7 +25,7 @@ */ /* - * Hyperbolic tangent of a complex argument z = x + i y. + * Hyperbolic tangent of a complex argument z = x + I y. * * The algorithm is from: * @@ -44,15 +44,15 @@ * * tanh(z) = sinh(z) / cosh(z) * - * sinh(x) cos(y) + i cosh(x) sin(y) + * sinh(x) cos(y) + I cosh(x) sin(y) * = - - * cosh(x) cos(y) + i sinh(x) sin(y) + * cosh(x) cos(y) + I sinh(x) sin(y) * - * cosh(x) sinh(x) / cos^2(y) + i tan(y) + * cosh(x) sinh(x) / cos^2(y) + I tan(y) * = - *1 + sinh^2(x) / cos^2(y) * - * beta rho s + i t + * beta rho s + I t * = * 1 + beta s^2 * @@ -85,16 +85,16 @@ ctanh(double complex z) ix = hx & 0x7fff; /* -* ctanh(NaN + i 0) = NaN + i 0 +* ctanh(NaN +- I 0) = d(NaN) +- I 0 * -* ctanh(NaN + i y) = NaN + i NaN for y != 0 +* ctanh(NaN + I y) = d(NaN,y) + I d(NaN,y) for y != 0 * * The imaginary part has the sign of x*sin(2*y), but there's no * special effort to get this right. * -* ctanh(+-Inf +- i Inf) = +-1 +- 0 +* ctanh(+-Inf +- I Inf) = +-1 +- I 0 * -* ctanh(+-Inf + i y) = +-1 + 0 sin(2y) for y finite +* ctanh(+-Inf + I y) = +-1 + I 0 sin(2y) for y finite * * The imaginary part of the sign is unspecified. This special * case is only needed to avoid a spurious invalid exception when @@ -102,24 +102,25 @@ ctanh(double complex z) */ if (ix >= 0x7ff0) { if ((ix & 0xf) | lx)/* x is NaN */ - return (CMPLX(x, (y == 0 ? y : x * y))); + return (CMPLX((x + 0) * (y + 0), + y == 0 ? y : (x + 0) * (y + 0))); SET_HIGH_WORD(x, hx - 0x4000); /* x = copysign(1, x) */ return (CMPLX(x, copysign(0, isinf(y) ? y : sin(y) * cos(y; } /* -* ctanh(x + i NAN) = NaN + i NaN -* ctanh(x +- i Inf) = NaN + i NaN +* ctanh(x + I NaN) = d(NaN) + I d(NaN) +* ctanh(x +- I Inf) = dNaN + I dNaN */ if (!isfinite(y)) return (CMPLX(y - y, y - y)); /* -* ctanh(+-huge + i +-y) ~= +-1 +- i 2sin(2y)/exp(2x), using the +* ctanh(+-huge +- I y) ~= +-1 +- I 2sin(2y)/exp(2x), using the * approximation sinh^2(huge) ~= exp(2*huge) / 4. * We use a modified formula to avoid spurious overflow. */ - if (ix >= 0x4036) { /* x >= 22 */ + if (ix >= 0x4036) { /* |x| >= 22 */ double exp_mx = exp(-fabs(x)); return (CMPLX(copysign(1, x), 4 * sin(y) * cos(y) * exp_mx * exp_mx)); @@ -138,7 +139,7 @@ double complex ctan(double complex z) { - /* ctan(z) = -I * ctanh(I * z) */ - z = ctanh(CMPLX(-cimag(z), creal(z))); - return (CMPLX(cimag(z), -creal(z))); + /* ctan(z) = -I * ctanh(I * z) = I * conj(ctanh(I * conj(z))) */ + z = ctanh(CMPLX(cimag(z), creal(z))); + return (CMPLX(cimag(z), creal(z))); } Modified: head/lib/msun/src/s_ctanhf.c == --- head/lib/msun/src/s_ctanhf.cMon Jun 15 20:16:53 2015 (r284426) +++ head/lib/msun/src/s_ctanhf.cMon Jun 15 20:40:44 2015 (r284427) @@ -60,7 +60,7 @@ ctanhf(float complex z) if (!isfinite(y)) return (CMPLXF(y - y, y - y)); - if (ix >= 0x4130) { /* x >= 11 */ + if (ix >= 0x4130) { /* |x| >= 11 */ float exp_mx = expf(-fabsf(x)); return (CMPLXF(copysignf(1, x), 4 * sinf(y) * cosf(y) * exp_mx * exp_mx)); @@ -78,7 +78,7 @@ float complex ctanf(float complex z) { - z = ctanhf(CMPLXF(-cimagf(z), crealf(z))); - return (CMPLXF(cimagf(z), -crealf(z))); + z = ctanhf(CMPLXF(cimagf(z), crealf(z))); + return (CMPLXF(c
svn commit: r284426 - head/lib/msun/src
Author: tijl Date: Mon Jun 15 20:16:53 2015 New Revision: 284426 URL: https://svnweb.freebsd.org/changeset/base/284426 Log: Fix some exceptional cases where the sign of the result is unspecified but must still satisfy csinh(conj(z)) == conj(csinh(z)) and csinh(-z) == -csinh(z). This allows eliminating two negations from csin(z). In collaboration with:bde Modified: head/lib/msun/src/s_csinh.c head/lib/msun/src/s_csinhf.c Modified: head/lib/msun/src/s_csinh.c == --- head/lib/msun/src/s_csinh.c Mon Jun 15 20:12:15 2015(r284425) +++ head/lib/msun/src/s_csinh.c Mon Jun 15 20:16:53 2015(r284426) @@ -32,6 +32,8 @@ * * Exceptional values are noted in the comments within the source code. * These values and the return value were taken from n1124.pdf. + * The sign of the result for some exceptional values is unspecified but + * must satisfy both sinh(conj(z)) == conj(sinh(z)) and sinh(-z) == -sinh(z). */ #include @@ -63,7 +65,7 @@ csinh(double complex z) if (ix < 0x7ff0 && iy < 0x7ff0) { if ((iy | ly) == 0) return (CMPLX(sinh(x), y)); - if (ix < 0x4036)/* small x: normal case */ + if (ix < 0x4036)/* |x| < 22: normal case */ return (CMPLX(sinh(x) * cos(y), cosh(x) * sin(y))); /* |x| >= 22, so cosh(x) ~= exp(|x|) */ @@ -83,27 +85,24 @@ csinh(double complex z) } /* -* sinh(+-0 +- I Inf) = sign(d(+-0, dNaN))0 + I dNaN. -* The sign of 0 in the result is unspecified. Choice = normally -* the same as dNaN. Raise the invalid floating-point exception. -* -* sinh(+-0 +- I NaN) = sign(d(+-0, NaN))0 + I d(NaN). -* The sign of 0 in the result is unspecified. Choice = normally -* the same as d(NaN). +* sinh(+-0 +- I Inf) = +-0 + I dNaN. +* The sign of 0 in the result is unspecified. Choice = same sign +* as the argument. Raise the invalid floating-point exception. +* +* sinh(+-0 +- I NaN) = +-0 + I d(NaN). +* The sign of 0 in the result is unspecified. Choice = same sign +* as the argument. */ - if ((ix | lx) == 0 && iy >= 0x7ff0) - return (CMPLX(copysign(0, x * (y - y)), y - y)); + if ((ix | lx) == 0) /* && iy >= 0x7ff0 */ + return (CMPLX(x, y - y)); /* * sinh(+-Inf +- I 0) = +-Inf + I +-0. * * sinh(NaN +- I 0) = d(NaN) + I +-0. */ - if ((iy | ly) == 0 && ix >= 0x7ff0) { - if (((hx & 0xf) | lx) == 0) - return (CMPLX(x, y)); - return (CMPLX(x, copysign(0, y))); - } + if ((iy | ly) == 0) /* && ix >= 0x7ff0 */ + return (CMPLX(x + x, y)); /* * sinh(x +- I Inf) = dNaN + I dNaN. @@ -113,45 +112,45 @@ csinh(double complex z) * Optionally raises the invalid floating-point exception for finite * nonzero x. Choice = don't raise (except for signaling NaNs). */ - if (ix < 0x7ff0 && iy >= 0x7ff0) - return (CMPLX(y - y, x * (y - y))); + if (ix < 0x7ff0)/* && iy >= 0x7ff0 */ + return (CMPLX(y - y, y - y)); /* * sinh(+-Inf + I NaN) = +-Inf + I d(NaN). -* The sign of Inf in the result is unspecified. Choice = normally -* the same as d(NaN). +* The sign of Inf in the result is unspecified. Choice = same sign +* as the argument. * -* sinh(+-Inf +- I Inf) = +Inf + I dNaN. -* The sign of Inf in the result is unspecified. Choice = always +. -* Raise the invalid floating-point exception. +* sinh(+-Inf +- I Inf) = +-Inf + I dNaN. +* The sign of Inf in the result is unspecified. Choice = same sign +* as the argument. Raise the invalid floating-point exception. * * sinh(+-Inf + I y) = +-Inf cos(y) + I Inf sin(y) */ - if (ix >= 0x7ff0 && ((hx & 0xf) | lx) == 0) { + if (ix == 0x7ff0 && lx == 0) { if (iy >= 0x7ff0) - return (CMPLX(x * x, x * (y - y))); + return (CMPLX(x, y - y)); return (CMPLX(x * cos(y), INFINITY * sin(y))); } /* -* sinh(NaN + I NaN) = d(NaN) + I d(NaN). +* sinh(NaN1 + I NaN2) = d(NaN1, NaN2) + I d(NaN1, NaN2). * -* sinh(NaN +- I Inf) = d(NaN) + I d(NaN). +* sinh(NaN +- I Inf) = d(NaN, dNaN) + I d(NaN, dNaN). * Optionally raises the invalid floating-point exception. * Choice = raise. * -* sinh(NaN + I y)= d(NaN) + I d(NaN). +* sinh(NaN + I y) = d(NaN) + I
svn commit: r284423 - head/lib/msun/src
Author: tijl Date: Mon Jun 15 20:11:06 2015 New Revision: 284423 URL: https://svnweb.freebsd.org/changeset/base/284423 Log: Fix some exceptional cases where the sign of the result is unspecified but must still satisfy ccosh(conj(z)) == conj(ccosh(z)) and ccosh(-z) == ccosh(z). In collaboration with:bde Modified: head/lib/msun/src/s_ccosh.c head/lib/msun/src/s_ccoshf.c Modified: head/lib/msun/src/s_ccosh.c == --- head/lib/msun/src/s_ccosh.c Mon Jun 15 19:48:28 2015(r284422) +++ head/lib/msun/src/s_ccosh.c Mon Jun 15 20:11:06 2015(r284423) @@ -32,6 +32,8 @@ * * Exceptional values are noted in the comments within the source code. * These values and the return value were taken from n1124.pdf. + * The sign of the result for some exceptional values is unspecified but + * must satisfy both cosh(conj(z)) == conj(cosh(z)) and cosh(-z) == cosh(z). */ #include @@ -63,7 +65,7 @@ ccosh(double complex z) if (ix < 0x7ff0 && iy < 0x7ff0) { if ((iy | ly) == 0) return (CMPLX(cosh(x), x * y)); - if (ix < 0x4036)/* small x: normal case */ + if (ix < 0x4036)/* |x| < 22: normal case */ return (CMPLX(cosh(x) * cos(y), sinh(x) * sin(y))); /* |x| >= 22, so cosh(x) ~= exp(|x|) */ @@ -83,28 +85,27 @@ ccosh(double complex z) } /* -* cosh(+-0 +- I Inf) = dNaN + I sign(d(+-0, dNaN))0. -* The sign of 0 in the result is unspecified. Choice = normally -* the same as dNaN. Raise the invalid floating-point exception. -* -* cosh(+-0 +- I NaN) = d(NaN) + I sign(d(+-0, NaN))0. -* The sign of 0 in the result is unspecified. Choice = normally -* the same as d(NaN). +* cosh(+-0 +- I Inf) = dNaN + I (+-)(+-)0. +* The sign of 0 in the result is unspecified. Choice = product +* of the signs of the argument. Raise the invalid floating-point +* exception. +* +* cosh(+-0 +- I NaN) = d(NaN) + I (+-)(+-)0. +* The sign of 0 in the result is unspecified. Choice = product +* of the signs of the argument. */ - if ((ix | lx) == 0 && iy >= 0x7ff0) - return (CMPLX(y - y, copysign(0, x * (y - y; + if ((ix | lx) == 0) /* && iy >= 0x7ff0 */ + return (CMPLX(y - y, x * copysign(0, y))); /* * cosh(+-Inf +- I 0) = +Inf + I (+-)(+-)0. * -* cosh(NaN +- I 0) = d(NaN) + I sign(d(NaN, +-0))0. -* The sign of 0 in the result is unspecified. +* cosh(NaN +- I 0) = d(NaN) + I (+-)(+-)0. +* The sign of 0 in the result is unspecified. Choice = product +* of the signs of the argument. */ - if ((iy | ly) == 0 && ix >= 0x7ff0) { - if (((hx & 0xf) | lx) == 0) - return (CMPLX(x * x, copysign(0, x) * y)); - return (CMPLX(x * x, copysign(0, (x + x) * y))); - } + if ((iy | ly) == 0) /* && ix >= 0x7ff0 */ + return (CMPLX(x * x, copysign(0, x) * y)); /* * cosh(x +- I Inf) = dNaN + I dNaN. @@ -114,7 +115,7 @@ ccosh(double complex z) * Optionally raises the invalid floating-point exception for finite * nonzero x. Choice = don't raise (except for signaling NaNs). */ - if (ix < 0x7ff0 && iy >= 0x7ff0) + if (ix < 0x7ff0)/* && iy >= 0x7ff0 */ return (CMPLX(y - y, x * (y - y))); /* @@ -126,10 +127,10 @@ ccosh(double complex z) * * cosh(+-Inf + I y) = +Inf cos(y) +- I Inf sin(y) */ - if (ix >= 0x7ff0 && ((hx & 0xf) | lx) == 0) { + if (ix == 0x7ff0 && lx == 0) { if (iy >= 0x7ff0) - return (CMPLX(x * x, x * (y - y))); - return (CMPLX((x * x) * cos(y), x * sin(y))); + return (CMPLX(INFINITY, x * (y - y))); + return (CMPLX(INFINITY * cos(y), x * sin(y))); } /* Modified: head/lib/msun/src/s_ccoshf.c == --- head/lib/msun/src/s_ccoshf.cMon Jun 15 19:48:28 2015 (r284422) +++ head/lib/msun/src/s_ccoshf.cMon Jun 15 20:11:06 2015 (r284423) @@ -25,7 +25,7 @@ */ /* - * Hyperbolic cosine of a complex argument. See s_ccosh.c for details. + * Float version of ccosh(). See s_ccosh.c for details. */ #include @@ -56,13 +56,13 @@ ccoshf(float complex z) if (ix < 0x7f80 && iy < 0x7f80) { if (iy == 0) return (CMPLXF(coshf(x), x * y)); - if (ix < 0x4110)/* small x: normal case */ +
svn commit: r284422 - head/usr.sbin/crunch/crunchgen
Author: tijl Date: Mon Jun 15 19:48:28 2015 New Revision: 284422 URL: https://svnweb.freebsd.org/changeset/base/284422 Log: Change -Wl,-r back to -r so gcc doesn't pass --relax to the linker on some architectures. PR: 200881 Modified: head/usr.sbin/crunch/crunchgen/crunchgen.c Modified: head/usr.sbin/crunch/crunchgen/crunchgen.c == --- head/usr.sbin/crunch/crunchgen/crunchgen.c Mon Jun 15 19:28:07 2015 (r284421) +++ head/usr.sbin/crunch/crunchgen/crunchgen.c Mon Jun 15 19:48:28 2015 (r284422) @@ -1110,7 +1110,7 @@ prog_makefile_rules(FILE *outmk, prog_t fprintf(outmk, " $(%s_LIBS)", p->ident); fprintf(outmk, "\n"); - fprintf(outmk, "\t$(CC) -nostdlib -Wl,-dc -Wl,-r -o %s.lo %s_stub.o $(%s_OBJPATHS)", + fprintf(outmk, "\t$(CC) -nostdlib -Wl,-dc -r -o %s.lo %s_stub.o $(%s_OBJPATHS)", p->name, p->name, p->ident); if (p->libs) fprintf(outmk, " $(%s_LIBS)", p->ident); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r284356 - head/usr.sbin/crunch/crunchgen
On Sun, 14 Jun 2015 08:31:32 -0700 Adrian Chadd wrote: > On 14 June 2015 at 08:28, Tijl Coosemans wrote: >> On Sun, 14 Jun 2015 08:07:17 -0700 Adrian Chadd wrote: >>> On 14 June 2015 at 02:41, Tijl Coosemans wrote: >>>> On Sat, 13 Jun 2015 22:01:21 + (UTC) Adrian Chadd >>>> wrote: >>>>> Author: adrian >>>>> Date: Sat Jun 13 22:01:21 2015 >>>>> New Revision: 284356 >>>>> URL: https://svnweb.freebsd.org/changeset/base/284356 >>>>> >>>>> Log: >>>>> Fix up crunchgen binary generation to work with external cross-build >>>>> tools. >>>>> >>>>> * Allow STRIP to be overridden by the environment >>>>> * Use CC to tie things together, not LD >>>>> >>>>> Tested: >>>>> >>>>> * i386, mips32 >>>>> >>>>> Submitted by: kan >>>>> >>>>> Modified: >>>>> head/usr.sbin/crunch/crunchgen/crunchgen.c >>>>> >>>>> Modified: head/usr.sbin/crunch/crunchgen/crunchgen.c >>>>> == >>>>> --- head/usr.sbin/crunch/crunchgen/crunchgen.cSat Jun 13 20:15:44 >>>>> 2015(r284355) >>>>> +++ head/usr.sbin/crunch/crunchgen/crunchgen.cSat Jun 13 22:01:21 >>>>> 2015(r284356) >>>>> @@ -1109,7 +1110,7 @@ prog_makefile_rules(FILE *outmk, prog_t >>>>> fprintf(outmk, " $(%s_LIBS)", p->ident); >>>>> >>>>> fprintf(outmk, "\n"); >>>>> - fprintf(outmk, "\t$(LD) -dc -r -o %s.lo %s_stub.o $(%s_OBJPATHS)", >>>>> + fprintf(outmk, "\t$(CC) -nostdlibs -dc -r -o %s.lo %s_stub.o >>>>> $(%s_OBJPATHS)", >>>> >>>> Does CC understand -dc and -r? >>> >>> Apparently? >> >> Hmm, it's undocumented but it seems to recognise -r and pass it on to >> the linker. Not -dc though. It's safer to use: -Wl,-dc -Wl,-r > > Ok. Would you mind committing it? I'm not near a FreeBSD machine at the > moment. Done in r284382. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r284382 - head/usr.sbin/crunch/crunchgen
Author: tijl Date: Sun Jun 14 15:40:17 2015 New Revision: 284382 URL: https://svnweb.freebsd.org/changeset/base/284382 Log: Tell the compiler that -dc and -r are linker flags. Reviewed by: adrian Modified: head/usr.sbin/crunch/crunchgen/crunchgen.c Modified: head/usr.sbin/crunch/crunchgen/crunchgen.c == --- head/usr.sbin/crunch/crunchgen/crunchgen.c Sun Jun 14 14:10:05 2015 (r284381) +++ head/usr.sbin/crunch/crunchgen/crunchgen.c Sun Jun 14 15:40:17 2015 (r284382) @@ -1110,7 +1110,7 @@ prog_makefile_rules(FILE *outmk, prog_t fprintf(outmk, " $(%s_LIBS)", p->ident); fprintf(outmk, "\n"); - fprintf(outmk, "\t$(CC) -nostdlib -dc -r -o %s.lo %s_stub.o $(%s_OBJPATHS)", + fprintf(outmk, "\t$(CC) -nostdlib -Wl,-dc -Wl,-r -o %s.lo %s_stub.o $(%s_OBJPATHS)", p->name, p->name, p->ident); if (p->libs) fprintf(outmk, " $(%s_LIBS)", p->ident); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r284356 - head/usr.sbin/crunch/crunchgen
On Sun, 14 Jun 2015 08:07:17 -0700 Adrian Chadd wrote: > On 14 June 2015 at 02:41, Tijl Coosemans wrote: >> On Sat, 13 Jun 2015 22:01:21 + (UTC) Adrian Chadd >> wrote: >>> Author: adrian >>> Date: Sat Jun 13 22:01:21 2015 >>> New Revision: 284356 >>> URL: https://svnweb.freebsd.org/changeset/base/284356 >>> >>> Log: >>> Fix up crunchgen binary generation to work with external cross-build >>> tools. >>> >>> * Allow STRIP to be overridden by the environment >>> * Use CC to tie things together, not LD >>> >>> Tested: >>> >>> * i386, mips32 >>> >>> Submitted by: kan >>> >>> Modified: >>> head/usr.sbin/crunch/crunchgen/crunchgen.c >>> >>> Modified: head/usr.sbin/crunch/crunchgen/crunchgen.c >>> == >>> --- head/usr.sbin/crunch/crunchgen/crunchgen.cSat Jun 13 20:15:44 >>> 2015(r284355) >>> +++ head/usr.sbin/crunch/crunchgen/crunchgen.cSat Jun 13 22:01:21 >>> 2015(r284356) >>> @@ -1109,7 +1110,7 @@ prog_makefile_rules(FILE *outmk, prog_t >>> fprintf(outmk, " $(%s_LIBS)", p->ident); >>> >>> fprintf(outmk, "\n"); >>> - fprintf(outmk, "\t$(LD) -dc -r -o %s.lo %s_stub.o $(%s_OBJPATHS)", >>> + fprintf(outmk, "\t$(CC) -nostdlibs -dc -r -o %s.lo %s_stub.o >>> $(%s_OBJPATHS)", >> >> Does CC understand -dc and -r? > > Apparently? Hmm, it's undocumented but it seems to recognise -r and pass it on to the linker. Not -dc though. It's safer to use: -Wl,-dc -Wl,-r ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r284356 - head/usr.sbin/crunch/crunchgen
On Sat, 13 Jun 2015 22:01:21 + (UTC) Adrian Chadd wrote: > Author: adrian > Date: Sat Jun 13 22:01:21 2015 > New Revision: 284356 > URL: https://svnweb.freebsd.org/changeset/base/284356 > > Log: > Fix up crunchgen binary generation to work with external cross-build > tools. > > * Allow STRIP to be overridden by the environment > * Use CC to tie things together, not LD > > Tested: > > * i386, mips32 > > Submitted by: kan > > Modified: > head/usr.sbin/crunch/crunchgen/crunchgen.c > > Modified: head/usr.sbin/crunch/crunchgen/crunchgen.c > == > --- head/usr.sbin/crunch/crunchgen/crunchgen.cSat Jun 13 20:15:44 > 2015(r284355) > +++ head/usr.sbin/crunch/crunchgen/crunchgen.cSat Jun 13 22:01:21 > 2015(r284356) > @@ -980,6 +980,7 @@ top_makefile_rules(FILE *outmk) > prog_t *p; > > fprintf(outmk, "LD?= ld\n"); > + fprintf(outmk, "STRIP?= strip\n"); > if ( subtract_strlst(&libs, &libs_so) ) > fprintf(outmk, "# NOTE: Some LIBS declarations below overridden > by LIBS_SO\n"); > > @@ -1027,7 +1028,7 @@ top_makefile_rules(FILE *outmk) > fprintf(outmk, "\t$(CC) -static -o %s %s.o $(CRUNCHED_OBJS) $(LIBS)\n", > execfname, execfname); > fprintf(outmk, ".endif\n"); > - fprintf(outmk, "\tstrip %s\n", execfname); > + fprintf(outmk, "\t$(STRIP) %s\n", execfname); > fprintf(outmk, "realclean: clean subclean\n"); > fprintf(outmk, "clean:\n\trm -f %s *.lo *.o *_stub.c\n", execfname); > fprintf(outmk, "subclean: $(SUBCLEAN_TARGETS)\n"); > @@ -1109,7 +1110,7 @@ prog_makefile_rules(FILE *outmk, prog_t > fprintf(outmk, " $(%s_LIBS)", p->ident); > > fprintf(outmk, "\n"); > - fprintf(outmk, "\t$(LD) -dc -r -o %s.lo %s_stub.o $(%s_OBJPATHS)", > + fprintf(outmk, "\t$(CC) -nostdlibs -dc -r -o %s.lo %s_stub.o > $(%s_OBJPATHS)", Does CC understand -dc and -r? ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283908 - stable/10/lib/libiconv_modules/UTF7
Author: tijl Date: Tue Jun 2 09:42:00 2015 New Revision: 283908 URL: https://svnweb.freebsd.org/changeset/base/283908 Log: MFC r283406,283418: Fix decoding of UTF-7 when a base64 encoded chunk appears at the end of the input buffer. _citrus_UTF7_mbtoutf16 stored the decoder state at the beginning so it could restore this state on an incomplete character such that the next call would restart the decoding. The problem was that "-" (end of base64 mode) at the end of a string was also treated as an incomplete character but was also removed from the state buffer. So the initial state would be restored (with base64 mode) and the next call would no longer see the "-" so it continued in base64 mode. This state saving/restoring isn't needed here. It's already handled elsewhere (citrus_iconv_std.c:_citrus_iconv_std_iconv_convert) so just remove it. Also initialise *nresult. When only 2 bytes can be read from a 4 byte UTF-16 character in a base64 encoded chunk of a UTF-7 string, treat that as an incomplete character and return an error instead of a shift sequence and no error. Also check that the low 2 bytes have a valid value. PR: 200398 Modified: stable/10/lib/libiconv_modules/UTF7/citrus_utf7.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libiconv_modules/UTF7/citrus_utf7.c == --- stable/10/lib/libiconv_modules/UTF7/citrus_utf7.c Tue Jun 2 09:05:45 2015(r283907) +++ stable/10/lib/libiconv_modules/UTF7/citrus_utf7.c Tue Jun 2 09:42:00 2015(r283908) @@ -62,8 +62,7 @@ typedef struct { unsigned int mode: 1,/* whether base64 mode */ bits: 4,/* need to hold 0 - 15 */ - cache: 22, /* 22 = BASE64_BIT + UTF16_BIT */ - surrogate: 1; /* whether surrogate pair or not */ + cache: 22; /* 22 = BASE64_BIT + UTF16_BIT */ int chlen; char ch[4]; /* BASE64_IN, 3 * 6 = 18, most closed to UTF16_BIT */ } _UTF7State; @@ -154,21 +153,17 @@ _citrus_UTF7_mbtoutf16(_UTF7EncodingInfo uint16_t * __restrict u16, char ** __restrict s, size_t n, _UTF7State * __restrict psenc, size_t * __restrict nresult) { - _UTF7State sv; char *s0; int done, i, len; + *nresult = 0; s0 = *s; - sv = *psenc; for (i = 0, done = 0; done == 0; i++) { if (i == psenc->chlen) { if (n-- < 1) { *nresult = (size_t)-2; *s = s0; - sv.chlen = psenc->chlen; - memcpy(sv.ch, psenc->ch, sizeof(sv.ch)); - *psenc = sv; return (0); } psenc->ch[psenc->chlen++] = *s0++; @@ -257,34 +252,31 @@ _citrus_UTF7_mbrtowc_priv(_UTF7EncodingI *nresult = (size_t)_ENCODING_IS_STATE_DEPENDENT; return (0); } - if (psenc->surrogate) { - hi = (psenc->cache >> psenc->bits) & UTF16_MAX; - if (hi < HISRG_MIN || hi > HISRG_MAX) - return (EINVAL); - siz = 0; - } else { - err = _citrus_UTF7_mbtoutf16(ei, &hi, s, n, psenc, &nr); - if (nr == (size_t)-1 || nr == (size_t)-2) { - *nresult = nr; - return (err); - } - if (err != 0) - return (err); - n -= nr; - siz = nr; - if (hi < HISRG_MIN || hi > HISRG_MAX) { - u32 = (uint32_t)hi; - goto done; - } - psenc->surrogate = 1; + err = _citrus_UTF7_mbtoutf16(ei, &hi, s, n, psenc, &nr); + if (nr == (size_t)-1 || nr == (size_t)-2) { + *nresult = nr; + return (err); + } + if (err != 0) + return (err); + n -= nr; + siz = nr; + if (hi < HISRG_MIN || hi > HISRG_MAX) { + u32 = (uint32_t)hi; + goto done; } err = _citrus_UTF7_mbtoutf16(ei, &lo, s, n, psenc, &nr); if (nr == (size_t)-1 || nr == (size_t)-2) { + psenc->chlen = 1; /* make get_state_desc return incomplete */ *nresult = nr; return (err); } if (err != 0) return (err); + if (lo < LOSRG_MIN || lo > LOSRG_MAX) { + *nresult = (size_t)-1; + return (EILSEQ); + } hi -= HISRG_MIN; lo -= LOSRG_MIN; u32 = (hi << 10 | lo) + SRG_BASE; @@ -297,7 +289,6 @@ done: _citrus_UTF7_init_state(ei, psenc); } else { *nresul
svn commit: r283418 - head/lib/libiconv_modules/UTF7
Author: tijl Date: Sun May 24 15:47:06 2015 New Revision: 283418 URL: https://svnweb.freebsd.org/changeset/base/283418 Log: When only 2 bytes can be read from a 4 byte UTF-16 character in a base64 encoded chunk of a UTF-7 string, treat that as an incomplete character and return an error instead of a shift sequence and no error. Also check that the low 2 bytes have a valid value. MFC after:1 week Modified: head/lib/libiconv_modules/UTF7/citrus_utf7.c Modified: head/lib/libiconv_modules/UTF7/citrus_utf7.c == --- head/lib/libiconv_modules/UTF7/citrus_utf7.cSun May 24 15:45:36 2015(r283417) +++ head/lib/libiconv_modules/UTF7/citrus_utf7.cSun May 24 15:47:06 2015(r283418) @@ -62,8 +62,7 @@ typedef struct { unsigned int mode: 1,/* whether base64 mode */ bits: 4,/* need to hold 0 - 15 */ - cache: 22, /* 22 = BASE64_BIT + UTF16_BIT */ - surrogate: 1; /* whether surrogate pair or not */ + cache: 22; /* 22 = BASE64_BIT + UTF16_BIT */ int chlen; char ch[4]; /* BASE64_IN, 3 * 6 = 18, most closed to UTF16_BIT */ } _UTF7State; @@ -253,34 +252,31 @@ _citrus_UTF7_mbrtowc_priv(_UTF7EncodingI *nresult = (size_t)_ENCODING_IS_STATE_DEPENDENT; return (0); } - if (psenc->surrogate) { - hi = (psenc->cache >> psenc->bits) & UTF16_MAX; - if (hi < HISRG_MIN || hi > HISRG_MAX) - return (EINVAL); - siz = 0; - } else { - err = _citrus_UTF7_mbtoutf16(ei, &hi, s, n, psenc, &nr); - if (nr == (size_t)-1 || nr == (size_t)-2) { - *nresult = nr; - return (err); - } - if (err != 0) - return (err); - n -= nr; - siz = nr; - if (hi < HISRG_MIN || hi > HISRG_MAX) { - u32 = (uint32_t)hi; - goto done; - } - psenc->surrogate = 1; + err = _citrus_UTF7_mbtoutf16(ei, &hi, s, n, psenc, &nr); + if (nr == (size_t)-1 || nr == (size_t)-2) { + *nresult = nr; + return (err); + } + if (err != 0) + return (err); + n -= nr; + siz = nr; + if (hi < HISRG_MIN || hi > HISRG_MAX) { + u32 = (uint32_t)hi; + goto done; } err = _citrus_UTF7_mbtoutf16(ei, &lo, s, n, psenc, &nr); if (nr == (size_t)-1 || nr == (size_t)-2) { + psenc->chlen = 1; /* make get_state_desc return incomplete */ *nresult = nr; return (err); } if (err != 0) return (err); + if (lo < LOSRG_MIN || lo > LOSRG_MAX) { + *nresult = (size_t)-1; + return (EILSEQ); + } hi -= HISRG_MIN; lo -= LOSRG_MIN; u32 = (hi << 10 | lo) + SRG_BASE; @@ -293,7 +289,6 @@ done: _citrus_UTF7_init_state(ei, psenc); } else { *nresult = siz; - psenc->surrogate = 0; } return (err); } @@ -392,7 +387,7 @@ _citrus_UTF7_put_state_reset(_UTF7Encodi { int bits, pos; - if (psenc->chlen != 0 || psenc->bits > BASE64_BIT || psenc->surrogate) + if (psenc->chlen != 0 || psenc->bits > BASE64_BIT) return (EINVAL); if (psenc->mode) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r283406 - head/lib/libiconv_modules/UTF7
Author: tijl Date: Sun May 24 15:27:31 2015 New Revision: 283406 URL: https://svnweb.freebsd.org/changeset/base/283406 Log: Fix decoding of UTF-7 when a base64 encoded chunk appears at the end of the input buffer. _citrus_UTF7_mbtoutf16 stored the decoder state at the beginning so it could restore this state on an incomplete character such that the next call would restart the decoding. The problem was that "-" (end of base64 mode) at the end of a string was also treated as an incomplete character but was also removed from the state buffer. So the initial state would be restored (with base64 mode) and the next call would no longer see the "-" so it continued in base64 mode. This state saving/restoring isn't needed here. It's already handled elsewhere (citrus_iconv_std.c:_citrus_iconv_std_iconv_convert) so just remove it. Also initialise *nresult. PR: 200398 Tested by:delphij MFC after:1 week Modified: head/lib/libiconv_modules/UTF7/citrus_utf7.c Modified: head/lib/libiconv_modules/UTF7/citrus_utf7.c == --- head/lib/libiconv_modules/UTF7/citrus_utf7.cSun May 24 15:22:33 2015(r283405) +++ head/lib/libiconv_modules/UTF7/citrus_utf7.cSun May 24 15:27:31 2015(r283406) @@ -154,21 +154,17 @@ _citrus_UTF7_mbtoutf16(_UTF7EncodingInfo uint16_t * __restrict u16, char ** __restrict s, size_t n, _UTF7State * __restrict psenc, size_t * __restrict nresult) { - _UTF7State sv; char *s0; int done, i, len; + *nresult = 0; s0 = *s; - sv = *psenc; for (i = 0, done = 0; done == 0; i++) { if (i == psenc->chlen) { if (n-- < 1) { *nresult = (size_t)-2; *s = s0; - sv.chlen = psenc->chlen; - memcpy(sv.ch, psenc->ch, sizeof(sv.ch)); - *psenc = sv; return (0); } psenc->ch[psenc->chlen++] = *s0++; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r282907 - head/sys/sys
On Thu, 14 May 2015 15:49:49 + (UTC) "Pedro F. Giffuni" wrote: > Author: pfg > Date: Thu May 14 15:49:48 2015 > New Revision: 282907 > URL: https://svnweb.freebsd.org/changeset/base/282907 > > Log: > Add new __unreachable() builtin > > This is one of the few post gcc4.2 builtins that has been implemented by > clang: > > __builtin_unreachable is used to indicate that a specific point in the > program cannot be reached, even if the compiler might otherwise think it > can. This is useful to improve optimization and eliminates certain > warnings. > > Hinted by: NetBSD > Differential Revision: https://reviews.freebsd.org/D2536 > > Modified: > head/sys/sys/cdefs.h > > Modified: head/sys/sys/cdefs.h > == > --- head/sys/sys/cdefs.h Thu May 14 15:14:03 2015(r282906) > +++ head/sys/sys/cdefs.h Thu May 14 15:49:48 2015(r282907) > @@ -388,6 +388,12 @@ > #define __alloc_size(x) > #endif > > +#if __has_builtin(__builtin_unreachable) || __GNUC_PREREQ__(4, 6) > +#define __unreachable() __builtin_unreachable() > +#else > +#define __unreachable() do {} while (/*CONSTCOND*/0) __builtin_unreachable() can be used in expressions so I think it's better to replace do-while with ((void)0). You can then do things like this: #define assume(e) ((e) ? (void)0 : __unreachable()) (like assert(e) but without error) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r282275 - in stable/10: . bin/csh contrib/smbfs/include/netsmb contrib/smbfs/lib/smb include lib/libarchive lib/libc/iconv lib/libc/locale lib/libiconv_modules/BIG5 lib/libiconv_module
On Thu, 30 Apr 2015 13:44:18 -0500 Bryan Drewery wrote: > On 4/30/2015 11:08 AM, Tijl Coosemans wrote: >> Author: tijl >> Date: Thu Apr 30 16:08:47 2015 >> New Revision: 282275 >> URL: https://svnweb.freebsd.org/changeset/base/282275 >> >> Log: >> MFC r275805: >> >> Fix incorrect type of "invalids" argument in __iconv() prototype. >> >> MFC r281550,281591: >> >> Remove the const qualifier from iconv(3) to comply with POSIX: >> http://pubs.opengroup.org/onlinepubs/9699919799/functions/iconv.html >> >> Adjust all code that calls iconv. >> >> PR:199099 >> >> Modified: >> stable/10/UPDATING >> stable/10/bin/csh/config.h >> stable/10/bin/csh/iconv_stub.h >> stable/10/contrib/smbfs/include/netsmb/smb_lib.h >> stable/10/contrib/smbfs/lib/smb/nls.c >> stable/10/contrib/smbfs/lib/smb/print.c >> stable/10/contrib/smbfs/lib/smb/rq.c >> stable/10/include/iconv.h >> stable/10/lib/libarchive/Makefile >> stable/10/lib/libc/iconv/__iconv.c >> stable/10/lib/libc/iconv/bsd_iconv.c >> stable/10/lib/libc/iconv/citrus_iconv.h >> stable/10/lib/libc/iconv/citrus_iconv_local.h >> stable/10/lib/libc/iconv/citrus_none.c >> stable/10/lib/libc/iconv/citrus_stdenc.h >> stable/10/lib/libc/iconv/citrus_stdenc_local.h >> stable/10/lib/libc/iconv/citrus_stdenc_template.h >> stable/10/lib/libc/iconv/iconv-internal.h >> stable/10/lib/libc/iconv/iconv.3 >> stable/10/lib/libc/iconv/iconv.c >> stable/10/lib/libc/iconv/iconv_compat.c >> stable/10/lib/libc/locale/cXXrtomb_iconv.h >> stable/10/lib/libc/locale/mbrtocXX_iconv.h >> stable/10/lib/libiconv_modules/BIG5/citrus_big5.c >> stable/10/lib/libiconv_modules/DECHanyu/citrus_dechanyu.c >> stable/10/lib/libiconv_modules/EUC/citrus_euc.c >> stable/10/lib/libiconv_modules/EUCTW/citrus_euctw.c >> stable/10/lib/libiconv_modules/GBK2K/citrus_gbk2k.c >> stable/10/lib/libiconv_modules/HZ/citrus_hz.c >> stable/10/lib/libiconv_modules/ISO2022/citrus_iso2022.c >> stable/10/lib/libiconv_modules/JOHAB/citrus_johab.c >> stable/10/lib/libiconv_modules/MSKanji/citrus_mskanji.c >> stable/10/lib/libiconv_modules/UES/citrus_ues.c >> stable/10/lib/libiconv_modules/UTF1632/citrus_utf1632.c >> stable/10/lib/libiconv_modules/UTF7/citrus_utf7.c >> stable/10/lib/libiconv_modules/UTF8/citrus_utf8.c >> stable/10/lib/libiconv_modules/VIQR/citrus_viqr.c >> stable/10/lib/libiconv_modules/ZW/citrus_zw.c >> stable/10/lib/libiconv_modules/iconv_none/citrus_iconv_none.c >> stable/10/lib/libiconv_modules/iconv_std/citrus_iconv_std.c >> stable/10/lib/libkiconv/xlat16_iconv.c >> stable/10/sys/sys/param.h >> stable/10/usr.bin/iconv/iconv.c >> Directory Properties: >> stable/10/ (props changed) >> >> Modified: stable/10/UPDATING >> == >> --- stable/10/UPDATING Thu Apr 30 15:48:48 2015(r282274) >> +++ stable/10/UPDATING Thu Apr 30 16:08:47 2015(r282275) >> @@ -16,6 +16,10 @@ from older versions of FreeBSD, try WITH >> stable/10, and then rebuild without this option. The bootstrap process from >> older version of current is a bit fragile. >> >> +20150430: >> +The const qualifier has been removed from iconv(3) to comply with >> +POSIX. The ports tree is aware of this from r384038 onwards. >> + > > Being an ABI change this seems wrong to MFC. Binaries are not only built > from Ports. > > For a binary built on 10.1 will this change cause any issues? Removing const from a function parameter is not an ABI change, so there are no issues for binaries. The worst you can run into is a warning/error from a compiler (when you pass a const char** argument to what is now a char** parameter), but this should be trivial to fix. pgpVIKvZjjvK9.pgp Description: OpenPGP digital signature
svn commit: r282275 - in stable/10: . bin/csh contrib/smbfs/include/netsmb contrib/smbfs/lib/smb include lib/libarchive lib/libc/iconv lib/libc/locale lib/libiconv_modules/BIG5 lib/libiconv_modules...
Author: tijl Date: Thu Apr 30 16:08:47 2015 New Revision: 282275 URL: https://svnweb.freebsd.org/changeset/base/282275 Log: MFC r275805: Fix incorrect type of "invalids" argument in __iconv() prototype. MFC r281550,281591: Remove the const qualifier from iconv(3) to comply with POSIX: http://pubs.opengroup.org/onlinepubs/9699919799/functions/iconv.html Adjust all code that calls iconv. PR: 199099 Modified: stable/10/UPDATING stable/10/bin/csh/config.h stable/10/bin/csh/iconv_stub.h stable/10/contrib/smbfs/include/netsmb/smb_lib.h stable/10/contrib/smbfs/lib/smb/nls.c stable/10/contrib/smbfs/lib/smb/print.c stable/10/contrib/smbfs/lib/smb/rq.c stable/10/include/iconv.h stable/10/lib/libarchive/Makefile stable/10/lib/libc/iconv/__iconv.c stable/10/lib/libc/iconv/bsd_iconv.c stable/10/lib/libc/iconv/citrus_iconv.h stable/10/lib/libc/iconv/citrus_iconv_local.h stable/10/lib/libc/iconv/citrus_none.c stable/10/lib/libc/iconv/citrus_stdenc.h stable/10/lib/libc/iconv/citrus_stdenc_local.h stable/10/lib/libc/iconv/citrus_stdenc_template.h stable/10/lib/libc/iconv/iconv-internal.h stable/10/lib/libc/iconv/iconv.3 stable/10/lib/libc/iconv/iconv.c stable/10/lib/libc/iconv/iconv_compat.c stable/10/lib/libc/locale/cXXrtomb_iconv.h stable/10/lib/libc/locale/mbrtocXX_iconv.h stable/10/lib/libiconv_modules/BIG5/citrus_big5.c stable/10/lib/libiconv_modules/DECHanyu/citrus_dechanyu.c stable/10/lib/libiconv_modules/EUC/citrus_euc.c stable/10/lib/libiconv_modules/EUCTW/citrus_euctw.c stable/10/lib/libiconv_modules/GBK2K/citrus_gbk2k.c stable/10/lib/libiconv_modules/HZ/citrus_hz.c stable/10/lib/libiconv_modules/ISO2022/citrus_iso2022.c stable/10/lib/libiconv_modules/JOHAB/citrus_johab.c stable/10/lib/libiconv_modules/MSKanji/citrus_mskanji.c stable/10/lib/libiconv_modules/UES/citrus_ues.c stable/10/lib/libiconv_modules/UTF1632/citrus_utf1632.c stable/10/lib/libiconv_modules/UTF7/citrus_utf7.c stable/10/lib/libiconv_modules/UTF8/citrus_utf8.c stable/10/lib/libiconv_modules/VIQR/citrus_viqr.c stable/10/lib/libiconv_modules/ZW/citrus_zw.c stable/10/lib/libiconv_modules/iconv_none/citrus_iconv_none.c stable/10/lib/libiconv_modules/iconv_std/citrus_iconv_std.c stable/10/lib/libkiconv/xlat16_iconv.c stable/10/sys/sys/param.h stable/10/usr.bin/iconv/iconv.c Directory Properties: stable/10/ (props changed) Modified: stable/10/UPDATING == --- stable/10/UPDATING Thu Apr 30 15:48:48 2015(r282274) +++ stable/10/UPDATING Thu Apr 30 16:08:47 2015(r282275) @@ -16,6 +16,10 @@ from older versions of FreeBSD, try WITH stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. +20150430: + The const qualifier has been removed from iconv(3) to comply with + POSIX. The ports tree is aware of this from r384038 onwards. + 20141215: At svn r275807, The default linux compat kernel ABI has been adjusted to 2.6.18 in support of the linux-c6 compat ports infrastructure Modified: stable/10/bin/csh/config.h == --- stable/10/bin/csh/config.h Thu Apr 30 15:48:48 2015(r282274) +++ stable/10/bin/csh/config.h Thu Apr 30 16:08:47 2015(r282275) @@ -198,7 +198,7 @@ #define HAVE_WCWIDTH 1 /* Define as const if the declaration of iconv() needs const. */ -#define ICONV_CONST const +#define ICONV_CONST /* Support NLS. */ #define NLS 1 Modified: stable/10/bin/csh/iconv_stub.h == --- stable/10/bin/csh/iconv_stub.h Thu Apr 30 15:48:48 2015 (r282274) +++ stable/10/bin/csh/iconv_stub.h Thu Apr 30 16:08:47 2015 (r282275) @@ -30,7 +30,7 @@ #define _ICONV_H_ typedef void *iconv_t; -typedef size_t dl_iconv_t(iconv_t, const char **, size_t *, char **, size_t *); +typedef size_t dl_iconv_t(iconv_t, char **, size_t *, char **, size_t *); typedef int dl_iconv_close_t(iconv_t); extern iconv_t dl_iconv_open(const char *, const char *); Modified: stable/10/contrib/smbfs/include/netsmb/smb_lib.h == --- stable/10/contrib/smbfs/include/netsmb/smb_lib.hThu Apr 30 15:48:48 2015(r282274) +++ stable/10/contrib/smbfs/include/netsmb/smb_lib.hThu Apr 30 16:08:47 2015(r282275) @@ -191,7 +191,7 @@ int smb_ctx_readrc(struct smb_ctx *); int smb_ctx_resolve(struct smb_ctx *); int smb_ctx_setflags(struct smb_ctx *, int, int, int); -int smb_smb_open_print_file(struct smb_ctx *, int, int, const char *, smbfh*); +int smb_smb_open_print_file(struct smb_ctx *, int, int, char *, smbfh*); int smb_smb_close_print_file(struct smb_ctx *, smbfh); int smb_read(struct smb_c
svn commit: r281591 - head/bin/csh
Author: tijl Date: Thu Apr 16 07:17:00 2015 New Revision: 281591 URL: https://svnweb.freebsd.org/changeset/base/281591 Log: Fix build after r281550 when WITHOUT_ICONV is defined. Reported by: adrian MFC after:2 weeks Modified: head/bin/csh/iconv_stub.h Modified: head/bin/csh/iconv_stub.h == --- head/bin/csh/iconv_stub.h Thu Apr 16 06:23:58 2015(r281590) +++ head/bin/csh/iconv_stub.h Thu Apr 16 07:17:00 2015(r281591) @@ -30,7 +30,7 @@ #define _ICONV_H_ typedef void *iconv_t; -typedef size_t dl_iconv_t(iconv_t, const char **, size_t *, char **, size_t *); +typedef size_t dl_iconv_t(iconv_t, char **, size_t *, char **, size_t *); typedef int dl_iconv_close_t(iconv_t); extern iconv_t dl_iconv_open(const char *, const char *); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r281550 - in head: . bin/csh contrib/smbfs/include/netsmb contrib/smbfs/lib/smb include lib/libarchive lib/libc/iconv lib/libc/locale lib/libiconv_modules/BIG5 lib/libiconv_modules/DEC
On Wed, 15 Apr 2015 11:29:19 -0700 Adrian Chadd wrote: > cc1: warnings being treated as errors > /usr/home/adrian/work/freebsd/embedded/head/src/bin/csh/../../contrib/tcsh/sh.func.c: > In function 'iconv_catgets': > /usr/home/adrian/work/freebsd/embedded/head/src/bin/csh/../../contrib/tcsh/sh.func.c:2599: > warning: passing argument 2 of 'dl_iconv' from incompatible pointer > type Does "embedded" mean that WITHOUT_ICONV is defined? Can you try the attached patch?Index: bin/csh/iconv_stub.h === --- bin/csh/iconv_stub.h (revision 281561) +++ bin/csh/iconv_stub.h (working copy) @@ -30,7 +30,7 @@ #define _ICONV_H_ typedef void *iconv_t; -typedef size_t dl_iconv_t(iconv_t, const char **, size_t *, char **, size_t *); +typedef size_t dl_iconv_t(iconv_t, char **, size_t *, char **, size_t *); typedef int dl_iconv_close_t(iconv_t); extern iconv_t dl_iconv_open(const char *, const char *); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r281552 - head/sys/sys
Author: tijl Date: Wed Apr 15 09:39:52 2015 New Revision: 281552 URL: https://svnweb.freebsd.org/changeset/base/281552 Log: Point to the right location where __FreeBSD_version numbers are documented. Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h == --- head/sys/sys/param.hWed Apr 15 09:13:11 2015(r281551) +++ head/sys/sys/param.hWed Apr 15 09:39:52 2015(r281552) @@ -50,7 +50,7 @@ * there. * Currently this lives here in the doc/ repository: * - * head/en_US.ISO8859-1/books/porters-handbook/book.xml + * head/en_US.ISO8859-1/books/porters-handbook/versions/chapter.xml * * scheme is: Rxx * 'R' is in the range 0 to 4 if this is a release branch or ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r281550 - in head: . bin/csh contrib/smbfs/include/netsmb contrib/smbfs/lib/smb include lib/libarchive lib/libc/iconv lib/libc/locale lib/libiconv_modules/BIG5 lib/libiconv_modules/DECH...
Author: tijl Date: Wed Apr 15 09:09:20 2015 New Revision: 281550 URL: https://svnweb.freebsd.org/changeset/base/281550 Log: Remove the const qualifier from iconv(3) to comply with POSIX: http://pubs.opengroup.org/onlinepubs/9699919799/functions/iconv.html Adjust all code that calls iconv. PR: 199099 Exp-run by: antoine MFC after:2 weeks Modified: head/UPDATING head/bin/csh/config.h head/contrib/smbfs/include/netsmb/smb_lib.h head/contrib/smbfs/lib/smb/nls.c head/contrib/smbfs/lib/smb/print.c head/contrib/smbfs/lib/smb/rq.c head/include/iconv.h head/lib/libarchive/Makefile head/lib/libc/iconv/__iconv.c head/lib/libc/iconv/bsd_iconv.c head/lib/libc/iconv/citrus_iconv.h head/lib/libc/iconv/citrus_iconv_local.h head/lib/libc/iconv/citrus_none.c head/lib/libc/iconv/citrus_stdenc.h head/lib/libc/iconv/citrus_stdenc_local.h head/lib/libc/iconv/citrus_stdenc_template.h head/lib/libc/iconv/iconv-internal.h head/lib/libc/iconv/iconv.3 head/lib/libc/iconv/iconv.c head/lib/libc/iconv/iconv_compat.c head/lib/libc/locale/cXXrtomb_iconv.h head/lib/libc/locale/mbrtocXX_iconv.h head/lib/libiconv_modules/BIG5/citrus_big5.c head/lib/libiconv_modules/DECHanyu/citrus_dechanyu.c head/lib/libiconv_modules/EUC/citrus_euc.c head/lib/libiconv_modules/EUCTW/citrus_euctw.c head/lib/libiconv_modules/GBK2K/citrus_gbk2k.c head/lib/libiconv_modules/HZ/citrus_hz.c head/lib/libiconv_modules/ISO2022/citrus_iso2022.c head/lib/libiconv_modules/JOHAB/citrus_johab.c head/lib/libiconv_modules/MSKanji/citrus_mskanji.c head/lib/libiconv_modules/UES/citrus_ues.c head/lib/libiconv_modules/UTF1632/citrus_utf1632.c head/lib/libiconv_modules/UTF7/citrus_utf7.c head/lib/libiconv_modules/UTF8/citrus_utf8.c head/lib/libiconv_modules/VIQR/citrus_viqr.c head/lib/libiconv_modules/ZW/citrus_zw.c head/lib/libiconv_modules/iconv_none/citrus_iconv_none.c head/lib/libiconv_modules/iconv_std/citrus_iconv_std.c head/lib/libkiconv/xlat16_iconv.c head/sys/sys/param.h head/usr.bin/iconv/iconv.c Modified: head/UPDATING == --- head/UPDATING Wed Apr 15 08:16:34 2015(r281549) +++ head/UPDATING Wed Apr 15 09:09:20 2015(r281550) @@ -31,6 +31,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20150415: + The const qualifier has been removed from iconv(3) to comply with + POSIX. The ports tree is aware of this from r384038 onwards. + 20150324: From legacy ata(4) driver was removed support for SATA controllers supported by more functional drivers ahci(4), siis(4) and mvs(4). Modified: head/bin/csh/config.h == --- head/bin/csh/config.h Wed Apr 15 08:16:34 2015(r281549) +++ head/bin/csh/config.h Wed Apr 15 09:09:20 2015(r281550) @@ -198,7 +198,7 @@ #define HAVE_WCWIDTH 1 /* Define as const if the declaration of iconv() needs const. */ -#define ICONV_CONST const +#define ICONV_CONST /* Support NLS. */ #define NLS 1 Modified: head/contrib/smbfs/include/netsmb/smb_lib.h == --- head/contrib/smbfs/include/netsmb/smb_lib.h Wed Apr 15 08:16:34 2015 (r281549) +++ head/contrib/smbfs/include/netsmb/smb_lib.h Wed Apr 15 09:09:20 2015 (r281550) @@ -191,7 +191,7 @@ int smb_ctx_readrc(struct smb_ctx *); int smb_ctx_resolve(struct smb_ctx *); int smb_ctx_setflags(struct smb_ctx *, int, int, int); -int smb_smb_open_print_file(struct smb_ctx *, int, int, const char *, smbfh*); +int smb_smb_open_print_file(struct smb_ctx *, int, int, char *, smbfh*); int smb_smb_close_print_file(struct smb_ctx *, smbfh); int smb_read(struct smb_ctx *, smbfh, off_t, size_t, char *); @@ -204,8 +204,8 @@ int smb_rq_init(struct smb_ctx *, u_cha void smb_rq_done(struct smb_rq *); void smb_rq_wend(struct smb_rq *); int smb_rq_simple(struct smb_rq *); -int smb_rq_dmem(struct mbdata *, const char *, size_t); -int smb_rq_dstring(struct mbdata *, const char *); +int smb_rq_dmem(struct mbdata *, char *, size_t); +int smb_rq_dstring(struct mbdata *, char *); int smb_t2_request(struct smb_ctx *, int, int, const char *, int, void *, int, void *, int *, void *, int *, void *); @@ -246,10 +246,10 @@ extern u_char nls_lower[256], nls_upper[ int nls_setrecode(const char *, const char *); int nls_setlocale(const char *); -char* nls_str_toext(char *, const char *); -char* nls_str_toloc(char *, const char *); -void* nls_mem_toext(void *, const void *, int); -void* nls_mem_toloc(void *, const void *, int); +char* nls_str_toext(char *, char *); +char* nls_str_toloc(char *, char *); +void* nls_mem_toext(void *, void *, in