CVS commit: src/sys/kern
Module Name:src Committed By: christos Date: Sat Jun 23 03:32:48 UTC 2018 Modified Files: src/sys/kern: sys_ptrace_common.c Log Message: Add some debugging in case someone else wants to debug gdb... To generate a diff of this commit: cvs rdiff -u -r1.44 -r1.45 src/sys/kern/sys_ptrace_common.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/sys_ptrace_common.c diff -u src/sys/kern/sys_ptrace_common.c:1.44 src/sys/kern/sys_ptrace_common.c:1.45 --- src/sys/kern/sys_ptrace_common.c:1.44 Wed May 30 19:54:03 2018 +++ src/sys/kern/sys_ptrace_common.c Fri Jun 22 23:32:48 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: sys_ptrace_common.c,v 1.44 2018/05/30 23:54:03 kamil Exp $ */ +/* $NetBSD: sys_ptrace_common.c,v 1.45 2018/06/23 03:32:48 christos Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -118,7 +118,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.44 2018/05/30 23:54:03 kamil Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.45 2018/06/23 03:32:48 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_ptrace.h" @@ -154,8 +154,7 @@ __KERNEL_RCSID(0, "$NetBSD: sys_ptrace_c #include #ifdef PTRACE - -# ifdef DEBUG +# ifdef PTRACE_DEBUG # define DPRINTF(a) uprintf a # else # define DPRINTF(a) @@ -573,6 +572,8 @@ ptrace_get_siginfo(struct proc *t, struc psi.psi_siginfo._info = t->p_sigctx.ps_info; psi.psi_lwpid = t->p_sigctx.ps_lwp; + DPRINTF(("%s: lwp=%d signal=%d\n", __func__, psi.psi_lwpid, + psi.psi_siginfo.si_signo)); return ptm->ptm_copyout_siginfo(, addr, data); } @@ -597,6 +598,8 @@ ptrace_set_siginfo(struct proc *t, struc t->p_sigctx.ps_faked = true; t->p_sigctx.ps_info = psi.psi_siginfo._info; t->p_sigctx.ps_lwp = psi.psi_lwpid; + DPRINTF(("%s: lwp=%d signal=%d\n", __func__, psi.psi_lwpid, + psi.psi_siginfo.si_signo)); return 0; } @@ -620,6 +623,8 @@ ptrace_get_event_mask(struct proc *t, vo PTRACE_LWP_CREATE : 0; pe.pe_set_event |= ISSET(t->p_slflag, PSL_TRACELWP_EXIT) ? PTRACE_LWP_EXIT : 0; + DPRINTF(("%s: lwp=%d event=%#x\n", __func__, + t->p_sigctx.ps_lwp, pe.pe_set_event)); return copyout(, addr, sizeof(pe)); } @@ -636,6 +641,8 @@ ptrace_set_event_mask(struct proc *t, vo if ((error = copyin(addr, , sizeof(pe))) != 0) return error; + DPRINTF(("%s: lwp=%d event=%#x\n", __func__, + t->p_sigctx.ps_lwp, pe.pe_set_event)); if (pe.pe_set_event & PTRACE_FORK) SET(t->p_slflag, PSL_TRACEFORK); else @@ -690,6 +697,9 @@ ptrace_get_process_state(struct proc *t, ps.pe_report_event = PTRACE_LWP_EXIT; ps.pe_lwp = t->p_lwp_exited; } + DPRINTF(("%s: lwp=%d event=%#x pid=%d lwp=%d\n", __func__, + t->p_sigctx.ps_lwp, ps.pe_report_event, + ps.pe_other_pid, ps.pe_lwp)); return copyout(, addr, sizeof(ps)); } @@ -739,10 +749,16 @@ ptrace_lwpinfo(struct proc *t, struct lw */ else if ((*lt)->l_lid == t->p_sigctx.ps_lwp || (t->p_sigctx.ps_lwp == 0 && - t->p_sigctx.ps_info._signo)) + t->p_sigctx.ps_info._signo)) { + DPRINTF(("%s: lwp=%d siglwp=%d signo %d\n", __func__, + pl.pl_lwpid, t->p_sigctx.ps_lwp, + t->p_sigctx.ps_info._signo)); pl.pl_event = PL_EVENT_SIGNAL; + } } mutex_exit(t->p_lock); + DPRINTF(("%s: lwp=%d event=%#x\n", __func__, + pl.pl_lwpid, pl.pl_event)); return copyout(, addr, sizeof(pl)); } @@ -756,6 +772,7 @@ ptrace_startstop(struct proc *t, struct if ((error = ptrace_update_lwp(t, lt, data)) != 0) return error; + DPRINTF(("%s: lwp=%d request=%d\n", __func__, (*lt)->l_lid, rq)); lwp_lock(*lt); if (rq == PT_SUSPEND) (*lt)->l_flag |= LW_WSUSPEND; @@ -798,6 +815,8 @@ ptrace_regs(struct lwp *l, struct lwp ** size_t size; int (*func)(struct lwp *, struct lwp *, struct uio *); + DPRINTF(("%s: lwp=%d request=%d\n", __func__, l->l_lid, rq)); + switch (rq) { #if defined(PT_SETREGS) || defined(PT_GETREGS) case_PT_GETREGS @@ -899,6 +918,8 @@ ptrace_sendsig(struct proc *t, struct lw } else { ksi.ksi_signo = signo; } + DPRINTF(("%s: pid=%d.%d signal=%d resume_all=%d\n", __func__, t->p_pid, + t->p_sigctx.ps_lwp, signo, resume_all)); kpsignal2(t, ); return 0; @@ -920,6 +941,7 @@ ptrace_dumpcore(struct lwp *lt, char *pa goto out; path[len] = '\0'; } + DPRINTF(("%s: lwp=%d\n", __func__, lt->l_lid)); error = (*coredump_vec)(lt, path); out: if (path) @@ -943,6 +965,8 @@ ptrace_doio(struct lwp *l, struct proc * uio.uio_offset = (off_t)(unsigned long)piod->piod_offs; uio.uio_resid = piod->piod_len; + DPRINTF(("%s: lwp=%d request=%d\n", __func__, l->l_lid, piod->piod_op)); + switch (piod->piod_op) { case PIOD_READ_D: case PIOD_READ_I:
CVS commit: src/sys/dev
Module Name:src Committed By: nat Date: Sat Jun 23 03:18:49 UTC 2018 Modified Files: src/sys/dev: auconv.c Log Message: Add all encoding supported by the mixer. Addresses PR kern/52585. To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.36 src/sys/dev/auconv.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/auconv.c diff -u src/sys/dev/auconv.c:1.35 src/sys/dev/auconv.c:1.36 --- src/sys/dev/auconv.c:1.35 Sat Dec 16 16:09:36 2017 +++ src/sys/dev/auconv.c Sat Jun 23 03:18:49 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: auconv.c,v 1.35 2017/12/16 16:09:36 nat Exp $ */ +/* $NetBSD: auconv.c,v 1.36 2018/06/23 03:18:49 nat Exp $ */ /* * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: auconv.c,v 1.35 2017/12/16 16:09:36 nat Exp $"); +__KERNEL_RCSID(0, "$NetBSD: auconv.c,v 1.36 2018/06/23 03:18:49 nat Exp $"); #include #include @@ -2340,8 +2340,9 @@ auconv_create_encodings(const struct aud { struct audio_encoding_set *buf; int capacity; - int i; + int i, j; int err; + static int enc_precision[] = { 16, 32 }; #define ADD_ENCODING(enc, prec, flags) do { \ err = auconv_add_encoding(enc, prec, flags, , ); \ @@ -2358,120 +2359,33 @@ auconv_create_encodings(const struct aud for (i = 0; i < nformats; i++) { if (!AUFMT_IS_VALID([i])) continue; - switch (formats[i].encoding) { - case AUDIO_ENCODING_SLINEAR_LE: - ADD_ENCODING(formats[i].encoding, - formats[i].precision, 0); - ADD_ENCODING(AUDIO_ENCODING_SLINEAR_BE, - formats[i].precision, - AUDIO_ENCODINGFLAG_EMULATED); - ADD_ENCODING(AUDIO_ENCODING_ULINEAR_LE, - formats[i].precision, - AUDIO_ENCODINGFLAG_EMULATED); - ADD_ENCODING(AUDIO_ENCODING_ULINEAR_BE, - formats[i].precision, - AUDIO_ENCODINGFLAG_EMULATED); -#if NMULAW > 0 - if (formats[i].precision == 8 - || formats[i].precision == 16) { -ADD_ENCODING(AUDIO_ENCODING_ULAW, 8, - AUDIO_ENCODINGFLAG_EMULATED); -ADD_ENCODING(AUDIO_ENCODING_ALAW, 8, - AUDIO_ENCODINGFLAG_EMULATED); - } -#endif - break; - case AUDIO_ENCODING_SLINEAR_BE: - ADD_ENCODING(formats[i].encoding, - formats[i].precision, 0); - ADD_ENCODING(AUDIO_ENCODING_SLINEAR_LE, - formats[i].precision, - AUDIO_ENCODINGFLAG_EMULATED); - ADD_ENCODING(AUDIO_ENCODING_ULINEAR_LE, - formats[i].precision, - AUDIO_ENCODINGFLAG_EMULATED); - ADD_ENCODING(AUDIO_ENCODING_ULINEAR_BE, - formats[i].precision, - AUDIO_ENCODINGFLAG_EMULATED); -#if NMULAW > 0 - if (formats[i].precision == 8 - || formats[i].precision == 16) { -ADD_ENCODING(AUDIO_ENCODING_ULAW, 8, - AUDIO_ENCODINGFLAG_EMULATED); -ADD_ENCODING(AUDIO_ENCODING_ALAW, 8, - AUDIO_ENCODINGFLAG_EMULATED); - } -#endif - break; - case AUDIO_ENCODING_ULINEAR_LE: - ADD_ENCODING(formats[i].encoding, - formats[i].precision, 0); + + for (j = 0; j < __arraycount(enc_precision); j++) { ADD_ENCODING(AUDIO_ENCODING_SLINEAR_BE, - formats[i].precision, + enc_precision[j], AUDIO_ENCODINGFLAG_EMULATED); ADD_ENCODING(AUDIO_ENCODING_SLINEAR_LE, - formats[i].precision, + enc_precision[j], AUDIO_ENCODINGFLAG_EMULATED); ADD_ENCODING(AUDIO_ENCODING_ULINEAR_BE, - formats[i].precision, - AUDIO_ENCODINGFLAG_EMULATED); -#if NMULAW > 0 - if (formats[i].precision == 8 - || formats[i].precision == 16) { -ADD_ENCODING(AUDIO_ENCODING_ULAW, 8, - AUDIO_ENCODINGFLAG_EMULATED); -ADD_ENCODING(AUDIO_ENCODING_ALAW, 8, - AUDIO_ENCODINGFLAG_EMULATED); - } -#endif - break; - case AUDIO_ENCODING_ULINEAR_BE: - ADD_ENCODING(formats[i].encoding, - formats[i].precision, 0); - ADD_ENCODING(AUDIO_ENCODING_SLINEAR_BE, - formats[i].precision, + enc_precision[j], AUDIO_ENCODINGFLAG_EMULATED); ADD_ENCODING(AUDIO_ENCODING_ULINEAR_LE, - formats[i].precision, - AUDIO_ENCODINGFLAG_EMULATED); - ADD_ENCODING(AUDIO_ENCODING_SLINEAR_LE, - formats[i].precision, + enc_precision[j], AUDIO_ENCODINGFLAG_EMULATED); -#if NMULAW > 0 - if (formats[i].precision == 8 - || formats[i].precision == 16) { -ADD_ENCODING(AUDIO_ENCODING_ULAW, 8, - AUDIO_ENCODINGFLAG_EMULATED); -ADD_ENCODING(AUDIO_ENCODING_ALAW, 8, - AUDIO_ENCODINGFLAG_EMULATED); - } -#endif - break; - - case AUDIO_ENCODING_ULAW: - case AUDIO_ENCODING_ALAW: - case AUDIO_ENCODING_ADPCM: - case AUDIO_ENCODING_MPEG_L1_STREAM: - case AUDIO_ENCODING_MPEG_L1_PACKETS: - case AUDIO_ENCODING_MPEG_L1_SYSTEM: - case AUDIO_ENCODING_MPEG_L2_STREAM: - case AUDIO_ENCODING_MPEG_L2_PACKETS: - case AUDIO_ENCODING_MPEG_L2_SYSTEM: - case AUDIO_ENCODING_AC3: -
CVS commit: src/external/gpl3/gdb/dist/gdb
Module Name:src Committed By: christos Date: Sat Jun 23 03:15:55 UTC 2018 Modified Files: src/external/gpl3/gdb/dist/gdb: inf-ptrace.c nbsd-nat.c Log Message: Fix thread debugging. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/external/gpl3/gdb/dist/gdb/inf-ptrace.c cvs rdiff -u -r1.5 -r1.6 src/external/gpl3/gdb/dist/gdb/nbsd-nat.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/gpl3/gdb/dist/gdb/inf-ptrace.c diff -u src/external/gpl3/gdb/dist/gdb/inf-ptrace.c:1.17 src/external/gpl3/gdb/dist/gdb/inf-ptrace.c:1.18 --- src/external/gpl3/gdb/dist/gdb/inf-ptrace.c:1.17 Fri Dec 1 17:19:59 2017 +++ src/external/gpl3/gdb/dist/gdb/inf-ptrace.c Fri Jun 22 23:15:55 2018 @@ -353,7 +353,7 @@ inf_ptrace_resume (struct target_ops *op all possible successor instructions), so we don't have to worry about that here. */ request = PT_STEP; -#if 0 +#if __NetBSD__ /* * On NetBSD the data field of PT_STEP contains the thread * to be stepped; all other threads are continued if this value is > 0 Index: src/external/gpl3/gdb/dist/gdb/nbsd-nat.c diff -u src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.5 src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.6 --- src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.5 Sun Dec 10 00:36:25 2017 +++ src/external/gpl3/gdb/dist/gdb/nbsd-nat.c Fri Jun 22 23:15:55 2018 @@ -371,7 +371,7 @@ nbsd_add_threads (pid_t pid) int val; struct ptrace_lwpinfo pl; - gdb_assert (!in_thread_list (pid_to_ptid (pid))); +// gdb_assert (!in_thread_list (pid_to_ptid (pid))); pl.pl_lwpid = 0; while ((val = ptrace (PT_LWPINFO, pid, (void *), sizeof(pl))) != -1 && pl.pl_lwpid != 0) @@ -537,68 +537,13 @@ static void nbsd_resume (struct target_ops *ops, ptid_t ptid, int step, enum gdb_signal signo) { -#if defined(TDP_RFPPWAIT) && !defined(PTRACE_VFORK) - pid_t pid; - - /* Don't PT_CONTINUE a process which has a pending vfork done event. */ - if (ptid_equal (minus_one_ptid, ptid)) -pid = ptid_get_pid (inferior_ptid); - else -pid = ptid_get_pid (ptid); - if (nbsd_is_vfork_done_pending (pid)) -return; -#endif - if (debug_nbsd_lwp) fprintf_unfiltered (gdb_stdlog, "NLWP: nbsd_resume for ptid (%d, %ld, %ld)\n", ptid_get_pid (ptid), ptid_get_lwp (ptid), ptid_get_tid (ptid)); - if (ptid_lwp_p (ptid)) -{ - /* FreeBSD: If ptid is a specific LWP, suspend all other LWPs in the - * process. - */ - /* NetBSD, this function is about resuming so we only deal with - * the thread we've been asked to work with - */ - struct thread_info *tp; - int request; - - ALL_NON_EXITED_THREADS (tp) -{ - if (ptid_get_pid (tp->ptid) != ptid_get_pid (ptid)) - continue; - - if (ptid_get_lwp (tp->ptid) == ptid_get_lwp (ptid)) - request = PT_RESUME; -#ifndef __NetBSD__ - else - request = PT_SUSPEND; -#endif - - if (ptrace (request, ptid_get_pid (tp->ptid), NULL, - ptid_get_lwp (tp->ptid)) == -1) - perror_with_name (("ptrace")); - } -} - else -{ - /* If ptid is a wildcard, resume all matching threads (they won't run - until the process is continued however). */ - struct thread_info *tp; - - ALL_NON_EXITED_THREADS (tp) -{ - if (!ptid_match (tp->ptid, ptid)) - continue; - - if (ptrace (PT_RESUME, ptid_get_pid (tp->ptid), NULL, - ptid_get_lwp (tp->ptid)) == -1) - perror_with_name (("ptrace")); - } - ptid = inferior_ptid; -} + if (ptid_get_pid(ptid) == -1) +ptid = inferior_ptid; super_resume (ops, ptid, step, signo); } @@ -613,203 +558,35 @@ nbsd_wait (struct target_ops *ops, { ptid_t wptid; - while (1) + wptid = super_wait (ops, ptid, ourstatus, target_options); + if (ourstatus->kind == TARGET_WAITKIND_STOPPED) { -#ifndef PTRACE_VFORK - wptid = nbsd_next_vfork_done (); - if (!ptid_equal (wptid, null_ptid)) - { - ourstatus->kind = TARGET_WAITKIND_VFORK_DONE; - return wptid; - } -#endif - wptid = super_wait (ops, ptid, ourstatus, target_options); - if (ourstatus->kind == TARGET_WAITKIND_STOPPED) - { - struct ptrace_lwpinfo pl; - pid_t pid; - int status; - - pid = ptid_get_pid (wptid); - pl.pl_lwpid = 0; - if (ptrace (PT_LWPINFO, pid, (caddr_t) , sizeof pl) == -1) - perror_with_name (("ptrace")); - - wptid = ptid_build (pid, pl.pl_lwpid, 0); - -#ifdef PT_LWP_EVENTS - if (pl.pl_flags & PL_FLAG_EXITED) - { - /* If GDB attaches to a multi-threaded process, exiting - threads might be skipped during nbsd_post_attach that - have not yet reported their PL_FLAG_EXITED event. - Ignore EXITED events for an unknown LWP. */ - if (in_thread_list (wptid)) - { - if (debug_nbsd_lwp) - fprintf_unfiltered (gdb_stdlog, - "NLWP: deleting thread for LWP %u\n", - pl.pl_lwpid); -
CVS commit: src/sys/arch/aarch64/conf
Module Name:src Committed By: jakllsch Date: Sat Jun 23 01:51:03 UTC 2018 Modified Files: src/sys/arch/aarch64/conf: Makefile.aarch64 Log Message: locore.S is a MD_SFILES. This keeps the dependency handling in the loop, so rebuilds after changing options, say EARLYCONS, don't fail. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/aarch64/conf/Makefile.aarch64 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/aarch64/conf/Makefile.aarch64 diff -u src/sys/arch/aarch64/conf/Makefile.aarch64:1.9 src/sys/arch/aarch64/conf/Makefile.aarch64:1.10 --- src/sys/arch/aarch64/conf/Makefile.aarch64:1.9 Sun Apr 1 04:35:03 2018 +++ src/sys/arch/aarch64/conf/Makefile.aarch64 Sat Jun 23 01:51:03 2018 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.aarch64,v 1.9 2018/04/01 04:35:03 ryo Exp $ +# $NetBSD: Makefile.aarch64,v 1.10 2018/06/23 01:51:03 jakllsch Exp $ # Makefile for NetBSD # @@ -50,7 +50,7 @@ KERN_AS= obj ## MD_OBJS+= ${SYSTEM_FIRST_OBJ} locore.o MD_CFILES+= -MD_SFILES+= ${SYSTEM_FIRST_SFILE} +MD_SFILES+= ${SYSTEM_FIRST_SFILE} ${A64}/aarch64/locore.S .if defined(SYSTEM_FIRST_OBJ) ${SYSTEM_FIRST_OBJ}: ${SYSTEM_FIRST_SFILE} assym.h
CVS commit: src/sys/arch
Module Name:src Committed By: maya Date: Sat Jun 23 01:23:27 UTC 2018 Modified Files: src/sys/arch/evbarm/conf: MMNET_GENERIC MPCSA_GENERIC src/sys/arch/mmeye/conf: MMTAICE MMTANEW Log Message: Remove commented out MATH_EMULATE from kernel configs that got it by copying an older i386 config. To generate a diff of this commit: cvs rdiff -u -r1.36 -r1.37 src/sys/arch/evbarm/conf/MMNET_GENERIC cvs rdiff -u -r1.57 -r1.58 src/sys/arch/evbarm/conf/MPCSA_GENERIC cvs rdiff -u -r1.55 -r1.56 src/sys/arch/mmeye/conf/MMTAICE cvs rdiff -u -r1.19 -r1.20 src/sys/arch/mmeye/conf/MMTANEW Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/evbarm/conf/MMNET_GENERIC diff -u src/sys/arch/evbarm/conf/MMNET_GENERIC:1.36 src/sys/arch/evbarm/conf/MMNET_GENERIC:1.37 --- src/sys/arch/evbarm/conf/MMNET_GENERIC:1.36 Thu Jun 7 13:36:28 2018 +++ src/sys/arch/evbarm/conf/MMNET_GENERIC Sat Jun 23 01:23:27 2018 @@ -1,4 +1,4 @@ -# $NetBSD: MMNET_GENERIC,v 1.36 2018/06/07 13:36:28 thorpej Exp $ +# $NetBSD: MMNET_GENERIC,v 1.37 2018/06/23 01:23:27 maya Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ include "arch/evbarm/conf/std.mmnet" options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "GENERIC-$Revision: 1.36 $" +#ident "GENERIC-$Revision: 1.37 $" maxusers 32 # estimated number of users @@ -31,7 +31,6 @@ options CPU_ARM9E makeoptions CPUFLAGS="-mtune=arm926ej-s -mcpu=arm926ej-s" # CPU-related options. -#options MATH_EMULATE # floating point emulation # doesn't work with MP just yet.. #options PERFCTRS # performance-monitoring counters support Index: src/sys/arch/evbarm/conf/MPCSA_GENERIC diff -u src/sys/arch/evbarm/conf/MPCSA_GENERIC:1.57 src/sys/arch/evbarm/conf/MPCSA_GENERIC:1.58 --- src/sys/arch/evbarm/conf/MPCSA_GENERIC:1.57 Thu Jun 7 13:36:28 2018 +++ src/sys/arch/evbarm/conf/MPCSA_GENERIC Sat Jun 23 01:23:27 2018 @@ -1,4 +1,4 @@ -# $NetBSD: MPCSA_GENERIC,v 1.57 2018/06/07 13:36:28 thorpej Exp $ +# $NetBSD: MPCSA_GENERIC,v 1.58 2018/06/23 01:23:27 maya Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ include "arch/evbarm/conf/std.mpcsa" options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "GENERIC-$Revision: 1.57 $" +#ident "GENERIC-$Revision: 1.58 $" maxusers 32 # estimated number of users @@ -31,7 +31,6 @@ options CPU_ARM9# Support the ARM9T makeoptions CPUFLAGS="-mtune=arm920t -mcpu=arm920t" # CPU-related options. -#options MATH_EMULATE # floating point emulation # doesn't work with MP just yet.. #options PERFCTRS # performance-monitoring counters support Index: src/sys/arch/mmeye/conf/MMTAICE diff -u src/sys/arch/mmeye/conf/MMTAICE:1.55 src/sys/arch/mmeye/conf/MMTAICE:1.56 --- src/sys/arch/mmeye/conf/MMTAICE:1.55 Thu Sep 14 07:58:42 2017 +++ src/sys/arch/mmeye/conf/MMTAICE Sat Jun 23 01:23:27 2018 @@ -1,4 +1,4 @@ -# $NetBSD: MMTAICE,v 1.55 2017/09/14 07:58:42 mrg Exp $ +# $NetBSD: MMTAICE,v 1.56 2018/06/23 01:23:27 maya Exp $ # # GENERIC -- everything that's currently supported # @@ -27,7 +27,6 @@ options IOM_RAM_BEGIN=0x0c00 makeoptions DEFTEXTADDR="0x8c01" # CPU-related options. -#options MATH_EMULATE # floating point emulation # eliminate delay no-ops in I/O; recommended on all but very old machines #options DUMMY_NOPS Index: src/sys/arch/mmeye/conf/MMTANEW diff -u src/sys/arch/mmeye/conf/MMTANEW:1.19 src/sys/arch/mmeye/conf/MMTANEW:1.20 --- src/sys/arch/mmeye/conf/MMTANEW:1.19 Sat Feb 19 10:46:27 2011 +++ src/sys/arch/mmeye/conf/MMTANEW Sat Jun 23 01:23:27 2018 @@ -1,9 +1,7 @@ -# $NetBSD: MMTANEW,v 1.19 2011/02/19 10:46:27 kiyohara Exp $ +# $NetBSD: MMTANEW,v 1.20 2018/06/23 01:23:27 maya Exp $ # include "arch/mmeye/conf/MMTA" options MMEYE_NEW_INT=0xb00e #options MMEYE_NO_CACHE - -#options MATH_EMULATE # floating point emulation
CVS commit: src/sys/arch/arm/fdt
Module Name:src Committed By: jmcneill Date: Fri Jun 22 23:46:04 UTC 2018 Modified Files: src/sys/arch/arm/fdt: cpu_fdt.c Log Message: Match generic arm,arm-v8 compatible string To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/fdt/cpu_fdt.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/fdt/cpu_fdt.c diff -u src/sys/arch/arm/fdt/cpu_fdt.c:1.6 src/sys/arch/arm/fdt/cpu_fdt.c:1.7 --- src/sys/arch/arm/fdt/cpu_fdt.c:1.6 Fri Jun 15 14:27:57 2018 +++ src/sys/arch/arm/fdt/cpu_fdt.c Fri Jun 22 23:46:04 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu_fdt.c,v 1.6 2018/06/15 14:27:57 jakllsch Exp $ */ +/* $NetBSD: cpu_fdt.c,v 1.7 2018/06/22 23:46:04 jmcneill Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cpu_fdt.c,v 1.6 2018/06/15 14:27:57 jakllsch Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpu_fdt.c,v 1.7 2018/06/22 23:46:04 jmcneill Exp $"); #include #include @@ -68,10 +68,12 @@ static const struct of_compat_data compa { "arm,cortex-a15", ARM_CPU_ARMV7 }, { "arm,cortex-a17", ARM_CPU_ARMV7 }, + { "arm,arm-v8", ARM_CPU_ARMV8 }, { "arm,cortex-a53", ARM_CPU_ARMV8 }, { "arm,cortex-a57", ARM_CPU_ARMV8 }, { "arm,cortex-a72", ARM_CPU_ARMV8 }, { "arm,cortex-a73", ARM_CPU_ARMV8 }, + { NULL } };
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: christos Date: Fri Jun 22 23:00:54 UTC 2018 Modified Files: src/sys/arch/x86/x86: identcpu.c Log Message: Handle more Vortex CPU's from Andrius V. While here refactor the code to make it smaller. To generate a diff of this commit: cvs rdiff -u -r1.73 -r1.74 src/sys/arch/x86/x86/identcpu.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/x86/x86/identcpu.c diff -u src/sys/arch/x86/x86/identcpu.c:1.73 src/sys/arch/x86/x86/identcpu.c:1.74 --- src/sys/arch/x86/x86/identcpu.c:1.73 Tue Jun 19 15:50:19 2018 +++ src/sys/arch/x86/x86/identcpu.c Fri Jun 22 19:00:54 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: identcpu.c,v 1.73 2018/06/19 19:50:19 jdolecek Exp $ */ +/* $NetBSD: identcpu.c,v 1.74 2018/06/22 23:00:54 christos Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.73 2018/06/19 19:50:19 jdolecek Exp $"); +__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.74 2018/06/22 23:00:54 christos Exp $"); #include "opt_xen.h" @@ -679,24 +679,18 @@ cpu_probe_vortex86(struct cpu_info *ci) outl(PCI_MODE1_ADDRESS_REG, PCI_MODE1_ENABLE | 0x90); reg = inl(PCI_MODE1_DATA_REG); - switch(reg) { - case 0x31504d44: - strcpy(cpu_brand_string, "Vortex86SX"); - break; - case 0x32504d44: - strcpy(cpu_brand_string, "Vortex86DX"); - break; - case 0x33504d44: - strcpy(cpu_brand_string, "Vortex86MX"); - break; - case 0x37504d44: - strcpy(cpu_brand_string, "Vortex86EX"); - break; - default: - strcpy(cpu_brand_string, "Unknown Vortex86"); - break; + if ((reg & 0xf8ff) != 0x30504d44) { + reg = 0; + } else { + reg = (reg >> 24) & 7; } + static const char *cpu_vortex86_flavor[] = { + "??", "SX", "DX", "MX", "DX2", "MX+", "DX3", "EX", + }; + snprintf(cpu_brand_string, sizeof(cpu_brand_string), "Vortex86%s", + cpu_vortex86_flavor[reg]); + #undef PCI_MODE1_ENABLE #undef PCI_MODE1_ADDRESS_REG #undef PCI_MODE1_DATA_REG
CVS commit: src/usr.sbin/intrctl
Module Name:src Committed By: jdolecek Date: Fri Jun 22 22:50:53 UTC 2018 Modified Files: src/usr.sbin/intrctl: intrctl.c Log Message: fix free() on unitialized value for list -c when there are no assigned interrupts To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/intrctl/intrctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/intrctl/intrctl.c diff -u src/usr.sbin/intrctl/intrctl.c:1.7 src/usr.sbin/intrctl/intrctl.c:1.8 --- src/usr.sbin/intrctl/intrctl.c:1.7 Wed Nov 2 11:03:33 2016 +++ src/usr.sbin/intrctl/intrctl.c Fri Jun 22 22:50:53 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: intrctl.c,v 1.7 2016/11/02 11:03:33 ryo Exp $ */ +/* $NetBSD: intrctl.c,v 1.8 2018/06/22 22:50:53 jdolecek Exp $ */ /* * Copyright (c) 2015 Internet Initiative Japan Inc. @@ -27,7 +27,7 @@ */ #include -__RCSID("$NetBSD: intrctl.c,v 1.7 2016/11/02 11:03:33 ryo Exp $"); +__RCSID("$NetBSD: intrctl.c,v 1.8 2018/06/22 22:50:53 jdolecek Exp $"); #include #include @@ -184,7 +184,7 @@ intrctl_list(int argc, char **argv) printf("%-*s ", (int)intridlen, illine->ill_intrid); if (compact) { uint64_t total = 0; - char *affinity, *oaffinity = NULL; + char *affinity = NULL, *oaffinity = NULL; for (i = 0; i < ncpus; i++) { illc = >ill_cpu[i]; total += illc->illc_count; @@ -200,7 +200,8 @@ intrctl_list(int argc, char **argv) } printf("%20" PRIu64 " ", total); printf("%5s ", affinity ? affinity : "none"); - free(affinity); + if (affinity) +free(affinity); } else { for (i = 0; i < ncpus; i++) { illc = >ill_cpu[i];
CVS commit: src/external/mpl/dhcp
Module Name:src Committed By: christos Date: Fri Jun 22 20:48:44 UTC 2018 Modified Files: src/external/mpl/dhcp: Makefile.inc Log Message: Explain the -Bstatic -Bdynamic dance. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/mpl/dhcp/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/mpl/dhcp/Makefile.inc diff -u src/external/mpl/dhcp/Makefile.inc:1.2 src/external/mpl/dhcp/Makefile.inc:1.3 --- src/external/mpl/dhcp/Makefile.inc:1.2 Thu Jun 21 07:02:48 2018 +++ src/external/mpl/dhcp/Makefile.inc Fri Jun 22 16:48:43 2018 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.2 2018/06/21 11:02:48 kamil Exp $ +# $NetBSD: Makefile.inc,v 1.3 2018/06/22 20:48:43 christos Exp $ WARNS?= 1 # XXX -Wshadow -Wcast-qual -Wsign-compare @@ -31,6 +31,10 @@ CPPFLAGS+= -DLOCALSTATEDIR='"/var"' LDADD+= ${COBJDIR}/libdhcp.a LDADD+= ${OMOBJDIR}/libomapi.a .if defined(PROG) && ${PROG} == "dhclient" && ${MKSANITIZER:Uno} != "yes" +# We link the libraries that are in /usr/lib and not in /lib statically +# because dhclient is in /sbin and is needed before /usr is mounted in +# some configurations with a split / and /usr. Another way to fix this, +# would be to install the libraries in /lib... LDADD+=-Wl,-Bstatic .endif LDADD+= -lirs -lisccfg -ldns -lisc
CVS commit: src/external/gpl3/gdb/dist/gdb
Module Name:src Committed By: christos Date: Fri Jun 22 19:41:40 UTC 2018 Modified Files: src/external/gpl3/gdb/dist/gdb: aarch64-nbsd-tdep.h Log Message: match our number of registers. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.h diff -u src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.h:1.1 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.h:1.2 --- src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.h:1.1 Sun May 20 22:10:47 2018 +++ src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.h Fri Jun 22 15:41:40 2018 @@ -19,10 +19,10 @@ #include "regset.h" -/* The general-purpose regset consists of 30 X registers, plus LR, SP, - ELR, and SPSR registers. SPSR is 32 bits but the structure is +/* The general-purpose regset consists of 31 registers (30 X , plus LR), SP, + ELR (PC), SPSR register, and TPIDR. SPSR is 32 bits but the structure is passed to 64 bit alignment. */ -#define AARCH64_NBSD_SIZEOF_GREGSET (34 * X_REGISTER_SIZE) +#define AARCH64_NBSD_SIZEOF_GREGSET (35 * X_REGISTER_SIZE) /* The fp regset consists of 32 V registers, plus FPSR and FPCR which are 4 bytes wide each, and the whole structure is padded to 128 bit
CVS commit: src/external/gpl3/gdb/dist/gdb
Module Name:src Committed By: christos Date: Fri Jun 22 19:41:16 UTC 2018 Modified Files: src/external/gpl3/gdb/dist/gdb: aarch64-nbsd-tdep.c Log Message: use the right emulation To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c diff -u src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c:1.1 src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c:1.2 --- src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c:1.1 Sun May 20 22:10:47 2018 +++ src/external/gpl3/gdb/dist/gdb/aarch64-nbsd-tdep.c Fri Jun 22 15:41:16 2018 @@ -197,6 +197,6 @@ aarch64_nbsd_init_abi (struct gdbarch_in void _initialize_aarch64_nbsd_tdep (void) { - gdbarch_register_osabi (bfd_arch_aarch64, 0, GDB_OSABI_FREEBSD, + gdbarch_register_osabi (bfd_arch_aarch64, 0, GDB_OSABI_NETBSD, aarch64_nbsd_init_abi); }
CVS commit: src/share/man/man5
Module Name:src Committed By: maya Date: Fri Jun 22 19:35:25 UTC 2018 Modified Files: src/share/man/man5: rc.conf.5 Log Message: Describe something for npf, npfd, blacklistd. To generate a diff of this commit: cvs rdiff -u -r1.169 -r1.170 src/share/man/man5/rc.conf.5 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man5/rc.conf.5 diff -u src/share/man/man5/rc.conf.5:1.169 src/share/man/man5/rc.conf.5:1.170 --- src/share/man/man5/rc.conf.5:1.169 Fri Jun 22 19:08:28 2018 +++ src/share/man/man5/rc.conf.5 Fri Jun 22 19:35:25 2018 @@ -1,4 +1,4 @@ -.\" $NetBSD: rc.conf.5,v 1.169 2018/06/22 19:08:28 maya Exp $ +.\" $NetBSD: rc.conf.5,v 1.170 2018/06/22 19:35:25 maya Exp $ .\" .\" Copyright (c) 1996 Matthew R. Green .\" All rights reserved. @@ -638,6 +638,12 @@ with the .Dq Li -l flag and suppresses warnings about interfaces in this list that do not have an ifconfig file or variable. +.It Sy blacklistd +Boolean value. +Runs +.Xr blacklistd 8 +to dynamically block hosts on a DoS according to configuration set in +.Xr blacklistd.conf 5 .It Sy dhclient Boolean value. Set true to configure some or all network interfaces using @@ -868,6 +874,17 @@ Runs to load in IPsec manual keys and policies from .Pa /etc/ipsec.conf at network boot time, before any interfaces are configured. +.It Sy npf +Boolean value. +Loads +.Xr npf.conf 5 +at network boot time, and starts +.Xr npf 7 . +.It Sy npfd +Boolean value. +Runs +.Xr npfd 8 , +the NPF packet filter logging and state synchronization daemon. .It Sy net_interfaces A string. The list of network interfaces to be configured at boot time.
CVS commit: src/share/man/man5
Module Name:src Committed By: maya Date: Fri Jun 22 19:08:28 UTC 2018 Modified Files: src/share/man/man5: rc.conf.5 Log Message: Remove documentation references to rtsol. To generate a diff of this commit: cvs rdiff -u -r1.168 -r1.169 src/share/man/man5/rc.conf.5 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man5/rc.conf.5 diff -u src/share/man/man5/rc.conf.5:1.168 src/share/man/man5/rc.conf.5:1.169 --- src/share/man/man5/rc.conf.5:1.168 Tue Jan 9 09:17:52 2018 +++ src/share/man/man5/rc.conf.5 Fri Jun 22 19:08:28 2018 @@ -1,4 +1,4 @@ -.\" $NetBSD: rc.conf.5,v 1.168 2018/01/09 09:17:52 wiz Exp $ +.\" $NetBSD: rc.conf.5,v 1.169 2018/06/22 19:08:28 maya Exp $ .\" .\" Copyright (c) 1996 Matthew R. Green .\" All rights reserved. @@ -55,7 +55,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 8, 2018 +.Dd June 22, 2018 .Dt RC.CONF 5 .Os .Sh NAME @@ -787,12 +787,6 @@ you can configure your node as a router, a non-autoconfigured host, or an autoconfigured host. Invalid values will be ignored, and the node will be configured as a non-autoconfigured host. -You may want to check -.Sy rtsol -and -.Sy rtsold -as well, if you set the variable to -.Dq Li autohost . .It Sy ip6uniquelocal Boolean value. If @@ -967,21 +961,6 @@ Boolean value. Runs .Xr racoon 8 , the IKE (ISAKMP/Oakley) key management daemon. -.It Sy rtsol -Boolean value. -Run -.Xr rtsol 8 , -router solicitation command for IPv6 hosts. -On nomadic hosts like notebook computers, you may want to enable -.Sy rtsold -as well. -Passes -.Sy rtsol_flags . -This is only for autoconfigured IPv6 hosts, so set -.Sy ip6mode -to -.Dq Li autohost -if you use it. .It Sy wpa_supplicant Boolean value. Run @@ -1194,24 +1173,6 @@ Passes .\" if .\" .Sy gated .\" is true. -.It Sy rtsold -Boolean value. -Runs -.Xr rtsold 8 , -the IPv6 router solicitation daemon. -.Xr rtsold 8 -periodically transmits router solicitation packets -to find IPv6 routers on the network. -This configuration is mainly for nomadic hosts like notebook computers. -Stationary hosts should work fine with just -.Sy rtsol . -Passes -.Sy rtsold_flags . -This is only for autoconfigured IPv6 hosts, so set -.Sy ip6mode -to -.Dq Li autohost -if you use it. .El .Ss Daemons used to boot other hosts over a network .Bl -tag -width net_interfaces
CVS commit: src/distrib/notes/common
Module Name:src Committed By: roy Date: Fri Jun 22 18:23:59 UTC 2018 Modified Files: src/distrib/notes/common: main Log Message: rtsol(8) and rtsold(8) have been long removed. To generate a diff of this commit: cvs rdiff -u -r1.544 -r1.545 src/distrib/notes/common/main Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/notes/common/main diff -u src/distrib/notes/common/main:1.544 src/distrib/notes/common/main:1.545 --- src/distrib/notes/common/main:1.544 Sun Mar 11 11:48:39 2018 +++ src/distrib/notes/common/main Fri Jun 22 18:23:59 2018 @@ -1,4 +1,4 @@ -.\" $NetBSD: main,v 1.544 2018/03/11 11:48:39 tih Exp $ +.\" $NetBSD: main,v 1.545 2018/06/22 18:23:59 roy Exp $ .\" .\" Copyright (c) 1999-2012 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -523,11 +523,6 @@ and .Xr groff 1 can still be found in pkgsrc as .Pa textproc/groff . -.It -.Xr rtsol 8 -and -.Xr rtsold 8 . -.bullet) . .Ss "The NetBSD Foundation" .Pp
CVS commit: src/bin/sh
Module Name:src Committed By: kre Date: Fri Jun 22 18:19:41 UTC 2018 Modified Files: src/bin/sh: expand.c Log Message: When processing character classes ([:xxx:] inside []), treat a class name that is longer than we can handle the same way we treat an unknown class name (as a valid char class which contains nothing, so never matches). Previously a "too long" class name invalidated the class, so [:very-long-name:] would match any of '[' ':' 'v' ... (note: "very-long-name" is not long enough to trigger this, but you get the idea!) However, the name itself has a restricted syntax ([[:***:]] is not a character class, it is a match for one of a '[' ':' or '*', followed by a ']') which we did not implement - check the syntax of the name before treating it as a character class (but we do add '_' to alphanumerics as legal class name characters). To generate a diff of this commit: cvs rdiff -u -r1.122 -r1.123 src/bin/sh/expand.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/sh/expand.c diff -u src/bin/sh/expand.c:1.122 src/bin/sh/expand.c:1.123 --- src/bin/sh/expand.c:1.122 Fri Jun 22 17:22:34 2018 +++ src/bin/sh/expand.c Fri Jun 22 18:19:41 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: expand.c,v 1.122 2018/06/22 17:22:34 kre Exp $ */ +/* $NetBSD: expand.c,v 1.123 2018/06/22 18:19:41 kre Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)expand.c 8.5 (Berkeley) 5/15/95"; #else -__RCSID("$NetBSD: expand.c,v 1.122 2018/06/22 17:22:34 kre Exp $"); +__RCSID("$NetBSD: expand.c,v 1.123 2018/06/22 18:19:41 kre Exp $"); #endif #endif /* not lint */ @@ -1659,12 +1659,20 @@ match_charclass(const char *p, wchar_t c *end = NULL; p++; nameend = strstr(p, ":]"); - if (nameend == NULL || (size_t)(nameend - p) >= sizeof(name) || - nameend == p) + if (nameend == NULL || nameend == p) /* not a valid class */ return 0; + + if (!is_alpha(*p) || strspn(p, /* '_' is a local extension */ + "0123456789" "_" + "abcdefghijklmnopqrstuvwxyz" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ") != (size_t)(nameend - p)) + return 0; + + *end = nameend + 2; /* committed to it being a char class */ + if ((size_t)(nameend - p) >= sizeof(name)) /* but too long */ + return 0;/* so no match */ memcpy(name, p, nameend - p); name[nameend - p] = '\0'; - *end = nameend + 2; cclass = wctype(name); /* An unknown class matches nothing but is valid nevertheless. */ if (cclass == 0) @@ -1673,7 +1681,6 @@ match_charclass(const char *p, wchar_t c } - /* * Returns true if the pattern matches the string. */
CVS commit: [netbsd-8] src/doc
Module Name:src Committed By: martin Date: Fri Jun 22 18:06:22 UTC 2018 Modified Files: src/doc [netbsd-8]: CHANGES-8.0 Log Message: Tickets #887, #888, #889 To generate a diff of this commit: cvs rdiff -u -r1.1.2.213 -r1.1.2.214 src/doc/CHANGES-8.0 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-8.0 diff -u src/doc/CHANGES-8.0:1.1.2.213 src/doc/CHANGES-8.0:1.1.2.214 --- src/doc/CHANGES-8.0:1.1.2.213 Wed Jun 20 12:41:45 2018 +++ src/doc/CHANGES-8.0 Fri Jun 22 18:06:22 2018 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-8.0,v 1.1.2.213 2018/06/20 12:41:45 martin Exp $ +# $NetBSD: CHANGES-8.0,v 1.1.2.214 2018/06/22 18:06:22 martin Exp $ A complete list of changes from the initial NetBSD 8.0 branch on 2017-06-04 until the 8.0 release: @@ -13954,3 +13954,28 @@ share/mk/bsd.sys.mk1.282 distrib/notes/common/main (changed manually) Updated for the upcoming release. + +bin/ed/main.c 1.30 + + Prevent shell execution also in the 'r ! dobad' case. + [christos, ticket #887] + +sys/dev/pci/ld_virtio.c1.17-1.21,1.23 + + Remove trailing whitespace. + Add feature/register definitions from virtio-v1.0-cs04. + Unload payload dma map upon command completion. + Make ld_virtio aware of a possible device-side write cache. + The virtio block device capacity config item is expressed always in + request protocol sector units of 512 bytes. + Also, add and use a symbolic constant to refer to request protocol + sector units. + Destroy 'sc_sync_wait' condvar and mutex upon detach. + [jakllsch, ticket #888] + +sys/netinet6/ip6_output.c 1.205 +sys/netipsec/xform_ah.c1.90,1.93,1.102,1.103 + + Simplify and strengthen the AH parser. + [maxv, ticket #889] +
CVS commit: [netbsd-8] src/sys/netipsec
Module Name:src Committed By: martin Date: Fri Jun 22 17:54:47 UTC 2018 Modified Files: src/sys/netipsec [netbsd-8]: xform_ah.c Log Message: Pull up following revision(s) (requested by maxv in ticket #889): sys/netinet6/ip6_output.c: revision 1.205 sys/netipsec/xform_ah.c: revision 1.90,1.93,1.102,1.103 Simplify the IPv4 parser. Get the option length in 'optlen', and sanitize it earlier. A new check is added (off + optlen > skip). In the IPv6 parser we reuse 'optlen', and remove 'ad' as a result. Remove the kernel RH0 code. RH0 is deprecated by RFC5095, for security reasons. RH0 was already removed in the kernel's input path, but some parts were still present in the output path: they are now removed. Sent on tech-net@ a few days ago. Fix non-INET6 builds Strengthen and simplify, once more. To generate a diff of this commit: cvs rdiff -u -r1.54.2.6 -r1.54.2.7 src/sys/netipsec/xform_ah.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/netipsec/xform_ah.c diff -u src/sys/netipsec/xform_ah.c:1.54.2.6 src/sys/netipsec/xform_ah.c:1.54.2.7 --- src/sys/netipsec/xform_ah.c:1.54.2.6 Sun Apr 1 08:48:39 2018 +++ src/sys/netipsec/xform_ah.c Fri Jun 22 17:54:47 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: xform_ah.c,v 1.54.2.6 2018/04/01 08:48:39 martin Exp $ */ +/* $NetBSD: xform_ah.c,v 1.54.2.7 2018/06/22 17:54:47 martin Exp $ */ /* $FreeBSD: src/sys/netipsec/xform_ah.c,v 1.1.4.1 2003/01/24 05:11:36 sam Exp $ */ /* $OpenBSD: ip_ah.c,v 1.63 2001/06/26 06:18:58 angelos Exp $ */ /* @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: xform_ah.c,v 1.54.2.6 2018/04/01 08:48:39 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xform_ah.c,v 1.54.2.7 2018/06/22 17:54:47 martin Exp $"); #if defined(_KERNEL_OPT) #include "opt_inet.h" @@ -276,15 +276,15 @@ ah_massage_headers(struct mbuf **m0, int { struct mbuf *m = *m0; unsigned char *ptr; - int off, count; + int off, optlen; #ifdef INET struct ip *ip; #endif #ifdef INET6 + int count, ip6optlen; struct ip6_ext *ip6e; struct ip6_hdr ip6; - struct ip6_rthdr *rh; - int alloc, ad, nxt; + int alloc, nxt; #endif switch (proto) { @@ -339,56 +339,32 @@ ah_massage_headers(struct mbuf **m0, int /* IPv4 option processing */ for (off = sizeof(struct ip); off < skip;) { - if (ptr[off] == IPOPT_EOL || ptr[off] == IPOPT_NOP || - off + 1 < skip) -; - else { -DPRINTF(("%s: illegal IPv4 option length for " -"option %d\n", __func__, ptr[off])); - + if (ptr[off] == IPOPT_EOL) { +break; + } else if (ptr[off] == IPOPT_NOP) { +optlen = 1; + } else if (off + 1 < skip) { +optlen = ptr[off + 1]; +if (optlen < 2 || off + optlen > skip) { + m_freem(m); + return EINVAL; +} + } else { m_freem(m); return EINVAL; } switch (ptr[off]) { - case IPOPT_EOL: -off = skip; /* End the loop. */ -break; - case IPOPT_NOP: -off++; -break; - - case IPOPT_SECURITY: /* 0x82 */ + case IPOPT_SECURITY: case 0x85: /* Extended security. */ case 0x86: /* Commercial security. */ case 0x94: /* Router alert */ case 0x95: /* RFC1770 */ -/* Sanity check for option length. */ -if (ptr[off + 1] < 2) { - DPRINTF(("%s: illegal IPv4 option " - "length for option %d\n", __func__, - ptr[off])); - - m_freem(m); - return EINVAL; -} - -off += ptr[off + 1]; break; case IPOPT_LSRR: case IPOPT_SSRR: -/* Sanity check for option length. */ -if (ptr[off + 1] < 2) { - DPRINTF(("%s: illegal IPv4 option " - "length for option %d\n", __func__, - ptr[off])); - - m_freem(m); - return EINVAL; -} - /* * On output, if we have either of the * source routing options, we should @@ -400,32 +376,21 @@ ah_massage_headers(struct mbuf **m0, int */ if (out) memcpy(>ip_dst, - ptr + off + ptr[off + 1] - + ptr + off + optlen - sizeof(struct in_addr), sizeof(struct in_addr)); +/* FALLTHROUGH */ -/* Fall through */ default: -/* Sanity check for option length. */ -if (ptr[off + 1] < 2) { - DPRINTF(("%s: illegal IPv4 option " - "length for option %d\n", __func__, - ptr[off])); - m_freem(m); - return EINVAL; -} - /* Zeroize all other options. */ -count = ptr[off + 1]; -memcpy(ptr + off, ipseczeroes, count); -off += count; +memcpy(ptr + off, ipseczeroes, optlen); break; } + off += optlen; + /* Sanity check. */ if (off > skip) { -DPRINTF(("%s: malformed IPv4 options header\n", - __func__)); m_freem(m); return EINVAL; } @@ -460,11 +425,12 @@ ah_massage_headers(struct mbuf **m0, int /* Done with IPv6 header. */ m_copyback(m, 0, sizeof(struct ip6_hdr), ); + ip6optlen = skip - sizeof(struct
CVS commit: src/share/mk
Module Name:src Committed By: christos Date: Fri Jun 22 17:31:24 UTC 2018 Modified Files: src/share/mk: bsd.own.mk Log Message: - Fix groff reproducibility: - specify mdoc and font paths - clear encoding - specify pagesize on the command line XXX: pullup-8 To generate a diff of this commit: cvs rdiff -u -r1.1065 -r1.1066 src/share/mk/bsd.own.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/mk/bsd.own.mk diff -u src/share/mk/bsd.own.mk:1.1065 src/share/mk/bsd.own.mk:1.1066 --- src/share/mk/bsd.own.mk:1.1065 Sat Jun 16 15:05:17 2018 +++ src/share/mk/bsd.own.mk Fri Jun 22 13:31:24 2018 @@ -1,4 +1,4 @@ -# $NetBSD: bsd.own.mk,v 1.1065 2018/06/16 19:05:17 mrg Exp $ +# $NetBSD: bsd.own.mk,v 1.1066 2018/06/22 17:31:24 christos Exp $ # This needs to be before bsd.init.mk .if defined(BSD_MK_COMPAT_FILE) @@ -390,7 +390,14 @@ TOOL_GPT= ${TOOLDIR}/bin/${_TOOL_PREFIX # grep exists in src/tools, but is not hooked up into the build. #TOOL_GREP= ${TOOLDIR}/bin/${_TOOL_PREFIX}grep TOOL_GREP= grep -TOOL_GROFF= PATH=${TOOLDIR}/lib/groff:$${PATH} ${TOOLDIR}/bin/${_TOOL_PREFIX}groff +GROFF_SHARE_PATH= ${TOOLDIR}/share/groff +TOOL_GROFF_ENV= \ +GROFF_ENCODING= \ +GROFF_BIN_PATH=${TOOLDIR}/lib/groff \ +GROFF_FONT_PATH=${GROFF_SHARE_PATH}/site-font:${GROFF_SHARE_PATH}/font \ +GROFF_TMAC_PATH=${GROFF_SHARE_PATH}/site-tmac:${GROFF_SHARE_PATH}/tmac +TOOL_GROFF= ${TOOL_GROFF_ENV} ${TOOLDIR}/bin/${_TOOL_PREFIX}groff ${GROFF_FLAGS} + TOOL_HEXDUMP= ${TOOLDIR}/bin/${_TOOL_PREFIX}hexdump TOOL_HP300MKBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}hp300-mkboot TOOL_HPPAMKBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}hppa-mkboot @@ -432,12 +439,12 @@ TOOL_PKG_CREATE= ${TOOLDIR}/bin/${_TOOL_ TOOL_POWERPCMKBOOTIMAGE=${TOOLDIR}/bin/${_TOOL_PREFIX}powerpc-mkbootimage TOOL_PWD_MKDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}pwd_mkdb TOOL_REFER= ${TOOLDIR}/bin/${_TOOL_PREFIX}refer -TOOL_ROFF_ASCII= PATH=${TOOLDIR}/lib/groff:$${PATH} ${TOOLDIR}/bin/${_TOOL_PREFIX}nroff +TOOL_ROFF_ASCII= ${TOOL_GROFF_ENV} ${TOOLDIR}/bin/${_TOOL_PREFIX}nroff TOOL_ROFF_DOCASCII= ${TOOL_GROFF} -Tascii TOOL_ROFF_DOCHTML= ${TOOL_GROFF} -Thtml -TOOL_ROFF_DVI= ${TOOL_GROFF} -Tdvi +TOOL_ROFF_DVI= ${TOOL_GROFF} -Tdvi ${ROFF_PAGESIZE} TOOL_ROFF_HTML= ${TOOL_GROFF} -Tlatin1 -mdoc2html -TOOL_ROFF_PS= ${TOOL_GROFF} -Tps +TOOL_ROFF_PS= ${TOOL_GROFF} -Tps ${ROFF_PAGESIZE} TOOL_ROFF_RAW= ${TOOL_GROFF} -Z TOOL_RPCGEN= RPCGEN_CPP=${CPP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}rpcgen TOOL_SED= ${TOOLDIR}/bin/${_TOOL_PREFIX}sed @@ -546,9 +553,9 @@ TOOL_REFER= refer TOOL_ROFF_ASCII= nroff TOOL_ROFF_DOCASCII= ${TOOL_GROFF} -Tascii TOOL_ROFF_DOCHTML= ${TOOL_GROFF} -Thtml -TOOL_ROFF_DVI= ${TOOL_GROFF} -Tdvi +TOOL_ROFF_DVI= ${TOOL_GROFF} -Tdvi ${ROFF_PAGESIZE} TOOL_ROFF_HTML= ${TOOL_GROFF} -Tlatin1 -mdoc2html -TOOL_ROFF_PS= ${TOOL_GROFF} -Tps +TOOL_ROFF_PS= ${TOOL_GROFF} -Tps ${ROFF_PAGESIZE} TOOL_ROFF_RAW= ${TOOL_GROFF} -Z TOOL_RPCGEN= rpcgen TOOL_SED= sed @@ -1128,6 +1135,8 @@ MKDYNAMICROOT= no .if defined(MKREPRO) MKARZERO ?= ${MKREPRO} +GROFF_FLAGS ?= -dpaper=letter +ROFF_PAGESIZE ?= -P-pletter .endif # Only install the general firmware on some systems
CVS commit: src/external/gpl2/groff/dist
Module Name:src Committed By: christos Date: Fri Jun 22 17:28:27 UTC 2018 Modified Files: src/external/gpl2/groff/dist: Makefile.in Log Message: Don't look in random (legacy) places for fonts. We want reproducible builds to work. XXX: pullup-8 To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/groff/dist/Makefile.in Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/gpl2/groff/dist/Makefile.in diff -u src/external/gpl2/groff/dist/Makefile.in:1.2 src/external/gpl2/groff/dist/Makefile.in:1.3 --- src/external/gpl2/groff/dist/Makefile.in:1.2 Wed Jan 13 14:01:58 2016 +++ src/external/gpl2/groff/dist/Makefile.in Fri Jun 22 13:28:27 2018 @@ -156,7 +156,7 @@ localfontdir=$(dataprogramdir)/site-font legacyfontdir=/usr/lib/font # `fontpath' says where to look for dev*/*. -fontpath=$(localfontdir)$(RT_SEP)$(fontdir)$(RT_SEP)$(legacyfontdir) +fontpath=$(localfontdir)$(RT_SEP)$(fontdir) # `tmacdir' says where to install macros. tmacdir=$(datasubdir)/tmac
CVS commit: src/bin/sh
Module Name:src Committed By: kre Date: Fri Jun 22 17:22:34 UTC 2018 Modified Files: src/bin/sh: expand.c Log Message: When matching a char class ([[:name:]]) in a pattern (for filename expansion, case patterrns, etc) do not force '[' to be a member of every class. Before this fix, try: case [ in [[:alpha:]]) echo Huh\?;; esac XXX pullup-8(Perhaps -7 as well, though that shell version has much more relevant bugs than this one.) This bug is not in -6 as that has no charclass support. To generate a diff of this commit: cvs rdiff -u -r1.121 -r1.122 src/bin/sh/expand.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/sh/expand.c diff -u src/bin/sh/expand.c:1.121 src/bin/sh/expand.c:1.122 --- src/bin/sh/expand.c:1.121 Fri Oct 6 21:09:45 2017 +++ src/bin/sh/expand.c Fri Jun 22 17:22:34 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: expand.c,v 1.121 2017/10/06 21:09:45 kre Exp $ */ +/* $NetBSD: expand.c,v 1.122 2018/06/22 17:22:34 kre Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)expand.c 8.5 (Berkeley) 5/15/95"; #else -__RCSID("$NetBSD: expand.c,v 1.121 2017/10/06 21:09:45 kre Exp $"); +__RCSID("$NetBSD: expand.c,v 1.122 2018/06/22 17:22:34 kre Exp $"); #endif #endif /* not lint */ @@ -1777,8 +1777,10 @@ patmatch(const char *pattern, const char } if (c == '[' && *p == ':') { found |= match_charclass(p, chr, ); - if (end != NULL) + if (end != NULL) { p = end; + continue; + } } if (c == CTLESC) c = *p++;
CVS commit: src/sys/dev/i2c
Module Name:src Committed By: martin Date: Fri Jun 22 15:52:00 UTC 2018 Modified Files: src/sys/dev/i2c: i2c.c Log Message: iic_use_direct_match(): when iic_compatible_match() does not find a comptible entry, set match quality to 0. Otherwise callers might use random stack garbage. To generate a diff of this commit: cvs rdiff -u -r1.63 -r1.64 src/sys/dev/i2c/i2c.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/i2c/i2c.c diff -u src/sys/dev/i2c/i2c.c:1.63 src/sys/dev/i2c/i2c.c:1.64 --- src/sys/dev/i2c/i2c.c:1.63 Mon Jun 18 17:07:07 2018 +++ src/sys/dev/i2c/i2c.c Fri Jun 22 15:52:00 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: i2c.c,v 1.63 2018/06/18 17:07:07 thorpej Exp $ */ +/* $NetBSD: i2c.c,v 1.64 2018/06/22 15:52:00 martin Exp $ */ /* * Copyright (c) 2003 Wasabi Systems, Inc. @@ -40,7 +40,7 @@ #endif #include -__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.63 2018/06/18 17:07:07 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.64 2018/06/22 15:52:00 martin Exp $"); #include #include @@ -735,7 +735,8 @@ iic_use_direct_match(const struct i2c_at } if (ia->ia_ncompat > 0 && ia->ia_compat != NULL) { - (void) iic_compatible_match(ia, compats, match_resultp); + if (iic_compatible_match(ia, compats, match_resultp) == NULL) + *match_resultp = 0; return true; }
CVS commit: src/sys/dev/i2c
Module Name:src Committed By: martin Date: Fri Jun 22 15:48:57 UTC 2018 Modified Files: src/sys/dev/i2c: dbcool.c Log Message: Add a kernel panic when we matched but can not handle a string - better die explicitly instead of crashing a few lines later with strange NULL derefs. To generate a diff of this commit: cvs rdiff -u -r1.50 -r1.51 src/sys/dev/i2c/dbcool.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/i2c/dbcool.c diff -u src/sys/dev/i2c/dbcool.c:1.50 src/sys/dev/i2c/dbcool.c:1.51 --- src/sys/dev/i2c/dbcool.c:1.50 Mon Jun 18 17:07:07 2018 +++ src/sys/dev/i2c/dbcool.c Fri Jun 22 15:48:57 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: dbcool.c,v 1.50 2018/06/18 17:07:07 thorpej Exp $ */ +/* $NetBSD: dbcool.c,v 1.51 2018/06/22 15:48:57 martin Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -50,7 +50,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dbcool.c,v 1.50 2018/06/18 17:07:07 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dbcool.c,v 1.51 2018/06/22 15:48:57 martin Exp $"); #include #include @@ -779,9 +779,11 @@ dbcool_attach(device_t parent, device_t sc->sc_dc.dc_chip = NULL; sc->sc_dc.dc_readreg = dbcool_readreg; sc->sc_dc.dc_writereg = dbcool_writereg; - (void)dbcool_chip_ident(>sc_dc); sc->sc_dev = self; + if (dbcool_chip_ident(>sc_dc) < 0 || sc->sc_dc.dc_chip == NULL) + panic("could not identify chip at addr %d", args->ia_addr); + aprint_naive("\n"); aprint_normal("\n");
CVS commit: src/share/mk
Module Name:src Committed By: maya Date: Fri Jun 22 11:25:04 UTC 2018 Modified Files: src/share/mk: sys.mk Log Message: Add comment describing why we remove -Wsystem-headers, requested by mrg. To generate a diff of this commit: cvs rdiff -u -r1.132 -r1.133 src/share/mk/sys.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/mk/sys.mk diff -u src/share/mk/sys.mk:1.132 src/share/mk/sys.mk:1.133 --- src/share/mk/sys.mk:1.132 Wed Jun 20 02:15:13 2018 +++ src/share/mk/sys.mk Fri Jun 22 11:25:03 2018 @@ -1,4 +1,4 @@ -# $NetBSD: sys.mk,v 1.132 2018/06/20 02:15:13 maya Exp $ +# $NetBSD: sys.mk,v 1.133 2018/06/22 11:25:03 maya Exp $ # @(#)sys.mk 8.2 (Berkeley) 3/21/94 # # This file contains the basic rules for make(1) and is read first @@ -50,6 +50,8 @@ CTFFLAGS ?= -g -L VERSION CTFMFLAGS ?= -t -g -L VERSION CXX?= c++ +# Strip flags unsupported by C++ compilers +# Remove -Wsystem-headers because C++ headers aren't clean of warnings CXXFLAGS?= ${CFLAGS:N-Wno-traditional:N-Wstrict-prototypes:N-Wmissing-prototypes:N-Wno-pointer-sign:N-ffreestanding:N-std=gnu[0-9][0-9]:N-Wold-style-definition:N-Wno-format-zero-length:N-Wsystem-headers} __ALLSRC1= ${empty(DESTDIR):?${.ALLSRC}:${.ALLSRC:S|^${DESTDIR}|^destdir|}}
CVS commit: src/bin/sh
Module Name:src Committed By: kre Date: Fri Jun 22 11:04:55 UTC 2018 Modified Files: src/bin/sh: eval.c exec.c exec.h mknodes.sh nodes.c.pat Log Message: Deal with ref after free found by ASAN when a function redefines itself, or some other function which is still active. This was a long known bug (fixed ages ago in the FreeBSD sh) which hadn't been fixed as in practice, the situation that causes the problem simply doesn't arise .. ASAN found it in the sh dotcmd tests which do have this odd "feature" in the way they are written (but where it never caused a problem, as the tests are so simple that no mem is ever allocated between when the old version of the function was deleted, and when it finished executing, so its code all remained intact, despite having been freed.) The fix is taken from the FreeBSD sh. XXX -- pullup-8 (after a while to ensure no other problems arise). To generate a diff of this commit: cvs rdiff -u -r1.154 -r1.155 src/bin/sh/eval.c cvs rdiff -u -r1.51 -r1.52 src/bin/sh/exec.c cvs rdiff -u -r1.26 -r1.27 src/bin/sh/exec.h cvs rdiff -u -r1.2 -r1.3 src/bin/sh/mknodes.sh cvs rdiff -u -r1.13 -r1.14 src/bin/sh/nodes.c.pat Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/sh/eval.c diff -u src/bin/sh/eval.c:1.154 src/bin/sh/eval.c:1.155 --- src/bin/sh/eval.c:1.154 Sun Jun 17 17:19:06 2018 +++ src/bin/sh/eval.c Fri Jun 22 11:04:55 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: eval.c,v 1.154 2018/06/17 17:19:06 kre Exp $ */ +/* $NetBSD: eval.c,v 1.155 2018/06/22 11:04:55 kre Exp $ */ /*- * Copyright (c) 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)eval.c 8.9 (Berkeley) 6/8/95"; #else -__RCSID("$NetBSD: eval.c,v 1.154 2018/06/17 17:19:06 kre Exp $"); +__RCSID("$NetBSD: eval.c,v 1.155 2018/06/22 11:04:55 kre Exp $"); #endif #endif /* not lint */ @@ -1069,6 +1069,7 @@ evalcommand(union node *cmd, int flgs, s INTOFF; savelocalvars = localvars; localvars = NULL; + reffunc(cmdentry.u.func); INTON; if (setjmp(jmploc.loc)) { if (exception == EXSHELLPROC) { @@ -1078,6 +1079,7 @@ evalcommand(union node *cmd, int flgs, s freeparam(); shellparam = saveparam; } + unreffunc(cmdentry.u.func); poplocalvars(); localvars = savelocalvars; funclinebase = savefuncline; @@ -1096,8 +1098,8 @@ evalcommand(union node *cmd, int flgs, s VTRACE(DBG_EVAL, ("function: node: %d '%s' # %d%s; funclinebase=%d\n", - cmdentry.u.func->type, - NODETYPENAME(cmdentry.u.func->type), + getfuncnode(cmdentry.u.func)->type, + NODETYPENAME(getfuncnode(cmdentry.u.func)->type), cmdentry.lineno, cmdentry.lno_frel?" (=1)":"", funclinebase)); } @@ -1105,9 +1107,10 @@ evalcommand(union node *cmd, int flgs, s /* stop shell blowing its stack */ if (++funcnest > 1000) error("too many nested function calls"); - evaltree(cmdentry.u.func, flags & EV_TESTED); + evaltree(getfuncnode(cmdentry.u.func), flags & EV_TESTED); funcnest--; INTOFF; + unreffunc(cmdentry.u.func); poplocalvars(); localvars = savelocalvars; funclinebase = savefuncline; Index: src/bin/sh/exec.c diff -u src/bin/sh/exec.c:1.51 src/bin/sh/exec.c:1.52 --- src/bin/sh/exec.c:1.51 Wed Jul 5 19:58:10 2017 +++ src/bin/sh/exec.c Fri Jun 22 11:04:55 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: exec.c,v 1.51 2017/07/05 19:58:10 kre Exp $ */ +/* $NetBSD: exec.c,v 1.52 2018/06/22 11:04:55 kre Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)exec.c 8.4 (Berkeley) 6/8/95"; #else -__RCSID("$NetBSD: exec.c,v 1.51 2017/07/05 19:58:10 kre Exp $"); +__RCSID("$NetBSD: exec.c,v 1.52 2018/06/22 11:04:55 kre Exp $"); #endif #endif /* not lint */ @@ -481,8 +481,9 @@ printentry(struct tblentry *cmdp, int ve out1fmt("%s", cmdp->cmdname); if (verbose) { struct procstat ps; + INTOFF; - commandtext(, cmdp->param.func); + commandtext(, getfuncnode(cmdp->param.func)); INTON; out1str("() { "); out1str(ps.cmd); @@ -989,9 +990,8 @@ addcmdentry(char *name, struct cmdentry INTOFF; cmdp = cmdlookup(name, 1); if (cmdp->cmdtype != CMDSPLBLTIN) { - if (cmdp->cmdtype == CMDFUNCTION) { - freefunc(cmdp->param.func); - } + if (cmdp->cmdtype == CMDFUNCTION) + unreffunc(cmdp->param.func); cmdp->cmdtype = entry->cmdtype; cmdp->lineno = entry->lineno; cmdp->fn_ln1 = entry->lno_frel; @@ -1031,7 +1031,7 @@ unsetfunc(char *name) if ((cmdp = cmdlookup(name, 0)) != NULL && cmdp->cmdtype == CMDFUNCTION) { - freefunc(cmdp->param.func); + unreffunc(cmdp->param.func); delete_cmd_entry(); } return 0; Index: src/bin/sh/exec.h diff -u src/bin/sh/exec.h:1.26 src/bin/sh/exec.h:1.27 --- src/bin/sh/exec.h:1.26 Wed Jun 7 05:08:32 2017 +++ src/bin/sh/exec.h Fri Jun 22 11:04:55 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: exec.h,v 1.26 2017/06/07 05:08:32 kre Exp $ */ +/* $NetBSD:
CVS commit: src/sys/dev/fdt
Module Name:src Committed By: jmcneill Date: Fri Jun 22 10:17:04 UTC 2018 Modified Files: src/sys/dev/fdt: dwcmmc_fdt.c Log Message: If max-frequency is not specified, use UINT_MAX instead of the rate programmed by the bootloader. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/dev/fdt/dwcmmc_fdt.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/fdt/dwcmmc_fdt.c diff -u src/sys/dev/fdt/dwcmmc_fdt.c:1.2 src/sys/dev/fdt/dwcmmc_fdt.c:1.3 --- src/sys/dev/fdt/dwcmmc_fdt.c:1.2 Tue Jun 19 22:44:33 2018 +++ src/sys/dev/fdt/dwcmmc_fdt.c Fri Jun 22 10:17:04 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: dwcmmc_fdt.c,v 1.2 2018/06/19 22:44:33 jmcneill Exp $ */ +/* $NetBSD: dwcmmc_fdt.c,v 1.3 2018/06/22 10:17:04 jmcneill Exp $ */ /*- * Copyright (c) 2015-2018 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dwcmmc_fdt.c,v 1.2 2018/06/19 22:44:33 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dwcmmc_fdt.c,v 1.3 2018/06/22 10:17:04 jmcneill Exp $"); #include #include @@ -88,8 +88,8 @@ dwcmmc_fdt_attach(device_t parent, devic struct dwc_mmc_softc *sc = >sc; struct fdt_attach_args * const faa = aux; const int phandle = faa->faa_phandle; - u_int fifo_depth, max_freq; char intrstr[128]; + u_int fifo_depth; bus_addr_t addr; bus_size_t size; int error; @@ -135,12 +135,9 @@ dwcmmc_fdt_attach(device_t parent, devic } esc->sc_conf = of_search_compatible(phandle, compat_data)->data; - const u_int ciu_div = esc->sc_conf->ciu_div > 0 ? esc->sc_conf->ciu_div : 1; - if (of_getprop_uint32(phandle, "max-frequency", _freq) == 0) - sc->sc_clock_freq = max_freq; - else - sc->sc_clock_freq = clk_get_rate(esc->sc_clk_ciu) / ciu_div; + if (of_getprop_uint32(phandle, "max-frequency", >sc_clock_freq) != 0) + sc->sc_clock_freq = UINT_MAX; sc->sc_fifo_depth = fifo_depth; sc->sc_flags = DWC_MMC_F_USE_HOLD_REG | DWC_MMC_F_DMA;
CVS commit: [netbsd-8] src/sys/dev/pci
Module Name:src Committed By: martin Date: Fri Jun 22 10:15:18 UTC 2018 Modified Files: src/sys/dev/pci [netbsd-8]: ld_virtio.c Log Message: Pull up following revision(s) (requested by jakllsch in ticket #888): sys/dev/pci/ld_virtio.c: revision 1.19-1.21,1.23 remove trailing whitespace add feature/register definitions from virtio-v1.0-cs04 unload payload dma map upon command completion Make ld_virtio aware of a possible device-side write cache. The virtio block device capacity config item is expressed always in request protocol sector units of 512 bytes. Also, add and use a symbolic constant to refer to request protocol sector units. destroy 'sc_sync_wait' condvar and mutex upon detach To generate a diff of this commit: cvs rdiff -u -r1.15.6.1 -r1.15.6.2 src/sys/dev/pci/ld_virtio.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/ld_virtio.c diff -u src/sys/dev/pci/ld_virtio.c:1.15.6.1 src/sys/dev/pci/ld_virtio.c:1.15.6.2 --- src/sys/dev/pci/ld_virtio.c:1.15.6.1 Fri Sep 1 09:59:11 2017 +++ src/sys/dev/pci/ld_virtio.c Fri Jun 22 10:15:18 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ld_virtio.c,v 1.15.6.1 2017/09/01 09:59:11 martin Exp $ */ +/* $NetBSD: ld_virtio.c,v 1.15.6.2 2018/06/22 10:15:18 martin Exp $ */ /* * Copyright (c) 2010 Minoura Makoto. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ld_virtio.c,v 1.15.6.1 2017/09/01 09:59:11 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ld_virtio.c,v 1.15.6.2 2018/06/22 10:15:18 martin Exp $"); #include #include @@ -60,6 +60,7 @@ __KERNEL_RCSID(0, "$NetBSD: ld_virtio.c, #define VIRTIO_BLK_CONFIG_GEOMETRY_H 18 /* 8bit */ #define VIRTIO_BLK_CONFIG_GEOMETRY_S 19 /* 8bit */ #define VIRTIO_BLK_CONFIG_BLK_SIZE 20 /* 32bit */ +#define VIRTIO_BLK_CONFIG_WRITEBACK 32 /* 8bit */ /* Feature bits */ #define VIRTIO_BLK_F_BARRIER (1<<0) @@ -70,15 +71,19 @@ __KERNEL_RCSID(0, "$NetBSD: ld_virtio.c, #define VIRTIO_BLK_F_BLK_SIZE (1<<6) #define VIRTIO_BLK_F_SCSI (1<<7) #define VIRTIO_BLK_F_FLUSH (1<<9) +#define VIRTIO_BLK_F_TOPOLOGY (1<<10) +#define VIRTIO_BLK_F_CONFIG_WCE (1<<11) -/* +/* * Each block request uses at least two segments - one for the header * and one for the status. -*/ +*/ #define VIRTIO_BLK_MIN_SEGMENTS 2 #define VIRTIO_BLK_FLAG_BITS \ VIRTIO_COMMON_FLAG_BITS \ + "\x0c""CONFIG_WCE" \ + "\x0b""TOPOLOGY" \ "\x0a""FLUSH" \ "\x08""SCSI" \ "\x07""BLK_SIZE" \ @@ -91,11 +96,16 @@ __KERNEL_RCSID(0, "$NetBSD: ld_virtio.c, /* Command */ #define VIRTIO_BLK_T_IN 0 #define VIRTIO_BLK_T_OUT 1 +#define VIRTIO_BLK_T_FLUSH 4 #define VIRTIO_BLK_T_BARRIER 0x8000 +/* Sector */ +#define VIRTIO_BLK_BSIZE 512 + /* Status */ #define VIRTIO_BLK_S_OK 0 #define VIRTIO_BLK_S_IOERR 1 +#define VIRTIO_BLK_S_UNSUPP 2 /* Request header structure */ struct virtio_blk_req_hdr { @@ -103,7 +113,7 @@ struct virtio_blk_req_hdr { uint32_t ioprio; uint64_t sector; } __packed; -/* 512*virtio_blk_req_hdr.sector byte payload and 1 byte status follows */ +/* payload and 1 byte status follows */ /* @@ -113,6 +123,7 @@ struct virtio_blk_req { struct virtio_blk_req_hdr vr_hdr; uint8_tvr_status; struct buf *vr_bp; +#define DUMMY_VR_BP((void *)1) bus_dmamap_t vr_cmdsts; bus_dmamap_t vr_payload; }; @@ -128,6 +139,13 @@ struct ld_virtio_softc { bus_dma_segment_t sc_reqs_seg; int sc_readonly; + + enum { + SYNC_FREE, SYNC_BUSY, SYNC_DONE + } sc_sync_use; + kcondvar_t sc_sync_wait; + kmutex_t sc_sync_wait_lock; + uint8_t sc_sync_status; }; static int ld_virtio_match(device_t, cfdata_t, void *); @@ -151,6 +169,7 @@ ld_virtio_match(device_t parent, cfdata_ static int ld_virtio_vq_done(struct virtqueue *); static int ld_virtio_dump(struct ld_softc *, void *, int, int); static int ld_virtio_start(struct ld_softc *, struct buf *); +static int ld_virtio_ioctl(struct ld_softc *, u_long, void *, int32_t, bool); static int ld_virtio_alloc_reqs(struct ld_virtio_softc *sc, int qsize) @@ -263,7 +282,8 @@ ld_virtio_attach(device_t parent, device virtio_child_attach_start(vsc, self, IPL_BIO, >sc_vq, NULL, virtio_vq_intr, 0, (VIRTIO_BLK_F_SIZE_MAX | VIRTIO_BLK_F_SEG_MAX | - VIRTIO_BLK_F_GEOMETRY | VIRTIO_BLK_F_RO | VIRTIO_BLK_F_BLK_SIZE), + VIRTIO_BLK_F_GEOMETRY | VIRTIO_BLK_F_RO | VIRTIO_BLK_F_BLK_SIZE | + VIRTIO_BLK_F_FLUSH | VIRTIO_BLK_F_CONFIG_WCE), VIRTIO_BLK_FLAG_BITS); features = virtio_features(vsc); @@ -277,7 +297,7 @@ ld_virtio_attach(device_t parent, device ld->sc_secsize = virtio_read_device_config_4(vsc, VIRTIO_BLK_CONFIG_BLK_SIZE); } else - ld->sc_secsize = 512; + ld->sc_secsize = VIRTIO_BLK_BSIZE; /* At least genfs_io assumes maxxfer == MAXPHYS. */ if (features & VIRTIO_BLK_F_SIZE_MAX) { @@ -327,7 +347,7 @@ ld_virtio_attach(device_t parent, device ld->sc_dv = self;
CVS commit: [netbsd-8] src/bin/ed
Module Name:src Committed By: martin Date: Fri Jun 22 10:08:22 UTC 2018 Modified Files: src/bin/ed [netbsd-8]: main.c Log Message: Pull up following revision(s) (requested by christos in ticket #887): bin/ed/main.c: revision 1.30 Prevent shell execution also in the 'r ! dobad' case, pointed out by Martijn van Duren, thanks! XXX: pullup-8 To generate a diff of this commit: cvs rdiff -u -r1.28.8.1 -r1.28.8.2 src/bin/ed/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/ed/main.c diff -u src/bin/ed/main.c:1.28.8.1 src/bin/ed/main.c:1.28.8.2 --- src/bin/ed/main.c:1.28.8.1 Sun Apr 8 06:04:08 2018 +++ src/bin/ed/main.c Fri Jun 22 10:08:22 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.28.8.1 2018/04/08 06:04:08 snj Exp $ */ +/* $NetBSD: main.c,v 1.28.8.2 2018/06/22 10:08:22 martin Exp $ */ /* main.c: This file contains the main control and user-interface routines for the ed line editor. */ @@ -39,7 +39,7 @@ __COPYRIGHT( #if 0 static char *rcsid = "@(#)main.c,v 1.1 1994/02/01 00:34:42 alm Exp"; #else -__RCSID("$NetBSD: main.c,v 1.28.8.1 2018/04/08 06:04:08 snj Exp $"); +__RCSID("$NetBSD: main.c,v 1.28.8.2 2018/06/22 10:08:22 martin Exp $"); #endif #endif /* not lint */ @@ -865,14 +865,11 @@ exec_command(void) printf("%ld\n", addr_cnt ? second_addr : addr_last); break; case '!': - if (secure) { - seterrmsg("'!' not allowed"); - return ERR; - } if (addr_cnt > 0) { seterrmsg("unexpected address"); return ERR; - } else if ((sflags = get_shell_command()) < 0) + } + if ((sflags = get_shell_command()) < 0) return ERR; GET_COMMAND_SUFFIX(); if (sflags) printf("%s\n", shcmd + 1); @@ -994,7 +991,7 @@ get_shell_command(void) int i = 0; int j = 0; - if (red) { + if (red || secure) { seterrmsg("shell access restricted"); return ERR; } else if ((s = ibufp = get_extended_line(, 1)) == NULL)
CVS commit: src/sys/arch/sun3/dev
Module Name:src Committed By: msaitoh Date: Fri Jun 22 09:31:04 UTC 2018 Modified Files: src/sys/arch/sun3/dev: if_ie.c Log Message: Remove bpf_tap() in iexmit() because ie_start() does bpf_mtap(). To generate a diff of this commit: cvs rdiff -u -r1.63 -r1.64 src/sys/arch/sun3/dev/if_ie.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/sun3/dev/if_ie.c diff -u src/sys/arch/sun3/dev/if_ie.c:1.63 src/sys/arch/sun3/dev/if_ie.c:1.64 --- src/sys/arch/sun3/dev/if_ie.c:1.63 Fri Jun 22 04:17:41 2018 +++ src/sys/arch/sun3/dev/if_ie.c Fri Jun 22 09:31:04 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: if_ie.c,v 1.63 2018/06/22 04:17:41 msaitoh Exp $ */ +/* $NetBSD: if_ie.c,v 1.64 2018/06/22 09:31:04 msaitoh Exp $ */ /*- * Copyright (c) 1993, 1994, 1995 Charles M. Hannum. @@ -98,7 +98,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_ie.c,v 1.63 2018/06/22 04:17:41 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_ie.c,v 1.64 2018/06/22 09:31:04 msaitoh Exp $"); #include "opt_inet.h" #include "opt_ns.h" @@ -725,13 +725,6 @@ iexmit(struct ie_softc *sc) sc->xctail); #endif - /* - * If BPF is listening on this interface, let it see the packet before - * we push it on the wire. - */ - bpf_tap(ifp, sc->xmit_cbuffs[sc->xctail], - SWAP(sc->xmit_buffs[sc->xctail]->ie_xmit_flags)); - sc->xmit_buffs[sc->xctail]->ie_xmit_flags |= IE_XMIT_LAST; sc->xmit_buffs[sc->xctail]->ie_xmit_next = SWAP(0x); sc->xmit_buffs[sc->xctail]->ie_xmit_buf =
CVS commit: src/sys/dev/pci
Module Name:src Committed By: msaitoh Date: Fri Jun 22 09:14:00 UTC 2018 Modified Files: src/sys/dev/pci: if_de.c Log Message: Remove bpf_tap() call in rx. It's done in if_percpuq_softint(). To generate a diff of this commit: cvs rdiff -u -r1.152 -r1.153 src/sys/dev/pci/if_de.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/if_de.c diff -u src/sys/dev/pci/if_de.c:1.152 src/sys/dev/pci/if_de.c:1.153 --- src/sys/dev/pci/if_de.c:1.152 Fri Jun 22 04:17:42 2018 +++ src/sys/dev/pci/if_de.c Fri Jun 22 09:13:59 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: if_de.c,v 1.152 2018/06/22 04:17:42 msaitoh Exp $ */ +/* $NetBSD: if_de.c,v 1.153 2018/06/22 09:13:59 msaitoh Exp $ */ /*- * Copyright (c) 1994-1997 Matt Thomas (m...@3am-software.com) @@ -37,7 +37,7 @@ * board which support 21040, 21041, or 21140 (mostly). */ #include -__KERNEL_RCSID(0, "$NetBSD: if_de.c,v 1.152 2018/06/22 04:17:42 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_de.c,v 1.153 2018/06/22 09:13:59 msaitoh Exp $"); #define TULIP_HDR_DATA @@ -3639,10 +3639,6 @@ tulip_rx_intr( #endif /* TULIP_BUS_DMA */ eh = *mtod(ms, struct ether_header *); - if (sc->tulip_bpf != NULL) { - if (me == ms) - bpf_tap(ifp, mtod(ms, void *), total_len); - } sc->tulip_flags |= TULIP_RXACT; if ((sc->tulip_flags & (TULIP_PROMISC|TULIP_HASHONLY)) && (eh.ether_dhost[0] & 1) == 0
CVS commit: src/sys/dev/ata
Module Name:src Committed By: pgoyette Date: Fri Jun 22 09:06:04 UTC 2018 Modified Files: src/sys/dev/ata: ata_raid.c Log Message: Call config_cfattach_attach() regardless of whether the module is being built as part of a kernel or as a external module. Addresses kern/53389 - thanks for the report! XXX pullup-8 To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 src/sys/dev/ata/ata_raid.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/ata/ata_raid.c diff -u src/sys/dev/ata/ata_raid.c:1.39 src/sys/dev/ata/ata_raid.c:1.40 --- src/sys/dev/ata/ata_raid.c:1.39 Tue Sep 27 08:05:34 2016 +++ src/sys/dev/ata/ata_raid.c Fri Jun 22 09:06:04 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ata_raid.c,v 1.39 2016/09/27 08:05:34 pgoyette Exp $ */ +/* $NetBSD: ata_raid.c,v 1.40 2018/06/22 09:06:04 pgoyette Exp $ */ /* * Copyright (c) 2003 Wasabi Systems, Inc. @@ -40,7 +40,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ata_raid.c,v 1.39 2016/09/27 08:05:34 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ata_raid.c,v 1.40 2018/06/22 09:06:04 pgoyette Exp $"); #include #include @@ -338,26 +338,27 @@ ataraid_modcmd(modcmd_t cmd, void *arg) error = config_cfdriver_attach(_cd); if (error) break; +#endif error = config_cfattach_attach(ataraid_cd.cd_name, _ca); if (error) { +#ifdef _MODULE config_cfdriver_detach(_cd); +#endif aprint_error("%s: unable to register cfattach for \n" "%s, error %d", __func__, ataraid_cd.cd_name, error); break; } -#endif break; case MODULE_CMD_FINI: -#ifdef _MODULE - error = config_cfattach_detach(ataraid_cd.cd_name, _ca); if (error) { aprint_error("%s: failed to detach %s cfattach, " "error %d\n", __func__, ataraid_cd.cd_name, error); break; } +#ifdef _MODULE error = config_cfdriver_detach(_cd); if (error) { (void)config_cfattach_attach(ataraid_cd.cd_name,
CVS commit: src/sys/arch
Module Name:src Committed By: maxv Date: Fri Jun 22 06:22:37 UTC 2018 Modified Files: src/sys/arch/x86/include: fpu.h src/sys/arch/x86/x86: cpu.c fpu.c src/sys/arch/xen/x86: cpu.c Log Message: Revert jdolecek's changes related to FXSAVE. They just didn't make any sense and were trying to hide a real bug, which is, that there is for some reason a wrong stack alignment that causes FXSAVE to fault in fpuinit_mxcsr_mask. As seen in current-users@ yesterday, rdi % 16 = 8. And as seen several months ago, as well. The rest of the changes in XSAVE are wrong too, but I'll let him fix these ones. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/arch/x86/include/fpu.h cvs rdiff -u -r1.157 -r1.158 src/sys/arch/x86/x86/cpu.c cvs rdiff -u -r1.41 -r1.42 src/sys/arch/x86/x86/fpu.c cvs rdiff -u -r1.119 -r1.120 src/sys/arch/xen/x86/cpu.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/x86/include/fpu.h diff -u src/sys/arch/x86/include/fpu.h:1.11 src/sys/arch/x86/include/fpu.h:1.12 --- src/sys/arch/x86/include/fpu.h:1.11 Wed Jun 20 20:43:20 2018 +++ src/sys/arch/x86/include/fpu.h Fri Jun 22 06:22:37 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: fpu.h,v 1.11 2018/06/20 20:43:20 jdolecek Exp $ */ +/* $NetBSD: fpu.h,v 1.12 2018/06/22 06:22:37 maxv Exp $ */ #ifndef _X86_FPU_H_ #define _X86_FPU_H_ @@ -12,7 +12,7 @@ struct lwp; struct trapframe; void fpuinit(struct cpu_info *); -void fpuinit_mxcsr_mask(bool); +void fpuinit_mxcsr_mask(void); void fpusave_lwp(struct lwp *, bool); void fpusave_cpu(bool); Index: src/sys/arch/x86/x86/cpu.c diff -u src/sys/arch/x86/x86/cpu.c:1.157 src/sys/arch/x86/x86/cpu.c:1.158 --- src/sys/arch/x86/x86/cpu.c:1.157 Wed Jun 20 20:43:21 2018 +++ src/sys/arch/x86/x86/cpu.c Fri Jun 22 06:22:37 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.c,v 1.157 2018/06/20 20:43:21 jdolecek Exp $ */ +/* $NetBSD: cpu.c,v 1.158 2018/06/22 06:22:37 maxv Exp $ */ /* * Copyright (c) 2000-2012 NetBSD Foundation, Inc. @@ -62,7 +62,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.157 2018/06/20 20:43:21 jdolecek Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.158 2018/06/22 06:22:37 maxv Exp $"); #include "opt_ddb.h" #include "opt_mpbios.h" /* for MPDEBUG */ @@ -638,7 +638,7 @@ cpu_init(struct cpu_info *ci) } if (x86_fpu_save >= FPU_SAVE_FXSAVE) { - fpuinit_mxcsr_mask(true); + fpuinit_mxcsr_mask(); } /* If xsave is enabled, enable all fpu features */ Index: src/sys/arch/x86/x86/fpu.c diff -u src/sys/arch/x86/x86/fpu.c:1.41 src/sys/arch/x86/x86/fpu.c:1.42 --- src/sys/arch/x86/x86/fpu.c:1.41 Wed Jun 20 20:43:21 2018 +++ src/sys/arch/x86/x86/fpu.c Fri Jun 22 06:22:37 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: fpu.c,v 1.41 2018/06/20 20:43:21 jdolecek Exp $ */ +/* $NetBSD: fpu.c,v 1.42 2018/06/22 06:22:37 maxv Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation, Inc. All @@ -96,7 +96,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.41 2018/06/20 20:43:21 jdolecek Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.42 2018/06/22 06:22:37 maxv Exp $"); #include "opt_multiprocessor.h" @@ -237,14 +237,9 @@ fpuinit(struct cpu_info *ci) * Get the value of MXCSR_MASK supported by the CPU. */ void -fpuinit_mxcsr_mask(bool has_fxsave) +fpuinit_mxcsr_mask(void) { - - if (!has_fxsave) { - x86_fpu_mxcsr_mask = __INITIAL_MXCSR_MASK__; - return; - } - +#ifndef XEN union savefpu fpusave __aligned(16); u_long psl; @@ -267,6 +262,9 @@ fpuinit_mxcsr_mask(bool has_fxsave) } else { x86_fpu_mxcsr_mask = fpusave.sv_xmm.fx_mxcsr_mask; } +#else + x86_fpu_mxcsr_mask = __INITIAL_MXCSR_MASK__; +#endif } static void Index: src/sys/arch/xen/x86/cpu.c diff -u src/sys/arch/xen/x86/cpu.c:1.119 src/sys/arch/xen/x86/cpu.c:1.120 --- src/sys/arch/xen/x86/cpu.c:1.119 Wed Jun 20 20:43:20 2018 +++ src/sys/arch/xen/x86/cpu.c Fri Jun 22 06:22:37 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.c,v 1.119 2018/06/20 20:43:20 jdolecek Exp $ */ +/* $NetBSD: cpu.c,v 1.120 2018/06/22 06:22:37 maxv Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -65,7 +65,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.119 2018/06/20 20:43:20 jdolecek Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.120 2018/06/22 06:22:37 maxv Exp $"); #include "opt_ddb.h" #include "opt_multiprocessor.h" @@ -564,8 +564,7 @@ cpu_init(struct cpu_info *ci) } if (x86_fpu_save >= FPU_SAVE_FXSAVE) { - /* XXX fxsave() faults on Xen with no-xsave flag, why? */ - fpuinit_mxcsr_mask((cr4 & CR4_OSXSAVE) != 0); + fpuinit_mxcsr_mask(); } /*