diff options
120 files changed, 786 insertions, 1716 deletions
diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 9899491..f9bf463 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -203,7 +203,7 @@ OLD_FILES+=usr/share/man/man9/rman_await_resource.9.gz # 20160517: ReiserFS removed OLD_FILES+=usr/share/man/man5/reiserfs.5.gz # 20160430: kvm_getfiles(3) removed from kvm(3) -OLD_LIBS+=usr/lib/libkvm.so.6 +OLD_LIBS+=lib/libkvm.so.6 OLD_FILES+=usr/share/man/man3/kvm_getfiles.3.gz # 20160423: remove mroute6d OLD_FILES+=etc/rc.d/mroute6d diff --git a/cddl/contrib/opensolaris/cmd/zpool/zpool.8 b/cddl/contrib/opensolaris/cmd/zpool/zpool.8 index a8463cf..c09448a 100644 --- a/cddl/contrib/opensolaris/cmd/zpool/zpool.8 +++ b/cddl/contrib/opensolaris/cmd/zpool/zpool.8 @@ -465,6 +465,15 @@ place in the configuration, and is removed from the spare list of all active pools. .Pp Spares cannot replace log devices. +.Pp +This feature requires a userland helper. +FreeBSD provides +.Xr zfsd 8 +for this purpose. +It must be manually enabled by adding +.Va zfsd_enable="YES" +to +.Pa /etc/rc.conf . .Ss Intent Log The .Tn ZFS @@ -2023,7 +2032,8 @@ Discarded approximately 29 seconds of transactions. .El .Sh SEE ALSO .Xr zpool-features 7 , -.Xr zfs 8 +.Xr zfs 8 , +.Xr zfsd 8 .Sh AUTHORS This manual page is a .Xr mdoc 7 @@ -2040,9 +2050,3 @@ The .Xr mdoc 7 implementation of this manual page was initially written by .An Martin Matuska Aq mm@FreeBSD.org . -.Sh CAVEATS -The -.Cm spare -feature requires a utility to detect zpool degradation and initiate -disk replacement within the zpool. -FreeBSD does not provide such a utility at this time. diff --git a/etc/rc.d/jail b/etc/rc.d/jail index a42e450..51ecf77 100755 --- a/etc/rc.d/jail +++ b/etc/rc.d/jail @@ -440,7 +440,7 @@ jail_status() jail_start() { - local _j _jv _jid _jl _id _name + local _j _jv _jid _id _name if [ $# = 0 ]; then return @@ -451,6 +451,9 @@ jail_start() command=$jail_program rc_flags=$jail_flags command_args="-f $jail_conf -c" + if ! checkyesno jail_parallel_start; then + command_args="$command_args -p1" + fi _tmp=`mktemp -t jail` || exit 3 if $command $rc_flags $command_args >> $_tmp 2>&1; then $jail_jls jid name | while read _id _name; do @@ -458,7 +461,7 @@ jail_start() echo $_id > /var/run/jail_${_name}.id done else - tail -1 $_tmp + cat $_tmp fi rm -f $_tmp echo '.' @@ -470,29 +473,30 @@ jail_start() # Start jails in parallel and then check jail id when # jail_parallel_start is YES. # - _jl= for _j in $@; do _j=$(echo $_j | tr /. _) _jv=$(echo -n $_j | tr -c '[:alnum:]' _) parse_options $_j $_jv || continue - _jl="$_jl $_j" eval rc_flags=\${jail_${_jv}_flags:-$jail_flags} eval command=\${jail_${_jv}_program:-$jail_program} command_args="-i -f $_conf -c $_j" - $command $rc_flags $command_args \ - >/dev/null 2>&1 </dev/null & - done - sleep 1 - for _j in $_jl; do - echo -n " ${_hostname:-${_j}}" - if _jid=$($jail_jls -j $_j jid); then - echo "$_jid" > /var/run/jail_${_j}.id - else - echo " cannot start jail " \ - "\"${_hostname:-${_j}}\": " - fi + ( + _tmp=`mktemp -t jail_${_j}` || exit 3 + if $command $rc_flags $command_args \ + >> $_tmp 2>&1 </dev/null; then + echo -n " ${_hostname:-${_j}}" + _jid=$($jail_jls -j $_j jid) + echo $_jid > /var/run/jail_${_j}.id + else + echo " cannot start jail " \ + "\"${_hostname:-${_j}}\": " + cat $_tmp + fi + rm -f $_tmp + ) & done + wait else # # Start jails one-by-one when jail_parallel_start is NO. @@ -544,7 +548,7 @@ jail_stop() _tmp=`mktemp -t jail` || exit 3 $command $rc_flags $command_args $_j >> $_tmp 2>&1 if $jail_jls -j $_j > /dev/null 2>&1; then - tail -1 $_tmp + cat $_tmp else rm -f /var/run/jail_${_j}.id fi @@ -567,7 +571,7 @@ jail_stop() _tmp=`mktemp -t jail` || exit 3 $command -q -f $_conf -r $_j >> $_tmp 2>&1 if $jail_jls -j $_j > /dev/null 2>&1; then - tail -1 $_tmp + cat $_tmp else rm -f /var/run/jail_${_j}.id fi diff --git a/release/Makefile b/release/Makefile index 60a86c7..9be27b8 100644 --- a/release/Makefile +++ b/release/Makefile @@ -187,7 +187,6 @@ disc1: packagesystem ln -fs /tmp/bsdinstall_etc/resolv.conf ${.TARGET}/etc/resolv.conf echo sendmail_enable=\"NONE\" > ${.TARGET}/etc/rc.conf echo hostid_enable=\"NO\" >> ${.TARGET}/etc/rc.conf - echo debug.witness.trace=0 >> ${.TARGET}/etc/sysctl.conf echo vfs.mountroot.timeout=\"10\" >> ${.TARGET}/boot/loader.conf cp ${.CURDIR}/rc.local ${.TARGET}/etc touch ${.TARGET} @@ -213,7 +212,6 @@ bootonly: packagesystem ln -fs /tmp/bsdinstall_etc/resolv.conf ${.TARGET}/etc/resolv.conf echo sendmail_enable=\"NONE\" > ${.TARGET}/etc/rc.conf echo hostid_enable=\"NO\" >> ${.TARGET}/etc/rc.conf - echo debug.witness.trace=0 >> ${.TARGET}/etc/sysctl.conf echo vfs.mountroot.timeout=\"10\" >> ${.TARGET}/boot/loader.conf cp ${.CURDIR}/rc.local ${.TARGET}/etc @@ -236,7 +234,6 @@ dvd: packagesystem ln -fs /tmp/bsdinstall_etc/resolv.conf ${.TARGET}/etc/resolv.conf echo sendmail_enable=\"NONE\" > ${.TARGET}/etc/rc.conf echo hostid_enable=\"NO\" >> ${.TARGET}/etc/rc.conf - echo debug.witness.trace=0 >> ${.TARGET}/etc/sysctl.conf echo vfs.mountroot.timeout=\"10\" >> ${.TARGET}/boot/loader.conf cp ${.CURDIR}/rc.local ${.TARGET}/etc touch ${.TARGET} diff --git a/sbin/ipfw/dummynet.c b/sbin/ipfw/dummynet.c index ca2dfc8..20c563b 100644 --- a/sbin/ipfw/dummynet.c +++ b/sbin/ipfw/dummynet.c @@ -612,6 +612,7 @@ list_pipes(struct dn_id *oid, struct dn_id *end) } list_flow(&bp, (struct dn_flow *)oid); printf("%s\n", bp.buf); + bp_flush(&bp); break; case DN_LINK: { diff --git a/sbin/ipfw/ipfw2.h b/sbin/ipfw/ipfw2.h index 7ea2083..b7f8c0b 100644 --- a/sbin/ipfw/ipfw2.h +++ b/sbin/ipfw/ipfw2.h @@ -371,6 +371,9 @@ void fill_unreach6_code(u_short *codep, char *str); void fill_icmp6types(struct _ipfw_insn_icmp6 *cmd, char *av, int cblen); int fill_ext6hdr(struct _ipfw_insn *cmd, char *av); +/* ipfw2.c */ +void bp_flush(struct buf_pr *b); + /* tables.c */ struct _ipfw_obj_ctlv; int table_check_name(const char *tablename); diff --git a/sys/amd64/cloudabi64/cloudabi64_sysvec.c b/sys/amd64/cloudabi64/cloudabi64_sysvec.c index f0aeb2e..08d85a2 100644 --- a/sys/amd64/cloudabi64/cloudabi64_sysvec.c +++ b/sys/amd64/cloudabi64/cloudabi64_sysvec.c @@ -96,6 +96,7 @@ cloudabi64_fetch_syscall_args(struct thread *td, struct syscall_args *sa) if (sa->code >= CLOUDABI64_SYS_MAXSYSCALL) return (ENOSYS); sa->callp = &cloudabi64_sysent[sa->code]; + sa->narg = sa->callp->sy_narg; /* Fetch system call arguments. */ sa->args[0] = frame->tf_rdi; diff --git a/sys/amd64/conf/GENERIC-NODEBUG b/sys/amd64/conf/GENERIC-NODEBUG deleted file mode 100644 index be8e6af..0000000 --- a/sys/amd64/conf/GENERIC-NODEBUG +++ /dev/null @@ -1,38 +0,0 @@ -# -# GENERIC-NODEBUG -- WITNESS and INVARIANTS free kernel configuration file -# for FreeBSD/amd64 -# -# This configuration file removes several debugging options, including -# WITNESS and INVARIANTS checking, which are known to have significant -# performance impact on running systems. When benchmarking new features -# this kernel should be used instead of the standard GENERIC. -# This kernel configuration should never appear outside of the HEAD -# of the FreeBSD tree. -# -# For more information on this file, please read the config(5) manual page, -# and/or the handbook section on Kernel Configuration Files: -# -# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html -# -# The handbook is also available locally in /usr/share/doc/handbook -# if you've installed the doc distribution, otherwise always see the -# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the -# latest information. -# -# An exhaustive list of options and more detailed explanations of the -# device lines is also present in the ../../conf/NOTES and NOTES files. -# If you are in doubt as to the purpose or necessity of a line, check first -# in NOTES. -# -# $FreeBSD$ - -include GENERIC - -ident GENERIC-NODEBUG - -nooptions INVARIANTS -nooptions INVARIANT_SUPPORT -nooptions WITNESS -nooptions WITNESS_SKIPSPIN -nooptions DEADLKRES - diff --git a/sys/amd64/include/intr_machdep.h b/sys/amd64/include/intr_machdep.h index 8de839b..6367570 100644 --- a/sys/amd64/include/intr_machdep.h +++ b/sys/amd64/include/intr_machdep.h @@ -149,6 +149,8 @@ extern cpuset_t intr_cpus; extern struct mtx icu_lock; extern int elcr_found; +extern int msix_disable_migration; + #ifndef DEV_ATPIC void atpic_reset(void); #endif diff --git a/sys/amd64/linux/linux.h b/sys/amd64/linux/linux.h index 639499a..b30568f 100644 --- a/sys/amd64/linux/linux.h +++ b/sys/amd64/linux/linux.h @@ -139,13 +139,6 @@ struct l_rlimit { l_ulong rlim_max; }; -/* mmap options */ -#define LINUX_MAP_SHARED 0x0001 -#define LINUX_MAP_PRIVATE 0x0002 -#define LINUX_MAP_FIXED 0x0010 -#define LINUX_MAP_ANON 0x0020 -#define LINUX_MAP_GROWSDOWN 0x0100 - /* * stat family of syscalls */ diff --git a/sys/amd64/linux/linux_machdep.c b/sys/amd64/linux/linux_machdep.c index 0459ba7..80c48aa 100644 --- a/sys/amd64/linux/linux_machdep.c +++ b/sys/amd64/linux/linux_machdep.c @@ -83,6 +83,7 @@ __FBSDID("$FreeBSD$"); #include <compat/linux/linux_ipc.h> #include <compat/linux/linux_file.h> #include <compat/linux/linux_misc.h> +#include <compat/linux/linux_mmap.h> #include <compat/linux/linux_signal.h> #include <compat/linux/linux_util.h> #include <compat/linux/linux_emul.h> @@ -122,181 +123,19 @@ linux_set_upcall_kse(struct thread *td, register_t stack) return (0); } -#define STACK_SIZE (2 * 1024 * 1024) -#define GUARD_SIZE (4 * PAGE_SIZE) - int linux_mmap2(struct thread *td, struct linux_mmap2_args *args) { - struct proc *p = td->td_proc; - struct mmap_args /* { - caddr_t addr; - size_t len; - int prot; - int flags; - int fd; - long pad; - off_t pos; - } */ bsd_args; - int error; - struct file *fp; - cap_rights_t rights; - - LINUX_CTR6(mmap2, "0x%lx, %ld, %ld, 0x%08lx, %ld, 0x%lx", - args->addr, args->len, args->prot, - args->flags, args->fd, args->pgoff); - - error = 0; - bsd_args.flags = 0; - fp = NULL; - - /* - * Linux mmap(2): - * You must specify exactly one of MAP_SHARED and MAP_PRIVATE - */ - if (! ((args->flags & LINUX_MAP_SHARED) ^ - (args->flags & LINUX_MAP_PRIVATE))) - return (EINVAL); - - if (args->flags & LINUX_MAP_SHARED) - bsd_args.flags |= MAP_SHARED; - if (args->flags & LINUX_MAP_PRIVATE) - bsd_args.flags |= MAP_PRIVATE; - if (args->flags & LINUX_MAP_FIXED) - bsd_args.flags |= MAP_FIXED; - if (args->flags & LINUX_MAP_ANON) - bsd_args.flags |= MAP_ANON; - else - bsd_args.flags |= MAP_NOSYNC; - if (args->flags & LINUX_MAP_GROWSDOWN) - bsd_args.flags |= MAP_STACK; - /* - * PROT_READ, PROT_WRITE, or PROT_EXEC implies PROT_READ and PROT_EXEC - * on Linux/i386. We do this to ensure maximum compatibility. - * Linux/ia64 does the same in i386 emulation mode. - */ - bsd_args.prot = args->prot; - if (bsd_args.prot & (PROT_READ | PROT_WRITE | PROT_EXEC)) - bsd_args.prot |= PROT_READ | PROT_EXEC; - - /* Linux does not check file descriptor when MAP_ANONYMOUS is set. */ - bsd_args.fd = (bsd_args.flags & MAP_ANON) ? -1 : args->fd; - if (bsd_args.fd != -1) { - /* - * Linux follows Solaris mmap(2) description: - * The file descriptor fildes is opened with - * read permission, regardless of the - * protection options specified. - */ - - error = fget(td, bsd_args.fd, - cap_rights_init(&rights, CAP_MMAP), &fp); - if (error != 0 ) - return (error); - if (fp->f_type != DTYPE_VNODE) { - fdrop(fp, td); - return (EINVAL); - } - - /* Linux mmap() just fails for O_WRONLY files */ - if (!(fp->f_flag & FREAD)) { - fdrop(fp, td); - return (EACCES); - } - - fdrop(fp, td); - } - - if (args->flags & LINUX_MAP_GROWSDOWN) { - /* - * The Linux MAP_GROWSDOWN option does not limit auto - * growth of the region. Linux mmap with this option - * takes as addr the initial BOS, and as len, the initial - * region size. It can then grow down from addr without - * limit. However, Linux threads has an implicit internal - * limit to stack size of STACK_SIZE. Its just not - * enforced explicitly in Linux. But, here we impose - * a limit of (STACK_SIZE - GUARD_SIZE) on the stack - * region, since we can do this with our mmap. - * - * Our mmap with MAP_STACK takes addr as the maximum - * downsize limit on BOS, and as len the max size of - * the region. It then maps the top SGROWSIZ bytes, - * and auto grows the region down, up to the limit - * in addr. - * - * If we don't use the MAP_STACK option, the effect - * of this code is to allocate a stack region of a - * fixed size of (STACK_SIZE - GUARD_SIZE). - */ - - if ((caddr_t)PTRIN(args->addr) + args->len > - p->p_vmspace->vm_maxsaddr) { - /* - * Some Linux apps will attempt to mmap - * thread stacks near the top of their - * address space. If their TOS is greater - * than vm_maxsaddr, vm_map_growstack() - * will confuse the thread stack with the - * process stack and deliver a SEGV if they - * attempt to grow the thread stack past their - * current stacksize rlimit. To avoid this, - * adjust vm_maxsaddr upwards to reflect - * the current stacksize rlimit rather - * than the maximum possible stacksize. - * It would be better to adjust the - * mmap'ed region, but some apps do not check - * mmap's return value. - */ - PROC_LOCK(p); - p->p_vmspace->vm_maxsaddr = (char *)USRSTACK - - lim_cur_proc(p, RLIMIT_STACK); - PROC_UNLOCK(p); - } - - /* - * This gives us our maximum stack size and a new BOS. - * If we're using VM_STACK, then mmap will just map - * the top SGROWSIZ bytes, and let the stack grow down - * to the limit at BOS. If we're not using VM_STACK - * we map the full stack, since we don't have a way - * to autogrow it. - */ - if (args->len > STACK_SIZE - GUARD_SIZE) { - bsd_args.addr = (caddr_t)PTRIN(args->addr); - bsd_args.len = args->len; - } else { - bsd_args.addr = (caddr_t)PTRIN(args->addr) - - (STACK_SIZE - GUARD_SIZE - args->len); - bsd_args.len = STACK_SIZE - GUARD_SIZE; - } - } else { - bsd_args.addr = (caddr_t)PTRIN(args->addr); - bsd_args.len = args->len; - } - bsd_args.pos = (off_t)args->pgoff; - - error = sys_mmap(td, &bsd_args); - - LINUX_CTR2(mmap2, "return: %d (%p)", - error, td->td_retval[0]); - return (error); + return (linux_mmap_common(td, PTROUT(args->addr), args->len, args->prot, + args->flags, args->fd, args->pgoff)); } int linux_mprotect(struct thread *td, struct linux_mprotect_args *uap) { - struct mprotect_args bsd_args; - - LINUX_CTR(mprotect); - bsd_args.addr = uap->addr; - bsd_args.len = uap->len; - bsd_args.prot = uap->prot; - if (bsd_args.prot & (PROT_READ | PROT_WRITE | PROT_EXEC)) - bsd_args.prot |= PROT_READ | PROT_EXEC; - return (sys_mprotect(td, &bsd_args)); + return (linux_mprotect_common(td, PTROUT(uap->addr), uap->len, uap->prot)); } int diff --git a/sys/amd64/linux/linux_proto.h b/sys/amd64/linux/linux_proto.h index 37e67e6..9af30c8 100644 --- a/sys/amd64/linux/linux_proto.h +++ b/sys/amd64/linux/linux_proto.h @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux/syscalls.master 300359 2016-05-21 08:01:14Z dchagin + * created from FreeBSD: head/sys/amd64/linux/syscalls.master 302515 2016-07-10 08:15:50Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -499,7 +499,7 @@ struct linux_mknod_args { char dev_l_[PADL_(l_dev_t)]; l_dev_t dev; char dev_r_[PADR_(l_dev_t)]; }; struct linux_personality_args { - char per_l_[PADL_(l_ulong)]; l_ulong per; char per_r_[PADR_(l_ulong)]; + char per_l_[PADL_(l_uint)]; l_uint per; char per_r_[PADR_(l_uint)]; }; struct linux_ustat_args { char dev_l_[PADL_(l_dev_t)]; l_dev_t dev; char dev_r_[PADR_(l_dev_t)]; @@ -1397,6 +1397,13 @@ int linux_finit_module(struct thread *, struct linux_finit_module_args *); #endif /* COMPAT_FREEBSD7 */ + +#ifdef COMPAT_FREEBSD10 + +#define nosys linux_nosys + +#endif /* COMPAT_FREEBSD10 */ + #define LINUX_SYS_AUE_linux_open AUE_OPEN_RWTC #define LINUX_SYS_AUE_linux_newstat AUE_STAT #define LINUX_SYS_AUE_linux_newfstat AUE_FSTAT diff --git a/sys/amd64/linux/linux_syscall.h b/sys/amd64/linux/linux_syscall.h index 4f32235..28cbf8b 100644 --- a/sys/amd64/linux/linux_syscall.h +++ b/sys/amd64/linux/linux_syscall.h @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux/syscalls.master 300359 2016-05-21 08:01:14Z dchagin + * created from FreeBSD: head/sys/amd64/linux/syscalls.master 302515 2016-07-10 08:15:50Z dchagin */ #define LINUX_SYS_read 0 diff --git a/sys/amd64/linux/linux_syscalls.c b/sys/amd64/linux/linux_syscalls.c index 447ba20..ccada20 100644 --- a/sys/amd64/linux/linux_syscalls.c +++ b/sys/amd64/linux/linux_syscalls.c @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux/syscalls.master 300359 2016-05-21 08:01:14Z dchagin + * created from FreeBSD: head/sys/amd64/linux/syscalls.master 302515 2016-07-10 08:15:50Z dchagin */ const char *linux_syscallnames[] = { diff --git a/sys/amd64/linux/linux_sysent.c b/sys/amd64/linux/linux_sysent.c index f2ca9fd..edf4fe6 100644 --- a/sys/amd64/linux/linux_sysent.c +++ b/sys/amd64/linux/linux_sysent.c @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux/syscalls.master 300359 2016-05-21 08:01:14Z dchagin + * created from FreeBSD: head/sys/amd64/linux/syscalls.master 302515 2016-07-10 08:15:50Z dchagin */ #include <sys/param.h> diff --git a/sys/amd64/linux/linux_systrace_args.c b/sys/amd64/linux/linux_systrace_args.c index 320dc35..db26824 100644 --- a/sys/amd64/linux/linux_systrace_args.c +++ b/sys/amd64/linux/linux_systrace_args.c @@ -1120,7 +1120,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* linux_personality */ case 135: { struct linux_personality_args *p = params; - iarg[0] = p->per; /* l_ulong */ + iarg[0] = p->per; /* l_uint */ *n_args = 1; break; } @@ -4112,7 +4112,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) case 135: switch(ndx) { case 0: - p = "l_ulong"; + p = "l_uint"; break; default: break; diff --git a/sys/amd64/linux/syscalls.master b/sys/amd64/linux/syscalls.master index 5ed098a..d4544f8 100644 --- a/sys/amd64/linux/syscalls.master +++ b/sys/amd64/linux/syscalls.master @@ -270,7 +270,7 @@ 133 AUE_MKNOD STD { int linux_mknod(char *path, l_int mode, \ l_dev_t dev); } 134 AUE_USELIB UNIMPL uselib -135 AUE_PERSONALITY STD { int linux_personality(l_ulong per); } +135 AUE_PERSONALITY STD { int linux_personality(l_uint per); } 136 AUE_NULL STD { int linux_ustat(l_dev_t dev, \ struct l_ustat *ubuf); } 137 AUE_STATFS STD { int linux_statfs(char *path, \ diff --git a/sys/amd64/linux32/linux.h b/sys/amd64/linux32/linux.h index 02d12f5..97da878 100644 --- a/sys/amd64/linux32/linux.h +++ b/sys/amd64/linux32/linux.h @@ -165,13 +165,6 @@ struct l_rusage { l_long ru_nivcsw; } __packed; -/* mmap options */ -#define LINUX_MAP_SHARED 0x0001 -#define LINUX_MAP_PRIVATE 0x0002 -#define LINUX_MAP_FIXED 0x0010 -#define LINUX_MAP_ANON 0x0020 -#define LINUX_MAP_GROWSDOWN 0x0100 - struct l_mmap_argv { l_uintptr_t addr; l_size_t len; diff --git a/sys/amd64/linux32/linux32_machdep.c b/sys/amd64/linux32/linux32_machdep.c index 25f023c..187ec15 100644 --- a/sys/amd64/linux32/linux32_machdep.c +++ b/sys/amd64/linux32/linux32_machdep.c @@ -70,6 +70,7 @@ __FBSDID("$FreeBSD$"); #include <amd64/linux32/linux32_proto.h> #include <compat/linux/linux_ipc.h> #include <compat/linux/linux_misc.h> +#include <compat/linux/linux_mmap.h> #include <compat/linux/linux_signal.h> #include <compat/linux/linux_util.h> #include <compat/linux/linux_emul.h> @@ -84,9 +85,6 @@ struct l_old_select_argv { l_uintptr_t timeout; } __packed; -static int linux_mmap_common(struct thread *td, l_uintptr_t addr, - l_size_t len, l_int prot, l_int flags, l_int fd, - l_loff_t pos); static void bsd_to_linux_rusage(struct rusage *ru, struct l_rusage *lru) @@ -448,9 +446,6 @@ linux_set_upcall_kse(struct thread *td, register_t stack) return (0); } -#define STACK_SIZE (2 * 1024 * 1024) -#define GUARD_SIZE (4 * PAGE_SIZE) - int linux_mmap2(struct thread *td, struct linux_mmap2_args *args) { @@ -489,184 +484,11 @@ linux_mmap(struct thread *td, struct linux_mmap_args *args) (uint32_t)linux_args.pgoff)); } -static int -linux_mmap_common(struct thread *td, l_uintptr_t addr, l_size_t len, l_int prot, - l_int flags, l_int fd, l_loff_t pos) -{ - struct proc *p = td->td_proc; - struct mmap_args /* { - caddr_t addr; - size_t len; - int prot; - int flags; - int fd; - long pad; - off_t pos; - } */ bsd_args; - int error; - struct file *fp; - cap_rights_t rights; - - error = 0; - bsd_args.flags = 0; - fp = NULL; - - /* - * Linux mmap(2): - * You must specify exactly one of MAP_SHARED and MAP_PRIVATE - */ - if (!((flags & LINUX_MAP_SHARED) ^ (flags & LINUX_MAP_PRIVATE))) - return (EINVAL); - - if (flags & LINUX_MAP_SHARED) - bsd_args.flags |= MAP_SHARED; - if (flags & LINUX_MAP_PRIVATE) - bsd_args.flags |= MAP_PRIVATE; - if (flags & LINUX_MAP_FIXED) - bsd_args.flags |= MAP_FIXED; - if (flags & LINUX_MAP_ANON) { - /* Enforce pos to be on page boundary, then ignore. */ - if ((pos & PAGE_MASK) != 0) - return (EINVAL); - pos = 0; - bsd_args.flags |= MAP_ANON; - } else - bsd_args.flags |= MAP_NOSYNC; - if (flags & LINUX_MAP_GROWSDOWN) - bsd_args.flags |= MAP_STACK; - - /* - * PROT_READ, PROT_WRITE, or PROT_EXEC implies PROT_READ and PROT_EXEC - * on Linux/i386. We do this to ensure maximum compatibility. - * Linux/ia64 does the same in i386 emulation mode. - */ - bsd_args.prot = prot; - if (bsd_args.prot & (PROT_READ | PROT_WRITE | PROT_EXEC)) - bsd_args.prot |= PROT_READ | PROT_EXEC; - - /* Linux does not check file descriptor when MAP_ANONYMOUS is set. */ - bsd_args.fd = (bsd_args.flags & MAP_ANON) ? -1 : fd; - if (bsd_args.fd != -1) { - /* - * Linux follows Solaris mmap(2) description: - * The file descriptor fildes is opened with - * read permission, regardless of the - * protection options specified. - */ - - error = fget(td, bsd_args.fd, - cap_rights_init(&rights, CAP_MMAP), &fp); - if (error != 0) - return (error); - if (fp->f_type != DTYPE_VNODE) { - fdrop(fp, td); - return (EINVAL); - } - - /* Linux mmap() just fails for O_WRONLY files */ - if (!(fp->f_flag & FREAD)) { - fdrop(fp, td); - return (EACCES); - } - - fdrop(fp, td); - } - - if (flags & LINUX_MAP_GROWSDOWN) { - /* - * The Linux MAP_GROWSDOWN option does not limit auto - * growth of the region. Linux mmap with this option - * takes as addr the initial BOS, and as len, the initial - * region size. It can then grow down from addr without - * limit. However, Linux threads has an implicit internal - * limit to stack size of STACK_SIZE. Its just not - * enforced explicitly in Linux. But, here we impose - * a limit of (STACK_SIZE - GUARD_SIZE) on the stack - * region, since we can do this with our mmap. - * - * Our mmap with MAP_STACK takes addr as the maximum - * downsize limit on BOS, and as len the max size of - * the region. It then maps the top SGROWSIZ bytes, - * and auto grows the region down, up to the limit - * in addr. - * - * If we don't use the MAP_STACK option, the effect - * of this code is to allocate a stack region of a - * fixed size of (STACK_SIZE - GUARD_SIZE). - */ - - if ((caddr_t)PTRIN(addr) + len > p->p_vmspace->vm_maxsaddr) { - /* - * Some Linux apps will attempt to mmap - * thread stacks near the top of their - * address space. If their TOS is greater - * than vm_maxsaddr, vm_map_growstack() - * will confuse the thread stack with the - * process stack and deliver a SEGV if they - * attempt to grow the thread stack past their - * current stacksize rlimit. To avoid this, - * adjust vm_maxsaddr upwards to reflect - * the current stacksize rlimit rather - * than the maximum possible stacksize. - * It would be better to adjust the - * mmap'ed region, but some apps do not check - * mmap's return value. - */ - PROC_LOCK(p); - p->p_vmspace->vm_maxsaddr = (char *)LINUX32_USRSTACK - - lim_cur_proc(p, RLIMIT_STACK); - PROC_UNLOCK(p); - } - - /* - * This gives us our maximum stack size and a new BOS. - * If we're using VM_STACK, then mmap will just map - * the top SGROWSIZ bytes, and let the stack grow down - * to the limit at BOS. If we're not using VM_STACK - * we map the full stack, since we don't have a way - * to autogrow it. - */ - if (len > STACK_SIZE - GUARD_SIZE) { - bsd_args.addr = (caddr_t)PTRIN(addr); - bsd_args.len = len; - } else { - bsd_args.addr = (caddr_t)PTRIN(addr) - - (STACK_SIZE - GUARD_SIZE - len); - bsd_args.len = STACK_SIZE - GUARD_SIZE; - } - } else { - bsd_args.addr = (caddr_t)PTRIN(addr); - bsd_args.len = len; - } - bsd_args.pos = pos; - -#ifdef DEBUG - if (ldebug(mmap)) - printf("-> %s(%p, %d, %d, 0x%08x, %d, 0x%x)\n", - __func__, - (void *)bsd_args.addr, (int)bsd_args.len, bsd_args.prot, - bsd_args.flags, bsd_args.fd, (int)bsd_args.pos); -#endif - error = sys_mmap(td, &bsd_args); -#ifdef DEBUG - if (ldebug(mmap)) - printf("-> %s() return: 0x%x (0x%08x)\n", - __func__, error, (u_int)td->td_retval[0]); -#endif - return (error); -} - int linux_mprotect(struct thread *td, struct linux_mprotect_args *uap) { - struct mprotect_args bsd_args; - - bsd_args.addr = uap->addr; - bsd_args.len = uap->len; - bsd_args.prot = uap->prot; - if (bsd_args.prot & (PROT_READ | PROT_WRITE | PROT_EXEC)) - bsd_args.prot |= PROT_READ | PROT_EXEC; - return (sys_mprotect(td, &bsd_args)); + + return (linux_mprotect_common(td, PTROUT(uap->addr), uap->len, uap->prot)); } int diff --git a/sys/amd64/linux32/linux32_proto.h b/sys/amd64/linux32/linux32_proto.h index 29f7d3f..35830ee 100644 --- a/sys/amd64/linux32/linux32_proto.h +++ b/sys/amd64/linux32/linux32_proto.h @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 300359 2016-05-21 08:01:14Z dchagin + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 302515 2016-07-10 08:15:50Z dchagin */ #ifndef _LINUX32_SYSPROTO_H_ @@ -427,7 +427,7 @@ struct linux_sysfs_args { char arg2_l_[PADL_(l_ulong)]; l_ulong arg2; char arg2_r_[PADR_(l_ulong)]; }; struct linux_personality_args { - char per_l_[PADL_(l_ulong)]; l_ulong per; char per_r_[PADR_(l_ulong)]; + char per_l_[PADL_(l_uint)]; l_uint per; char per_r_[PADR_(l_uint)]; }; struct linux_setfsuid16_args { char uid_l_[PADL_(l_uid16_t)]; l_uid16_t uid; char uid_r_[PADR_(l_uid16_t)]; @@ -1466,6 +1466,13 @@ int linux_process_vm_writev(struct thread *, struct linux_process_vm_writev_args #endif /* COMPAT_FREEBSD7 */ + +#ifdef COMPAT_FREEBSD10 + +#define nosys linux_nosys + +#endif /* COMPAT_FREEBSD10 */ + #define LINUX32_SYS_AUE_linux_exit AUE_EXIT #define LINUX32_SYS_AUE_linux_fork AUE_FORK #define LINUX32_SYS_AUE_linux_open AUE_OPEN_RWTC diff --git a/sys/amd64/linux32/linux32_syscall.h b/sys/amd64/linux32/linux32_syscall.h index d6ab9cd..862520a 100644 --- a/sys/amd64/linux32/linux32_syscall.h +++ b/sys/amd64/linux32/linux32_syscall.h @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 300359 2016-05-21 08:01:14Z dchagin + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 302515 2016-07-10 08:15:50Z dchagin */ #define LINUX32_SYS_linux_exit 1 diff --git a/sys/amd64/linux32/linux32_syscalls.c b/sys/amd64/linux32/linux32_syscalls.c index 3d23c74..d05c4a0 100644 --- a/sys/amd64/linux32/linux32_syscalls.c +++ b/sys/amd64/linux32/linux32_syscalls.c @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 300359 2016-05-21 08:01:14Z dchagin + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 302515 2016-07-10 08:15:50Z dchagin */ const char *linux32_syscallnames[] = { diff --git a/sys/amd64/linux32/linux32_sysent.c b/sys/amd64/linux32/linux32_sysent.c index d6f31e2..73ce67a 100644 --- a/sys/amd64/linux32/linux32_sysent.c +++ b/sys/amd64/linux32/linux32_sysent.c @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 300359 2016-05-21 08:01:14Z dchagin + * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 302515 2016-07-10 08:15:50Z dchagin */ #include "opt_compat.h" diff --git a/sys/amd64/linux32/linux32_systrace_args.c b/sys/amd64/linux32/linux32_systrace_args.c index cabfab7..f3bde85 100644 --- a/sys/amd64/linux32/linux32_systrace_args.c +++ b/sys/amd64/linux32/linux32_systrace_args.c @@ -910,7 +910,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* linux_personality */ case 136: { struct linux_personality_args *p = params; - iarg[0] = p->per; /* l_ulong */ + iarg[0] = p->per; /* l_uint */ *n_args = 1; break; } @@ -3715,7 +3715,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) case 136: switch(ndx) { case 0: - p = "l_ulong"; + p = "l_uint"; break; default: break; diff --git a/sys/amd64/linux32/syscalls.master b/sys/amd64/linux32/syscalls.master index 79cd2c8..20aa3c4 100644 --- a/sys/amd64/linux32/syscalls.master +++ b/sys/amd64/linux32/syscalls.master @@ -238,7 +238,7 @@ 134 AUE_BDFLUSH STD { int linux_bdflush(void); } 135 AUE_NULL STD { int linux_sysfs(l_int option, \ l_ulong arg1, l_ulong arg2); } -136 AUE_PERSONALITY STD { int linux_personality(l_ulong per); } +136 AUE_PERSONALITY STD { int linux_personality(l_uint per); } 137 AUE_NULL UNIMPL afs_syscall 138 AUE_SETFSUID STD { int linux_setfsuid16(l_uid16_t uid); } 139 AUE_SETFSGID STD { int linux_setfsgid16(l_gid16_t gid); } diff --git a/sys/arm/conf/A10 b/sys/arm/conf/A10 index 6adad1d..8d5bb3f 100644 --- a/sys/arm/conf/A10 +++ b/sys/arm/conf/A10 @@ -32,21 +32,6 @@ options SCHED_4BSD # 4BSD scheduler options PLATFORM options MULTIDELAY -# Debugging for use in -current -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options ALT_BREAK_TO_DEBUGGER -#options VERBOSE_SYSINIT # Enable verbose sysinit messages -options KDB # Enable kernel debugger support -# For minimum debugger support (stable branch) use: -#options KDB_TRACE # Print a stack trace for a panic -# For full debugger support use this instead: -options DDB # Enable the kernel debugger -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS # Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options DIAGNOSTIC - # NFS root from boopt/dhcp #options BOOTP #options BOOTP_NFSROOT @@ -94,9 +79,6 @@ device pass # Passthrough device (direct ATA/SCSI access) # USB support options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. device usb -options USB_DEBUG -#options USB_REQ_DEBUG -#options USB_VERBOSE #device uhci device ohci device ehci diff --git a/sys/arm/conf/ALLWINNER b/sys/arm/conf/ALLWINNER index e68ebd9..b3258e5 100644 --- a/sys/arm/conf/ALLWINNER +++ b/sys/arm/conf/ALLWINNER @@ -39,21 +39,6 @@ options PLATFORM options PLATFORM_SMP options MULTIDELAY -# Debugging for use in -current -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options ALT_BREAK_TO_DEBUGGER -#options VERBOSE_SYSINIT # Enable verbose sysinit messages -options KDB # Enable kernel debugger support -# For minimum debugger support (stable branch) use: -#options KDB_TRACE # Print a stack trace for a panic -# For full debugger support use this instead: -options DDB # Enable the kernel debugger -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS # Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options DIAGNOSTIC - # NFS root from boopt/dhcp #options BOOTP #options BOOTP_NFSROOT @@ -109,9 +94,6 @@ device pass # Passthrough device (direct ATA/SCSI access) # USB support options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. device usb -options USB_DEBUG -#options USB_REQ_DEBUG -#options USB_VERBOSE #device uhci device ohci device ehci diff --git a/sys/arm/conf/ALPINE b/sys/arm/conf/ALPINE index 55e4468d3..4160f95 100644 --- a/sys/arm/conf/ALPINE +++ b/sys/arm/conf/ALPINE @@ -29,12 +29,6 @@ options HZ=100 options SCHED_4BSD # 4BSD scheduler options SMP # Enable multiple cores -# Debugging -makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols -options ALT_BREAK_TO_DEBUGGER -options KDB -options DDB #Enable the kernel debugger - # Interrupt controller device gic options INTRNG diff --git a/sys/arm/conf/AML8726 b/sys/arm/conf/AML8726 index 1c3d683..a90cccf 100644 --- a/sys/arm/conf/AML8726 +++ b/sys/arm/conf/AML8726 @@ -28,22 +28,6 @@ options SCHED_ULE # ULE scheduler options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. options LINUX_BOOT_ABI -# Debugging -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options ALT_BREAK_TO_DEBUGGER -#options VERBOSE_SYSINIT # Enable verbose sysinit messages -options BOOTVERBOSE=1 -options KDB # Enable kernel debugger support -# For minimum debugger support (stable branch) use: -#options KDB_TRACE # Print a stack trace for a panic -# For full debugger support use this instead: -options DDB # Enable the kernel debugger -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS # Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options DIAGNOSTIC - # NFS root from boopt/dhcp #options BOOTP #options BOOTP_NFSROOT @@ -94,9 +78,6 @@ device bpf # Berkeley packet filter device usb # General USB code (mandatory for USB) device dwcotg # DWC OTG controller options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. -options USB_DEBUG -#options USB_REQ_DEBUG -#options USB_VERBOSE #device ukbd # USB keyboard #device ums # USB mouse diff --git a/sys/arm/conf/ARMADA38X b/sys/arm/conf/ARMADA38X index 519127b..3176a81 100644 --- a/sys/arm/conf/ARMADA38X +++ b/sys/arm/conf/ARMADA38X @@ -11,7 +11,6 @@ ident ARMADA38X options SOC_MV_ARMADA38X -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions WERROR="-Werror" options MD_ROOT @@ -24,22 +23,6 @@ options SCHED_ULE # ULE scheduler options SMP -# Debugging -#options DEBUG -#options VERBOSE_SYSINIT -options ALT_BREAK_TO_DEBUGGER -options DDB -#options GDB -#options DIAGNOSTIC -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options KDB -options KDB_TRACE -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options WITNESS_KDB -#options BOOTVERBOSE - # Pseudo devices device random device pty diff --git a/sys/arm/conf/ARMADAXP b/sys/arm/conf/ARMADAXP index a57f783..5e107dd 100644 --- a/sys/arm/conf/ARMADAXP +++ b/sys/arm/conf/ARMADAXP @@ -31,28 +31,6 @@ options HZ=1000 options SCHED_ULE # ULE scheduler options SMP # Enable multiple cores -# Debugging for use in -current -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -#options VERBOSE_SYSINIT # Enable verbose sysinit messages -options ALT_BREAK_TO_DEBUGGER -options KDB # Enable kernel debugger support -# For minimum debugger support (stable branch) use: -options KDB_TRACE # Print a stack trace for a panic -# For full debugger support use this instead: -options DDB # Enable the kernel debugger -options GDB -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options WITNESS_KDB -#options DIAGNOSTIC -#options KTR -#options KTR_VERBOSE=0 -#options KTR_ENTRIES=16384 -#options KTR_MASK=(KTR_SPARE2) -#options KTR_COMPILE=KTR_ALL - # NFS root from boopt/dhcp options BOOTP options BOOTP_NFSROOT @@ -73,7 +51,6 @@ device loop device md # USB -options USB_DEBUG # enable debug msgs device usb device ehci device umass diff --git a/sys/arm/conf/ATMEL b/sys/arm/conf/ATMEL index 63cd785..52d2e13 100644 --- a/sys/arm/conf/ATMEL +++ b/sys/arm/conf/ATMEL @@ -31,8 +31,6 @@ device at91_board_sam9x25ek device at91_board_sn9g45 device at91_board_tsc4370 -#makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols - options SCHED_4BSD # 4BSD scheduler #options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking @@ -72,20 +70,6 @@ options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. #options MAC # TrustedBSD MAC Framework #options INCLUDE_CONFIG_FILE # Include this file in kernel -# Debugging support. Always need this: -options KDB # Enable kernel debugger support -# For minimum debugger support (stable branch) use: -options KDB_TRACE # Print a stack trace for a panic -# For full debugger support use this instead: -options DDB # Enable the kernel debugger -options GDB # Support remote GDB -#options DEADLKRES # Enable the deadlock resolver -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones - # NFS root from boopt/dhcp options BOOTP options BOOTP_NFSROOT @@ -152,10 +136,8 @@ device ses # Enclosure Services (SES and SAF-TE) # Serial (COM) ports device uart # Multi-uart driver -options ALT_BREAK_TO_DEBUGGER # USB support -options USB_DEBUG # enable debug msgs device ohci # OHCI USB interface device usb # USB Bus (required) device umass # Disks/Mass storage - Requires scbus and da diff --git a/sys/arm/conf/AVILA b/sys/arm/conf/AVILA index fd4d62a..c2a05fa 100644 --- a/sys/arm/conf/AVILA +++ b/sys/arm/conf/AVILA @@ -29,23 +29,11 @@ options XSCALE_CACHE_READ_WRITE_ALLOCATE hints "AVILA.hints" # Default places to look for devices. makeoptions MODULES_OVERRIDE="" -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions CONF_CFLAGS=-mcpu=xscale #options HZ=1000 options HZ=100 options DEVICE_POLLING -# Debugging for use in -current -options KDB -#options GDB -options DDB # Enable the kernel debugger -#options DEADLKRES # Enable the deadlock resolver -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options DIAGNOSTIC - options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking options GEOM_PART_BSD # BSD partition scheme @@ -146,7 +134,6 @@ device ath_ar9160 device ath_ar9280 device usb -#options USB_DEBUG device ohci device ehci device umass diff --git a/sys/arm/conf/BEAGLEBONE b/sys/arm/conf/BEAGLEBONE index 4497b0ff..312659b 100644 --- a/sys/arm/conf/BEAGLEBONE +++ b/sys/arm/conf/BEAGLEBONE @@ -34,21 +34,6 @@ options HZ=100 options SCHED_4BSD # 4BSD scheduler options PLATFORM -# Debugging for use in -current -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options ALT_BREAK_TO_DEBUGGER -#options VERBOSE_SYSINIT # Enable verbose sysinit messages -options KDB # Enable kernel debugger support -# For minimum debugger support (stable branch) use: -#options KDB_TRACE # Print a stack trace for a panic -# For full debugger support use this instead: -options DDB # Enable the kernel debugger -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS # Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options DIAGNOSTIC - # NFS server support #options NFSD @@ -114,9 +99,6 @@ device pmu # USB support device usb options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. -options USB_DEBUG -#options USB_REQ_DEBUG -#options USB_VERBOSE device musb device umass device scbus # SCSI bus (required for ATA/SCSI) diff --git a/sys/arm/conf/BWCT b/sys/arm/conf/BWCT index a539923..fad7b24 100644 --- a/sys/arm/conf/BWCT +++ b/sys/arm/conf/BWCT @@ -30,8 +30,6 @@ include "../at91/std.bwct" hints "BWCT.hints" makeoptions MODULES_OVERRIDE="" -#makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols - options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking #options INET6 # IPv6 communications protocols @@ -59,16 +57,6 @@ options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING #POSIX P1003_1B real-time extensions -# Debugging for use in -current -options KDB # Enable kernel debugger support -options DDB # Enable the kernel debugger -#options DEADLKRES # Enable the deadlock resolver -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options DIAGNOSTIC - options BOOTP options BOOTP_NFSROOT @@ -120,11 +108,8 @@ device md # Memory "disks" # Serial (COM) ports device uart # Multi-uart driver -options BREAK_TO_DEBUGGER -options ALT_BREAK_TO_DEBUGGER # USB support -#options USB_DEBUG #device ohci #device usb #device umass # Disks/Mass storage - Requires scbus and da diff --git a/sys/arm/conf/CAMBRIA b/sys/arm/conf/CAMBRIA index c25521b..91f00e3 100644 --- a/sys/arm/conf/CAMBRIA +++ b/sys/arm/conf/CAMBRIA @@ -28,24 +28,12 @@ options XSCALE_CACHE_READ_WRITE_ALLOCATE #To statically compile in device wiring instead of /boot/device.hints hints "CAMBRIA.hints" # Default places to look for devices. -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions CONF_CFLAGS=-mcpu=xscale makeoptions MODULES_OVERRIDE="" #options HZ=1000 options HZ=100 options DEVICE_POLLING -# Debugging for use in -current -options KDB -#options GDB -options DDB # Enable the kernel debugger -#options DEADLKRES # Enable the deadlock resolver -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options DIAGNOSTIC - options SCHED_4BSD # 4BSD scheduler #options PREEMPTION options INET # InterNETworking @@ -141,7 +129,6 @@ device ath_hal # NB: 2 USB 2.0 ports standard device usb options USB_EHCI_BIG_ENDIAN_DESC # handle big-endian byte order -#options USB_DEBUG device ehci device umass device scbus # SCSI bus (required for ATA/SCSI) diff --git a/sys/arm/conf/CNS11XXNAS b/sys/arm/conf/CNS11XXNAS index 6fc8876..2bf2cf5 100644 --- a/sys/arm/conf/CNS11XXNAS +++ b/sys/arm/conf/CNS11XXNAS @@ -30,21 +30,9 @@ include "../cavium/cns11xx/std.econa" makeoptions MODULES_OVERRIDE="" -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols options HZ=100 options DEVICE_POLLING -# Debugging for use in -current -options KDB -#options GDB -options DDB # Enable the kernel debugger -#options DEADLKRES # Enable the deadlock resolver -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -##options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options DIAGNOSTIC - options SCHED_ULE # ULE scheduler #options SCHED_4BSD # 4BSD scheduler @@ -102,7 +90,6 @@ device random # Entropy device device usb -#options USB_DEBUG device ohci device ehci device umass diff --git a/sys/arm/conf/CRB b/sys/arm/conf/CRB index c85913b..c5d6cdf 100644 --- a/sys/arm/conf/CRB +++ b/sys/arm/conf/CRB @@ -27,10 +27,8 @@ options COUNTS_PER_SEC=400000000 include "../xscale/i8134x/std.crb" makeoptions MODULES_OVERRIDE="" -#makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions CONF_CFLAGS=-mcpu=xscale options HZ=100 -options BREAK_TO_DEBUGGER #options DEVICE_POLLING options SCHED_4BSD # 4BSD scheduler @@ -90,16 +88,6 @@ device "7seg" #options AHD_REG_PRETTY_PRINT # Print register bitfields in debug # output. Adds ~215k to driver. -# Debugging for use in -current -options KDB -options DDB # Enable the kernel debugger -#options DEADLKRES # Enable the deadlock resolver -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options DIAGNOSTIC - options XSCALE_CACHE_READ_WRITE_ALLOCATE device md device random # Entropy device diff --git a/sys/arm/conf/DB-78XXX b/sys/arm/conf/DB-78XXX index d387ca3..66ed195 100644 --- a/sys/arm/conf/DB-78XXX +++ b/sys/arm/conf/DB-78XXX @@ -10,7 +10,6 @@ include "../mv/discovery/std.db78xxx" options SOC_MV_DISCOVERY -#makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions WERROR="-Werror" options SCHED_4BSD # 4BSD scheduler @@ -40,18 +39,6 @@ options RWLOCK_NOINLINE options NO_FFS_SNAPSHOT options NO_SWAPPING -# Debugging -options ALT_BREAK_TO_DEBUGGER -options DDB -#options DEADLKRES # Enable the deadlock resolver -#options DIAGNOSTIC -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options KDB -options WITNESS # Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options WITNESS_KDB - device pci # Pseudo devices @@ -71,7 +58,6 @@ device e1000phy device bpf # USB -options USB_DEBUG # enable debug msgs device usb device ehci device umass diff --git a/sys/arm/conf/DB-88F5XXX b/sys/arm/conf/DB-88F5XXX index 4e6f7f8..d057d6f 100644 --- a/sys/arm/conf/DB-88F5XXX +++ b/sys/arm/conf/DB-88F5XXX @@ -10,7 +10,6 @@ include "../mv/orion/std.db88f5xxx" options SOC_MV_ORION -#makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions WERROR="-Werror" options SCHED_4BSD # 4BSD scheduler @@ -39,18 +38,6 @@ options RWLOCK_NOINLINE options NO_FFS_SNAPSHOT options NO_SWAPPING -# Debugging -options ALT_BREAK_TO_DEBUGGER -options DDB -#options DEADLKRES # Enable the deadlock resolver -#options DIAGNOSTIC -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options KDB -options WITNESS # Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options WITNESS_KDB - device pci # Pseudo devices @@ -78,7 +65,6 @@ device twsi device ds133x # USB -options USB_DEBUG # enable debug msgs device usb device ehci device umass diff --git a/sys/arm/conf/DB-88F6XXX b/sys/arm/conf/DB-88F6XXX index 09e5f0b..e278606 100644 --- a/sys/arm/conf/DB-88F6XXX +++ b/sys/arm/conf/DB-88F6XXX @@ -32,19 +32,6 @@ options RWLOCK_NOINLINE options NO_FFS_SNAPSHOT options NO_SWAPPING -# Debugging for use in -current -#makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options ALT_BREAK_TO_DEBUGGER -options KDB # Enable kernel debugger support -options DDB # Enable the kernel debugger -#options DEADLKRES # Enable the deadlock resolver -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS # Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options WITNESS_KDB -#options DIAGNOSTIC - # NFS root from boopt/dhcp options BOOTP options BOOTP_NFSROOT @@ -76,7 +63,6 @@ device crypto device cryptodev # USB -options USB_DEBUG # enable debug msgs device usb device ehci device umass diff --git a/sys/arm/conf/DOCKSTAR b/sys/arm/conf/DOCKSTAR index 9a138bf..bf2d551 100644 --- a/sys/arm/conf/DOCKSTAR +++ b/sys/arm/conf/DOCKSTAR @@ -48,18 +48,6 @@ options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -# Debugging for use in -current -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options ALT_BREAK_TO_DEBUGGER -options KDB # Enable kernel debugger support -options DDB # Enable the kernel debugger -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options WITNESS_KDB -#options DIAGNOSTIC - # Enable these options for nfs root configured via BOOTP. #options BOOTP #options BOOTP_NFSROOT @@ -101,7 +89,6 @@ device e1000phy # USB options USB_HOST_ALIGN=32 # Align DMA to cacheline -#options USB_DEBUG # Compile in USB debug support device usb # Basic usb support device ehci # USB host controller device umass # Mass storage diff --git a/sys/arm/conf/DREAMPLUG-1001 b/sys/arm/conf/DREAMPLUG-1001 index 5391d18..21e4f61 100644 --- a/sys/arm/conf/DREAMPLUG-1001 +++ b/sys/arm/conf/DREAMPLUG-1001 @@ -51,18 +51,6 @@ options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -# Debugging for use in -current -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options ALT_BREAK_TO_DEBUGGER -options KDB # Enable kernel debugger support -options DDB # Enable the kernel debugger -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options WITNESS_KDB -#options DIAGNOSTIC - # Enable these options for nfs root configured via BOOTP. #options BOOTP #options BOOTP_NFSROOT @@ -105,7 +93,6 @@ device e1000phy # USB options USB_HOST_ALIGN=32 # Align DMA to cacheline -#options USB_DEBUG # Compile in USB debug support device usb # Basic usb support device ehci # USB host controller device umass # Mass storage diff --git a/sys/arm/conf/EA3250 b/sys/arm/conf/EA3250 index 8f13505..2557fab 100644 --- a/sys/arm/conf/EA3250 +++ b/sys/arm/conf/EA3250 @@ -11,7 +11,6 @@ hints "EA3250.hints" makeoptions MODULES_OVERRIDE="" -#makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions WERROR="-Werror" options SCHED_4BSD # 4BSD scheduler @@ -41,18 +40,6 @@ options RWLOCK_NOINLINE options NO_FFS_SNAPSHOT options NO_SWAPPING -# Debugging -options ALT_BREAK_TO_DEBUGGER -options DDB -#options DEADLKRES # Enable the deadlock resolver -#options DIAGNOSTIC -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options KDB -options WITNESS # Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options WITNESS_KDB - # Pseudo devices device loop device md @@ -69,7 +56,6 @@ device bpf device lpe # USB -options USB_DEBUG device usb device ohci device umass diff --git a/sys/arm/conf/EB9200 b/sys/arm/conf/EB9200 index 6625783..888ab31 100644 --- a/sys/arm/conf/EB9200 +++ b/sys/arm/conf/EB9200 @@ -23,8 +23,6 @@ include "../at91/std.eb9200" hints "EB9200.hints" makeoptions MODULES_OVERRIDE="" -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols - options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking #options INET6 # IPv6 communications protocols @@ -53,15 +51,6 @@ options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -# Debugging for use in -current -options KDB # Enable kernel debugger support -options DDB # Enable the kernel debugger -#options DEADLKRES # Enable the deadlock resolver -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed - # NFS root from boopt/dhcp options BOOTP options BOOTP_NFSROOT @@ -115,7 +104,6 @@ device pass # Passthrough device (direct ATA/SCSI access) device uart # Multi-uart driver # USB support -options USB_DEBUG # enable debug msgs device ohci # OHCI USB interface device usb # USB Bus (required) device umass # Disks/Mass storage - Requires scbus and da diff --git a/sys/arm/conf/EFIKA_MX b/sys/arm/conf/EFIKA_MX index 8b4b4aa..a5a1509 100644 --- a/sys/arm/conf/EFIKA_MX +++ b/sys/arm/conf/EFIKA_MX @@ -33,22 +33,6 @@ options SCHED_4BSD # 4BSD scheduler options PLATFORM options INCLUDE_CONFIG_FILE # Include this file in kernel -# Debugging for use in -current -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options ALT_BREAK_TO_DEBUGGER -#options VERBOSE_SYSINIT # Enable verbose sysinit messages -options KDB # Enable kernel debugger support -# For minimum debugger support (stable branch) use: -#options KDB_TRACE # Print a stack trace for a panic -# For full debugger support use this instead: -options DDB # Enable the kernel debugger -#options GDB # Support remote GDB -options DEADLKRES # Enable the deadlock resolver -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed - # NFS root from boopt/dhcp #options BOOTP #options BOOTP_NFSROOT @@ -83,7 +67,6 @@ device ether # Ethernet support # Serial (COM) ports device uart # Multi-uart driver -options ALT_BREAK_TO_DEBUGGER device ata device atapci # Only for helper functions @@ -104,7 +87,6 @@ device pass # Passthrough device (direct ATA/SCSI access) # USB support options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. -#options USB_DEBUG # enable debug msgs device ehci # OHCI USB interface device usb # USB Bus (required) device umass # Disks/Mass storage - Requires scbus and da diff --git a/sys/arm/conf/ETHERNUT5 b/sys/arm/conf/ETHERNUT5 index e54513b..65cd897 100644 --- a/sys/arm/conf/ETHERNUT5 +++ b/sys/arm/conf/ETHERNUT5 @@ -27,8 +27,6 @@ include "../at91/std.ethernut5" # To statically compile in device wiring instead of /boot/device.hints hints "ETHERNUT5.hints" -#makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols - options SCHED_4BSD # 4BSD scheduler #options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking @@ -68,20 +66,6 @@ options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. #options MAC # TrustedBSD MAC Framework #options INCLUDE_CONFIG_FILE # Include this file in kernel -# Debugging support. Always need this: -#options KDB # Enable kernel debugger support. -# For minimum debugger support (stable branch) use: -#options KDB_TRACE # Print a stack trace for a panic. -# For full debugger support use this instead: -#options DDB # Enable the kernel debugger -#options GDB # Support remote GDB -#options DEADLKRES # Enable the deadlock resolver -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones - # NFS root from boopt/dhcp options BOOTP options BOOTP_NFSROOT @@ -148,10 +132,8 @@ device ether # Ethernet support # Serial (COM) ports device uart # Multi-uart driver -options ALT_BREAK_TO_DEBUGGER # USB support -#options USB_DEBUG # enable debug msgs device ohci # OHCI USB interface device usb # USB Bus (required) #device umass # Disks/Mass storage - Requires scbus and da diff --git a/sys/arm/conf/EXYNOS5.common b/sys/arm/conf/EXYNOS5.common index c997916..ad42056 100644 --- a/sys/arm/conf/EXYNOS5.common +++ b/sys/arm/conf/EXYNOS5.common @@ -56,21 +56,6 @@ options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) options VFP # Enable floating point hardware support options SMP # Enable multiple cores -# Debugging for use in -current -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options ALT_BREAK_TO_DEBUGGER -#options VERBOSE_SYSINIT # Enable verbose sysinit messages -options KDB # Enable kernel debugger support -# For minimum debugger support (stable branch) use: -#options KDB_TRACE # Print a stack trace for a panic -# For full debugger support use this instead: -options DDB # Enable the kernel debugger -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options DIAGNOSTIC - # NFS root from boopt/dhcp #options BOOTP #options BOOTP_NFSROOT @@ -103,9 +88,6 @@ device gpio # USB support options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. device usb -options USB_DEBUG -#options USB_REQ_DEBUG -#options USB_VERBOSE #device musb device ehci #device ohci diff --git a/sys/arm/conf/GUMSTIX b/sys/arm/conf/GUMSTIX index 0b9c423..4cc18e3 100644 --- a/sys/arm/conf/GUMSTIX +++ b/sys/arm/conf/GUMSTIX @@ -33,7 +33,6 @@ options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm include "../xscale/pxa/std.pxa" makeoptions MODULES_OVERRIDE="" -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols options HZ=100 #options DEVICE_POLLING @@ -78,15 +77,5 @@ device smcphy device uart device uart_ns8250 -# Debugging for use in -current -options KDB -options DDB # Enable the kernel debugger -#options DEADLKRES # Enable the deadlock resolver -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options DIAGNOSTIC - device md device random # Entropy device diff --git a/sys/arm/conf/HL200 b/sys/arm/conf/HL200 index 091ab39..da14231 100644 --- a/sys/arm/conf/HL200 +++ b/sys/arm/conf/HL200 @@ -28,8 +28,6 @@ include "../at91/std.hl200" hints "KB920X.hints" makeoptions MODULES_OVERRIDE="" -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols - options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking #options INET6 # IPv6 communications protocols @@ -57,15 +55,6 @@ options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -# Debugging for use in -current -options KDB # Enable kernel debugger support -options DDB # Enable the kernel debugger -#options DEADLKRES # Enable the deadlock resolver -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed - options BOOTP options BOOTP_NFSROOT options BOOTP_COMPAT @@ -123,7 +112,6 @@ device pass # Passthrough device (direct ATA/SCSI access) device uart # Multi-uart driver # USB support -options USB_DEBUG # enable debug msgs device ohci # OHCI USB interface device usb # USB Bus (required) #device udbp # USB Double Bulk Pipe devices diff --git a/sys/arm/conf/HL201 b/sys/arm/conf/HL201 index d65766a..e4c181f 100644 --- a/sys/arm/conf/HL201 +++ b/sys/arm/conf/HL201 @@ -26,8 +26,6 @@ include "../at91/std.hl201" makeoptions MODULES_OVERRIDE="" -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols - options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking #options INET6 # IPv6 communications protocols @@ -56,15 +54,6 @@ options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -# Debugging for use in -current -options KDB # Enable kernel debugger support -options DDB # Enable the kernel debugger -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options DIAGNOSTIC - # NFS root from boopt/dhcp #options BOOTP #options BOOTP_NFSROOT @@ -114,7 +103,6 @@ device pass # Passthrough device (direct ATA/SCSI access) # Serial (COM) ports device uart # Multi-uart driver -options ALT_BREAK_TO_DEBUGGER # USB support device ohci # OHCI USB interface diff --git a/sys/arm/conf/IMX53 b/sys/arm/conf/IMX53 index e320562..8989344 100644 --- a/sys/arm/conf/IMX53 +++ b/sys/arm/conf/IMX53 @@ -30,20 +30,6 @@ options SCHED_4BSD # 4BSD scheduler options PLATFORM options INCLUDE_CONFIG_FILE # Include this file in kernel -# Debugging for use in -current -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options KDB # Enable kernel debugger support -# For minimum debugger support (stable branch) use: -#options KDB_TRACE # Print a stack trace for a panic -# For full debugger support use this instead: -options DDB # Enable the kernel debugger -#options GDB # Support remote GDB -options DEADLKRES # Enable the deadlock resolver -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed - # kernel/memory size reduction #options MUTEX_NOINLINE #options NO_FFS_SNAPSHOT @@ -72,7 +58,6 @@ device miibus # Standard mii bus # Serial (COM) ports device uart # Multi-uart driver -options ALT_BREAK_TO_DEBUGGER device ata device atapci # Only for helper functions @@ -93,7 +78,6 @@ device pass # Passthrough device (direct ATA/SCSI access) # USB support options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. -options USB_DEBUG # enable debug msgs device ehci # OHCI USB interface device usb # USB Bus (required) device umass # Disks/Mass storage - Requires scbus and da diff --git a/sys/arm/conf/IMX6 b/sys/arm/conf/IMX6 index bc1145f..6000566 100644 --- a/sys/arm/conf/IMX6 +++ b/sys/arm/conf/IMX6 @@ -33,23 +33,6 @@ options INCLUDE_CONFIG_FILE # Include this file in kernel options PLATFORM options SMP # Enable multiple cores -# Debugging for use in -current -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options KDB # Enable kernel debugger support -# For minimum debugger support (stable branch) use: -#options KDB_TRACE # Print a stack trace for a panic -# For full debugger support use this instead: -options DDB # Enable the kernel debugger -#options GDB # Support remote GDB. -# Other debugging options... -options ALT_BREAK_TO_DEBUGGER # Use <CR><tilde><ctrl-b> to enter debugger. -#options DEADLKRES # Enable the deadlock resolver -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options DIAGNOSTIC - # NFS root from boopt/dhcp #options BOOTP #options BOOTP_NFSROOT @@ -97,7 +80,6 @@ device cd # CD device pass # Passthrough device (direct ATA/SCSI access) # USB support -#options USB_DEBUG # enable debug msgs device ehci # OHCI USB interface device usb # USB Bus (required) device umass # Disks/Mass storage - Requires scbus and da diff --git a/sys/arm/conf/KB920X b/sys/arm/conf/KB920X index 07aa62c..46b7e69 100644 --- a/sys/arm/conf/KB920X +++ b/sys/arm/conf/KB920X @@ -29,8 +29,6 @@ include "../at91/std.kb920x" hints "KB920X.hints" makeoptions MODULES_OVERRIDE="" -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols - options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking #options INET6 # IPv6 communications protocols @@ -58,15 +56,6 @@ options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -# Debugging for use in -current -options KDB # Enable kernel debugger support -options DDB # Enable the kernel debugger -#options DEADLKRES # Enable the deadlock resolver -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed - # NFS root from boopt/dhcp #options BOOTP #options BOOTP_NFSROOT @@ -130,7 +119,6 @@ device wlan_tkip # 802.11 TKIP support device wlan_amrr # AMRR transmit rate control algorithm # USB support -options USB_DEBUG # enable debug msgs device ohci # OHCI USB interface device usb # USB Bus (required) #device udbp # USB Double Bulk Pipe devices diff --git a/sys/arm/conf/NSLU b/sys/arm/conf/NSLU index a5ea6ed..b1c9f21 100644 --- a/sys/arm/conf/NSLU +++ b/sys/arm/conf/NSLU @@ -36,22 +36,10 @@ options XSCALE_CACHE_READ_WRITE_ALLOCATE hints "NSLU.hints" # Default places to look for devices. makeoptions MODULES_OVERRIDE="" -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions CONF_CFLAGS=-mcpu=xscale options HZ=100 options DEVICE_POLLING -# Debugging for use in -current -options KDB -#options GDB -options DDB # Enable the kernel debugger -#options DEADLKRES # Enable the deadlock resolver -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options DIAGNOSTIC - options SCHED_ULE # ULE scheduler options INET # InterNETworking options INET6 # IPv6 communications protocols @@ -111,7 +99,6 @@ device md device random # Entropy device device usb -options USB_DEBUG device ohci device ehci device umass diff --git a/sys/arm/conf/PANDABOARD b/sys/arm/conf/PANDABOARD index 69a8252..158a9b7 100644 --- a/sys/arm/conf/PANDABOARD +++ b/sys/arm/conf/PANDABOARD @@ -35,21 +35,6 @@ options SCHED_ULE # ULE scheduler options PLATFORM options SMP # Enable multiple cores -# Debugging for use in -current -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options ALT_BREAK_TO_DEBUGGER -#options VERBOSE_SYSINIT # Enable verbose sysinit messages -options KDB # Enable kernel debugger support -# For minimum debugger support (stable branch) use: -#options KDB_TRACE # Print a stack trace for a panic -# For full debugger support use this instead: -options DDB # Enable the kernel debugger -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options DIAGNOSTIC - # NFS root from boopt/dhcp #options BOOTP #options BOOTP_NFSROOT @@ -98,9 +83,6 @@ device gpioled # USB support device usb options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. -options USB_DEBUG -#options USB_REQ_DEBUG -#options USB_VERBOSE device ohci device ehci device umass diff --git a/sys/arm/conf/QILA9G20 b/sys/arm/conf/QILA9G20 index 5117566..29618b9 100644 --- a/sys/arm/conf/QILA9G20 +++ b/sys/arm/conf/QILA9G20 @@ -29,8 +29,6 @@ include "../at91/std.qila9g20" hints "QILA9G20.hints" makeoptions MODULES_OVERRIDE="" -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols - options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking #options INET6 # IPv6 communications protocols @@ -58,15 +56,6 @@ options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -# Debugging for use in -current -options KDB # Enable kernel debugger support -options DDB # Enable the kernel debugger -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options DIAGNOSTIC - # NFS root from boopt/dhcp #options BOOTP #options BOOTP_NFSROOT @@ -128,7 +117,6 @@ device pass # Passthrough device (direct ATA/SCSI access) # Serial (COM) ports device uart # Multi-uart driver -options ALT_BREAK_TO_DEBUGGER # USB support device ohci # OHCI USB interface diff --git a/sys/arm/conf/RK3188 b/sys/arm/conf/RK3188 index e3e5ac8..7528c0c 100644 --- a/sys/arm/conf/RK3188 +++ b/sys/arm/conf/RK3188 @@ -27,21 +27,6 @@ options HZ=100 options SCHED_ULE # ULE scheduler options SMP # Enable multiple cores -# Debugging for use in -current -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options ALT_BREAK_TO_DEBUGGER -#options VERBOSE_SYSINIT # Enable verbose sysinit messages -options KDB # Enable kernel debugger support -# For minimum debugger support (stable branch) use: -#options KDB_TRACE # Print a stack trace for a panic -# For full debugger support use this instead: -options DDB # Enable the kernel debugger -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS # Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -options DIAGNOSTIC - # Root mount from MMC/SD card options ROOTDEVNAME=\"ufs:/dev/mmcsd0\" @@ -79,9 +64,6 @@ device pass # USB support options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. device usb -options USB_DEBUG -#options USB_REQ_DEBUG -#options USB_VERBOSE device dwcotg # DWC OTG controller device umass diff --git a/sys/arm/conf/RPI-B b/sys/arm/conf/RPI-B index 5f6bc27..58d05ca 100644 --- a/sys/arm/conf/RPI-B +++ b/sys/arm/conf/RPI-B @@ -30,21 +30,6 @@ options HZ=100 options SCHED_4BSD # 4BSD scheduler options PLATFORM -# Debugging for use in -current -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options ALT_BREAK_TO_DEBUGGER -#options VERBOSE_SYSINIT # Enable verbose sysinit messages -options KDB # Enable kernel debugger support -# For minimum debugger support (stable branch) use: -#options KDB_TRACE # Print a stack trace for a panic -# For full debugger support use this instead: -options DDB # Enable the kernel debugger -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options DIAGNOSTIC - # NFS root from boopt/dhcp #options BOOTP #options BOOTP_NFSROOT @@ -84,7 +69,6 @@ device random # Entropy device # USB support device usb -options USB_DEBUG device dwcotg # DWC OTG controller # USB storage support diff --git a/sys/arm/conf/RPI2 b/sys/arm/conf/RPI2 index e669580..75e1b7e 100644 --- a/sys/arm/conf/RPI2 +++ b/sys/arm/conf/RPI2 @@ -31,21 +31,6 @@ options SCHED_ULE # ULE scheduler options SMP # Enable multiple cores options PLATFORM -# Debugging for use in -current -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options ALT_BREAK_TO_DEBUGGER -#options VERBOSE_SYSINIT # Enable verbose sysinit messages -options KDB # Enable kernel debugger support -# For minimum debugger support (stable branch) use: -#options KDB_TRACE # Print a stack trace for a panic -# For full debugger support use this instead: -options DDB # Enable the kernel debugger -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options DIAGNOSTIC - # NFS root from boopt/dhcp #options BOOTP #options BOOTP_NFSROOT @@ -88,7 +73,6 @@ device random # Entropy device # USB support device usb -options USB_DEBUG device dwcotg # DWC OTG controller # USB storage support diff --git a/sys/arm/conf/SAM9260EK b/sys/arm/conf/SAM9260EK index 7248046..d394938 100644 --- a/sys/arm/conf/SAM9260EK +++ b/sys/arm/conf/SAM9260EK @@ -36,7 +36,6 @@ options SOCDEV_VA=0xdc000000 # To statically compile in device wiring instead of /boot/device.hints hints "SAM9260EK.hints" -#makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions MODULES_OVERRIDE="" options SCHED_4BSD # 4BSD scheduler @@ -79,20 +78,6 @@ options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. #options MAC # TrustedBSD MAC Framework #options INCLUDE_CONFIG_FILE # Include this file in kernel -# Debugging support. Always need this: -#options KDB # Enable kernel debugger support -# For minimum debugger support (stable branch) use: -#options KDB_TRACE # Print a stack trace for a panic -# For full debugger support use this instead: -#options DDB # Enable the kernel debugger -#options GDB # Support remote GDB -#options DEADLKRES # Enable the deadlock resolver -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones - # NFS root from boopt/dhcp #options BOOTP #options BOOTP_NFSROOT @@ -170,10 +155,8 @@ device md # Memory "disks" # Serial (COM) ports device uart # Multi-uart driver -options ALT_BREAK_TO_DEBUGGER # USB support -#options USB_DEBUG # enable debug msgs #device ohci # OHCI USB interface #device usb # USB Bus (required) #device umass # Disks/Mass storage - Requires scbus and da diff --git a/sys/arm/conf/SAM9G20EK b/sys/arm/conf/SAM9G20EK index 685b2bf..2f23cae 100644 --- a/sys/arm/conf/SAM9G20EK +++ b/sys/arm/conf/SAM9G20EK @@ -35,8 +35,6 @@ options SOCDEV_VA=0xdc000000 hints "SAM9G20EK.hints" makeoptions MODULES_OVERRIDE="" -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols - options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking #options INET6 # IPv6 communications protocols @@ -65,16 +63,6 @@ options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions -# Debugging support. Always need this: -options KDB # Enable kernel debugger support -options DDB # Enable the kernel debugger -# Always turn these off, even in -current builds, they are too slow. -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options DIAGNOSTIC - # NFS root from boopt/dhcp #options BOOTP #options BOOTP_NFSROOT @@ -142,7 +130,6 @@ device pass # Passthrough device (direct ATA/SCSI access) # Serial (COM) ports device uart # Multi-uart driver -options ALT_BREAK_TO_DEBUGGER # USB support device ohci # OHCI USB interface diff --git a/sys/arm/conf/SAM9X25EK b/sys/arm/conf/SAM9X25EK index ff2e97c..1d014a3 100644 --- a/sys/arm/conf/SAM9X25EK +++ b/sys/arm/conf/SAM9X25EK @@ -28,10 +28,6 @@ include "../at91/std.sam9x25ek" hints "SAM9G20EK.hints" makeoptions MODULES_OVERRIDE="" -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options DDB -options KDB - options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking #options INET6 # IPv6 communications protocols @@ -59,14 +55,6 @@ options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions - -# Debugging for use in -current -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options DIAGNOSTIC - # NFS root from boopt/dhcp #options BOOTP #options BOOTP_NFSROOT @@ -130,7 +118,6 @@ device pass # Passthrough device (direct ATA/SCSI access) # Serial (COM) ports device uart # Multi-uart driver -options ALT_BREAK_TO_DEBUGGER # USB support #device ohci # OHCI USB interface diff --git a/sys/arm/conf/SHEEVAPLUG b/sys/arm/conf/SHEEVAPLUG index 367de9d..2c6bda4 100644 --- a/sys/arm/conf/SHEEVAPLUG +++ b/sys/arm/conf/SHEEVAPLUG @@ -34,12 +34,6 @@ options RWLOCK_NOINLINE options NO_FFS_SNAPSHOT options NO_SWAPPING -# Debugging for use in -current -#makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options ALT_BREAK_TO_DEBUGGER -options KDB # Enable kernel debugger support -options DDB # Enable the kernel debugger - # NFS root from boopt/dhcp options BOOTP options BOOTP_NFSROOT @@ -71,7 +65,6 @@ device crypto device cryptodev # USB -options USB_DEBUG # enable debug msgs device usb device ehci device umass diff --git a/sys/arm/conf/SN9G45 b/sys/arm/conf/SN9G45 index 28d2c25..33eece9 100644 --- a/sys/arm/conf/SN9G45 +++ b/sys/arm/conf/SN9G45 @@ -28,8 +28,6 @@ include "../at91/std.sn9g45" #hints "SN9G45.hints" makeoptions MODULES_OVERRIDE="" -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols - options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking #options INET6 # IPv6 communications protocols @@ -57,15 +55,6 @@ options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions -# Debugging for use in -current -options KDB # Enable kernel debugger support -options DDB # Enable the kernel debugger -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options DIAGNOSTIC - # NFS root from boopt/dhcp #options BOOTP #options BOOTP_NFSROOT @@ -106,7 +95,6 @@ device pass # Passthrough device (direct ATA/SCSI access) # Serial (COM) ports device uart # Multi-uart driver -options ALT_BREAK_TO_DEBUGGER # USB support device ohci # OHCI USB interface diff --git a/sys/arm/conf/SOCKIT.common b/sys/arm/conf/SOCKIT.common index 3db9457..964c98a 100644 --- a/sys/arm/conf/SOCKIT.common +++ b/sys/arm/conf/SOCKIT.common @@ -29,21 +29,6 @@ options HZ=100 options SCHED_ULE # ULE scheduler options SMP # Enable multiple cores -# Debugging for use in -current -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options ALT_BREAK_TO_DEBUGGER -#options VERBOSE_SYSINIT # Enable verbose sysinit messages -options KDB # Enable kernel debugger support -# For minimum debugger support (stable branch) use: -#options KDB_TRACE # Print a stack trace for a panic -# For full debugger support use this instead: -options DDB # Enable the kernel debugger -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options DIAGNOSTIC - # NFS root from boopt/dhcp #options BOOTP #options BOOTP_NFSROOT @@ -74,9 +59,6 @@ device gpio # USB support options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. device usb -options USB_DEBUG -#options USB_REQ_DEBUG -#options USB_VERBOSE #device musb device dwcotg diff --git a/sys/arm/conf/TEGRA124 b/sys/arm/conf/TEGRA124 index 3d55c4b..663a948 100644 --- a/sys/arm/conf/TEGRA124 +++ b/sys/arm/conf/TEGRA124 @@ -30,21 +30,6 @@ options PLATFORM_SMP options SMP # Enable multiple cores options LINUX_BOOT_ABI -# Debugging for use in -current -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options BREAK_TO_DEBUGGER -options ALT_BREAK_TO_DEBUGGER -#options VERBOSE_SYSINIT # Enable verbose sysinit messages -options KDB # Enable kernel debugger support -# For minimum debugger support (stable branch) use: -#options KDB_TRACE # Print a stack trace for a panic -# For full debugger support use this instead: -options DDB # Enable the kernel debugger -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS # Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed - # Interrupt controller device gic @@ -100,7 +85,6 @@ device pass # Passthrough device (direct ATA/SCSI access) # USB support options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. -options USB_DEBUG # enable debug msgs device ehci # EHCI USB interface device usb # USB Bus (required) device umass # Disks/Mass storage - Requires scbus and da diff --git a/sys/arm/conf/TS7800 b/sys/arm/conf/TS7800 index e06b0aa..1b65632 100644 --- a/sys/arm/conf/TS7800 +++ b/sys/arm/conf/TS7800 @@ -10,7 +10,6 @@ include "../mv/orion/std.ts7800" options SOC_MV_ORION -#makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions WERROR="-Werror" options SCHED_4BSD # 4BSD scheduler @@ -39,12 +38,6 @@ options RWLOCK_NOINLINE options NO_FFS_SNAPSHOT options NO_SWAPPING -# Debugging -options ALT_BREAK_TO_DEBUGGER -options DDB -options KDB -options GDB # Support remote GDB. - device mvs device pci diff --git a/sys/arm/conf/VERSATILEPB b/sys/arm/conf/VERSATILEPB index 8ba960d..63feaff 100644 --- a/sys/arm/conf/VERSATILEPB +++ b/sys/arm/conf/VERSATILEPB @@ -33,16 +33,6 @@ options HZ=100 options SCHED_4BSD # 4BSD scheduler options LINUX_BOOT_ABI # Process metadata passed from Linux boot loaders -# Debugging for use in -current -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options KDB # Enable kernel debugger support -# For minimum debugger support (stable branch) use: -#options KDB_TRACE # Print a stack trace for a panic -# For full debugger support use this instead: -options DDB # Enable the kernel debugger -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS - options ROOTDEVNAME=\"ufs:da0s1a\" device bpf diff --git a/sys/arm/conf/VIRT b/sys/arm/conf/VIRT index ba73b59..007e24c 100644 --- a/sys/arm/conf/VIRT +++ b/sys/arm/conf/VIRT @@ -30,22 +30,6 @@ options PLATFORM_SMP options SMP # Enable multiple cores options MULTIDELAY -# Debugging for use in -current -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options BREAK_TO_DEBUGGER -options ALT_BREAK_TO_DEBUGGER -#options VERBOSE_SYSINIT # Enable verbose sysinit messages -options KDB # Enable kernel debugger support -# For minimum debugger support (stable branch) use: -#options KDB_TRACE # Print a stack trace for a panic -# For full debugger support use this instead: -options DDB # Enable the kernel debugger -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options DIAGNOSTIC - # Interrupt controller device gic options INTRNG diff --git a/sys/arm/conf/VYBRID b/sys/arm/conf/VYBRID index 3e15e42..d834b55 100644 --- a/sys/arm/conf/VYBRID +++ b/sys/arm/conf/VYBRID @@ -29,21 +29,6 @@ options SCHED_4BSD # 4BSD scheduler #options NANDFS # NAND Filesystem #options SMP # Enable multiple cores -# Debugging for use in -current -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options ALT_BREAK_TO_DEBUGGER -#options VERBOSE_SYSINIT # Enable verbose sysinit messages -options KDB # Enable kernel debugger support -# For minimum debugger support (stable branch) use: -#options KDB_TRACE # Print a stack trace for a panic -# For full debugger support use this instead: -options DDB # Enable the kernel debugger -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options DIAGNOSTIC - # NFS root from boopt/dhcp #options BOOTP #options BOOTP_NFSROOT @@ -83,9 +68,6 @@ device gpio # USB support options USB_HOST_ALIGN=32 # Align usb buffers to cache line size. device usb -options USB_DEBUG -#options USB_REQ_DEBUG -#options USB_VERBOSE #device musb device ehci #device ohci diff --git a/sys/arm/conf/ZEDBOARD b/sys/arm/conf/ZEDBOARD index bb7de5c..2de7571 100644 --- a/sys/arm/conf/ZEDBOARD +++ b/sys/arm/conf/ZEDBOARD @@ -30,20 +30,6 @@ options SCHED_ULE # ULE scheduler #options NFSSD # Network Filesystem Server options SMP # Enable multiple cores -# Debugging for use in -current -makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -options ALT_BREAK_TO_DEBUGGER -options KDB # Enable kernel debugger support -# For minimum debugger support (stable branch) use: -#options KDB_TRACE # Print a stack trace for a panic -# For full debugger support use this instead: -options DDB # Enable the kernel debugger -#options INVARIANTS # Enable calls of extra sanity checking -#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -#options WITNESS # Enable checks to detect deadlocks and cycles -#options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -#options DIAGNOSTIC - # NFS root from boopt/dhcp #options BOOTP #options BOOTP_NFSROOT @@ -80,9 +66,6 @@ device bpf # Berkeley packet filter # USB support device usb -options USB_DEBUG -#options USB_REQ_DEBUG -#options USB_VERBOSE device ehci device umass device scbus # SCSI bus (required for ATA/SCSI) diff --git a/sys/arm/conf/std.arm b/sys/arm/conf/std.arm index b9ac640..7f3e3dd 100644 --- a/sys/arm/conf/std.arm +++ b/sys/arm/conf/std.arm @@ -4,3 +4,33 @@ options COMPAT_FREEBSD10 # Compatible with FreeBSD10 +# Debugging support. Always need this: +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +options KDB # Enable kernel debugger support. +options KDB_TRACE # Print a stack trace for a panic. + +# For full debugger support use (turn off in stable branch): +options DDB # Support DDB +#options DEADLKRES # Enable the deadlock resolver +options INVARIANTS # Enable calls of extra sanity checking +options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +options WITNESS # Enable checks to detect deadlocks and cycles +options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed +#options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones +options ALT_BREAK_TO_DEBUGGER # Enter debugger on keyboard escape sequence +options USB_DEBUG # Enable usb debug support code + +# Optional extras, never enabled by default: +#options BOOTVERBOSE +#options DEBUG # May result in extreme spewage +#options KTR +#options KTR_COMPILE=KTR_ALL +#options KTR_ENTRIES=16384 +#options KTR_MASK=(KTR_SPARE2) +#options KTR_VERBOSE=0 +#options USB_REQ_DEBUG +#options USB_VERBOSE +#options VERBOSE_SYSINIT # Enable verbose sysinit messages + + + diff --git a/sys/arm/conf/std.armv6 b/sys/arm/conf/std.armv6 index e414bbf..d67b9c4 100644 --- a/sys/arm/conf/std.armv6 +++ b/sys/arm/conf/std.armv6 @@ -46,3 +46,32 @@ options COMPAT_FREEBSD10 # Compatible with FreeBSD10 options KDTRACE_HOOKS # Kernel DTrace hooks options DDB_CTF # all architectures - kernel ELF linker loads CTF data makeoptions WITH_CTF=1 + +# Debugging support. Always need this: +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +options KDB # Enable kernel debugger support. +options KDB_TRACE # Print a stack trace for a panic. + +# For full debugger support use (turn off in stable branch): +options DDB # Support DDB +#options DEADLKRES # Enable the deadlock resolver +options INVARIANTS # Enable calls of extra sanity checking +options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +options WITNESS # Enable checks to detect deadlocks and cycles +options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed +options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones +options ALT_BREAK_TO_DEBUGGER # Enter debugger on keyboard escape sequence +options USB_DEBUG # Enable usb debug support code + +# Optional extras, never enabled by default: +#options BOOTVERBOSE +#options DEBUG # May result in extreme spewage +#options KTR +#options KTR_COMPILE=KTR_ALL +#options KTR_ENTRIES=16384 +#options KTR_MASK=(KTR_SPARE2) +#options KTR_VERBOSE=0 +#options USB_REQ_DEBUG +#options USB_VERBOSE +#options VERBOSE_SYSINIT # Enable verbose sysinit messages + diff --git a/sys/arm/lpc/if_lpe.c b/sys/arm/lpc/if_lpe.c index 0ddd2a5..45ca363 100644 --- a/sys/arm/lpc/if_lpe.c +++ b/sys/arm/lpc/if_lpe.c @@ -172,7 +172,7 @@ static void lpe_ifmedia_sts(struct ifnet *, struct ifmediareq *); #define lpe_lock(_sc) mtx_lock(&(_sc)->lpe_mtx) #define lpe_unlock(_sc) mtx_unlock(&(_sc)->lpe_mtx) -#define lpe_lock_assert(sc) mtx_assert(&(_sc)->lpe_mtx, MA_OWNED) +#define lpe_lock_assert(_sc) mtx_assert(&(_sc)->lpe_mtx, MA_OWNED) #define lpe_read_4(_sc, _reg) \ bus_space_read_4((_sc)->lpe_bst, (_sc)->lpe_bsh, (_reg)) diff --git a/sys/arm/samsung/exynos/chrome_kb.c b/sys/arm/samsung/exynos/chrome_kb.c index 6965d3c..1b6d1be 100644 --- a/sys/arm/samsung/exynos/chrome_kb.c +++ b/sys/arm/samsung/exynos/chrome_kb.c @@ -310,7 +310,7 @@ static uint16_t keymap_read(struct ckb_softc *sc, int col, int row) { - KASSERT(sc->keymap != NULL, "keymap_read: no keymap"); + KASSERT(sc->keymap != NULL, ("keymap_read: no keymap")); if (col >= 0 && col < sc->cols && row >= 0 && row < sc->rows) { return sc->keymap[row * sc->cols + col]; @@ -323,7 +323,7 @@ static int keymap_write(struct ckb_softc *sc, int col, int row, uint16_t key) { - KASSERT(sc->keymap != NULL, "keymap_write: no keymap"); + KASSERT(sc->keymap != NULL, ("keymap_write: no keymap")); if (col >= 0 && col < sc->cols && row >= 0 && row < sc->rows) { sc->keymap[row * sc->cols + col] = key; diff --git a/sys/arm64/cloudabi64/cloudabi64_sysvec.c b/sys/arm64/cloudabi64/cloudabi64_sysvec.c index 913d127..cf3e594 100644 --- a/sys/arm64/cloudabi64/cloudabi64_sysvec.c +++ b/sys/arm64/cloudabi64/cloudabi64_sysvec.c @@ -77,6 +77,7 @@ cloudabi64_fetch_syscall_args(struct thread *td, struct syscall_args *sa) if (sa->code >= CLOUDABI64_SYS_MAXSYSCALL) return (ENOSYS); sa->callp = &cloudabi64_sysent[sa->code]; + sa->narg = sa->callp->sy_narg; /* Fetch system call arguments. */ for (i = 0; i < MAXARGS; i++) diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c index c2cfd82..e14af78 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c +++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c @@ -7348,7 +7348,7 @@ dtrace_probe(dtrace_id_t id, uintptr_t arg0, uintptr_t arg1, if (pred != NULL) { dtrace_difo_t *dp = pred->dtp_difo; - int rval; + uint64_t rval; rval = dtrace_dif_emulate(dp, &mstate, vstate, state); diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c index af2adfd..cbafa03 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c @@ -1125,6 +1125,7 @@ domount: */ ASSERT(VTOZ(*vpp)->z_zfsvfs != zfsvfs); VTOZ(*vpp)->z_zfsvfs->z_parent = zfsvfs; + (*vpp)->v_flag &= ~VROOT; } ZFS_EXIT(zfsvfs); diff --git a/sys/compat/linux/linux_emul.c b/sys/compat/linux/linux_emul.c index c2bf3ae..b244eea 100644 --- a/sys/compat/linux/linux_emul.c +++ b/sys/compat/linux/linux_emul.c @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include <compat/linux/linux_emul.h> #include <compat/linux/linux_misc.h> +#include <compat/linux/linux_persona.h> #include <compat/linux/linux_util.h> @@ -127,7 +128,7 @@ linux_proc_init(struct thread *td, struct thread *newtd, int flags) /* epoll should be destroyed in a case of exec. */ pem = pem_find(p); KASSERT(pem != NULL, ("proc_exit: proc emuldata not found.\n")); - + pem->persona = 0; if (pem->epoll != NULL) { emd = pem->epoll; pem->epoll = NULL; @@ -220,6 +221,9 @@ linux_proc_exec(void *arg __unused, struct proc *p, struct image_params *imgp) { struct thread *td = curthread; struct thread *othertd; +#if defined(__amd64__) + struct linux_pemuldata *pem; +#endif /* * In a case of execing from linux binary properly detach @@ -243,6 +247,17 @@ linux_proc_exec(void *arg __unused, struct proc *p, struct image_params *imgp) linux_proc_init(td, NULL, 0); else linux_proc_init(td, td, 0); +#if defined(__amd64__) + /* + * An IA32 executable which has executable stack will have the + * READ_IMPLIES_EXEC personality flag set automatically. + */ + if (SV_PROC_FLAG(td->td_proc, SV_ILP32) && + imgp->stack_prot & VM_PROT_EXECUTE) { + pem = pem_find(p); + pem->persona |= LINUX_READ_IMPLIES_EXEC; + } +#endif } } diff --git a/sys/compat/linux/linux_emul.h b/sys/compat/linux/linux_emul.h index 7262093..9a5a667 100644 --- a/sys/compat/linux/linux_emul.h +++ b/sys/compat/linux/linux_emul.h @@ -67,6 +67,7 @@ struct linux_pemuldata { uint32_t flags; /* process emuldata flags */ struct sx pem_sx; /* lock for this struct */ void *epoll; /* epoll data */ + uint32_t persona; /* process execution domain */ }; #define LINUX_PEM_XLOCK(p) sx_xlock(&(p)->pem_sx) diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 01fd25a..e61d363 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -1200,15 +1200,23 @@ linux_mknodat(struct thread *td, struct linux_mknodat_args *args) int linux_personality(struct thread *td, struct linux_personality_args *args) { + struct linux_pemuldata *pem; + struct proc *p = td->td_proc; + uint32_t old; + #ifdef DEBUG if (ldebug(personality)) - printf(ARGS(personality, "%lu"), (unsigned long)args->per); + printf(ARGS(personality, "%u"), args->per); #endif - if (args->per != 0) - return (EINVAL); - /* Yes Jim, it's still a Linux... */ - td->td_retval[0] = 0; + PROC_LOCK(p); + pem = pem_find(p); + old = pem->persona; + if (args->per != 0xffffffff) + pem->persona = args->per; + PROC_UNLOCK(p); + + td->td_retval[0] = old; return (0); } diff --git a/sys/compat/linux/linux_mmap.c b/sys/compat/linux/linux_mmap.c new file mode 100644 index 0000000..870f0be --- /dev/null +++ b/sys/compat/linux/linux_mmap.c @@ -0,0 +1,257 @@ +/*- + * Copyright (c) 2004 Tim J. Robbins + * Copyright (c) 2002 Doug Rabson + * Copyright (c) 2000 Marcel Moolenaar + * 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 + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + +#include <sys/capsicum.h> +#include <sys/file.h> +#include <sys/imgact.h> +#include <sys/ktr.h> +#include <sys/mman.h> +#include <sys/proc.h> +#include <sys/resourcevar.h> +#include <sys/sysent.h> +#include <sys/sysproto.h> + +#include <vm/pmap.h> +#include <vm/vm_map.h> + +#include <compat/linux/linux_emul.h> +#include <compat/linux/linux_mmap.h> +#include <compat/linux/linux_persona.h> +#include <compat/linux/linux_util.h> + + +#define STACK_SIZE (2 * 1024 * 1024) +#define GUARD_SIZE (4 * PAGE_SIZE) + +#if defined(__amd64__) +static void linux_fixup_prot(struct thread *td, int *prot); +#endif + + +int +linux_mmap_common(struct thread *td, uintptr_t addr, size_t len, int prot, + int flags, int fd, off_t pos) +{ + struct proc *p = td->td_proc; + struct vmspace *vms = td->td_proc->p_vmspace; + struct mmap_args /* { + caddr_t addr; + size_t len; + int prot; + int flags; + int fd; + off_t pos; + } */ bsd_args; + int error; + struct file *fp; + + cap_rights_t rights; + LINUX_CTR6(mmap2, "0x%lx, %ld, %ld, 0x%08lx, %ld, 0x%lx", + addr, len, prot, flags, fd, pos); + + error = 0; + bsd_args.flags = 0; + fp = NULL; + + /* + * Linux mmap(2): + * You must specify exactly one of MAP_SHARED and MAP_PRIVATE + */ + if (!((flags & LINUX_MAP_SHARED) ^ (flags & LINUX_MAP_PRIVATE))) + return (EINVAL); + + if (flags & LINUX_MAP_SHARED) + bsd_args.flags |= MAP_SHARED; + if (flags & LINUX_MAP_PRIVATE) + bsd_args.flags |= MAP_PRIVATE; + if (flags & LINUX_MAP_FIXED) + bsd_args.flags |= MAP_FIXED; + if (flags & LINUX_MAP_ANON) { + /* Enforce pos to be on page boundary, then ignore. */ + if ((pos & PAGE_MASK) != 0) + return (EINVAL); + pos = 0; + bsd_args.flags |= MAP_ANON; + } else + bsd_args.flags |= MAP_NOSYNC; + if (flags & LINUX_MAP_GROWSDOWN) + bsd_args.flags |= MAP_STACK; + + /* + * PROT_READ, PROT_WRITE, or PROT_EXEC implies PROT_READ and PROT_EXEC + * on Linux/i386 if the binary requires executable stack. + * We do this only for IA32 emulation as on native i386 this is does not + * make sense without PAE. + * + * XXX. Linux checks that the file system is not mounted with noexec. + */ + bsd_args.prot = prot; +#if defined(__amd64__) + linux_fixup_prot(td, &bsd_args.prot); +#endif + + /* Linux does not check file descriptor when MAP_ANONYMOUS is set. */ + bsd_args.fd = (bsd_args.flags & MAP_ANON) ? -1 : fd; + if (bsd_args.fd != -1) { + /* + * Linux follows Solaris mmap(2) description: + * The file descriptor fildes is opened with + * read permission, regardless of the + * protection options specified. + */ + + error = fget(td, bsd_args.fd, + cap_rights_init(&rights, CAP_MMAP), &fp); + if (error != 0) + return (error); + if (fp->f_type != DTYPE_VNODE) { + fdrop(fp, td); + return (EINVAL); + } + + /* Linux mmap() just fails for O_WRONLY files */ + if (!(fp->f_flag & FREAD)) { + fdrop(fp, td); + return (EACCES); + } + + fdrop(fp, td); + } + + if (flags & LINUX_MAP_GROWSDOWN) { + /* + * The Linux MAP_GROWSDOWN option does not limit auto + * growth of the region. Linux mmap with this option + * takes as addr the initial BOS, and as len, the initial + * region size. It can then grow down from addr without + * limit. However, Linux threads has an implicit internal + * limit to stack size of STACK_SIZE. Its just not + * enforced explicitly in Linux. But, here we impose + * a limit of (STACK_SIZE - GUARD_SIZE) on the stack + * region, since we can do this with our mmap. + * + * Our mmap with MAP_STACK takes addr as the maximum + * downsize limit on BOS, and as len the max size of + * the region. It then maps the top SGROWSIZ bytes, + * and auto grows the region down, up to the limit + * in addr. + * + * If we don't use the MAP_STACK option, the effect + * of this code is to allocate a stack region of a + * fixed size of (STACK_SIZE - GUARD_SIZE). + */ + + if ((caddr_t)addr + len > vms->vm_maxsaddr) { + /* + * Some Linux apps will attempt to mmap + * thread stacks near the top of their + * address space. If their TOS is greater + * than vm_maxsaddr, vm_map_growstack() + * will confuse the thread stack with the + * process stack and deliver a SEGV if they + * attempt to grow the thread stack past their + * current stacksize rlimit. To avoid this, + * adjust vm_maxsaddr upwards to reflect + * the current stacksize rlimit rather + * than the maximum possible stacksize. + * It would be better to adjust the + * mmap'ed region, but some apps do not check + * mmap's return value. + */ + PROC_LOCK(p); + vms->vm_maxsaddr = (char *)p->p_sysent->sv_usrstack - + lim_cur_proc(p, RLIMIT_STACK); + PROC_UNLOCK(p); + } + + /* + * This gives us our maximum stack size and a new BOS. + * If we're using VM_STACK, then mmap will just map + * the top SGROWSIZ bytes, and let the stack grow down + * to the limit at BOS. If we're not using VM_STACK + * we map the full stack, since we don't have a way + * to autogrow it. + */ + if (len > STACK_SIZE - GUARD_SIZE) { + bsd_args.addr = (caddr_t)addr; + bsd_args.len = len; + } else { + bsd_args.addr = (caddr_t)addr - + (STACK_SIZE - GUARD_SIZE - len); + bsd_args.len = STACK_SIZE - GUARD_SIZE; + } + } else { + bsd_args.addr = (caddr_t)addr; + bsd_args.len = len; + } + bsd_args.pos = pos; + + error = sys_mmap(td, &bsd_args); + + LINUX_CTR2(mmap2, "return: %d (%p)", error, td->td_retval[0]); + + return (error); +} + +int +linux_mprotect_common(struct thread *td, uintptr_t addr, size_t len, int prot) +{ + struct mprotect_args bsd_args; + + bsd_args.addr = (void *)addr; + bsd_args.len = len; + bsd_args.prot = prot; + +#if defined(__amd64__) + linux_fixup_prot(td, &bsd_args.prot); +#endif + return (sys_mprotect(td, &bsd_args)); +} + +#if defined(__amd64__) +static void +linux_fixup_prot(struct thread *td, int *prot) +{ + struct linux_pemuldata *pem; + + if (SV_PROC_FLAG(td->td_proc, SV_ILP32) && *prot & PROT_READ) { + pem = pem_find(td->td_proc); + if (pem->persona & LINUX_READ_IMPLIES_EXEC) + *prot |= PROT_EXEC; + } + +} +#endif diff --git a/sys/compat/linux/linux_mmap.h b/sys/compat/linux/linux_mmap.h new file mode 100644 index 0000000..a27d99d --- /dev/null +++ b/sys/compat/linux/linux_mmap.h @@ -0,0 +1,49 @@ +/*- + * Copyright (c) 2004 Tim J. Robbins + * Copyright (c) 2002 Doug Rabson + * Copyright (c) 2000 Marcel Moolenaar + * 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 + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LINUX_MMAP_H_ +#define _LINUX_MMAP_H_ + +/* mmap options */ +#define LINUX_MAP_SHARED 0x0001 +#define LINUX_MAP_PRIVATE 0x0002 +#define LINUX_MAP_FIXED 0x0010 +#define LINUX_MAP_ANON 0x0020 +#define LINUX_MAP_GROWSDOWN 0x0100 + + +int linux_mmap_common(struct thread *, uintptr_t, size_t, int, int, + int, off_t); +int linux_mprotect_common(struct thread *, uintptr_t, size_t, int); + +#endif /* _LINUX_MMAP_H_ */ diff --git a/sys/compat/linux/linux_persona.h b/sys/compat/linux/linux_persona.h new file mode 100644 index 0000000..8d84134 --- /dev/null +++ b/sys/compat/linux/linux_persona.h @@ -0,0 +1,56 @@ +/* + * $FreeBSD$ + */ + +#ifndef LINUX_PERSONALITY_H +#define LINUX_PERSONALITY_H + +/* + * Flags for bug emulation. + * + * These occupy the top three bytes. + */ +enum { + LINUX_UNAME26 = 0x0020000, + LINUX_ADDR_NO_RANDOMIZE = 0x0040000, /* disable randomization + * of VA space + */ + LINUX_FDPIC_FUNCPTRS = 0x0080000, /* userspace function + * ptrs point to descriptors + * (signal handling) + */ + LINUX_MMAP_PAGE_ZERO = 0x0100000, + LINUX_ADDR_COMPAT_LAYOUT = 0x0200000, + LINUX_READ_IMPLIES_EXEC = 0x0400000, + LINUX_ADDR_LIMIT_32BIT = 0x0800000, + LINUX_SHORT_INODE = 0x1000000, + LINUX_WHOLE_SECONDS = 0x2000000, + LINUX_STICKY_TIMEOUTS = 0x4000000, + LINUX_ADDR_LIMIT_3GB = 0x8000000, +}; + +/* + * Security-relevant compatibility flags that must be + * cleared upon setuid or setgid exec: + */ +#define LINUX_PER_CLEAR_ON_SETID (LINUX_READ_IMPLIES_EXEC | \ + LINUX_ADDR_NO_RANDOMIZE | \ + LINUX_ADDR_COMPAT_LAYOUT | \ + LINUX_MMAP_PAGE_ZERO) + +/* + * Personality types. + * + * These go in the low byte. Avoid using the top bit, it will + * conflict with error returns. + */ +enum { + LINUX_PER_LINUX = 0x0000, + LINUX_PER_LINUX_32BIT = 0x0000 | LINUX_ADDR_LIMIT_32BIT, + LINUX_PER_LINUX_FDPIC = 0x0000 | LINUX_FDPIC_FUNCPTRS, + LINUX_PER_LINUX32 = 0x0008, + LINUX_PER_LINUX32_3GB = 0x0008 | LINUX_ADDR_LIMIT_3GB, + LINUX_PER_MASK = 0x00ff, +}; + +#endif /* LINUX_PERSONALITY_H */ diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64 index 4949d71..ffe8b65 100644 --- a/sys/conf/files.amd64 +++ b/sys/conf/files.amd64 @@ -530,6 +530,7 @@ compat/linux/linux_ioctl.c optional compat_linux32 compat/linux/linux_ipc.c optional compat_linux32 compat/linux/linux_mib.c optional compat_linux32 compat/linux/linux_misc.c optional compat_linux32 +compat/linux/linux_mmap.c optional compat_linux32 compat/linux/linux_signal.c optional compat_linux32 compat/linux/linux_socket.c optional compat_linux32 compat/linux/linux_stats.c optional compat_linux32 diff --git a/sys/conf/files.i386 b/sys/conf/files.i386 index 50463c2..ac65941 100644 --- a/sys/conf/files.i386 +++ b/sys/conf/files.i386 @@ -96,6 +96,7 @@ compat/linux/linux_ioctl.c optional compat_linux compat/linux/linux_ipc.c optional compat_linux compat/linux/linux_mib.c optional compat_linux compat/linux/linux_misc.c optional compat_linux +compat/linux/linux_mmap.c optional compat_linux compat/linux/linux_signal.c optional compat_linux compat/linux/linux_socket.c optional compat_linux compat/linux/linux_stats.c optional compat_linux diff --git a/sys/conf/files.pc98 b/sys/conf/files.pc98 index 9f0ef00..ecb3d4a 100644 --- a/sys/conf/files.pc98 +++ b/sys/conf/files.pc98 @@ -63,6 +63,7 @@ compat/linux/linux_ioctl.c optional compat_linux compat/linux/linux_ipc.c optional compat_linux compat/linux/linux_mib.c optional compat_linux compat/linux/linux_misc.c optional compat_linux +compat/linux/linux_mmap.c optional compat_linux compat/linux/linux_signal.c optional compat_linux compat/linux/linux_socket.c optional compat_linux compat/linux/linux_stats.c optional compat_linux diff --git a/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c b/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c index c0c4563..33a638c 100644 --- a/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c +++ b/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c @@ -805,6 +805,13 @@ hv_storvsc_on_iocompletion(struct storvsc_softc *sc, vm_srb = &vstor_packet->u.vm_srb; + /* + * Copy some fields of the host's response into the request structure, + * because the fields will be used later in storvsc_io_done(). + */ + request->vstor_packet.u.vm_srb.scsi_status = vm_srb->scsi_status; + request->vstor_packet.u.vm_srb.transfer_len = vm_srb->transfer_len; + if (((vm_srb->scsi_status & 0xFF) == SCSI_STATUS_CHECK_COND) && (vm_srb->srb_status & SRB_STATUS_AUTOSENSE_VALID)) { /* Autosense data available */ @@ -1939,62 +1946,24 @@ create_storvsc_request(union ccb *ccb, struct hv_storvsc_request *reqp) } /* - * Modified based on scsi_print_inquiry which is responsible to - * print the detail information for scsi_inquiry_data. - * + * SCSI Inquiry checks qualifier and type. + * If qualifier is 011b, means the device server is not capable + * of supporting a peripheral device on this logical unit, and + * the type should be set to 1Fh. + * * Return 1 if it is valid, 0 otherwise. */ static inline int is_inquiry_valid(const struct scsi_inquiry_data *inq_data) { uint8_t type; - char vendor[16], product[48], revision[16]; - - /* - * Check device type and qualifier - */ - if (!(SID_QUAL_IS_VENDOR_UNIQUE(inq_data) || - SID_QUAL(inq_data) == SID_QUAL_LU_CONNECTED)) + if (SID_QUAL(inq_data) != SID_QUAL_LU_CONNECTED) { return (0); - + } type = SID_TYPE(inq_data); - switch (type) { - case T_DIRECT: - case T_SEQUENTIAL: - case T_PRINTER: - case T_PROCESSOR: - case T_WORM: - case T_CDROM: - case T_SCANNER: - case T_OPTICAL: - case T_CHANGER: - case T_COMM: - case T_STORARRAY: - case T_ENCLOSURE: - case T_RBC: - case T_OCRW: - case T_OSD: - case T_ADC: - break; - case T_NODEVICE: - default: + if (type == T_NODEVICE) { return (0); } - - /* - * Check vendor, product, and revision - */ - cam_strvis(vendor, inq_data->vendor, sizeof(inq_data->vendor), - sizeof(vendor)); - cam_strvis(product, inq_data->product, sizeof(inq_data->product), - sizeof(product)); - cam_strvis(revision, inq_data->revision, sizeof(inq_data->revision), - sizeof(revision)); - if (strlen(vendor) == 0 || - strlen(product) == 0 || - strlen(revision) == 0) - return (0); - return (1); } @@ -2071,7 +2040,6 @@ storvsc_io_done(struct hv_storvsc_request *reqp) ccb->ccb_h.status &= ~CAM_STATUS_MASK; if (vm_srb->scsi_status == SCSI_STATUS_OK) { const struct scsi_generic *cmd; - /* * Check whether the data for INQUIRY cmd is valid or * not. Windows 10 and Windows 2016 send all zero @@ -2080,23 +2048,59 @@ storvsc_io_done(struct hv_storvsc_request *reqp) cmd = (const struct scsi_generic *) ((ccb->ccb_h.flags & CAM_CDB_POINTER) ? csio->cdb_io.cdb_ptr : csio->cdb_io.cdb_bytes); - if (cmd->opcode == INQUIRY && - /* - * XXX: Temporary work around disk hot plugin on win2k12r2, - * only filtering the invalid disk on win10 or 2016 server. - * So, the hot plugin on win10 and 2016 server needs - * to be fixed. + if (cmd->opcode == INQUIRY) { + /* + * The host of Windows 10 or 2016 server will response + * the inquiry request with invalid data for unexisted device: + [0x7f 0x0 0x5 0x2 0x1f ... ] + * But on windows 2012 R2, the response is: + [0x7f 0x0 0x0 0x0 0x0 ] + * That is why here wants to validate the inquiry response. + * The validation will skip the INQUIRY whose response is short, + * which is less than SHORT_INQUIRY_LENGTH (36). + * + * For more information about INQUIRY, please refer to: + * ftp://ftp.avc-pioneer.com/Mtfuji_7/Proposal/Jun09/INQUIRY.pdf */ - vmstor_proto_version == VMSTOR_PROTOCOL_VERSION_WIN10 && - is_inquiry_valid( - (const struct scsi_inquiry_data *)csio->data_ptr) == 0) { + const struct scsi_inquiry_data *inq_data = + (const struct scsi_inquiry_data *)csio->data_ptr; + uint8_t* resp_buf = (uint8_t*)csio->data_ptr; + /* Get the buffer length reported by host */ + int resp_xfer_len = vm_srb->transfer_len; + /* Get the available buffer length */ + int resp_buf_len = resp_xfer_len >= 5 ? resp_buf[4] + 5 : 0; + int data_len = (resp_buf_len < resp_xfer_len) ? resp_buf_len : resp_xfer_len; + if (data_len < SHORT_INQUIRY_LENGTH) { + ccb->ccb_h.status |= CAM_REQ_CMP; + if (bootverbose && data_len >= 5) { + mtx_lock(&sc->hs_lock); + xpt_print(ccb->ccb_h.path, + "storvsc skips the validation for short inquiry (%d)" + " [%x %x %x %x %x]\n", + data_len,resp_buf[0],resp_buf[1],resp_buf[2], + resp_buf[3],resp_buf[4]); + mtx_unlock(&sc->hs_lock); + } + } else if (is_inquiry_valid(inq_data) == 0) { ccb->ccb_h.status |= CAM_DEV_NOT_THERE; + if (bootverbose && data_len >= 5) { + mtx_lock(&sc->hs_lock); + xpt_print(ccb->ccb_h.path, + "storvsc uninstalled invalid device" + " [%x %x %x %x %x]\n", + resp_buf[0],resp_buf[1],resp_buf[2],resp_buf[3],resp_buf[4]); + mtx_unlock(&sc->hs_lock); + } + } else { + ccb->ccb_h.status |= CAM_REQ_CMP; if (bootverbose) { mtx_lock(&sc->hs_lock); xpt_print(ccb->ccb_h.path, - "storvsc uninstalled device\n"); + "storvsc has passed inquiry response (%d) validation\n", + data_len); mtx_unlock(&sc->hs_lock); } + } } else { ccb->ccb_h.status |= CAM_REQ_CMP; } diff --git a/sys/i386/conf/GENERIC-NODEBUG b/sys/i386/conf/GENERIC-NODEBUG deleted file mode 100644 index 2aabed6..0000000 --- a/sys/i386/conf/GENERIC-NODEBUG +++ /dev/null @@ -1,38 +0,0 @@ -# -# GENERIC-NODEBUG -- WITNESS and INVARIANTS free kernel configuration file -# for FreeBSD/i386 -# -# This configuration file removes several debugging options, including -# WITNESS and INVARIANTS checking, which are known to have significant -# performance impact on running systems. When benchmarking new features -# this kernel should be used instead of the standard GENERIC. -# This kernel configuration should never appear outside of the HEAD -# of the FreeBSD tree. -# -# For more information on this file, please read the config(5) manual page, -# and/or the handbook section on Kernel Configuration Files: -# -# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html -# -# The handbook is also available locally in /usr/share/doc/handbook -# if you've installed the doc distribution, otherwise always see the -# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the -# latest information. -# -# An exhaustive list of options and more detailed explanations of the -# device lines is also present in the ../../conf/NOTES and NOTES files. -# If you are in doubt as to the purpose or necessity of a line, check first -# in NOTES. -# -# $FreeBSD$ - -include GENERIC - -ident GENERIC-NODEBUG - -nooptions INVARIANTS -nooptions INVARIANT_SUPPORT -nooptions WITNESS -nooptions WITNESS_SKIPSPIN -nooptions DEADLKRES - diff --git a/sys/i386/i386/exception.s b/sys/i386/i386/exception.s index c03cbce..a8f738a 100644 --- a/sys/i386/i386/exception.s +++ b/sys/i386/i386/exception.s @@ -234,7 +234,7 @@ IDTVEC(lcall_syscall) pushfl /* save eflags */ popl 8(%esp) /* shuffle into tf_eflags */ pushl $7 /* sizeof "lcall 7,0" */ - subl $4,%esp /* skip over tf_trapno */ + pushl $0 /* tf_trapno */ pushal pushl $0 movw %ds,(%esp) @@ -263,7 +263,7 @@ IDTVEC(lcall_syscall) SUPERALIGN_TEXT IDTVEC(int0x80_syscall) pushl $2 /* sizeof "int 0x80" */ - subl $4,%esp /* skip over tf_trapno */ + pushl $0 /* tf_trapno */ pushal pushl $0 movw %ds,(%esp) diff --git a/sys/i386/include/intr_machdep.h b/sys/i386/include/intr_machdep.h index 5b9c759..629f137 100644 --- a/sys/i386/include/intr_machdep.h +++ b/sys/i386/include/intr_machdep.h @@ -140,6 +140,8 @@ extern cpuset_t intr_cpus; extern struct mtx icu_lock; extern int elcr_found; +extern int msix_disable_migration; + #ifndef DEV_ATPIC void atpic_reset(void); #endif diff --git a/sys/i386/linux/linux.h b/sys/i386/linux/linux.h index 36b2084..42e836c 100644 --- a/sys/i386/linux/linux.h +++ b/sys/i386/linux/linux.h @@ -140,13 +140,6 @@ struct l_rlimit { l_ulong rlim_max; }; -/* mmap options */ -#define LINUX_MAP_SHARED 0x0001 -#define LINUX_MAP_PRIVATE 0x0002 -#define LINUX_MAP_FIXED 0x0010 -#define LINUX_MAP_ANON 0x0020 -#define LINUX_MAP_GROWSDOWN 0x0100 - struct l_mmap_argv { l_uintptr_t addr; l_size_t len; diff --git a/sys/i386/linux/linux_machdep.c b/sys/i386/linux/linux_machdep.c index 4fb5785..4b4b886 100644 --- a/sys/i386/linux/linux_machdep.c +++ b/sys/i386/linux/linux_machdep.c @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include <i386/linux/linux_proto.h> #include <compat/linux/linux_ipc.h> #include <compat/linux/linux_misc.h> +#include <compat/linux/linux_mmap.h> #include <compat/linux/linux_signal.h> #include <compat/linux/linux_util.h> #include <compat/linux/linux_emul.h> @@ -95,10 +96,6 @@ struct l_old_select_argv { struct l_timeval *timeout; }; -static int linux_mmap_common(struct thread *td, l_uintptr_t addr, - l_size_t len, l_int prot, l_int flags, l_int fd, - l_loff_t pos); - int linux_execve(struct thread *td, struct linux_execve_args *args) @@ -340,9 +337,6 @@ linux_set_upcall_kse(struct thread *td, register_t stack) return (0); } -#define STACK_SIZE (2 * 1024 * 1024) -#define GUARD_SIZE (4 * PAGE_SIZE) - int linux_mmap2(struct thread *td, struct linux_mmap2_args *args) { @@ -381,187 +375,11 @@ linux_mmap(struct thread *td, struct linux_mmap_args *args) (uint32_t)linux_args.pgoff)); } -static int -linux_mmap_common(struct thread *td, l_uintptr_t addr, l_size_t len, l_int prot, - l_int flags, l_int fd, l_loff_t pos) -{ - struct proc *p = td->td_proc; - struct mmap_args /* { - caddr_t addr; - size_t len; - int prot; - int flags; - int fd; - long pad; - off_t pos; - } */ bsd_args; - int error; - struct file *fp; - cap_rights_t rights; - - error = 0; - bsd_args.flags = 0; - fp = NULL; - - /* - * Linux mmap(2): - * You must specify exactly one of MAP_SHARED and MAP_PRIVATE - */ - if (!((flags & LINUX_MAP_SHARED) ^ (flags & LINUX_MAP_PRIVATE))) - return (EINVAL); - - if (flags & LINUX_MAP_SHARED) - bsd_args.flags |= MAP_SHARED; - if (flags & LINUX_MAP_PRIVATE) - bsd_args.flags |= MAP_PRIVATE; - if (flags & LINUX_MAP_FIXED) - bsd_args.flags |= MAP_FIXED; - if (flags & LINUX_MAP_ANON) { - /* Enforce pos to be on page boundary, then ignore. */ - if ((pos & PAGE_MASK) != 0) - return (EINVAL); - pos = 0; - bsd_args.flags |= MAP_ANON; - } else - bsd_args.flags |= MAP_NOSYNC; - if (flags & LINUX_MAP_GROWSDOWN) - bsd_args.flags |= MAP_STACK; - - /* - * PROT_READ, PROT_WRITE, or PROT_EXEC implies PROT_READ and PROT_EXEC - * on Linux/i386. We do this to ensure maximum compatibility. - * Linux/ia64 does the same in i386 emulation mode. - */ - bsd_args.prot = prot; - if (bsd_args.prot & (PROT_READ | PROT_WRITE | PROT_EXEC)) - bsd_args.prot |= PROT_READ | PROT_EXEC; - - /* Linux does not check file descriptor when MAP_ANONYMOUS is set. */ - bsd_args.fd = (bsd_args.flags & MAP_ANON) ? -1 : fd; - if (bsd_args.fd != -1) { - /* - * Linux follows Solaris mmap(2) description: - * The file descriptor fildes is opened with - * read permission, regardless of the - * protection options specified. - * - * Checking just CAP_MMAP is fine here, since the real work - * is done in the FreeBSD mmap(). - */ - - error = fget(td, bsd_args.fd, - cap_rights_init(&rights, CAP_MMAP), &fp); - if (error != 0) - return (error); - if (fp->f_type != DTYPE_VNODE) { - fdrop(fp, td); - return (EINVAL); - } - - /* Linux mmap() just fails for O_WRONLY files */ - if (!(fp->f_flag & FREAD)) { - fdrop(fp, td); - return (EACCES); - } - - fdrop(fp, td); - } - - if (flags & LINUX_MAP_GROWSDOWN) { - /* - * The Linux MAP_GROWSDOWN option does not limit auto - * growth of the region. Linux mmap with this option - * takes as addr the inital BOS, and as len, the initial - * region size. It can then grow down from addr without - * limit. However, linux threads has an implicit internal - * limit to stack size of STACK_SIZE. Its just not - * enforced explicitly in linux. But, here we impose - * a limit of (STACK_SIZE - GUARD_SIZE) on the stack - * region, since we can do this with our mmap. - * - * Our mmap with MAP_STACK takes addr as the maximum - * downsize limit on BOS, and as len the max size of - * the region. It them maps the top SGROWSIZ bytes, - * and auto grows the region down, up to the limit - * in addr. - * - * If we don't use the MAP_STACK option, the effect - * of this code is to allocate a stack region of a - * fixed size of (STACK_SIZE - GUARD_SIZE). - */ - - if ((caddr_t)PTRIN(addr) + len > p->p_vmspace->vm_maxsaddr) { - /* - * Some linux apps will attempt to mmap - * thread stacks near the top of their - * address space. If their TOS is greater - * than vm_maxsaddr, vm_map_growstack() - * will confuse the thread stack with the - * process stack and deliver a SEGV if they - * attempt to grow the thread stack past their - * current stacksize rlimit. To avoid this, - * adjust vm_maxsaddr upwards to reflect - * the current stacksize rlimit rather - * than the maximum possible stacksize. - * It would be better to adjust the - * mmap'ed region, but some apps do not check - * mmap's return value. - */ - PROC_LOCK(p); - p->p_vmspace->vm_maxsaddr = (char *)USRSTACK - - lim_cur_proc(p, RLIMIT_STACK); - PROC_UNLOCK(p); - } - - /* - * This gives us our maximum stack size and a new BOS. - * If we're using VM_STACK, then mmap will just map - * the top SGROWSIZ bytes, and let the stack grow down - * to the limit at BOS. If we're not using VM_STACK - * we map the full stack, since we don't have a way - * to autogrow it. - */ - if (len > STACK_SIZE - GUARD_SIZE) { - bsd_args.addr = (caddr_t)PTRIN(addr); - bsd_args.len = len; - } else { - bsd_args.addr = (caddr_t)PTRIN(addr) - - (STACK_SIZE - GUARD_SIZE - len); - bsd_args.len = STACK_SIZE - GUARD_SIZE; - } - } else { - bsd_args.addr = (caddr_t)PTRIN(addr); - bsd_args.len = len; - } - bsd_args.pos = pos; - -#ifdef DEBUG - if (ldebug(mmap)) - printf("-> %s(%p, %d, %d, 0x%08x, %d, 0x%x)\n", - __func__, - (void *)bsd_args.addr, bsd_args.len, bsd_args.prot, - bsd_args.flags, bsd_args.fd, (int)bsd_args.pos); -#endif - error = sys_mmap(td, &bsd_args); -#ifdef DEBUG - if (ldebug(mmap)) - printf("-> %s() return: 0x%x (0x%08x)\n", - __func__, error, (u_int)td->td_retval[0]); -#endif - return (error); -} - int linux_mprotect(struct thread *td, struct linux_mprotect_args *uap) { - struct mprotect_args bsd_args; - - bsd_args.addr = uap->addr; - bsd_args.len = uap->len; - bsd_args.prot = uap->prot; - if (bsd_args.prot & (PROT_READ | PROT_WRITE | PROT_EXEC)) - bsd_args.prot |= PROT_READ | PROT_EXEC; - return (sys_mprotect(td, &bsd_args)); + + return (linux_mprotect_common(td, PTROUT(uap->addr), uap->len, uap->prot)); } int diff --git a/sys/i386/linux/linux_proto.h b/sys/i386/linux/linux_proto.h index 87926f4..19b6881 100644 --- a/sys/i386/linux/linux_proto.h +++ b/sys/i386/linux/linux_proto.h @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 300359 2016-05-21 08:01:14Z dchagin + * created from FreeBSD: head/sys/i386/linux/syscalls.master 302515 2016-07-10 08:15:50Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -435,7 +435,7 @@ struct linux_sysfs_args { char arg2_l_[PADL_(l_ulong)]; l_ulong arg2; char arg2_r_[PADR_(l_ulong)]; }; struct linux_personality_args { - char per_l_[PADL_(l_ulong)]; l_ulong per; char per_r_[PADR_(l_ulong)]; + char per_l_[PADL_(l_uint)]; l_uint per; char per_r_[PADR_(l_uint)]; }; struct linux_setfsuid16_args { char uid_l_[PADL_(l_uid16_t)]; l_uid16_t uid; char uid_r_[PADR_(l_uid16_t)]; @@ -1486,6 +1486,13 @@ int linux_process_vm_writev(struct thread *, struct linux_process_vm_writev_args #endif /* COMPAT_FREEBSD7 */ + +#ifdef COMPAT_FREEBSD10 + +#define nosys linux_nosys + +#endif /* COMPAT_FREEBSD10 */ + #define LINUX_SYS_AUE_linux_exit AUE_EXIT #define LINUX_SYS_AUE_linux_fork AUE_FORK #define LINUX_SYS_AUE_linux_open AUE_OPEN_RWTC diff --git a/sys/i386/linux/linux_syscall.h b/sys/i386/linux/linux_syscall.h index d028629..3d2204f 100644 --- a/sys/i386/linux/linux_syscall.h +++ b/sys/i386/linux/linux_syscall.h @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 300359 2016-05-21 08:01:14Z dchagin + * created from FreeBSD: head/sys/i386/linux/syscalls.master 302515 2016-07-10 08:15:50Z dchagin */ #define LINUX_SYS_linux_exit 1 diff --git a/sys/i386/linux/linux_syscalls.c b/sys/i386/linux/linux_syscalls.c index cdde808..fc695e4 100644 --- a/sys/i386/linux/linux_syscalls.c +++ b/sys/i386/linux/linux_syscalls.c @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 300359 2016-05-21 08:01:14Z dchagin + * created from FreeBSD: head/sys/i386/linux/syscalls.master 302515 2016-07-10 08:15:50Z dchagin */ const char *linux_syscallnames[] = { diff --git a/sys/i386/linux/linux_sysent.c b/sys/i386/linux/linux_sysent.c index 7268964..10e3ac3 100644 --- a/sys/i386/linux/linux_sysent.c +++ b/sys/i386/linux/linux_sysent.c @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/i386/linux/syscalls.master 300359 2016-05-21 08:01:14Z dchagin + * created from FreeBSD: head/sys/i386/linux/syscalls.master 302515 2016-07-10 08:15:50Z dchagin */ #include <sys/param.h> diff --git a/sys/i386/linux/linux_systrace_args.c b/sys/i386/linux/linux_systrace_args.c index f02f34f..0a0bf42 100644 --- a/sys/i386/linux/linux_systrace_args.c +++ b/sys/i386/linux/linux_systrace_args.c @@ -948,7 +948,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* linux_personality */ case 136: { struct linux_personality_args *p = params; - iarg[0] = p->per; /* l_ulong */ + iarg[0] = p->per; /* l_uint */ *n_args = 1; break; } @@ -3849,7 +3849,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) case 136: switch(ndx) { case 0: - p = "l_ulong"; + p = "l_uint"; break; default: break; diff --git a/sys/i386/linux/syscalls.master b/sys/i386/linux/syscalls.master index 7ec3154..5899adb 100644 --- a/sys/i386/linux/syscalls.master +++ b/sys/i386/linux/syscalls.master @@ -240,7 +240,7 @@ 134 AUE_BDFLUSH STD { int linux_bdflush(void); } 135 AUE_NULL STD { int linux_sysfs(l_int option, \ l_ulong arg1, l_ulong arg2); } -136 AUE_PERSONALITY STD { int linux_personality(l_ulong per); } +136 AUE_PERSONALITY STD { int linux_personality(l_uint per); } 137 AUE_NULL UNIMPL afs_syscall 138 AUE_SETFSUID STD { int linux_setfsuid16(l_uid16_t uid); } 139 AUE_SETFSGID STD { int linux_setfsgid16(l_gid16_t gid); } diff --git a/sys/modules/linux/Makefile b/sys/modules/linux/Makefile index f262972..d1707c9 100644 --- a/sys/modules/linux/Makefile +++ b/sys/modules/linux/Makefile @@ -30,7 +30,7 @@ SRCS+= opt_apic.h OBJS= ${VDSO}.so .if ${MACHINE_CPUARCH} == "i386" -SRCS+= linux_ptrace.c imgact_linux.c linux_util.c linux_mib.c \ +SRCS+= linux_ptrace.c imgact_linux.c linux_util.c linux_mib.c linux_mmap.c \ linux_emul.c opt_cpu.h linux.c .endif diff --git a/sys/modules/linux_common/Makefile b/sys/modules/linux_common/Makefile index 91449f7..2301796 100644 --- a/sys/modules/linux_common/Makefile +++ b/sys/modules/linux_common/Makefile @@ -3,7 +3,7 @@ .PATH: ${.CURDIR}/../../compat/linux KMOD= linux_common -SRCS= linux_common.c linux_mib.c linux_util.c linux_emul.c \ +SRCS= linux_common.c linux_mib.c linux_mmap.c linux_util.c linux_emul.c \ linux.c opt_compat.h device_if.h vnode_if.h bus_if.h EXPORT_SYMS= diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 67282b7..c11da16 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -626,12 +626,12 @@ MODULE_DEPEND(iflib, netmap, 1, 1, 1); /* * device-specific sysctl variables: * - * ixl_crcstrip: 0: keep CRC in rx frames (default), 1: strip it. + * iflib_crcstrip: 0: keep CRC in rx frames (default), 1: strip it. * During regular operations the CRC is stripped, but on some * hardware reception of frames not multiple of 64 is slower, * so using crcstrip=0 helps in benchmarks. * - * ixl_rx_miss, ixl_rx_miss_bufs: + * iflib_rx_miss, iflib_rx_miss_bufs: * count packets that might be missed due to lost interrupts. */ SYSCTL_DECL(_dev_netmap); @@ -646,7 +646,7 @@ SYSCTL_INT(_dev_netmap, OID_AUTO, iflib_crcstrip, int iflib_rx_miss, iflib_rx_miss_bufs; SYSCTL_INT(_dev_netmap, OID_AUTO, iflib_rx_miss, CTLFLAG_RW, &iflib_rx_miss, 0, "potentially missed rx intr"); -SYSCTL_INT(_dev_netmap, OID_AUTO, ixl_rx_miss_bufs, +SYSCTL_INT(_dev_netmap, OID_AUTO, iflib_rx_miss_bufs, CTLFLAG_RW, &iflib_rx_miss_bufs, 0, "potentially missed rx intr bufs"); /* diff --git a/sys/net/mppcc.c b/sys/net/mppcc.c index 01ce3ff..8ec21ad 100644 --- a/sys/net/mppcc.c +++ b/sys/net/mppcc.c @@ -232,8 +232,9 @@ int MPPC_Compress(u_char **src, u_char **dst, u_long *srcCnt, u_long *dstCnt, ch } else if (off < 8192) { /* 16-bit offset; 320 <= offset < 8192 */ putbits16(*dst, 0xc000|(off-320), 16, &olen, &l); } else { /* NOTREACHED */ + __unreachable(); rtn &= ~MPPC_OK; - return rtn; + return (rtn); } /* Encode length of match. */ diff --git a/sys/net/mppcd.c b/sys/net/mppcd.c index c1730e5..d8e663c 100644 --- a/sys/net/mppcd.c +++ b/sys/net/mppcd.c @@ -170,7 +170,7 @@ int MPPC_Decompress(u_char **src, u_char **dst, u_long *srcCnt, u_long *dstCnt, rtn &= ~MPPC_OK; return (rtn); } - } else { /* NOTREACHED */ + } else { /* This shouldn't happen. */ rtn &= ~MPPC_OK; return (rtn); } diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index c03bf5e..a768f74 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -2659,8 +2659,8 @@ ip6_setpktopt(int optname, u_char *buf, int len, struct ip6_pktopts *opt, if (ifp == NULL) return (ENXIO); } - if (ifp != NULL && ( - ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED)) + if (ifp != NULL && (ifp->if_afdata[AF_INET6] == NULL || + (ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) != 0)) return (ENETDOWN); if (ifp != NULL && diff --git a/sys/netpfil/ipfw/dn_sched_fq_pie.c b/sys/netpfil/ipfw/dn_sched_fq_pie.c index 2883cf8..bfcd6c5 100644 --- a/sys/netpfil/ipfw/dn_sched_fq_pie.c +++ b/sys/netpfil/ipfw/dn_sched_fq_pie.c @@ -111,7 +111,7 @@ struct fq_pie_flow { int deficit; int active; /* 1: flow is active (in a list) */ struct pie_status pst; /* pie status variables */ - struct fq_pie_si *psi; /* parent scheduler instance */ + struct fq_pie_si_extra *psi_extra; STAILQ_ENTRY(fq_pie_flow) flowchain; }; @@ -120,23 +120,30 @@ struct fq_pie_schk { struct dn_sch_fq_pie_parms cfg; }; + +/* fq_pie scheduler instance extra state vars. + * The purpose of separation this structure is to preserve number of active + * sub-queues and the flows array pointer even after the scheduler instance + * is destroyed. + * Preserving these varaiables allows freeing the allocated memory by + * fqpie_callout_cleanup() independently from fq_pie_free_sched(). + */ +struct fq_pie_si_extra { + uint32_t nr_active_q; /* number of active queues */ + struct fq_pie_flow *flows; /* array of flows (queues) */ + }; + /* fq_pie scheduler instance */ struct fq_pie_si { - struct dn_sch_inst _si; /* standard scheduler instance */ + struct dn_sch_inst _si; /* standard scheduler instance. SHOULD BE FIRST */ struct dn_queue main_q; /* main queue is after si directly */ - uint32_t nr_active_q; - struct fq_pie_flow *flows; /* array of flows (queues) */ uint32_t perturbation; /* random value */ struct fq_pie_list newflows; /* list of new queues */ struct fq_pie_list oldflows; /* list of old queues */ + struct fq_pie_si_extra *si_extra; /* extra state vars*/ }; -struct mem_to_free { - void *mem_flows; - void *mem_callout; -}; -static struct mtx freemem_mtx; static struct dn_alg fq_pie_desc; /* Default FQ-PIE parameters including PIE */ @@ -371,22 +378,6 @@ fq_calculate_drop_prob(void *x) int64_t p, prob, oldprob; aqm_time_t now; - /* dealing with race condition */ - if (callout_pending(&pst->aqm_pie_callout)) { - /* callout was reset */ - mtx_unlock(&pst->lock_mtx); - return; - } - - if (!callout_active(&pst->aqm_pie_callout)) { - /* callout was stopped */ - mtx_unlock(&pst->lock_mtx); - mtx_destroy(&pst->lock_mtx); - q->psi->nr_active_q--; - return; - } - callout_deactivate(&pst->aqm_pie_callout); - now = AQM_UNOW; pprms = pst->parms; prob = pst->drop_prob; @@ -524,20 +515,17 @@ fq_deactivate_pie(struct pie_status *pst) * Initialize PIE for sub-queue 'q' */ static int -pie_init(struct fq_pie_flow *q) +pie_init(struct fq_pie_flow *q, struct fq_pie_schk *fqpie_schk) { struct pie_status *pst=&q->pst; struct dn_aqm_pie_parms *pprms = pst->parms; - struct fq_pie_schk *fqpie_schk; - - fqpie_schk = (struct fq_pie_schk *)(q->psi->_si.sched+1); - int err = 0; + int err = 0; if (!pprms){ D("AQM_PIE is not configured"); err = EINVAL; } else { - q->psi->nr_active_q++; + q->psi_extra->nr_active_q++; /* For speed optimization, we caculate 1/3 queue size once here */ // XXX limit divided by number of queues divided by 3 ??? @@ -553,8 +541,36 @@ pie_init(struct fq_pie_flow *q) } /* + * callout function to destroy PIE lock, and free fq_pie flows and fq_pie si + * extra memory when number of active sub-queues reaches zero. + * 'x' is a fq_pie_flow to be destroyed + */ +static void +fqpie_callout_cleanup(void *x) +{ + struct fq_pie_flow *q = x; + struct pie_status *pst = &q->pst; + struct fq_pie_si_extra *psi_extra; + + mtx_unlock(&pst->lock_mtx); + mtx_destroy(&pst->lock_mtx); + psi_extra = q->psi_extra; + + DN_BH_WLOCK(); + psi_extra->nr_active_q--; + + /* when all sub-queues are destroyed, free flows fq_pie extra vars memory */ + if (!psi_extra->nr_active_q) { + free(psi_extra->flows, M_DUMMYNET); + free(psi_extra, M_DUMMYNET); + fq_pie_desc.ref_count--; + } + DN_BH_WUNLOCK(); +} + +/* * Clean up PIE status for sub-queue 'q' - * Stop callout timer and destroy mtx + * Stop callout timer and destroy mtx using fqpie_callout_cleanup() callout. */ static int pie_cleanup(struct fq_pie_flow *q) @@ -562,14 +578,9 @@ pie_cleanup(struct fq_pie_flow *q) struct pie_status *pst = &q->pst; mtx_lock(&pst->lock_mtx); - if (callout_stop(&pst->aqm_pie_callout) || !(pst->sflags & PIE_ACTIVE)) { - mtx_unlock(&pst->lock_mtx); - mtx_destroy(&pst->lock_mtx); - q->psi->nr_active_q--; - } else { - mtx_unlock(&pst->lock_mtx); - return EBUSY; - } + callout_reset_sbt(&pst->aqm_pie_callout, + SBT_1US, 0, fqpie_callout_cleanup, q, 0); + mtx_unlock(&pst->lock_mtx); return 0; } @@ -831,10 +842,12 @@ fq_pie_enqueue(struct dn_sch_inst *_si, struct dn_queue *_q, struct fq_pie_schk *schk; struct dn_sch_fq_pie_parms *param; struct dn_queue *mainq; + struct fq_pie_flow *flows; int idx, drop, i, maxidx; mainq = (struct dn_queue *)(_si + 1); si = (struct fq_pie_si *)_si; + flows = si->si_extra->flows; schk = (struct fq_pie_schk *)(si->_si.sched+1); param = &schk->cfg; @@ -844,7 +857,7 @@ fq_pie_enqueue(struct dn_sch_inst *_si, struct dn_queue *_q, /* enqueue packet into appropriate queue using PIE AQM. * Note: 'pie_enqueue' function returns 1 only when it unable to * add timestamp to packet (no limit check)*/ - drop = pie_enqueue(&si->flows[idx], m, si); + drop = pie_enqueue(&flows[idx], m, si); /* pie unable to timestamp a packet */ if (drop) @@ -853,11 +866,11 @@ fq_pie_enqueue(struct dn_sch_inst *_si, struct dn_queue *_q, /* If the flow (sub-queue) is not active ,then add it to tail of * new flows list, initialize and activate it. */ - if (!si->flows[idx].active) { - STAILQ_INSERT_TAIL(&si->newflows, &si->flows[idx], flowchain); - si->flows[idx].deficit = param->quantum; - fq_activate_pie(&si->flows[idx]); - si->flows[idx].active = 1; + if (!flows[idx].active) { + STAILQ_INSERT_TAIL(&si->newflows, &flows[idx], flowchain); + flows[idx].deficit = param->quantum; + fq_activate_pie(&flows[idx]); + flows[idx].active = 1; } /* check the limit for all queues and remove a packet from the @@ -866,15 +879,15 @@ fq_pie_enqueue(struct dn_sch_inst *_si, struct dn_queue *_q, if (mainq->ni.length > schk->cfg.limit) { /* find first active flow */ for (maxidx = 0; maxidx < schk->cfg.flows_cnt; maxidx++) - if (si->flows[maxidx].active) + if (flows[maxidx].active) break; if (maxidx < schk->cfg.flows_cnt) { /* find the largest sub- queue */ for (i = maxidx + 1; i < schk->cfg.flows_cnt; i++) - if (si->flows[i].active && si->flows[i].stats.length > - si->flows[maxidx].stats.length) + if (flows[i].active && flows[i].stats.length > + flows[maxidx].stats.length) maxidx = i; - pie_drop_head(&si->flows[maxidx], si); + pie_drop_head(&flows[maxidx], si); drop = 1; } } @@ -974,12 +987,13 @@ fq_pie_new_sched(struct dn_sch_inst *_si) struct fq_pie_si *si; struct dn_queue *q; struct fq_pie_schk *schk; + struct fq_pie_flow *flows; int i; si = (struct fq_pie_si *)_si; schk = (struct fq_pie_schk *)(_si->sched+1); - if(si->flows) { + if(si->si_extra) { D("si already configured!"); return 0; } @@ -990,17 +1004,27 @@ fq_pie_new_sched(struct dn_sch_inst *_si) q->_si = _si; q->fs = _si->sched->fs; + /* allocate memory for scheduler instance extra vars */ + si->si_extra = malloc(sizeof(struct fq_pie_si_extra), + M_DUMMYNET, M_NOWAIT | M_ZERO); + if (si->si_extra == NULL) { + D("cannot allocate memory for fq_pie si extra vars"); + return ENOMEM ; + } /* allocate memory for flows array */ - si->flows = malloc(schk->cfg.flows_cnt * sizeof(struct fq_pie_flow), + si->si_extra->flows = malloc(schk->cfg.flows_cnt * sizeof(struct fq_pie_flow), M_DUMMYNET, M_NOWAIT | M_ZERO); - if (si->flows == NULL) { - D("cannot allocate memory for fq_pie configuration parameters"); + flows = si->si_extra->flows; + if (flows == NULL) { + free(si->si_extra, M_DUMMYNET); + si->si_extra = NULL; + D("cannot allocate memory for fq_pie flows"); return ENOMEM ; } /* init perturbation for this si */ si->perturbation = random(); - si->nr_active_q = 0; + si->si_extra->nr_active_q = 0; /* init the old and new flows lists */ STAILQ_INIT(&si->newflows); @@ -1008,45 +1032,16 @@ fq_pie_new_sched(struct dn_sch_inst *_si) /* init the flows (sub-queues) */ for (i = 0; i < schk->cfg.flows_cnt; i++) { - si->flows[i].pst.parms = &schk->cfg.pcfg; - si->flows[i].psi = si; - pie_init(&si->flows[i]); - } - - /* init mtx lock and callout function for free memory */ - if (!fq_pie_desc.ref_count) { - mtx_init(&freemem_mtx, "mtx_pie", NULL, MTX_DEF); + flows[i].pst.parms = &schk->cfg.pcfg; + flows[i].psi_extra = si->si_extra; + pie_init(&flows[i], schk); } - mtx_lock(&freemem_mtx); fq_pie_desc.ref_count++; - mtx_unlock(&freemem_mtx); return 0; } -/* - * Free FQ-PIE flows memory callout function. - * This function is scheduled when a flow or more still active and - * the scheduer is about to be destroyed, to prevent memory leak. - */ -static void -free_flows(void *_mem) -{ - struct mem_to_free *mem = _mem; - - free(mem->mem_flows, M_DUMMYNET); - free(mem->mem_callout, M_DUMMYNET); - free(_mem, M_DUMMYNET); - - fq_pie_desc.ref_count--; - if (!fq_pie_desc.ref_count) { - mtx_unlock(&freemem_mtx); - mtx_destroy(&freemem_mtx); - } else - mtx_unlock(&freemem_mtx); - //D("mem freed ok!"); -} /* * Free fq_pie scheduler instance. @@ -1056,61 +1051,17 @@ fq_pie_free_sched(struct dn_sch_inst *_si) { struct fq_pie_si *si; struct fq_pie_schk *schk; + struct fq_pie_flow *flows; int i; si = (struct fq_pie_si *)_si; schk = (struct fq_pie_schk *)(_si->sched+1); - + flows = si->si_extra->flows; for (i = 0; i < schk->cfg.flows_cnt; i++) { - pie_cleanup(&si->flows[i]); - } - - /* if there are still some queues have a callout going to start, - * we cannot free flows memory. If we do so, a panic can happen - * as prob calculate callout function uses flows memory. - */ - if (!si->nr_active_q) { - /* free the flows array */ - free(si->flows , M_DUMMYNET); - si->flows = NULL; - mtx_lock(&freemem_mtx); - fq_pie_desc.ref_count--; - if (!fq_pie_desc.ref_count) { - mtx_unlock(&freemem_mtx); - mtx_destroy(&freemem_mtx); - } else - mtx_unlock(&freemem_mtx); - //D("ok!"); - return 0; - } else { - /* memory leak happens here. So, we register a callout function to free - * flows memory later. - */ - D("unable to stop all fq_pie sub-queues!"); - mtx_lock(&freemem_mtx); - - struct callout *mem_callout; - struct mem_to_free *mem; - - mem = malloc(sizeof(*mem), M_DUMMYNET, - M_NOWAIT | M_ZERO); - mem_callout = malloc(sizeof(*mem_callout), M_DUMMYNET, - M_NOWAIT | M_ZERO); - - callout_init_mtx(mem_callout, &freemem_mtx, - CALLOUT_RETURNUNLOCKED); - - mem->mem_flows = si->flows; - mem->mem_callout = mem_callout; - callout_reset_sbt(mem_callout, - (uint64_t)(si->flows[0].pst.parms->tupdate + 1000) * SBT_1US, - 0, free_flows, mem, 0); - - si->flows = NULL; - mtx_unlock(&freemem_mtx); - - return EBUSY; + pie_cleanup(&flows[i]); } + si->si_extra = NULL; + return 0; } /* diff --git a/sys/pc98/conf/GENERIC-NODEBUG b/sys/pc98/conf/GENERIC-NODEBUG deleted file mode 100644 index 7863b44..0000000 --- a/sys/pc98/conf/GENERIC-NODEBUG +++ /dev/null @@ -1,38 +0,0 @@ -# -# GENERIC-NODEBUG -- WITNESS and INVARIANTS free kernel configuration file -# for FreeBSD/pc98 -# -# This configuration file removes several debugging options, including -# WITNESS and INVARIANTS checking, which are known to have significant -# performance impact on running systems. When benchmarking new features -# this kernel should be used instead of the standard GENERIC. -# This kernel configuration should never appear outside of the HEAD -# of the FreeBSD tree. -# -# For more information on this file, please read the config(5) manual page, -# and/or the handbook section on Kernel Configuration Files: -# -# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html -# -# The handbook is also available locally in /usr/share/doc/handbook -# if you've installed the doc distribution, otherwise always see the -# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the -# latest information. -# -# An exhaustive list of options and more detailed explanations of the -# device lines is also present in the ../../conf/NOTES and NOTES files. -# If you are in doubt as to the purpose or necessity of a line, check first -# in NOTES. -# -# $FreeBSD$ - -include GENERIC - -ident GENERIC-NODEBUG - -nooptions INVARIANTS -nooptions INVARIANT_SUPPORT -nooptions WITNESS -nooptions WITNESS_SKIPSPIN -nooptions DEADLKRES - diff --git a/sys/powerpc/conf/GENERIC-NODEBUG b/sys/powerpc/conf/GENERIC-NODEBUG deleted file mode 100644 index 517f714..0000000 --- a/sys/powerpc/conf/GENERIC-NODEBUG +++ /dev/null @@ -1,38 +0,0 @@ -# -# GENERIC-NODEBUG -- WITNESS and INVARIANTS free kernel configuration file -# for FreeBSD/powerpc -# -# This configuration file removes several debugging options, including -# WITNESS and INVARIANTS checking, which are known to have significant -# performance impact on running systems. When benchmarking new features -# this kernel should be used instead of the standard GENERIC. -# This kernel configuration should never appear outside of the HEAD -# of the FreeBSD tree. -# -# For more information on this file, please read the config(5) manual page, -# and/or the handbook section on Kernel Configuration Files: -# -# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html -# -# The handbook is also available locally in /usr/share/doc/handbook -# if you've installed the doc distribution, otherwise always see the -# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the -# latest information. -# -# An exhaustive list of options and more detailed explanations of the -# device lines is also present in the ../../conf/NOTES and NOTES files. -# If you are in doubt as to the purpose or necessity of a line, check first -# in NOTES. -# -# $FreeBSD$ - -include GENERIC - -ident GENERIC-NODEBUG - -nooptions INVARIANTS -nooptions INVARIANT_SUPPORT -nooptions WITNESS -nooptions WITNESS_SKIPSPIN -nooptions DEADLKRES - diff --git a/sys/sparc64/conf/GENERIC-NODEBUG b/sys/sparc64/conf/GENERIC-NODEBUG deleted file mode 100644 index ce5a895..0000000 --- a/sys/sparc64/conf/GENERIC-NODEBUG +++ /dev/null @@ -1,38 +0,0 @@ -# -# GENERIC-NODEBUG -- WITNESS and INVARIANTS free kernel configuration file -# for FreeBSD/sparc64 -# -# This configuration file removes several debugging options, including -# WITNESS and INVARIANTS checking, which are known to have significant -# performance impact on running systems. When benchmarking new features -# this kernel should be used instead of the standard GENERIC. -# This kernel configuration should never appear outside of the HEAD -# of the FreeBSD tree. -# -# For more information on this file, please read the config(5) manual page, -# and/or the handbook section on Kernel Configuration Files: -# -# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html -# -# The handbook is also available locally in /usr/share/doc/handbook -# if you've installed the doc distribution, otherwise always see the -# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the -# latest information. -# -# An exhaustive list of options and more detailed explanations of the -# device lines is also present in the ../../conf/NOTES and NOTES files. -# If you are in doubt as to the purpose or necessity of a line, check first -# in NOTES. -# -# $FreeBSD$ - -include GENERIC - -ident GENERIC-NODEBUG - -nooptions INVARIANTS -nooptions INVARIANT_SUPPORT -nooptions WITNESS -nooptions WITNESS_SKIPSPIN -nooptions DEADLKRES - diff --git a/sys/x86/x86/msi.c b/sys/x86/x86/msi.c index 19a427a..324ac6c 100644 --- a/sys/x86/x86/msi.c +++ b/sys/x86/x86/msi.c @@ -149,12 +149,16 @@ struct pic msi_pic = { .pic_reprogram_pin = NULL, }; -/* +/** * Xen hypervisors prior to 4.6.0 do not properly handle updates to * enabled MSI-X table entries. Allow migration of MSI-X interrupts - * to be disabled via a tunable. + * to be disabled via a tunable. Values have the following meaning: + * + * -1: automatic detection by FreeBSD + * 0: enable migration + * 1: disable migration */ -static int msix_disable_migration = 0; +int msix_disable_migration = -1; SYSCTL_INT(_machdep, OID_AUTO, disable_msix_migration, CTLFLAG_RDTUN, &msix_disable_migration, 0, "Disable migration of MSI-X interrupts between CPUs"); @@ -312,6 +316,11 @@ msi_init(void) return; } + if (msix_disable_migration == -1) { + /* The default is to allow migration of MSI-X interrupts. */ + msix_disable_migration = 0; + } + msi_enabled = 1; intr_register_pic(&msi_pic); mtx_init(&msi_lock, "msi", NULL, MTX_DEF); diff --git a/sys/x86/xen/hvm.c b/sys/x86/xen/hvm.c index a8b14fd..3569cd0 100644 --- a/sys/x86/xen/hvm.c +++ b/sys/x86/xen/hvm.c @@ -134,9 +134,29 @@ xen_hvm_init_hypercall_stubs(enum xen_hvm_init_type init_type) return (ENXIO); if (init_type == XEN_HVM_INIT_COLD) { + int major, minor; + do_cpuid(base + 1, regs); - printf("XEN: Hypervisor version %d.%d detected.\n", - regs[0] >> 16, regs[0] & 0xffff); + + major = regs[0] >> 16; + minor = regs[0] & 0xffff; + printf("XEN: Hypervisor version %d.%d detected.\n", major, + minor); + + if (((major < 4) || (major == 4 && minor <= 5)) && + msix_disable_migration == -1) { + /* + * Xen hypervisors prior to 4.6.0 do not properly + * handle updates to enabled MSI-X table entries, + * so disable MSI-X interrupt migration in that + * case. + */ + if (bootverbose) + printf( +"Disabling MSI-X interrupt migration due to Xen hypervisor bug.\n" +"Set machdep.msix_disable_migration=0 to forcefully enable it.\n"); + msix_disable_migration = 1; + } } /* diff --git a/usr.bin/mail/cmd3.c b/usr.bin/mail/cmd3.c index 9308ad3..11954d1 100644 --- a/usr.bin/mail/cmd3.c +++ b/usr.bin/mail/cmd3.c @@ -463,7 +463,8 @@ group(char **argv) gname = *argv; h = hash(gname); if ((gh = findgroup(gname)) == NULL) { - gh = calloc(sizeof(*gh), 1); + if ((gh = calloc(1, sizeof(*gh))) == NULL) + err(1, "Out of memory"); gh->g_name = vcopy(gname); gh->g_list = NULL; gh->g_link = groups[h]; @@ -477,7 +478,8 @@ group(char **argv) */ for (ap = argv+1; *ap != NULL; ap++) { - gp = calloc(sizeof(*gp), 1); + if ((gp = calloc(1, sizeof(*gp))) == NULL) + err(1, "Out of memory"); gp->ge_name = vcopy(*ap); gp->ge_link = gh->g_list; gh->g_list = gp; @@ -702,7 +704,8 @@ alternates(char **namelist) } if (altnames != 0) (void)free(altnames); - altnames = calloc((unsigned)c, sizeof(char *)); + if ((altnames = calloc((unsigned)c, sizeof(char *))) == NULL) + err(1, "Out of memory"); for (ap = namelist, ap2 = altnames; *ap != NULL; ap++, ap2++) { cp = calloc((unsigned)strlen(*ap) + 1, sizeof(char)); strcpy(cp, *ap); diff --git a/usr.bin/mail/vars.c b/usr.bin/mail/vars.c index dca0604..f3c6659 100644 --- a/usr.bin/mail/vars.c +++ b/usr.bin/mail/vars.c @@ -56,7 +56,8 @@ assign(const char *name, const char *value) h = hash(name); vp = lookup(name); if (vp == NULL) { - vp = calloc(sizeof(*vp), 1); + if ((vp = calloc(1, sizeof(*vp))) == NULL) + err(1, "Out of memory"); vp->v_name = vcopy(name); vp->v_link = variables[h]; variables[h] = vp; diff --git a/usr.sbin/ctld/ctld.c b/usr.sbin/ctld/ctld.c index a2bc17d..6ee6f74 100644 --- a/usr.sbin/ctld/ctld.c +++ b/usr.sbin/ctld/ctld.c @@ -402,7 +402,7 @@ auth_portal_new(struct auth_group *ag, const char *portal) error: free(ap); - log_errx(1, "Incorrect initiator portal '%s'", portal); + log_warnx("incorrect initiator portal \"%s\"", portal); return (NULL); } diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh index 1b6f0a1..bb12d36 100755 --- a/usr.sbin/etcupdate/etcupdate.sh +++ b/usr.sbin/etcupdate/etcupdate.sh @@ -184,7 +184,7 @@ build_tree() { local destdir dir file make - make="make $MAKE_OPTIONS" + make="make $MAKE_OPTIONS -DNO_FILEMON" log "Building tree at $1 with $make" mkdir -p $1/usr/obj >&3 2>&1 diff --git a/usr.sbin/jail/command.c b/usr.sbin/jail/command.c index 8dc6d3ec..f95344c 100644 --- a/usr.sbin/jail/command.c +++ b/usr.sbin/jail/command.c @@ -92,9 +92,13 @@ next_command(struct cfjail *j) int create_failed, stopping; if (paralimit == 0) { - requeue(j, &runnable); + if (j->flags & JF_FROM_RUNQ) + requeue_head(j, &runnable); + else + requeue(j, &runnable); return 1; } + j->flags &= ~JF_FROM_RUNQ; create_failed = (j->flags & (JF_STOP | JF_FAILED)) == JF_FAILED; stopping = (j->flags & JF_STOP) != 0; comparam = *j->comparam; @@ -160,20 +164,23 @@ next_command(struct cfjail *j) int finish_command(struct cfjail *j) { + struct cfjail *rj; int error; if (!(j->flags & JF_SLEEPQ)) return 0; j->flags &= ~JF_SLEEPQ; - if (*j->comparam == IP_STOP_TIMEOUT) - { + if (*j->comparam == IP_STOP_TIMEOUT) { j->flags &= ~JF_TIMEOUT; j->pstatus = 0; return 0; } paralimit++; - if (!TAILQ_EMPTY(&runnable)) - requeue(TAILQ_FIRST(&runnable), &ready); + if (!TAILQ_EMPTY(&runnable)) { + rj = TAILQ_FIRST(&runnable); + rj->flags |= JF_FROM_RUNQ; + requeue(rj, &ready); + } error = 0; if (j->flags & JF_TIMEOUT) { j->flags &= ~JF_TIMEOUT; @@ -259,7 +266,7 @@ next_proc(int nonblock) } /* - * Run a single command for a jail, possible inside the jail. + * Run a single command for a jail, possibly inside the jail. */ static int run_command(struct cfjail *j) diff --git a/usr.sbin/jail/jailp.h b/usr.sbin/jail/jailp.h index 4498f4b..5c4efd5 100644 --- a/usr.sbin/jail/jailp.h +++ b/usr.sbin/jail/jailp.h @@ -64,6 +64,7 @@ #define JF_PERSIST 0x0100 /* Jail is temporarily persistent */ #define JF_TIMEOUT 0x0200 /* A command (or process kill) timed out */ #define JF_SLEEPQ 0x0400 /* Waiting on a command and/or timeout */ +#define JF_FROM_RUNQ 0x0800 /* Has already been on the run queue */ #define JF_OP_MASK (JF_START | JF_SET | JF_STOP) #define JF_RESTART (JF_START | JF_STOP) @@ -223,6 +224,7 @@ extern struct cfjail *next_jail(void); extern int start_state(const char *target, int docf, unsigned state, int running); extern void requeue(struct cfjail *j, struct cfjails *queue); +extern void requeue_head(struct cfjail *j, struct cfjails *queue); extern void yyerror(const char *); extern int yylex(void); diff --git a/usr.sbin/jail/state.c b/usr.sbin/jail/state.c index b3eb942..05522e3 100644 --- a/usr.sbin/jail/state.c +++ b/usr.sbin/jail/state.c @@ -397,6 +397,14 @@ requeue(struct cfjail *j, struct cfjails *queue) } } +void +requeue_head(struct cfjail *j, struct cfjails *queue) +{ + TAILQ_REMOVE(j->queue, j, tq); + TAILQ_INSERT_HEAD(queue, j, tq); + j->queue = queue; +} + /* * Add a dependency edge between two jails. */ diff --git a/usr.sbin/mergemaster/mergemaster.sh b/usr.sbin/mergemaster/mergemaster.sh index 9bf4f9f..8561503 100755 --- a/usr.sbin/mergemaster/mergemaster.sh +++ b/usr.sbin/mergemaster/mergemaster.sh @@ -486,7 +486,7 @@ fi SOURCEDIR=$(realpath "$SOURCEDIR") # Setup make to use system files from SOURCEDIR -MM_MAKE="make ${ARCHSTRING} -m ${SOURCEDIR}/share/mk" +MM_MAKE="make ${ARCHSTRING} -m ${SOURCEDIR}/share/mk -DNO_FILEMON" # Check DESTDIR against the mergemaster mtree database to see what # files the user changed from the reference files. |