CVS commit: src/doc
Module Name:src Committed By: kamil Date: Sun Feb 12 06:16:33 UTC 2017 Modified Files: src/doc: TODO.ptrace Log Message: Update TODO.ptrace Remove: - add PT_SET_SIGMASK and PT_GET_SIGMASK - used by checkpointing software This interface has been committed to HEAD. Sponsored by To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/doc/TODO.ptrace Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/TODO.ptrace diff -u src/doc/TODO.ptrace:1.18 src/doc/TODO.ptrace:1.19 --- src/doc/TODO.ptrace:1.18 Sun Feb 12 05:21:34 2017 +++ src/doc/TODO.ptrace Sun Feb 12 06:16:33 2017 @@ -1,4 +1,4 @@ -$NetBSD: TODO.ptrace,v 1.18 2017/02/12 05:21:34 kamil Exp $ +$NetBSD: TODO.ptrace,v 1.19 2017/02/12 06:16:33 kamil Exp $ Items we (currently) plan to finish in the ptrace(2) field: @@ -21,7 +21,6 @@ Items we (currently) plan to finish in t - add ATF tests for SIGCHLD - add si_code values for PT_SYSCALL: TRAP_SCE and TRAP_SCX - add ATF tests for PT_SYSCALL and PT_SYSCALLEMU - - add PT_SET_SIGMASK and PT_GET_SIGMASK - used by checkpointing software - research support PT_SYSCALL & PT_STEP combined like in Linux - fix more calls for netbsd32 compat
CVS commit: src
Module Name:src Committed By: kamil Date: Sun Feb 12 06:09:53 UTC 2017 Modified Files: src/lib/libc/sys: ptrace.2 src/sys/kern: sys_ptrace_common.c src/sys/sys: ptrace.h src/tests/kernel: t_ptrace_wait.c Log Message: Introduce new interface in ptrace(2) - PT_GET_SIGMASK and PT_SET_SIGMASK Add new interface to add ability to get/set signal mask of a tracee. It has been inspired by Linux PTRACE_GETSIGMASK and PTRACE_SETSIGMASK, but adapted for NetBSD API. This interface is used for checkpointing software to set/restore context of a process including signal mask like criu or just to track this property in reverse-execution software like Record and Replay Framework (rr). Add new ATF tests for this interface getsigmask1: Verify that plain PT_SET_SIGMASK can be called getsigmask2: Verify that PT_SET_SIGMASK reports correct mask from tracee setsigmask1: Verify that plain PT_SET_SIGMASK can be called with empty mask setsigmask2: Verify that sigmask is preserved between PT_GET_SIGMASK and PT_SET_SIGMASK setsigmask3: Verify that sigmask is preserved between PT_GET_SIGMASK, process resumed and PT_SET_SIGMASK setsigmask4: Verify that new sigmask is visible in tracee Kernel ABI bump delayed as there are more interfaces to come in ptrace(2). Sponsored by To generate a diff of this commit: cvs rdiff -u -r1.58 -r1.59 src/lib/libc/sys/ptrace.2 cvs rdiff -u -r1.13 -r1.14 src/sys/kern/sys_ptrace_common.c cvs rdiff -u -r1.55 -r1.56 src/sys/sys/ptrace.h cvs rdiff -u -r1.69 -r1.70 src/tests/kernel/t_ptrace_wait.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/sys/ptrace.2 diff -u src/lib/libc/sys/ptrace.2:1.58 src/lib/libc/sys/ptrace.2:1.59 --- src/lib/libc/sys/ptrace.2:1.58 Fri Jan 27 12:52:39 2017 +++ src/lib/libc/sys/ptrace.2 Sun Feb 12 06:09:53 2017 @@ -1,7 +1,7 @@ -.\" $NetBSD: ptrace.2,v 1.58 2017/01/27 12:52:39 wiz Exp $ +.\" $NetBSD: ptrace.2,v 1.59 2017/02/12 06:09:53 kamil Exp $ .\" .\" This file is in the public domain. -.Dd January 25, 2016 +.Dd February 12, 2016 .Dt PTRACE 2 .Os .Sh NAME @@ -514,6 +514,31 @@ The .Fa data argument should be set to .Li sizeof(struct ptrace_siginfo) . +.It Dv PT_SET_SIGMASK +This request loads the traced process' signal mask from +.Dq Li "sigset_t" +(defined in +.In sys/sigtypes.h ) +pointed to by +.Fa addr . +The +.Fa data +argument contains the LWP ID of the thread whose registers are to +be written. +If zero is supplied, the first thread of the process is written. +.It Dv PT_GET_SIGMASK +This request is the converse of +.Dv PT_SET_SIGMASK ; +it reads the traced process' signal mask into +.Dq Li "sigset_t" +(defined in +.In sys/sigtypes.h ) +pointed to by +.Fa addr . +The +.Fa data +argument contains the LWP ID of the thread whose mask is to be read. +If zero is supplied, the first thread of the process is read. .El .Pp Additionally, the following requests exist but are Index: src/sys/kern/sys_ptrace_common.c diff -u src/sys/kern/sys_ptrace_common.c:1.13 src/sys/kern/sys_ptrace_common.c:1.14 --- src/sys/kern/sys_ptrace_common.c:1.13 Sat Feb 11 19:32:41 2017 +++ src/sys/kern/sys_ptrace_common.c Sun Feb 12 06:09:52 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: sys_ptrace_common.c,v 1.13 2017/02/11 19:32:41 kamil Exp $ */ +/* $NetBSD: sys_ptrace_common.c,v 1.14 2017/02/12 06:09:52 kamil Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -118,7 +118,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.13 2017/02/11 19:32:41 kamil Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.14 2017/02/12 06:09:52 kamil Exp $"); #ifdef _KERNEL_OPT #include "opt_ptrace.h" @@ -212,6 +212,8 @@ ptrace_listener_cb(kauth_cred_t cred, ka case PT_GET_PROCESS_STATE: case PT_SET_SIGINFO: case PT_GET_SIGINFO: + case PT_SET_SIGMASK: + case PT_GET_SIGMASK: #ifdef __HAVE_PTRACE_MACHDEP PTRACE_MACHDEP_REQUEST_CASES #endif @@ -406,6 +408,8 @@ do_ptrace(struct ptrace_methods *ptm, st case PT_IO: case PT_SET_SIGINFO: case PT_GET_SIGINFO: + case PT_SET_SIGMASK: + case PT_GET_SIGMASK: #ifdef PT_GETREGS case PT_GETREGS: #endif @@ -1039,6 +1043,35 @@ do_ptrace(struct ptrace_methods *ptm, st break; + case PT_SET_SIGMASK: + write = 1; + + case PT_GET_SIGMASK: + /* write = 0 done above. */ + + tmp = data; + if (tmp != 0 && t->p_nlwps > 1) { + lwp_delref(lt); + mutex_enter(t->p_lock); + lt = lwp_find(t, tmp); + if (lt == NULL) { +mutex_exit(t->p_lock); +error = ESRCH; +break; + } + lwp_addref(lt); + mutex_exit(t->p_lock); + } + + if (!process_validregs(lt)) + error = EINVAL; + else if (write == 1) + error = copyin(addr, >l_sigmask, sizeof(sigset_t)); + else + error = copyout(>l_sigmask, addr, sizeof(sigset_t)); + + break; + #ifdef PT_SETREGS case
CVS commit: src/doc
Module Name:src Committed By: kamil Date: Sun Feb 12 05:21:34 UTC 2017 Modified Files: src/doc: TODO.ptrace Log Message: Update TODO.ptrace with new entries Added entries: - add support to read debugger events via a file descriptor in procfs (kevent(2)), it's still useful in cases when a parent traces tracee and has to call waitpid(2) for its child - as this clashes with GUI toolkits - fix more calls for netbsd32 compat Sponsored by To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/doc/TODO.ptrace Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/TODO.ptrace diff -u src/doc/TODO.ptrace:1.17 src/doc/TODO.ptrace:1.18 --- src/doc/TODO.ptrace:1.17 Sat Feb 11 19:10:04 2017 +++ src/doc/TODO.ptrace Sun Feb 12 05:21:34 2017 @@ -1,4 +1,4 @@ -$NetBSD: TODO.ptrace,v 1.17 2017/02/11 19:10:04 kamil Exp $ +$NetBSD: TODO.ptrace,v 1.18 2017/02/12 05:21:34 kamil Exp $ Items we (currently) plan to finish in the ptrace(2) field: @@ -12,6 +12,9 @@ Items we (currently) plan to finish in t - switch PT_WATCHPOINT* to PT_*ETDBREGS and document it, add ATF tests - add tests for the procfs interface covering all functions available on the same level as ptrace(2) + - add support to read debugger events via a file descriptor in procfs + (kevent(2)), it's still useful in cases when a parent traces tracee and has + to call waitpid(2) for its child - as this clashes with GUI toolkits - add support for PT_STEP, PT_GETREGS, PT_SETREGS, PT_GETFPREGS, PT_SETFPREGS in all ports - add proper implementation of PTRACE_VFORK for vfork(2)-like events @@ -20,6 +23,7 @@ Items we (currently) plan to finish in t - add ATF tests for PT_SYSCALL and PT_SYSCALLEMU - add PT_SET_SIGMASK and PT_GET_SIGMASK - used by checkpointing software - research support PT_SYSCALL & PT_STEP combined like in Linux + - fix more calls for netbsd32 compat and of course: fix as many bugs as possible.
CVS commit: src/sys/arch/sparc64/sparc64
Module Name:src Committed By: palle Date: Sat Feb 11 23:41:36 UTC 2017 Modified Files: src/sys/arch/sparc64/sparc64: trap.c Log Message: sun4v: Fix calculation of mmu data fault address (pointer arithmetic) To generate a diff of this commit: cvs rdiff -u -r1.186 -r1.187 src/sys/arch/sparc64/sparc64/trap.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/sparc64/sparc64/trap.c diff -u src/sys/arch/sparc64/sparc64/trap.c:1.186 src/sys/arch/sparc64/sparc64/trap.c:1.187 --- src/sys/arch/sparc64/sparc64/trap.c:1.186 Sat Feb 11 21:04:29 2017 +++ src/sys/arch/sparc64/sparc64/trap.c Sat Feb 11 23:41:36 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.186 2017/02/11 21:04:29 christos Exp $ */ +/* $NetBSD: trap.c,v 1.187 2017/02/11 23:41:36 palle Exp $ */ /* * Copyright (c) 1996-2002 Eduardo Horvath. All rights reserved. @@ -50,7 +50,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.186 2017/02/11 21:04:29 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.187 2017/02/11 23:41:36 palle Exp $"); #include "opt_ddb.h" #include "opt_multiprocessor.h" @@ -738,8 +738,8 @@ badtrap: if (dsfsr & SFSR_FV) dsfar = ldxa(SFAR, ASI_DMMU); } else { - paddr_t mmu_fsa_dfa = cpus->ci_mmufsa - + offsetof(struct mmufsa, dfa); + paddr_t mmu_fsa_dfa = cpus->ci_mmufsa + + (offsetof(struct mmufsa, dfa) / sizeof(paddr_t)); dsfar = ldxa(mmu_fsa_dfa, ASI_PHYS_CACHED); } #ifdef DEBUG
CVS commit: src/distrib/evbarm/instkernel/sshramdisk
Module Name:src Committed By: christos Date: Sat Feb 11 22:57:01 UTC 2017 Modified Files: src/distrib/evbarm/instkernel/sshramdisk: Makefile Log Message: fix typo. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/distrib/evbarm/instkernel/sshramdisk/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/evbarm/instkernel/sshramdisk/Makefile diff -u src/distrib/evbarm/instkernel/sshramdisk/Makefile:1.13 src/distrib/evbarm/instkernel/sshramdisk/Makefile:1.14 --- src/distrib/evbarm/instkernel/sshramdisk/Makefile:1.13 Fri Feb 10 22:07:06 2017 +++ src/distrib/evbarm/instkernel/sshramdisk/Makefile Sat Feb 11 17:57:00 2017 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.13 2017/02/11 03:07:06 christos Exp $ +# $NetBSD: Makefile,v 1.14 2017/02/11 22:57:00 christos Exp $ .include .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib" @@ -29,7 +29,7 @@ IMAGEDEPENDS= ${CRUNCHBIN} \ ${NETBSDSRCDIR}/etc/group \ ${NETBSDSRCDIR}/etc/netconfig ${DISTRIBDIR}/common/protocols \ ${DISTRIBDIR}/common/services -IMAGEPREBUILD= ${TOOL_PAX} ${PAX_TIMESTAMP{ -rw -pp ${DESTDIR}/libdata/firmware ${WORKDIR} +IMAGEPREBUILD= ${TOOL_PAX} ${PAX_TIMESTAMP} -rw -pp ${DESTDIR}/libdata/firmware ${WORKDIR} # Use stubs to eliminate some large stuff from libc HACKSRC= ${DISTRIBDIR}/utils/libhack
CVS commit: src/sys/arch/sparc64/sparc64
Module Name:src Committed By: christos Date: Sat Feb 11 21:04:29 UTC 2017 Modified Files: src/sys/arch/sparc64/sparc64: trap.c Log Message: make this compile again. To generate a diff of this commit: cvs rdiff -u -r1.185 -r1.186 src/sys/arch/sparc64/sparc64/trap.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/sparc64/sparc64/trap.c diff -u src/sys/arch/sparc64/sparc64/trap.c:1.185 src/sys/arch/sparc64/sparc64/trap.c:1.186 --- src/sys/arch/sparc64/sparc64/trap.c:1.185 Fri Feb 10 18:26:23 2017 +++ src/sys/arch/sparc64/sparc64/trap.c Sat Feb 11 16:04:29 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.185 2017/02/10 23:26:23 palle Exp $ */ +/* $NetBSD: trap.c,v 1.186 2017/02/11 21:04:29 christos Exp $ */ /* * Copyright (c) 1996-2002 Eduardo Horvath. All rights reserved. @@ -50,7 +50,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.185 2017/02/10 23:26:23 palle Exp $"); +__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.186 2017/02/11 21:04:29 christos Exp $"); #include "opt_ddb.h" #include "opt_multiprocessor.h" @@ -738,8 +738,9 @@ badtrap: if (dsfsr & SFSR_FV) dsfar = ldxa(SFAR, ASI_DMMU); } else { - uint8_t* mmu_fsa_dfa = (uint8_t*)cpus->ci_mmufsa + offsetof(struct mmufsa, dfa); - dsfar = ldxa((paddr_t)mmu_fsa_dfa, ASI_PHYS_CACHED); + paddr_t mmu_fsa_dfa = cpus->ci_mmufsa + + offsetof(struct mmufsa, dfa); + dsfar = ldxa(mmu_fsa_dfa, ASI_PHYS_CACHED); } #ifdef DEBUG if (!CPU_ISSUN4V) {
CVS commit: src/usr.sbin/postinstall
Module Name:src Committed By: uwe Date: Sat Feb 11 19:35:45 UTC 2017 Modified Files: src/usr.sbin/postinstall: postinstall Log Message: Don't use slow file_exists_exact if we don't have to. file_exists_exact function was introduced in 1.26 for the benefit of cross-building on OS X case-insensitive file system. It is extremely slow on diskless machines. That becomes especially noticeable when you upgrade a system that has a lot of obsolete files, it can take literally hours. To generate a diff of this commit: cvs rdiff -u -r1.209 -r1.210 src/usr.sbin/postinstall/postinstall 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/postinstall/postinstall diff -u src/usr.sbin/postinstall/postinstall:1.209 src/usr.sbin/postinstall/postinstall:1.210 --- src/usr.sbin/postinstall/postinstall:1.209 Mon Jan 9 19:51:31 2017 +++ src/usr.sbin/postinstall/postinstall Sat Feb 11 19:35:45 2017 @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: postinstall,v 1.209 2017/01/09 19:51:31 christos Exp $ +# $NetBSD: postinstall,v 1.210 2017/02/11 19:35:45 uwe Exp $ # # Copyright (c) 2002-2015 The NetBSD Foundation, Inc. # All rights reserved. @@ -523,7 +523,7 @@ obsolete_paths() failed=0 while read ofile; do - if ! file_exists_exact "${ofile}"; then + if ! ${file_exists_exact} "${ofile}"; then continue fi ofile="${DEST_DIR}${ofile#.}" @@ -534,6 +534,8 @@ obsolete_paths() elif [ -d "${ofile}" ]; then ftype="directory" cmd="rmdir" + elif [ ! -e "${ofile}" ]; then + continue fi if [ "${op}" = "check" ]; then msg "Remove obsolete ${ftype} ${ofile}" @@ -2328,6 +2330,16 @@ main() DIRMODE=false # true if "-s" specified a directory SOURCEMODE=false # true if "-s" specified a source directory + case "$(uname -s)" in + Darwin) + # case sensitive match for case insensitive fs + file_exists_exact=file_exists_exact + ;; + *) + file_exists_exact=: + ;; + esac + while getopts s:x:d:m:a: ch; do case "${ch}" in s)
CVS commit: src/doc
Module Name:src Committed By: christos Date: Sat Feb 11 19:34:23 UTC 2017 Modified Files: src/doc: 3RDPARTY CHANGES Log Message: new byacc To generate a diff of this commit: cvs rdiff -u -r1.1412 -r1.1413 src/doc/3RDPARTY cvs rdiff -u -r1.2249 -r1.2250 src/doc/CHANGES Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/3RDPARTY diff -u src/doc/3RDPARTY:1.1412 src/doc/3RDPARTY:1.1413 --- src/doc/3RDPARTY:1.1412 Fri Feb 10 13:12:52 2017 +++ src/doc/3RDPARTY Sat Feb 11 14:34:23 2017 @@ -1,4 +1,4 @@ -# $NetBSD: 3RDPARTY,v 1.1412 2017/02/10 18:12:52 christos Exp $ +# $NetBSD: 3RDPARTY,v 1.1413 2017/02/11 19:34:23 christos Exp $ # # This file contains a list of the software that has been integrated into # NetBSD where we are not the primary maintainer. @@ -225,8 +225,8 @@ is a FreeBSD committer who has been help in the past. Package: byacc -Version: 20150711 -Current Vers: 20150711 +Version: 20170201 +Current Vers: 20170201 Maintainer: Thomas Dickey <dic...@invisible-island.net> Archive Site: http://www.invisible-island.net/byacc/byacc.html Home Page: http://www.invisible-island.net/byacc/byacc.html Index: src/doc/CHANGES diff -u src/doc/CHANGES:1.2249 src/doc/CHANGES:1.2250 --- src/doc/CHANGES:1.2249 Fri Feb 10 13:12:52 2017 +++ src/doc/CHANGES Sat Feb 11 14:34:23 2017 @@ -1,4 +1,4 @@ -# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.2249 $> +# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.2250 $> # # # [Note: This file does not mention every change made to the NetBSD source tree. @@ -466,3 +466,4 @@ Changes from NetBSD 7.0 to NetBSD 8.0: bind: Import version 9.10.4-P6. [christos 20170208] openldap: Import 2.4.44. [christos 20170208] file(1): Upgraded to 5.30. [christos 20170210] + byacc: update to 20170201 [christos 20170211]
CVS commit: src/sys/kern
Module Name:src Committed By: kamil Date: Sat Feb 11 19:32:41 UTC 2017 Modified Files: src/sys/kern: sys_ptrace_common.c Log Message: Be paranoid about PT_SET_SIGINFO and PT_GET_SIGINFO in ptrace(2) Currently a tracer is prohibited to read and write memory of a tracee. Prohibit reading and faking signal information. Sponsored by To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 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.12 src/sys/kern/sys_ptrace_common.c:1.13 --- src/sys/kern/sys_ptrace_common.c:1.12 Thu Jan 26 03:54:01 2017 +++ src/sys/kern/sys_ptrace_common.c Sat Feb 11 19:32:41 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: sys_ptrace_common.c,v 1.12 2017/01/26 03:54:01 christos Exp $ */ +/* $NetBSD: sys_ptrace_common.c,v 1.13 2017/02/11 19:32:41 kamil Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -118,7 +118,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.12 2017/01/26 03:54:01 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.13 2017/02/11 19:32:41 kamil Exp $"); #ifdef _KERNEL_OPT #include "opt_ptrace.h" @@ -404,6 +404,8 @@ do_ptrace(struct ptrace_methods *ptm, st case PT_WRITE_I: case PT_WRITE_D: case PT_IO: + case PT_SET_SIGINFO: + case PT_GET_SIGINFO: #ifdef PT_GETREGS case PT_GETREGS: #endif @@ -451,8 +453,6 @@ do_ptrace(struct ptrace_methods *ptm, st case PT_SET_EVENT_MASK: case PT_GET_EVENT_MASK: case PT_GET_PROCESS_STATE: - case PT_SET_SIGINFO: - case PT_GET_SIGINFO: /* * You can't do what you want to the process if: * (1) It's not being traced at all,
CVS import: src/external/bsd/byacc/dist
Module Name:src Committed By: christos Date: Sat Feb 11 19:30:05 UTC 2017 Update of /cvsroot/src/external/bsd/byacc/dist In directory ivanova.netbsd.org:/tmp/cvs-serv26740 Log Message: 2017-02-01 Thomas E. Dickey* test/btyacc/expr.oxout.error, test/btyacc/expr.oxout.output, test/btyacc/expr.oxout.tab.c, test/btyacc/expr.oxout.tab.h, test/yacc/expr.oxout.error, test/yacc/expr.oxout.output, test/yacc/expr.oxout.tab.c, test/yacc/expr.oxout.tab.h: RCS_BASE * package/debian/copyright: update copyright * reader.c, defs.h, main.c: avoid using regex.h since some low-end platforms do not have this * test/expr.oxout.y: RCS_BASE * configure: regen * aclocal.m4: quiet a strict gcc warning in CF_MKSTEMP 2017-02-01 Tom.Shields * main.c, reader.c, defs.h: process #line directives, like bison and flex 2017-02-01 Thomas E. Dickey * VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile: bump 2016-12-31 Thomas E. Dickey * config.guess, config.sub: 2017-01-01 2016-12-02 Thomas E. Dickey * test/btyacc/quote_calc4-s.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/error.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/ok_syntax1.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/rename_debug.c, test/btyacc/btyacc_calc1.tab.c, test /btyacc/btyacc_demo.tab.c, test/btyacc/btyacc_destroy1.tab.c, test/btyacc/btyacc_destroy2.tab.c, test/btyacc/btyacc_destroy3.tab.c, btyaccpar.c: regen * btyaccpar.skel: changes from NetBSD + use YYINT rather than short in btyaccpar.skel (some of this had already been done by Tom Shields) + remove some casts of malloc/realloc * yaccpar.c, yaccpar.skel, output.c: changes from NetBSD - Add some more bison stuff to make the mesa/gallium parser work: %initial-action (add missing source struct member in location) %debug (unimplemented) %error-verbose (unimplemented) This changes some existing code: + yylloc is now a pointer, so + the first parameter to YYERROR_DECL() is a pointer + struct YYLTYPE now has a "source" field * test/btyacc/btyacc_demo.tab.h, test/btyacc/code_calc.tab.c, test/btyacc/code_error.tab.c, test/btyacc/err_inherit4.tab.h: regen * btyaccpar.c, btyaccpar.skel, reader.c: changes from NetBSD - Add some more bison stuff to make the mesa/gallium parser work: %initial-action (add missing source struct member in location) %debug (unimplemented) %error-verbose (unimplemented) This changes some existing code: + yylloc is now a pointer, so + the first parameter to YYERROR_DECL() is a pointer + struct YYLTYPE now has a "source" field * reader.c: fix from NetBSD: correct off-by-one when adding a null in copy_param() * reader.c: adapted from NetBSD - Convert *most* error fingerprints to: -unterminated_arglist(int a_lineno, char *a_line, char *a_cptr) +unterminated_arglist(const struct ainfo *a) - Cast new args to unsigned char * defs.h: changes from NetBSD - Add some more bison stuff to make the mesa/gallium parser work: %initial-action (add missing source struct member in location) %debug (unimplemented) %error-verbose (unimplemented) This changes some existing code: + yylloc is now a pointer, so + the first parameter to YYERROR_DECL() is a pointer + struct YYLTYPE now has a "source" field * defs.h: adapted from NetBSD - Convert *most* error fingerprints to: -unterminated_arglist(int a_lineno, char *a_line, char *a_cptr) +unterminated_arglist(const struct ainfo *a) - Cast new args to unsigned char * main.c: changes from NetBSD - Add some more bison stuff to make the mesa/gallium parser
CVS commit: src/doc
Module Name:src Committed By: kamil Date: Sat Feb 11 19:10:05 UTC 2017 Modified Files: src/doc: TODO.ptrace Log Message: Update TODO.ptrace Remove entries: - remove exect(3) from libc - there is no usecase for it Interface has been marked obsolete and it's on the queue to be removed for. - research what happens when a tracee masks signals (including SIGTRAP) and a breakpoint is triggered It has been researched and ATF tests added (signal1 .. signal10). It's currently broken on NetBSD. Add: - research support PT_SYSCALL & PT_STEP combined like in Linux There are circumstances when we want to sstep and catch syscall events. Sponsored by To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/doc/TODO.ptrace Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/TODO.ptrace diff -u src/doc/TODO.ptrace:1.16 src/doc/TODO.ptrace:1.17 --- src/doc/TODO.ptrace:1.16 Wed Feb 8 14:53:50 2017 +++ src/doc/TODO.ptrace Sat Feb 11 19:10:04 2017 @@ -1,4 +1,4 @@ -$NetBSD: TODO.ptrace,v 1.16 2017/02/08 14:53:50 kamil Exp $ +$NetBSD: TODO.ptrace,v 1.17 2017/02/11 19:10:04 kamil Exp $ Items we (currently) plan to finish in the ptrace(2) field: @@ -15,13 +15,11 @@ Items we (currently) plan to finish in t - add support for PT_STEP, PT_GETREGS, PT_SETREGS, PT_GETFPREGS, PT_SETFPREGS in all ports - add proper implementation of PTRACE_VFORK for vfork(2)-like events - - remove exect(3) from libc - there is no usecase for it - - research what happens when a tracee masks signals (including SIGTRAP) and a - breakpoint is triggered - add ATF tests for SIGCHLD - add si_code values for PT_SYSCALL: TRAP_SCE and TRAP_SCX - add ATF tests for PT_SYSCALL and PT_SYSCALLEMU - add PT_SET_SIGMASK and PT_GET_SIGMASK - used by checkpointing software + - research support PT_SYSCALL & PT_STEP combined like in Linux and of course: fix as many bugs as possible.
CVS commit: src/distrib/sets/lists/tests
Module Name:src Committed By: nakayama Date: Sat Feb 11 18:47:36 UTC 2017 Modified Files: src/distrib/sets/lists/tests: mi Log Message: Redo rev.1.718, remove trash in line end. To generate a diff of this commit: cvs rdiff -u -r1.719 -r1.720 src/distrib/sets/lists/tests/mi Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/tests/mi diff -u src/distrib/sets/lists/tests/mi:1.719 src/distrib/sets/lists/tests/mi:1.720 --- src/distrib/sets/lists/tests/mi:1.719 Thu Feb 9 13:59:02 2017 +++ src/distrib/sets/lists/tests/mi Sat Feb 11 18:47:36 2017 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.719 2017/02/09 13:59:02 christos Exp $ +# $NetBSD: mi,v 1.720 2017/02/11 18:47:36 nakayama Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -2431,9 +2431,9 @@ ./usr/tests/lib/libc/gen/Atffile tests-lib-tests compattestfile,atf ./usr/tests/lib/libc/gen/Kyuafile tests-lib-tests compattestfile,atf,kyua ./usr/tests/lib/libc/gen/exect tests-obsolete obsolete -./usr/tests/lib/libc/gen/exect/Atffile tests-obsolete obsoleteernel-tests compattestfile,atf -./usr/tests/lib/libc/gen/exect/Kyuafile tests-obsolete obsoleteernel-tests compattestfile,atf,kyua -./usr/tests/lib/libc/gen/exect/t_exect tests-obsolete obsoleteernel-tests compattestfile,atf +./usr/tests/lib/libc/gen/exect/Atffile tests-obsolete obsolete +./usr/tests/lib/libc/gen/exect/Kyuafile tests-obsolete obsolete +./usr/tests/lib/libc/gen/exect/t_exect tests-obsolete obsolete ./usr/tests/lib/libc/gen/execve tests-kernel-tests compattestfile,atf ./usr/tests/lib/libc/gen/execve/Atffile tests-kernel-tests compattestfile,atf ./usr/tests/lib/libc/gen/execve/Kyuafile tests-kernel-tests compattestfile,atf,kyua
CVS commit: src/external/bsd/file/dist/src
Module Name:src Committed By: christos Date: Sat Feb 11 18:17:29 UTC 2017 Modified Files: src/external/bsd/file/dist/src: readelf.c Log Message: fix reversed logic To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/external/bsd/file/dist/src/readelf.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/bsd/file/dist/src/readelf.c diff -u src/external/bsd/file/dist/src/readelf.c:1.13 src/external/bsd/file/dist/src/readelf.c:1.14 --- src/external/bsd/file/dist/src/readelf.c:1.13 Fri Feb 10 13:06:59 2017 +++ src/external/bsd/file/dist/src/readelf.c Sat Feb 11 13:17:29 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: readelf.c,v 1.13 2017/02/10 18:06:59 christos Exp $ */ +/* $NetBSD: readelf.c,v 1.14 2017/02/11 18:17:29 christos Exp $ */ /* * Copyright (c) Christos Zoulas 2003. @@ -32,7 +32,7 @@ #if 0 FILE_RCSID("@(#)$File: readelf.c,v 1.130 2017/01/29 19:34:24 christos Exp $") #else -__RCSID("$NetBSD: readelf.c,v 1.13 2017/02/10 18:06:59 christos Exp $"); +__RCSID("$NetBSD: readelf.c,v 1.14 2017/02/11 18:17:29 christos Exp $"); #endif #endif @@ -1191,7 +1191,7 @@ doshn(struct magic_set *ms, int clazz, i { Elf32_Shdr sh32; Elf64_Shdr sh64; - int stripped = 1, has_debug_info = 1; + int stripped = 1, has_debug_info = 0; size_t nbadcap = 0; void *nbuf; off_t noff, coff, name_off;
CVS commit: src/usr.sbin/makefs
Module Name:src Committed By: christos Date: Sat Feb 11 16:04:59 UTC 2017 Modified Files: src/usr.sbin/makefs: makefs.8 Log Message: untorture language. To generate a diff of this commit: cvs rdiff -u -r1.59 -r1.60 src/usr.sbin/makefs/makefs.8 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/makefs/makefs.8 diff -u src/usr.sbin/makefs/makefs.8:1.59 src/usr.sbin/makefs/makefs.8:1.60 --- src/usr.sbin/makefs/makefs.8:1.59 Sat Feb 11 10:32:51 2017 +++ src/usr.sbin/makefs/makefs.8 Sat Feb 11 11:04:59 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: makefs.8,v 1.59 2017/02/11 15:32:51 christos Exp $ +.\" $NetBSD: makefs.8,v 1.60 2017/02/11 16:04:59 christos Exp $ .\" .\" Copyright (c) 2001-2003 Wasabi Systems, Inc. .\" All rights reserved. @@ -215,12 +215,12 @@ value interpreted as the number of secon Note that timestamps specified in an .Xr mtree 5 spec file, override the default timestamp. -Some filesystems (cd9660, udf) that are using +When this option is enabled, filesystems that regularly use .Xr localtime 3 -to convert times to the native format, use +to convert times to the native format (such as udf and cd9660), use .Xr gmtime 3 -with the specified timestamps so that they are immune to timezone changes -and get consistent timestamps. +instead with the specified timestamps so that they are immune to +timezone changes and get consistent timestamps. .It Fl t Ar fs-type Create an .Ar fs-type
CVS commit: src/sys/arch/amd64/conf
Module Name:src Committed By: maxv Date: Sat Feb 11 16:02:11 UTC 2017 Modified Files: src/sys/arch/amd64/conf: Makefile.amd64 kern.ldscript Log Message: Put 2MB alignments between the kernel segments. This way the kernel image is entirely mapped with large pages, which uniformizes performance and reduces fluctuation. Sent on port-amd64. To generate a diff of this commit: cvs rdiff -u -r1.56 -r1.57 src/sys/arch/amd64/conf/Makefile.amd64 cvs rdiff -u -r1.21 -r1.22 src/sys/arch/amd64/conf/kern.ldscript 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/amd64/conf/Makefile.amd64 diff -u src/sys/arch/amd64/conf/Makefile.amd64:1.56 src/sys/arch/amd64/conf/Makefile.amd64:1.57 --- src/sys/arch/amd64/conf/Makefile.amd64:1.56 Thu Feb 2 19:09:08 2017 +++ src/sys/arch/amd64/conf/Makefile.amd64 Sat Feb 11 16:02:11 2017 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.amd64,v 1.56 2017/02/02 19:09:08 maxv Exp $ +# $NetBSD: Makefile.amd64,v 1.57 2017/02/11 16:02:11 maxv Exp $ # Makefile for NetBSD # @@ -61,7 +61,7 @@ KERN_AS= library ## (5) link settings ## TEXTADDR?= 0x8020 -EXTRA_LINKFLAGS= -z max-page-size=0x10 +EXTRA_LINKFLAGS= -z max-page-size=0x20 LINKFLAGS_NORMAL= -X KERNLDSCRIPT?= ${AMD64}/conf/kern.ldscript Index: src/sys/arch/amd64/conf/kern.ldscript diff -u src/sys/arch/amd64/conf/kern.ldscript:1.21 src/sys/arch/amd64/conf/kern.ldscript:1.22 --- src/sys/arch/amd64/conf/kern.ldscript:1.21 Thu May 12 09:05:16 2016 +++ src/sys/arch/amd64/conf/kern.ldscript Sat Feb 11 16:02:11 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: kern.ldscript,v 1.21 2016/05/12 09:05:16 maxv Exp $ */ +/* $NetBSD: kern.ldscript,v 1.22 2017/02/11 16:02:11 maxv Exp $ */ #include "assym.h" @@ -35,7 +35,7 @@ SECTIONS *(.rodata.*) } - . = ALIGN(__PAGE_SIZE); + . = ALIGN(__LARGE_PAGE_SIZE); __data_start = . ; .data : @@ -66,7 +66,7 @@ SECTIONS . = ALIGN(64 / 8); } - . = ALIGN(__PAGE_SIZE); + . = ALIGN(__LARGE_PAGE_SIZE); /* End of the kernel image */ __kernel_end = . ;
CVS commit: src/sys/netinet
Module Name:src Committed By: roy Date: Sat Feb 11 15:37:30 UTC 2017 Modified Files: src/sys/netinet: if_arp.c Log Message: Allow Unicast Poll from RFC 1122 to bypass DaD checking. To generate a diff of this commit: cvs rdiff -u -r1.241 -r1.242 src/sys/netinet/if_arp.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/netinet/if_arp.c diff -u src/sys/netinet/if_arp.c:1.241 src/sys/netinet/if_arp.c:1.242 --- src/sys/netinet/if_arp.c:1.241 Tue Feb 7 02:38:08 2017 +++ src/sys/netinet/if_arp.c Sat Feb 11 15:37:30 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: if_arp.c,v 1.241 2017/02/07 02:38:08 ozaki-r Exp $ */ +/* $NetBSD: if_arp.c,v 1.242 2017/02/11 15:37:30 roy Exp $ */ /*- * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc. @@ -68,7 +68,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.241 2017/02/07 02:38:08 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.242 2017/02/11 15:37:30 roy Exp $"); #ifdef _KERNEL_OPT #include "opt_ddb.h" @@ -1161,7 +1161,8 @@ in_arpinput(struct mbuf *m) /* DAD check, RFC 5227 */ if (in_hosteq(isaddr, myaddr) || - (in_nullhost(isaddr) && in_hosteq(itaddr, myaddr))) + (in_nullhost(isaddr) && in_hosteq(itaddr, myaddr) + && ISSET(m->m_flags, M_BCAST))) /* Allow Unicast Poll, RFC 1122 */ { arp_dad_duplicated((struct ifaddr *)ia, lla_snprintf(llabuf, ar_sha(ah), ah->ar_hln));
CVS commit: src/usr.sbin/makefs
Module Name:src Committed By: christos Date: Sat Feb 11 15:32:51 UTC 2017 Modified Files: src/usr.sbin/makefs: makefs.8 Log Message: mention timezone change for -T timestamp To generate a diff of this commit: cvs rdiff -u -r1.58 -r1.59 src/usr.sbin/makefs/makefs.8 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/makefs/makefs.8 diff -u src/usr.sbin/makefs/makefs.8:1.58 src/usr.sbin/makefs/makefs.8:1.59 --- src/usr.sbin/makefs/makefs.8:1.58 Tue Jan 24 06:22:43 2017 +++ src/usr.sbin/makefs/makefs.8 Sat Feb 11 10:32:51 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: makefs.8,v 1.58 2017/01/24 11:22:43 nonaka Exp $ +.\" $NetBSD: makefs.8,v 1.59 2017/02/11 15:32:51 christos Exp $ .\" .\" Copyright (c) 2001-2003 Wasabi Systems, Inc. .\" All rights reserved. @@ -33,7 +33,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd January 11, 2017 +.Dd February 11, 2017 .Dt MAKEFS 8 .Os .Sh NAME @@ -215,6 +215,12 @@ value interpreted as the number of secon Note that timestamps specified in an .Xr mtree 5 spec file, override the default timestamp. +Some filesystems (cd9660, udf) that are using +.Xr localtime 3 +to convert times to the native format, use +.Xr gmtime 3 +with the specified timestamps so that they are immune to timezone changes +and get consistent timestamps. .It Fl t Ar fs-type Create an .Ar fs-type
CVS commit: src
Module Name:src Committed By: roy Date: Sat Feb 11 15:27:08 UTC 2017 Modified Files: src: UPDATING Log Message: Note a new tic tool is required for the new terminfo database. To generate a diff of this commit: cvs rdiff -u -r1.280 -r1.281 src/UPDATING Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/UPDATING diff -u src/UPDATING:1.280 src/UPDATING:1.281 --- src/UPDATING:1.280 Wed Feb 8 14:47:55 2017 +++ src/UPDATING Sat Feb 11 15:27:08 2017 @@ -1,4 +1,4 @@ -$NetBSD: UPDATING,v 1.280 2017/02/08 14:47:55 kre Exp $ +$NetBSD: UPDATING,v 1.281 2017/02/11 15:27:08 roy Exp $ This file (UPDATING) is intended to be a brief reference to recent changes that might cause problems in the build process, and a guide for @@ -19,6 +19,12 @@ See also: BUILDING, build.sh, Makefile. Recent changes: ^^^ +20170211: + a new terminfo database has been imported. + The structure of it has changed slightly from prior versions and + an updated tic tool is required. + If you build.sh, don't use -u + 20170207: various arch dependent libc/exect.S files were removed Either remove the obj directories (lib/libc and compat/amd64/i386/lib
CVS commit: src/lib/libterminfo
Module Name:src Committed By: roy Date: Sat Feb 11 15:13:17 UTC 2017 Modified Files: src/lib/libterminfo: compile.c Log Message: Warn about unprintable characters in capability strings. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/lib/libterminfo/compile.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libterminfo/compile.c diff -u src/lib/libterminfo/compile.c:1.10 src/lib/libterminfo/compile.c:1.11 --- src/lib/libterminfo/compile.c:1.10 Sat Feb 11 14:57:15 2017 +++ src/lib/libterminfo/compile.c Sat Feb 11 15:13:17 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: compile.c,v 1.10 2017/02/11 14:57:15 roy Exp $ */ +/* $NetBSD: compile.c,v 1.11 2017/02/11 15:13:17 roy Exp $ */ /* * Copyright (c) 2009, 2010, 2011 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #endif #include -__RCSID("$NetBSD: compile.c,v 1.10 2017/02/11 14:57:15 roy Exp $"); +__RCSID("$NetBSD: compile.c,v 1.11 2017/02/11 15:13:17 roy Exp $"); #if !HAVE_NBTOOL_CONFIG_H || HAVE_SYS_ENDIAN_H #include @@ -347,7 +347,10 @@ encode_string(const char *term, const ch ch = '\177'; else if ((ch &= 037) == 0) ch = (char)128; - } + } else if (!isprint((unsigned char)ch)) +dowarn(flags, +"%s: %s: unprintable character", +term, cap); *p++ = ch; last = ch; continue;
CVS commit: src/sys/arch/x86/include
Module Name:src Committed By: maxv Date: Sat Feb 11 15:11:45 UTC 2017 Modified Files: src/sys/arch/x86/include: specialreg.h Log Message: Fix a few (unused) MSR values, and add some others that I believe are relevant. >From Murray Armfield (PR/42861). To generate a diff of this commit: cvs rdiff -u -r1.92 -r1.93 src/sys/arch/x86/include/specialreg.h 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/specialreg.h diff -u src/sys/arch/x86/include/specialreg.h:1.92 src/sys/arch/x86/include/specialreg.h:1.93 --- src/sys/arch/x86/include/specialreg.h:1.92 Thu Feb 2 05:43:48 2017 +++ src/sys/arch/x86/include/specialreg.h Sat Feb 11 15:11:45 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: specialreg.h,v 1.92 2017/02/02 05:43:48 msaitoh Exp $ */ +/* $NetBSD: specialreg.h,v 1.93 2017/02/11 15:11:45 maxv Exp $ */ /*- * Copyright (c) 1991 The Regents of the University of California. @@ -651,14 +651,14 @@ #define MSR_MC2_STATUS 0x409 #define MSR_MC2_ADDR 0x40a #define MSR_MC2_MISC 0x40b -#define MSR_MC4_CTL 0x40c -#define MSR_MC4_STATUS 0x40d -#define MSR_MC4_ADDR 0x40e -#define MSR_MC4_MISC 0x40f -#define MSR_MC3_CTL 0x410 -#define MSR_MC3_STATUS 0x411 -#define MSR_MC3_ADDR 0x412 -#define MSR_MC3_MISC 0x413 +#define MSR_MC3_CTL 0x40c +#define MSR_MC3_STATUS 0x40d +#define MSR_MC3_ADDR 0x40e +#define MSR_MC3_MISC 0x40f +#define MSR_MC4_CTL 0x410 +#define MSR_MC4_STATUS 0x411 +#define MSR_MC4_ADDR 0x412 +#define MSR_MC4_MISC 0x413 /* 0x480 - 0x490 VMX */ /* @@ -694,13 +694,16 @@ /* * AMD K8 (Opteron) MSRs. */ -#define MSR_SYSCFG 0xc010 +#define MSR_SYSCFG 0xc0010010 #define MSR_EFER 0xc080 /* Extended feature enable */ -#define EFER_SCE 0x0001 /* SYSCALL extension */ -#define EFER_LME 0x0100 /* Long Mode Active */ -#define EFER_LMA 0x0400 /* Long Mode Enabled */ -#define EFER_NXE 0x0800 /* No-Execute Enabled */ +#define EFER_SCE 0x0001 /* SYSCALL extension */ +#define EFER_LME 0x0100 /* Long Mode Active */ +#define EFER_LMA 0x0400 /* Long Mode Enabled */ +#define EFER_NXE 0x0800 /* No-Execute Enabled */ +#define EFER_SVME 0x1000 /* Secure Virtual Machine En. */ +#define EFER_LMSLE 0x2000 /* Long Mode Segment Limit E. */ +#define EFER_FFXSR 0x4000 /* Fast FXSAVE/FXRSTOR En. */ #define MSR_STAR 0xc081 /* 32 bit syscall gate addr */ #define MSR_LSTAR 0xc082 /* 64 bit syscall gate addr */
CVS commit: src/sys/arch
Module Name:src Committed By: maxv Date: Sat Feb 11 15:05:15 UTC 2017 Modified Files: src/sys/arch/amd64/include: vmparam.h src/sys/arch/i386/include: vmparam.h Log Message: Remove VM_MAX_KERNEL_BUF (unused). Looks like several other ports could do the same. To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.39 src/sys/arch/amd64/include/vmparam.h cvs rdiff -u -r1.83 -r1.84 src/sys/arch/i386/include/vmparam.h 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/amd64/include/vmparam.h diff -u src/sys/arch/amd64/include/vmparam.h:1.38 src/sys/arch/amd64/include/vmparam.h:1.39 --- src/sys/arch/amd64/include/vmparam.h:1.38 Sat Nov 19 09:22:03 2016 +++ src/sys/arch/amd64/include/vmparam.h Sat Feb 11 15:05:15 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: vmparam.h,v 1.38 2016/11/19 09:22:03 maxv Exp $ */ +/* $NetBSD: vmparam.h,v 1.39 2017/02/11 15:05:15 maxv Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -143,13 +143,6 @@ #define VM_DEFAULT_ADDRESS32_BOTTOMUP(da, sz) \ round_page((vaddr_t)(da) + (vsize_t)MAXDSIZ32) -/* - * XXXfvdl we have plenty of KVM now, remove this. - */ -#ifndef VM_MAX_KERNEL_BUF -#define VM_MAX_KERNEL_BUF (384 * 1024 * 1024) -#endif - /* virtual sizes (bytes) for various kernel submaps */ #define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE) Index: src/sys/arch/i386/include/vmparam.h diff -u src/sys/arch/i386/include/vmparam.h:1.83 src/sys/arch/i386/include/vmparam.h:1.84 --- src/sys/arch/i386/include/vmparam.h:1.83 Sat Nov 19 09:22:03 2016 +++ src/sys/arch/i386/include/vmparam.h Sat Feb 11 15:05:15 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: vmparam.h,v 1.83 2016/11/19 09:22:03 maxv Exp $ */ +/* $NetBSD: vmparam.h,v 1.84 2017/02/11 15:05:15 maxv Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -119,11 +119,6 @@ #define VM_DEFAULT_ADDRESS_BOTTOMUP(da, sz) \ round_page((vaddr_t)(da) + (vsize_t)MIN(maxdmap, MAXDSIZ_BU)) -/* XXX max. amount of KVM to be used by buffers. */ -#ifndef VM_MAX_KERNEL_BUF -#define VM_MAX_KERNEL_BUF (384 * 1024 * 1024) -#endif - /* virtual sizes (bytes) for various kernel submaps */ #define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE)
CVS commit: src/lib/libterminfo
Module Name:src Committed By: roy Date: Sat Feb 11 14:57:15 UTC 2017 Modified Files: src/lib/libterminfo: compile.c Log Message: Following a newline, strip leading whitespace from capability strings. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/lib/libterminfo/compile.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libterminfo/compile.c diff -u src/lib/libterminfo/compile.c:1.9 src/lib/libterminfo/compile.c:1.10 --- src/lib/libterminfo/compile.c:1.9 Fri Jun 7 13:16:18 2013 +++ src/lib/libterminfo/compile.c Sat Feb 11 14:57:15 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: compile.c,v 1.9 2013/06/07 13:16:18 roy Exp $ */ +/* $NetBSD: compile.c,v 1.10 2017/02/11 14:57:15 roy Exp $ */ /* * Copyright (c) 2009, 2010, 2011 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #endif #include -__RCSID("$NetBSD: compile.c,v 1.9 2013/06/07 13:16:18 roy Exp $"); +__RCSID("$NetBSD: compile.c,v 1.10 2017/02/11 14:57:15 roy Exp $"); #if !HAVE_NBTOOL_CONFIG_H || HAVE_SYS_ENDIAN_H #include @@ -323,6 +323,13 @@ encode_string(const char *term, const ch last = '\0'; /* Convert escape codes */ while ((ch = *str++) != '\0') { + if (ch == '\n') { + /* Following a newline, strip leading whitespace from + * capability strings. */ + while (isspace((unsigned char)*str)) +str++; + continue; + } if (slash == 0 && ch == '\\') { slash = 1; continue;
CVS commit: src/sys/arch
Module Name:src Committed By: maxv Date: Sat Feb 11 14:11:25 UTC 2017 Modified Files: src/sys/arch/x86/include: cpu.h pmap.h src/sys/arch/x86/x86: cpu.c pmap.c src/sys/arch/xen/x86: cpu.c Log Message: Instead of using a global array with per-cpu indexes, embed the tmp VAs into cpu_info directly. This concerns only {i386, Xen-i386, Xen-amd64}, because amd64 already has a direct map that is way faster than that. There are two major issues with the global array: maxcpus entries are allocated while it is unlikely that common i386 machines have so many cpus, and the base VA of these entries is not cache-line-aligned, which mostly guarantees cache-line-thrashing each time the VAs are entered. Now the number of tmp VAs allocated is proportionate to the number of CPUs attached (which therefore reduces memory consumption), and the base is properly aligned. On my 3-core AMD, the number of DC_refills_L2 events triggered when performing 5x10^6 calls to pmap_zero_page on two dedicated cores is on average divided by two with this patch. Discussed on tech-kern a little. To generate a diff of this commit: cvs rdiff -u -r1.67 -r1.68 src/sys/arch/x86/include/cpu.h cvs rdiff -u -r1.61 -r1.62 src/sys/arch/x86/include/pmap.h cvs rdiff -u -r1.122 -r1.123 src/sys/arch/x86/x86/cpu.c cvs rdiff -u -r1.239 -r1.240 src/sys/arch/x86/x86/pmap.c cvs rdiff -u -r1.108 -r1.109 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/cpu.h diff -u src/sys/arch/x86/include/cpu.h:1.67 src/sys/arch/x86/include/cpu.h:1.68 --- src/sys/arch/x86/include/cpu.h:1.67 Sun Dec 13 15:02:19 2015 +++ src/sys/arch/x86/include/cpu.h Sat Feb 11 14:11:24 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.h,v 1.67 2015/12/13 15:02:19 maxv Exp $ */ +/* $NetBSD: cpu.h,v 1.68 2017/02/11 14:11:24 maxv Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -133,6 +133,16 @@ struct cpu_info { volatile int ci_mtx_count; /* Negative count of spin mutexes */ volatile int ci_mtx_oldspl; /* Old SPL at this ci_idepth */ +#ifndef __HAVE_DIRECT_MAP +#define VPAGE_SRC 0 +#define VPAGE_DST 1 +#define VPAGE_ZER 2 +#define VPAGE_PTP 3 +#define VPAGE_MAX 4 + vaddr_t vpage[VPAGE_MAX]; + pt_entry_t *vpage_pte[VPAGE_MAX]; +#endif + /* The following must be aligned for cmpxchg8b. */ struct { uint32_t ipending; Index: src/sys/arch/x86/include/pmap.h diff -u src/sys/arch/x86/include/pmap.h:1.61 src/sys/arch/x86/include/pmap.h:1.62 --- src/sys/arch/x86/include/pmap.h:1.61 Tue Nov 8 03:05:36 2016 +++ src/sys/arch/x86/include/pmap.h Sat Feb 11 14:11:24 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.h,v 1.61 2016/11/08 03:05:36 christos Exp $ */ +/* $NetBSD: pmap.h,v 1.62 2017/02/11 14:11:24 maxv Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -278,6 +278,10 @@ u_int x86_mmap_flags(paddr_t); bool pmap_is_curpmap(struct pmap *); +#ifndef __HAVE_DIRECT_MAP +void pmap_vpage_cpu_init(struct cpu_info *); +#endif + vaddr_t reserve_dumppages(vaddr_t); /* XXX: not a pmap fn */ typedef enum tlbwhy { Index: src/sys/arch/x86/x86/cpu.c diff -u src/sys/arch/x86/x86/cpu.c:1.122 src/sys/arch/x86/x86/cpu.c:1.123 --- src/sys/arch/x86/x86/cpu.c:1.122 Thu Feb 2 08:57:04 2017 +++ src/sys/arch/x86/x86/cpu.c Sat Feb 11 14:11:24 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.c,v 1.122 2017/02/02 08:57:04 maxv Exp $ */ +/* $NetBSD: cpu.c,v 1.123 2017/02/11 14:11:24 maxv Exp $ */ /*- * Copyright (c) 2000-2012 NetBSD Foundation, Inc. @@ -62,7 +62,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.122 2017/02/02 08:57:04 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.123 2017/02/11 14:11:24 maxv Exp $"); #include "opt_ddb.h" #include "opt_mpbios.h" /* for MPDEBUG */ @@ -286,6 +286,9 @@ cpu_vm_init(struct cpu_info *ci) uvm_page_recolor(ncolors); pmap_tlb_cpu_init(ci); +#ifndef __HAVE_DIRECT_MAP + pmap_vpage_cpu_init(ci); +#endif } static void Index: src/sys/arch/x86/x86/pmap.c diff -u src/sys/arch/x86/x86/pmap.c:1.239 src/sys/arch/x86/x86/pmap.c:1.240 --- src/sys/arch/x86/x86/pmap.c:1.239 Thu Feb 2 17:37:49 2017 +++ src/sys/arch/x86/x86/pmap.c Sat Feb 11 14:11:24 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.239 2017/02/02 17:37:49 maxv Exp $ */ +/* $NetBSD: pmap.c,v 1.240 2017/02/11 14:11:24 maxv Exp $ */ /*- * Copyright (c) 2008, 2010, 2016, 2017 The NetBSD Foundation, Inc. @@ -171,7 +171,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.239 2017/02/02 17:37:49 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.240 2017/02/11 14:11:24 maxv Exp $"); #include "opt_user_ldt.h" #include "opt_lockdebug.h" @@ -496,29 +496,15 @@ static struct pool_cache pmap_pv_cache; #ifndef __HAVE_DIRECT_MAP /* - * MULTIPROCESSOR: special VAs and PTEs are actually allocated inside a - * (maxcpus * NPTECL) array of PTE, to
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: maxv Date: Sat Feb 11 13:22:58 UTC 2017 Modified Files: src/sys/arch/x86/x86: tprof_amdpmi.c Log Message: As the XXX implicitly suggests, this line is wrong. Many other families support PMCs (like my 10h amd). While here, put a warning in a comment. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/arch/x86/x86/tprof_amdpmi.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/tprof_amdpmi.c diff -u src/sys/arch/x86/x86/tprof_amdpmi.c:1.5 src/sys/arch/x86/x86/tprof_amdpmi.c:1.6 --- src/sys/arch/x86/x86/tprof_amdpmi.c:1.5 Tue Jan 31 17:38:54 2017 +++ src/sys/arch/x86/x86/tprof_amdpmi.c Sat Feb 11 13:22:58 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: tprof_amdpmi.c,v 1.5 2017/01/31 17:38:54 maxv Exp $ */ +/* $NetBSD: tprof_amdpmi.c,v 1.6 2017/02/11 13:22:58 maxv Exp $ */ /*- * Copyright (c)2008,2009 YAMAMOTO Takashi, @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tprof_amdpmi.c,v 1.5 2017/01/31 17:38:54 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tprof_amdpmi.c,v 1.6 2017/02/11 13:22:58 maxv Exp $"); #include #include @@ -86,7 +86,10 @@ __KERNEL_RCSID(0, "$NetBSD: tprof_amdpmi #define DC_refills_sys__EVENT 0x43 #define DC_refills_sys__UNIT 0x1E -/* Hardcode your counter here */ +/* + * Hardcode your counter here. There is no detection, so make sure it is + * supported by your CPU family. + */ static uint32_t event = CPU_clocks__EVENT; static uint32_t unit = CPU_clocks__UNIT; static int ctrno = 0; @@ -180,11 +183,9 @@ tprof_amdpmi_estimate_freq(void) static int tprof_amdpmi_start(tprof_backend_cookie_t *cookie) { - struct cpu_info * const ci = curcpu(); uint64_t xc; - if (!(cpu_vendor == CPUVENDOR_AMD) || - CPUID_TO_FAMILY(ci->ci_signature) != 0xf) { /* XXX */ + if (cpu_vendor != CPUVENDOR_AMD) { return ENOTSUP; }
CVS commit: src/sys/arch/i386/stand/efiboot
Module Name:src Committed By: nonaka Date: Sat Feb 11 10:33:44 UTC 2017 Added Files: src/sys/arch/i386/stand/efiboot: TODO.efiboot Log Message: Added efiboot TODO. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/sys/arch/i386/stand/efiboot/TODO.efiboot Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/sys/arch/i386/stand/efiboot/TODO.efiboot diff -u /dev/null src/sys/arch/i386/stand/efiboot/TODO.efiboot:1.1 --- /dev/null Sat Feb 11 10:33:44 2017 +++ src/sys/arch/i386/stand/efiboot/TODO.efiboot Sat Feb 11 10:33:44 2017 @@ -0,0 +1,18 @@ +- efiboot + * handle UEFI variables + * boot from CD/DVD (bootable from CD/DVD, but root fs not found.) + * load boot.cfg from EFI system partition (FAT32) + * fix module_init(). need to allocate memory for modules. + * bootia32.efi can load kernel, but can't start kernel + +- kernel + * handle UEFI variables (/dev/efivar) + * accelerated console + +- userland + * efibootmgr like utility + * merge distrib/amd64/uefi-installimage to distrib/amd64/install-image + * merge distrib/amd64/uefi-installimage/Makefile.* to distrib/common/Makefile.* + +- installer + * sysinst(8): handle dk(4) for install disk
CVS commit: src/sys/arch/i386/stand
Module Name:src Committed By: nonaka Date: Sat Feb 11 10:23:39 UTC 2017 Modified Files: src/sys/arch/i386/stand/efiboot: efiboot.c efiboot.h src/sys/arch/i386/stand/efiboot/bootx64: efibootx64.c startprog64.S src/sys/arch/i386/stand/lib: exec.c Log Message: PR/51953: fix unable to boot on some AMD machine. Delayed the timing to copy the kernel to actual address. copy routine from common/lib/libc/arch/x86_64/string/bcopy.S To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/i386/stand/efiboot/efiboot.c \ src/sys/arch/i386/stand/efiboot/efiboot.h cvs rdiff -u -r1.1 -r1.2 src/sys/arch/i386/stand/efiboot/bootx64/efibootx64.c cvs rdiff -u -r1.2 -r1.3 \ src/sys/arch/i386/stand/efiboot/bootx64/startprog64.S cvs rdiff -u -r1.64 -r1.65 src/sys/arch/i386/stand/lib/exec.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/i386/stand/efiboot/efiboot.c diff -u src/sys/arch/i386/stand/efiboot/efiboot.c:1.3 src/sys/arch/i386/stand/efiboot/efiboot.c:1.4 --- src/sys/arch/i386/stand/efiboot/efiboot.c:1.3 Sat Feb 11 10:15:55 2017 +++ src/sys/arch/i386/stand/efiboot/efiboot.c Sat Feb 11 10:23:39 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: efiboot.c,v 1.3 2017/02/11 10:15:55 nonaka Exp $ */ +/* $NetBSD: efiboot.c,v 1.4 2017/02/11 10:23:39 nonaka Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka@@ -35,6 +35,8 @@ EFI_HANDLE IH; EFI_DEVICE_PATH *efi_bootdp; EFI_LOADED_IMAGE *efi_li; uintptr_t efi_main_sp; +physaddr_t efi_loadaddr, efi_kernel_start; +u_long efi_kernel_size; bool efi_cleanuped; static EFI_PHYSICAL_ADDRESS heap_start = EFI_ALLOCATE_MAX_ADDRESS; Index: src/sys/arch/i386/stand/efiboot/efiboot.h diff -u src/sys/arch/i386/stand/efiboot/efiboot.h:1.3 src/sys/arch/i386/stand/efiboot/efiboot.h:1.4 --- src/sys/arch/i386/stand/efiboot/efiboot.h:1.3 Sat Feb 11 10:15:55 2017 +++ src/sys/arch/i386/stand/efiboot/efiboot.h Sat Feb 11 10:23:39 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: efiboot.h,v 1.3 2017/02/11 10:15:55 nonaka Exp $ */ +/* $NetBSD: efiboot.h,v 1.4 2017/02/11 10:23:39 nonaka Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka @@ -48,6 +48,8 @@ extern EFI_HANDLE IH; extern EFI_DEVICE_PATH *efi_bootdp; extern EFI_LOADED_IMAGE *efi_li; extern uintptr_t efi_main_sp; +extern physaddr_t efi_loadaddr, efi_kernel_start; +extern u_long efi_kernel_size; extern bool efi_cleanuped; void efi_cleanup(void); Index: src/sys/arch/i386/stand/efiboot/bootx64/efibootx64.c diff -u src/sys/arch/i386/stand/efiboot/bootx64/efibootx64.c:1.1 src/sys/arch/i386/stand/efiboot/bootx64/efibootx64.c:1.2 --- src/sys/arch/i386/stand/efiboot/bootx64/efibootx64.c:1.1 Tue Jan 24 11:09:14 2017 +++ src/sys/arch/i386/stand/efiboot/bootx64/efibootx64.c Sat Feb 11 10:23:39 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: efibootx64.c,v 1.1 2017/01/24 11:09:14 nonaka Exp $ */ +/* $NetBSD: efibootx64.c,v 1.2 2017/02/11 10:23:39 nonaka Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka @@ -32,8 +32,10 @@ struct x86_boot_params boot_params; -void startprog64_start(void *, physaddr_t, physaddr_t); -extern void (*startprog64)(void *, physaddr_t, physaddr_t); +void startprog64_start(physaddr_t, physaddr_t, physaddr_t, u_long, +void *, physaddr_t); +extern void (*startprog64)(physaddr_t, physaddr_t, physaddr_t, u_long, +void *, physaddr_t); extern u_int startprog64_size; void @@ -64,7 +66,8 @@ startprog(physaddr_t entry, uint32_t arg memcpy(newsp, argv, sizeof(*argv) * argc); } - (*startprog64)(startprog64, entry, (physaddr_t)newsp); + (*startprog64)(efi_kernel_start, efi_kernel_start + efi_loadaddr, + (physaddr_t)newsp, efi_kernel_size, startprog64, entry); } /* ARGSUSED */ Index: src/sys/arch/i386/stand/efiboot/bootx64/startprog64.S diff -u src/sys/arch/i386/stand/efiboot/bootx64/startprog64.S:1.2 src/sys/arch/i386/stand/efiboot/bootx64/startprog64.S:1.3 --- src/sys/arch/i386/stand/efiboot/bootx64/startprog64.S:1.2 Sat Feb 4 16:14:27 2017 +++ src/sys/arch/i386/stand/efiboot/bootx64/startprog64.S Sat Feb 11 10:23:39 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: startprog64.S,v 1.2 2017/02/04 16:14:27 christos Exp $ */ +/* $NetBSD: startprog64.S,v 1.3 2017/02/11 10:23:39 nonaka Exp $ */ /* NetBSD: startprog.S,v 1.3 2003/02/01 14:48:18 dsl Exp */ /* starts program in protected mode / flat space @@ -78,26 +78,135 @@ _C_LABEL(startprog64_size): .p2align 4,,15 /* - * startprog64(loadddr,entry,stack) + * startprog64(loadddr,entry,stack,kern_load,kern_start,kern_size) */ ENTRY(startprog64_start) start: /* * This function is to call the loaded kernel's start() with * 32bit segment mode from x64 mode. - * %rdi: loaded start address - * %rsi: kernel entry address + * %rdi: kernel start address + * %rsi: loaded kernel address * %rdx: stack address + * %rcx: loaded kernel size + * %r8 : loaded start
CVS commit: src/sys/arch/i386/stand/lib
Module Name:src Committed By: nonaka Date: Sat Feb 11 10:18:10 UTC 2017 Modified Files: src/sys/arch/i386/stand/lib: exec.c Log Message: efiboot: Copy bootinfo to safe arena. To generate a diff of this commit: cvs rdiff -u -r1.63 -r1.64 src/sys/arch/i386/stand/lib/exec.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/i386/stand/lib/exec.c diff -u src/sys/arch/i386/stand/lib/exec.c:1.63 src/sys/arch/i386/stand/lib/exec.c:1.64 --- src/sys/arch/i386/stand/lib/exec.c:1.63 Tue Jan 24 11:09:14 2017 +++ src/sys/arch/i386/stand/lib/exec.c Sat Feb 11 10:18:10 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: exec.c,v 1.63 2017/01/24 11:09:14 nonaka Exp $ */ +/* $NetBSD: exec.c,v 1.64 2017/02/11 10:18:10 nonaka Exp $ */ /* * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -389,6 +389,9 @@ exec_netbsd(const char *file, physaddr_t u_long extmem; u_long basemem; int error; +#ifdef EFIBOOT + int i; +#endif #ifdef DEBUG printf("exec: file=%s loadaddr=0x%lx\n", file ? file : "NULL", @@ -449,6 +452,14 @@ exec_netbsd(const char *file, physaddr_t if (callback != NULL) (*callback)(); #ifdef EFIBOOT + /* Copy bootinfo to safe arena. */ + for (i = 0; i < bootinfo->nentries; i++) { + struct btinfo_common *bi = (void *)(u_long)bootinfo->entry[i]; + char *p = alloc(bi->len); + memcpy(p, bi, bi->len); + bootinfo->entry[i] = vtophys(p); + } + /* Copy the kernel to original load address. */ memmove((void *)marks[MARK_START], (void *)(efi_loadaddr + marks[MARK_START]),
CVS commit: src/sys/arch/i386/stand/efiboot
Module Name:src Committed By: nonaka Date: Sat Feb 11 10:15:55 UTC 2017 Modified Files: src/sys/arch/i386/stand/efiboot: efiboot.c efiboot.h panic.c Log Message: efiboot: don't call WaitForSingleEvent after ExitBootServices is called. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/i386/stand/efiboot/efiboot.c \ src/sys/arch/i386/stand/efiboot/efiboot.h cvs rdiff -u -r1.3 -r1.4 src/sys/arch/i386/stand/efiboot/panic.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/i386/stand/efiboot/efiboot.c diff -u src/sys/arch/i386/stand/efiboot/efiboot.c:1.2 src/sys/arch/i386/stand/efiboot/efiboot.c:1.3 --- src/sys/arch/i386/stand/efiboot/efiboot.c:1.2 Sat Feb 11 10:13:46 2017 +++ src/sys/arch/i386/stand/efiboot/efiboot.c Sat Feb 11 10:15:55 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: efiboot.c,v 1.2 2017/02/11 10:13:46 nonaka Exp $ */ +/* $NetBSD: efiboot.c,v 1.3 2017/02/11 10:15:55 nonaka Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka@@ -35,6 +35,7 @@ EFI_HANDLE IH; EFI_DEVICE_PATH *efi_bootdp; EFI_LOADED_IMAGE *efi_li; uintptr_t efi_main_sp; +bool efi_cleanuped; static EFI_PHYSICAL_ADDRESS heap_start = EFI_ALLOCATE_MAX_ADDRESS; static UINTN heap_size = 1 * 1024 * 1024; /* 1MB */ @@ -121,6 +122,7 @@ efi_cleanup(void) if (EFI_ERROR(status)) Panic(L"ExitBootServices failed"); } + efi_cleanuped = true; allocsz = sizeof(struct btinfo_efimemmap) - 1 + NoEntries * DescriptorSize; Index: src/sys/arch/i386/stand/efiboot/efiboot.h diff -u src/sys/arch/i386/stand/efiboot/efiboot.h:1.2 src/sys/arch/i386/stand/efiboot/efiboot.h:1.3 --- src/sys/arch/i386/stand/efiboot/efiboot.h:1.2 Sat Feb 11 10:13:46 2017 +++ src/sys/arch/i386/stand/efiboot/efiboot.h Sat Feb 11 10:15:55 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: efiboot.h,v 1.2 2017/02/11 10:13:46 nonaka Exp $ */ +/* $NetBSD: efiboot.h,v 1.3 2017/02/11 10:15:55 nonaka Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka @@ -48,6 +48,7 @@ extern EFI_HANDLE IH; extern EFI_DEVICE_PATH *efi_bootdp; extern EFI_LOADED_IMAGE *efi_li; extern uintptr_t efi_main_sp; +extern bool efi_cleanuped; void efi_cleanup(void); /* eficons.c */ Index: src/sys/arch/i386/stand/efiboot/panic.c diff -u src/sys/arch/i386/stand/efiboot/panic.c:1.3 src/sys/arch/i386/stand/efiboot/panic.c:1.4 --- src/sys/arch/i386/stand/efiboot/panic.c:1.3 Sun Feb 5 10:13:43 2017 +++ src/sys/arch/i386/stand/efiboot/panic.c Sat Feb 11 10:15:55 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: panic.c,v 1.3 2017/02/05 10:13:43 joerg Exp $ */ +/* $NetBSD: panic.c,v 1.4 2017/02/11 10:15:55 nonaka Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka @@ -54,7 +54,8 @@ __dead void reboot(void) { - WaitForSingleEvent(ST->ConIn->WaitForKey, 0); + if (!efi_cleanuped) + WaitForSingleEvent(ST->ConIn->WaitForKey, 0); uefi_call_wrapper(RT->ResetSystem, 4, EfiResetCold, EFI_SUCCESS, 0, NULL);
CVS commit: src/sys/arch/i386/stand/efiboot
Module Name:src Committed By: nonaka Date: Sat Feb 11 10:13:46 UTC 2017 Modified Files: src/sys/arch/i386/stand/efiboot: Makefile.efiboot efiboot.c efiboot.h efimemory.c Log Message: efiboot: pass memory map after ExitBootService is called to kernel. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/i386/stand/efiboot/Makefile.efiboot cvs rdiff -u -r1.1 -r1.2 src/sys/arch/i386/stand/efiboot/efiboot.c \ src/sys/arch/i386/stand/efiboot/efiboot.h cvs rdiff -u -r1.2 -r1.3 src/sys/arch/i386/stand/efiboot/efimemory.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/i386/stand/efiboot/Makefile.efiboot diff -u src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.6 src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.7 --- src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.6 Mon Feb 6 10:32:35 2017 +++ src/sys/arch/i386/stand/efiboot/Makefile.efiboot Sat Feb 11 10:13:46 2017 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.efiboot,v 1.6 2017/02/06 10:32:35 nonaka Exp $ +# $NetBSD: Makefile.efiboot,v 1.7 2017/02/11 10:13:46 nonaka Exp $ S= ${.CURDIR}/../../../../.. @@ -61,7 +61,6 @@ CPPFLAGS+= -DSUPPORT_CD9660 CPPFLAGS+= -DSUPPORT_DOSFS CPPFLAGS+= -DSUPPORT_EXT2FS CPPFLAGS+= -DPASS_BIOSGEOM -CPPFLAGS+= -DPASS_MEMMAP CPPFLAGS+= -DLIBSA_ENABLE_LS_OP EFIDIR= ${S}/external/bsd/gnu-efi/dist Index: src/sys/arch/i386/stand/efiboot/efiboot.c diff -u src/sys/arch/i386/stand/efiboot/efiboot.c:1.1 src/sys/arch/i386/stand/efiboot/efiboot.c:1.2 --- src/sys/arch/i386/stand/efiboot/efiboot.c:1.1 Tue Jan 24 11:09:14 2017 +++ src/sys/arch/i386/stand/efiboot/efiboot.c Sat Feb 11 10:13:46 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: efiboot.c,v 1.1 2017/01/24 11:09:14 nonaka Exp $ */ +/* $NetBSD: efiboot.c,v 1.2 2017/02/11 10:13:46 nonaka Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka@@ -97,6 +97,8 @@ efi_cleanup(void) EFI_MEMORY_DESCRIPTOR *desc; UINTN NoEntries, MapKey, DescriptorSize; UINT32 DescriptorVersion; + struct btinfo_efimemmap *bim; + size_t allocsz; clearit(); @@ -108,17 +110,26 @@ efi_cleanup(void) BI_ADD(_efi, BTINFO_EFI, sizeof(btinfo_efi)); NoEntries = 0; - desc = LibMemoryMap(, , , - ); + desc = efi_memory_get_map(, , , + , true); status = uefi_call_wrapper(BS->ExitBootServices, 2, IH, MapKey); if (EFI_ERROR(status)) { FreePool(desc); - desc = LibMemoryMap(, , , - ); + desc = efi_memory_get_map(, , , + , true); status = uefi_call_wrapper(BS->ExitBootServices, 2, IH, MapKey); if (EFI_ERROR(status)) Panic(L"ExitBootServices failed"); } + + allocsz = sizeof(struct btinfo_efimemmap) - 1 + + NoEntries * DescriptorSize; + bim = alloc(allocsz); + bim->num = NoEntries; + bim->version = DescriptorVersion; + bim->size = DescriptorSize; + memcpy(bim->memmap, desc, NoEntries * DescriptorSize); + BI_ADD(bim, BTINFO_EFIMEMMAP, allocsz); } static void Index: src/sys/arch/i386/stand/efiboot/efiboot.h diff -u src/sys/arch/i386/stand/efiboot/efiboot.h:1.1 src/sys/arch/i386/stand/efiboot/efiboot.h:1.2 --- src/sys/arch/i386/stand/efiboot/efiboot.h:1.1 Tue Jan 24 11:09:14 2017 +++ src/sys/arch/i386/stand/efiboot/efiboot.h Sat Feb 11 10:13:46 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: efiboot.h,v 1.1 2017/01/24 11:09:14 nonaka Exp $ */ +/* $NetBSD: efiboot.h,v 1.2 2017/02/11 10:13:46 nonaka Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka @@ -61,6 +61,8 @@ void efi_disk_probe(void); /* efimemory.c */ void efi_memory_probe(void); void efi_memory_show_map(bool); +EFI_MEMORY_DESCRIPTOR *efi_memory_get_map(UINTN *, UINTN *, UINTN *, UINT32 *, +bool); /* panic.c */ __dead VOID Panic(IN CHAR16 *, ...); Index: src/sys/arch/i386/stand/efiboot/efimemory.c diff -u src/sys/arch/i386/stand/efiboot/efimemory.c:1.2 src/sys/arch/i386/stand/efiboot/efimemory.c:1.3 --- src/sys/arch/i386/stand/efiboot/efimemory.c:1.2 Fri Feb 3 16:42:26 2017 +++ src/sys/arch/i386/stand/efiboot/efimemory.c Sat Feb 11 10:13:46 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: efimemory.c,v 1.2 2017/02/03 16:42:26 roy Exp $ */ +/* $NetBSD: efimemory.c,v 1.3 2017/02/11 10:13:46 nonaka Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka @@ -87,9 +87,9 @@ getmemtype(EFI_MEMORY_DESCRIPTOR *md) return BIM_Reserved; } -static EFI_MEMORY_DESCRIPTOR * -GetMemoryMap(OUT UINTN *NoEntries, OUT UINTN *MapKey, OUT UINTN *DescriptorSize, -OUT UINT32 *DescriptorVersion, bool sorted) +EFI_MEMORY_DESCRIPTOR * +efi_memory_get_map(UINTN *NoEntries, UINTN *MapKey, UINTN *DescriptorSize, +UINT32 *DescriptorVersion, bool sorted) { EFI_MEMORY_DESCRIPTOR *desc, *md, *next, *target, tmp; UINTN i, j; @@ -98,7 +98,7 @@ GetMemoryMap(OUT UINTN *NoEntries, OUT U desc = LibMemoryMap(NoEntries, MapKey, DescriptorSize, DescriptorVersion); if (desc == NULL) - Panic(L"LibMemoryMap failed"); +
CVS commit: src/share/terminfo
Module Name:src Committed By: roy Date: Sat Feb 11 09:15:38 UTC 2017 Modified Files: src/share/terminfo: terminfo Log Message: Sync our changes. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/share/terminfo/terminfo Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/terminfo/terminfo diff -u src/share/terminfo/terminfo:1.9 src/share/terminfo/terminfo:1.10 --- src/share/terminfo/terminfo:1.9 Sat Feb 11 09:12:32 2017 +++ src/share/terminfo/terminfo Sat Feb 11 09:15:38 2017 @@ -6,8 +6,8 @@ # Report bugs and new terminal descriptions to # bug-ncur...@gnu.org # -# $Revision: 1.9 $ -# $Date: 2017/02/11 09:12:32 $ +# $Revision: 1.10 $ +# $Date: 2017/02/11 09:15:38 $ # # The original header is preserved below for reference. It is noted that there # is a "newer" version which differs in some cosmetic details (but actually @@ -2481,7 +2481,7 @@ arm100-w|arm100-wam|Arm(RiscPC) ncurses # From Minoura Makoto, 12 May 1996 x68k|x68k-ite|NetBSD/x68k ITE, cols#96, lines#32, - kclr=\E[9~, khlp=\E[28~, use=vt220, + kbs=\177,kclr=\E[9~, khlp=\E[28~, use=vt220, # : # Entry for the DNARD OpenFirmware console, close to ANSI but not quite. @@ -10865,7 +10865,7 @@ wy85-wvb|wyse85-wvb|wyse 85 with visible # terminfo. At one point, I found some reference indicating that this # terminal bug (not sending \E[) was acknowledged by Wyse (so it's not just # me), but I can't find that and the server under my bookmark to "Wyse -# Technical" isn't responding. So there's the question of wether the wy85 +# Technical" isn't responding. So there's the question of whether the wy85 # terminfo should reflect the manufactuer's intended behaviour of the terminal # or the actual." wy85-8bit|wyse85-8bit|wyse 85 in 8-bit mode,
CVS commit: src/sys/dev
Module Name:src Committed By: nat Date: Sat Feb 11 08:36:31 UTC 2017 Modified Files: src/sys/dev: audio.c Log Message: Audio passed the atf test again. To generate a diff of this commit: cvs rdiff -u -r1.302 -r1.303 src/sys/dev/audio.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/audio.c diff -u src/sys/dev/audio.c:1.302 src/sys/dev/audio.c:1.303 --- src/sys/dev/audio.c:1.302 Fri Feb 10 19:31:42 2017 +++ src/sys/dev/audio.c Sat Feb 11 08:36:30 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: audio.c,v 1.302 2017/02/10 19:31:42 nat Exp $ */ +/* $NetBSD: audio.c,v 1.303 2017/02/11 08:36:30 nat Exp $ */ /*- * Copyright (c) 2016 Nathanial Sloss@@ -148,7 +148,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.302 2017/02/10 19:31:42 nat Exp $"); +__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.303 2017/02/11 08:36:30 nat Exp $"); #include "audio.h" #if NAUDIO > 0 @@ -5526,7 +5526,7 @@ mix_func8(struct audio_softc *sc, struct for (m = 0; m < cc; m++) { orig[m] += (int8_t)((int32_t)(tomix[m] * (vc->sc_swvol + 1)) / (sc->sc_opens * - 255)); + 256)); } if ([m] >= (int8_t *)sc->sc_pr.s.end) @@ -5563,7 +5563,7 @@ mix_func16(struct audio_softc *sc, struc for (m = 0; m < cc / 2; m++) { orig[m] += (int16_t)((int32_t)(tomix[m] * (vc->sc_swvol + 1)) / (sc->sc_opens * - 255)); + 256)); } if ([m] >= (int16_t *)sc->sc_pr.s.end) @@ -5600,7 +5600,7 @@ mix_func32(struct audio_softc *sc, struc for (m = 0; m < cc / 4; m++) { orig[m] += (int32_t)((int32_t)(tomix[m] * (vc->sc_swvol + 1)) / (sc->sc_opens * - 255)); + 256)); } if ([m] >= (int32_t *)sc->sc_pr.s.end)
CVS commit: src/distrib/amd64/uefi-installimage
Module Name:src Committed By: pgoyette Date: Sat Feb 11 08:14:05 UTC 2017 Modified Files: src/distrib/amd64/uefi-installimage: Makefile.bootimage Log Message: Clean up another extraneous -f option To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 \ src/distrib/amd64/uefi-installimage/Makefile.bootimage Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/amd64/uefi-installimage/Makefile.bootimage diff -u src/distrib/amd64/uefi-installimage/Makefile.bootimage:1.4 src/distrib/amd64/uefi-installimage/Makefile.bootimage:1.5 --- src/distrib/amd64/uefi-installimage/Makefile.bootimage:1.4 Sat Feb 11 03:07:06 2017 +++ src/distrib/amd64/uefi-installimage/Makefile.bootimage Sat Feb 11 08:14:05 2017 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.bootimage,v 1.4 2017/02/11 03:07:06 christos Exp $ +# $NetBSD: Makefile.bootimage,v 1.5 2017/02/11 08:14:05 pgoyette Exp $ # # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui. All rights reserved. # @@ -409,7 +409,7 @@ ${IMGBASE}.img: ${TARGETFS} @${MKDIR} ${MKDIRPERM} ${EFIWORKDIR}/EFI/boot .if !empty(EFIBOOT) .for f in ${EFIBOOT} - ${INSTALL} ${COPY} -m 0644 -f ${f} ${EFIWORKDIR}/EFI/boot/`basename ${f}` + ${INSTALL} ${COPY} -m 0644 ${f} ${EFIWORKDIR}/EFI/boot/`basename ${f}` .endfor .endif ${RM} -f ${WORKEFI}
CVS commit: src/distrib/common/bootimage
Module Name:src Committed By: pgoyette Date: Sat Feb 11 08:08:00 UTC 2017 Modified Files: src/distrib/common/bootimage: Makefile.bootimage Log Message: Remove leftover "-f" from when this used to be a cp command. Unbreak the build for install-image target. To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/distrib/common/bootimage/Makefile.bootimage Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/common/bootimage/Makefile.bootimage diff -u src/distrib/common/bootimage/Makefile.bootimage:1.16 src/distrib/common/bootimage/Makefile.bootimage:1.17 --- src/distrib/common/bootimage/Makefile.bootimage:1.16 Sat Feb 11 04:19:25 2017 +++ src/distrib/common/bootimage/Makefile.bootimage Sat Feb 11 08:08:00 2017 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.bootimage,v 1.16 2017/02/11 04:19:25 christos Exp $ +# $NetBSD: Makefile.bootimage,v 1.17 2017/02/11 08:08:00 pgoyette Exp $ # # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui. All rights reserved. # @@ -240,7 +240,7 @@ ${TARGETFS}: prepare_md_post .endfor .if defined(SECONDARY_BOOT) @echo Copying secondary boot... - ${INSTALL} ${COPY} -m 0644 -f ${WORKDIR}/usr/mdec/${SECONDARY_BOOT} ${WORKDIR} + ${INSTALL} ${COPY} -m 0644 ${WORKDIR}/usr/mdec/${SECONDARY_BOOT} ${WORKDIR} .endif @echo Preparing /etc/fstab ... ${TOOL_SED} "s/@@BOOTDISK@@/${BOOTDISK}/" < ${FSTAB_IN} > ${WORKFSTAB}